Skip to content

Commit

Permalink
feat: Made sure that SkybridgeContext is serializable
Browse files Browse the repository at this point in the history
  • Loading branch information
sbp-rib committed Jan 25, 2021
1 parent 1199f83 commit 01769d9
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/modules/context/SkybridgeContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import type { SkybridgeBridge } from '../bridges';

export type SkybridgeContext<M extends SkybridgeMode = SkybridgeMode> = {
readonly mode: M;
readonly affiliateApi?: string;
readonly affiliateApi: string;
readonly servers: {
readonly swapNode: { readonly [k in SkybridgeBridge]: string };
readonly indexer: { readonly [k in SkybridgeBridge]: string };
readonly swapNode: { readonly [k in SkybridgeBridge]: string | null };
readonly indexer: { readonly [k in SkybridgeBridge]: string | null };
};
};
8 changes: 4 additions & 4 deletions src/modules/context/buildContext.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,21 +33,21 @@ export const buildContext = async <M extends SkybridgeMode>({
btc_erc:
result.response[mode].swapNodes.btc_erc[
randomInt(0, result.response[mode].swapNodes.btc_erc.length - 1)
],
] || null,
btc_bep:
result.response[mode].swapNodes.btc_bep[
randomInt(0, result.response[mode].swapNodes.btc_bep.length - 1)
],
] || null,
},
indexer: {
btc_erc:
result.response[mode].indexerNodes.btc_erc[
randomInt(0, result.response[mode].indexerNodes.btc_erc.length - 1)
],
] || null,
btc_bep:
result.response[mode].indexerNodes.btc_bep[
randomInt(0, result.response[mode].indexerNodes.btc_bep.length - 1)
],
] || null,
},
},
};
Expand Down

0 comments on commit 01769d9

Please sign in to comment.