Skip to content

Commit

Permalink
Merge pull request #780 from near/relayer
Browse files Browse the repository at this point in the history
Add relayerUrl to configuration options
  • Loading branch information
DamirSQA authored Apr 25, 2023
2 parents 984d0d7 + d82f38d commit 14a037f
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions packages/core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ const selector = await setupWalletSelector({
- `randomizeWalletOrder` (`boolean?`): Randomize wallets order in the `More` section of the UI.
- `allowMultipleSelectors` (`boolean?`): Optionally allow creating new instances of wallet selector.
- `languageCode` (`string?`): Optionally set specific ISO 639-1 two-letter language code, disables language detection based on the browser's settings.
- `relayerUrl` (`string?`): Optionally set the URL that meta-transaction enabled wallet modules can use to submit DelegateActions to a relayer
- `storage` (`StorageService?`): Async storage implementation. Useful when [`localStorage`](https://developer.mozilla.org/en-US/docs/Web/API/Window/localStorage) is unavailable. Defaults to `localStorage`.
- `modules` (`Array<WalletModuleFactory>`): List of wallets to support in your dApp.

Expand Down
2 changes: 2 additions & 0 deletions packages/core/docs/api/selector.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
- `optimizeWalletOrder` (`boolean`): Whether wallet order optimization is enabled.
- `randomizeWalletOrder` (`boolean`): Weather wallet order randomization is enabled.
- `languageCode` (`string?`): ISO 639-1 two-letter language code.
- `relayerUrl` (`string?`): The URL where DelegateActions are sent by meta transaction enabled wallet modules.

**Description**

Resolved variation of the options passed to `setupWalletSelector`.
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/lib/options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const resolveOptions = (params: WalletSelectorParams) => {
debug: params.debug || false,
optimizeWalletOrder: params.optimizeWalletOrder === false ? false : true,
randomizeWalletOrder: params.randomizeWalletOrder || false,
relayerUrl: params.relayerUrl || undefined,
};

return {
Expand Down
1 change: 1 addition & 0 deletions packages/core/src/lib/options.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,5 @@ export interface Options {
debug: boolean;
optimizeWalletOrder: boolean;
randomizeWalletOrder: boolean;
relayerUrl: string | undefined;
}
1 change: 1 addition & 0 deletions packages/core/src/lib/wallet-selector.types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export interface WalletSelectorParams {
allowMultipleSelectors?: boolean;
randomizeWalletOrder?: boolean;
languageCode?: SupportedLanguage;
relayerUrl?: string;
}

export type WalletSelectorStore = ReadOnlyStore;
Expand Down

0 comments on commit 14a037f

Please sign in to comment.