mirror of
https://github.com/RoboSats/robosats.git
synced 2025-07-18 08:43:14 +00:00
Include Peach orders
This commit is contained in:
@ -56,6 +56,9 @@ const BookControl = ({
|
||||
|
||||
const handleHostChange = function (e: React.ChangeEvent<HTMLInputElement>): void {
|
||||
const coordinator = String(e.target.value);
|
||||
if (coordinator === 'any') {
|
||||
federation.refreshBookHosts(coordinator !== 'any');
|
||||
}
|
||||
setFav({ ...fav, coordinator });
|
||||
};
|
||||
|
||||
|
@ -35,7 +35,7 @@ export const FederationContext = createContext<UseFederationStoreType>(initialFe
|
||||
export const FederationContextProvider = ({
|
||||
children,
|
||||
}: FederationContextProviderProps): JSX.Element => {
|
||||
const { settings, page, origin, hostUrl, open, torStatus, client } =
|
||||
const { settings, page, origin, hostUrl, open, torStatus, client, fav } =
|
||||
useContext<UseAppStoreType>(AppContext);
|
||||
const { setMaker, garage } = useContext<UseGarageStoreType>(GarageContext);
|
||||
const [federation] = useState(new Federation(origin, settings, hostUrl));
|
||||
@ -57,7 +57,7 @@ export const FederationContextProvider = ({
|
||||
if (client !== 'mobile' || torStatus === 'ON' || !settings.useProxy) {
|
||||
void federation.updateUrl(origin, settings, hostUrl);
|
||||
void federation.loadLimits();
|
||||
federation.setConnection(settings);
|
||||
federation.setConnection(settings, fav.coordinator);
|
||||
}
|
||||
}, [settings.network, settings.useProxy, torStatus, settings.connection]);
|
||||
|
||||
|
@ -78,24 +78,28 @@ export class Federation {
|
||||
|
||||
public roboPool: RoboPool;
|
||||
|
||||
setConnection = (settings: Settings): void => {
|
||||
setConnection = (settings: Settings, coordinator: string): void => {
|
||||
this.connection = settings.connection;
|
||||
this.loading = true;
|
||||
this.book = {};
|
||||
this.exchange.loadingCache = this.roboPool.relays.length;
|
||||
if (this.connection === 'nostr') {
|
||||
this.roboPool.connect();
|
||||
this.loadBookNostr();
|
||||
this.loadBookNostr(coordinator !== 'any');
|
||||
} else {
|
||||
this.roboPool.close();
|
||||
void this.loadBook();
|
||||
}
|
||||
};
|
||||
|
||||
loadBookNostr = (): void => {
|
||||
this.loading = true;
|
||||
this.book = {};
|
||||
refreshBookHosts: (robosatsOnly: boolean) => void = (robosatsOnly) => {
|
||||
if (this.connection === 'nostr') {
|
||||
this.loadBookNostr(robosatsOnly);
|
||||
}
|
||||
};
|
||||
|
||||
this.exchange.loadingCache = this.roboPool.relays.length;
|
||||
|
||||
this.roboPool.subscribeBook({
|
||||
loadBookNostr = (robosatsOnly: boolean): void => {
|
||||
this.roboPool.subscribeBook(robosatsOnly, {
|
||||
onevent: (event) => {
|
||||
const { dTag, publicOrder } = eventToPublicOrder(event);
|
||||
if (publicOrder) {
|
||||
|
@ -98,10 +98,12 @@ class RoboPool {
|
||||
});
|
||||
};
|
||||
|
||||
subscribeBook = (events: RoboPoolEvents): void => {
|
||||
const authors = [...Object.values(defaultFederation), ...Object.values(thirdParties)]
|
||||
.map((f) => f.nostrHexPubkey)
|
||||
.filter((item) => item !== undefined);
|
||||
subscribeBook = (robosatsOnly: boolean, events: RoboPoolEvents): void => {
|
||||
let scope = Object.values(defaultFederation);
|
||||
if (!robosatsOnly) {
|
||||
scope = [...scope, ...Object.values(thirdParties)];
|
||||
}
|
||||
const authors = scope.map((f) => f.nostrHexPubkey).filter((item) => item !== undefined);
|
||||
|
||||
const requestPending = [
|
||||
'REQ',
|
||||
|
BIN
frontend/static/federation/avatars/peach.small.webp
Normal file
BIN
frontend/static/federation/avatars/peach.small.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 5.6 KiB |
BIN
frontend/static/federation/avatars/peach.webp
Normal file
BIN
frontend/static/federation/avatars/peach.webp
Normal file
Binary file not shown.
After Width: | Height: | Size: 7.3 KiB |
@ -0,0 +1,15 @@
|
||||
-----BEGIN PGP PUBLIC KEY BLOCK-----
|
||||
Comment: 4833 9A19 645E 2E53 488E 0E54 79E1 B270 FACD 1BD2
|
||||
Comment: hello@peachbitcoin.com <hello@peachbitcoin.com>
|
||||
|
||||
xjMEYiOtWhYJKwYBBAHaRw8BAQdAsOKDD90QG9Fsr2TQomq1plxf0QGlQdL8OXCS
|
||||
TTjE+vjNL2hlbGxvQHBlYWNoYml0Y29pbi5jb20gPGhlbGxvQHBlYWNoYml0Y29p
|
||||
bi5jb20+wo8EEBYKACAFAmIjrVoGCwkHCAMCBBUICgIEFgIBAAIZAQIbAwIeAQAh
|
||||
CRB54bJw+s0b0hYhBEgzmhlkXi5TSI4OVHnhsnD6zRvSDwIA/A2Z1td84Fos0L8Y
|
||||
180evwOWDdbbI+8N0Y7GgkoU6iUqAQCgqMyBknoPYF9pvE2RLsYYjh52tWrV9mSI
|
||||
zEMoH38JAc44BGIjrVoSCisGAQQBl1UBBQEBB0AMyWxwd2kF+8Kn5A6OuYCt8OQv
|
||||
YbzwKJN3Jvnr4Z+ARgMBCAfCeAQYFggACQUCYiOtWgIbDAAhCRB54bJw+s0b0hYh
|
||||
BEgzmhlkXi5TSI4OVHnhsnD6zRvSw7UBAIb3PAWG2iIXEapRxLVDkEuQ+RRVn/FU
|
||||
rSwNRLsCJBsqAQDI9SNIkJuqT2RcP7qeQMj0tcZk9dBV+M48OL9XqPTEDA==
|
||||
=HMiR
|
||||
-----END PGP PUBLIC KEY BLOCK-----
|
@ -9,8 +9,22 @@
|
||||
"email": null,
|
||||
"telegram": "https://t.me/p2plightning",
|
||||
"simplex": null,
|
||||
"nostr": null,
|
||||
"nostr": "https://njump.me/nprofile1qqs0es4q4yl3t7txceldxjrwkjfk6gdm88q5m6f68qff7683s8udrmqs874xa",
|
||||
"website": "https://lnp2pbot.com"
|
||||
}
|
||||
},
|
||||
"peach": {
|
||||
"longAlias": "Peach",
|
||||
"federated": false,
|
||||
"shortAlias": "peach",
|
||||
"nostrHexPubkey": "a47457722e10ba3a271fbe7040259a3c4da2cf53bfd1e198138214d235064fc2",
|
||||
"description": "The easiest way to buy & sell Bitcoin peer-to-peer.",
|
||||
"contact": {
|
||||
"email": "hello@peachbitcoin.com",
|
||||
"telegram": "https://t.me/peachtopeach",
|
||||
"simplex": null,
|
||||
"nostr": "https://njump.me/nprofile1qqs2gazhwghppw36yu0muuzqykdrcndzeafml50pnqfcy9xjx5rylsss0wkz7",
|
||||
"website": "https://peachbitcoin.com"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user