Skip to content

Commit

Permalink
Use custom storage by default in the WalletConnect provider
Browse files Browse the repository at this point in the history
  • Loading branch information
Lbqds committed Dec 25, 2024
1 parent a8bd92f commit 7d2d9e7
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/walletconnect/src/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,12 @@ export class WalletConnectProvider extends SignerProvider {

// ---------- Private ----------------------------------------------- //

private getCustomStoragePrefix(): string {
return this.providerOpts.customStoragePrefix ?? 'alephium'
}

private getWCStorageKey(prefix: string, version: string, name: string): string {
const customStoragePrefix = this.providerOpts.customStoragePrefix ? `:${this.providerOpts.customStoragePrefix}` : ''
const customStoragePrefix = `:${this.getCustomStoragePrefix()}`
return prefix + version + customStoragePrefix + '//' + name
}

Expand Down Expand Up @@ -333,7 +337,8 @@ export class WalletConnectProvider extends SignerProvider {
(await SignClient.init({
...this.providerOpts,
logger: this.providerOpts.logger || LOGGER,
relayUrl: this.providerOpts.relayUrl || RELAY_URL
relayUrl: this.providerOpts.relayUrl || RELAY_URL,
customStoragePrefix: this.getCustomStoragePrefix()
}))
}

Expand Down

0 comments on commit 7d2d9e7

Please sign in to comment.