Skip to content

@swapped/connect-sdk / core / Wallets

Interface: Wallets ​

Defined in: src/modules/wallets/wallets.module.ts:120

Browser wallet connect / balances APIs.

Available on the client as client.wallets. Connection privileged actions go through the gateway iframe host; balances use the backend HTTP API.

Methods ​

cancelPairing() ​

cancelPairing(): Promise<boolean>

Defined in: src/modules/wallets/wallets.module.ts:503

Abort an in-flight WalletConnect pairing (clears pending QR).

Returns ​

Promise<boolean>


connect() ​

connect(request): Promise<WalletConnection | null>

Defined in: src/modules/wallets/wallets.module.ts:411

Parameters ​

request ​

ConnectWalletRequest

Returns ​

Promise<WalletConnection | null>


disconnect() ​

disconnect(walletId): Promise<void>

Defined in: src/modules/wallets/wallets.module.ts:515

Parameters ​

walletId ​

string

Returns ​

Promise<void>


disconnectAll() ​

disconnectAll(): Promise<void>

Defined in: src/modules/wallets/wallets.module.ts:560

Returns ​

Promise<void>


disconnectProvider() ​

disconnectProvider(provider): Promise<void>

Defined in: src/modules/wallets/wallets.module.ts:535

Parameters ​

provider ​

IntegrationProvider

Returns ​

Promise<void>


getAddresses() ​

getAddresses(): WalletAccount & object[]

Defined in: src/modules/wallets/wallets.module.ts:608

Returns ​

WalletAccount & object[]


getAvailable() ​

getAvailable(options?): Promise<AvailableWallet[]>

Defined in: src/modules/wallets/wallets.module.ts:321

Pair session wallet payment methods with page-detected installs + host transports. Fetches payment methods when they are not already cached.

Parameters ​

options? ​
forceRefetch? ​

boolean

Returns ​

Promise<AvailableWallet[]>


getBalances() ​

getBalances(options?): Promise<WalletBalancesForWallet[]>

Defined in: src/modules/wallets/wallets.module.ts:617

Parameters ​

options? ​
forceRefetch? ​

boolean

Returns ​

Promise<WalletBalancesForWallet[]>


getCachedBalances() ​

getCachedBalances(): WalletBalancesForWallet[]

Defined in: src/modules/wallets/wallets.module.ts:590

Last balances snapshot used for getConnections({ sort: 'balanceDesc' }).

Returns ​

WalletBalancesForWallet[]


getConnection() ​

getConnection(walletId): WalletConnection | null

Defined in: src/modules/wallets/wallets.module.ts:594

Parameters ​

walletId ​

string

Returns ​

WalletConnection | null


getConnections() ​

getConnections(options?): WalletConnection[]

Defined in: src/modules/wallets/wallets.module.ts:582

Parameters ​

options? ​
sort? ​

WalletConnectionsSort

Returns ​

WalletConnection[]


getConnectionsByProvider() ​

getConnectionsByProvider(provider): WalletConnection[]

Defined in: src/modules/wallets/wallets.module.ts:602

Parameters ​

provider ​

IntegrationProvider

Returns ​

WalletConnection[]


getConnectionState() ​

getConnectionState(): WalletsConnectionState

Defined in: src/modules/wallets/wallets.module.ts:900

Returns ​

WalletsConnectionState


getDeepLinkUrl() ​

getDeepLinkUrl(provider): string | null

Defined in: src/modules/wallets/wallets.module.ts:367

Browse deeplink that opens the Swapped checkout in the wallet app.

Parameters ​

provider ​

IntegrationProvider

Returns ​

string | null


getWalletBalance() ​

getWalletBalance(walletId, options?): Promise<WalletBalance[]>

Defined in: src/modules/wallets/wallets.module.ts:657

Refresh balances for one wallet (all namespaces / networks) in a single /wallets/balances request. Concurrent callers share the in-flight promise.

Parameters ​

walletId ​

string

options? ​
forceRefetch? ​

boolean

Returns ​

Promise<WalletBalance[]>


isConnected() ​

isConnected(provider): boolean

Defined in: src/modules/wallets/wallets.module.ts:598

Parameters ​

provider ​

IntegrationProvider

Returns ​

boolean


openDeepLink(provider): string | null

Defined in: src/modules/wallets/wallets.module.ts:385

Open the browse deeplink from the merchant window.

Parameters ​

provider ​

IntegrationProvider

Returns ​

string | null


reconnect() ​

reconnect(options?): Promise<WalletConnection[]>

Defined in: src/modules/wallets/wallets.module.ts:853

Re-hydrate from the iframe store. Pass { force: true } to re-talk to popup-routed extensions in a new popup.

Parameters ​

options? ​
force? ​

boolean

Returns ​

Promise<WalletConnection[]>


requiresDeepLink(provider): boolean

Defined in: src/modules/wallets/wallets.module.ts:358

Parameters ​

provider ​

IntegrationProvider

Returns ​

boolean


sendTransaction() ​

sendTransaction(request): Promise<SendWalletTransactionResult>

Defined in: src/modules/wallets/wallets.module.ts:722

Parameters ​

request ​

SendWalletTransactionRequest

Returns ​

Promise<SendWalletTransactionResult>


signMessage() ​

signMessage(request): Promise<string>

Defined in: src/modules/wallets/wallets.module.ts:711

Parameters ​

request ​

SignWalletMessageRequest

Returns ​

Promise<string>


subscribe() ​

subscribe(listener): () => void

Defined in: src/modules/wallets/wallets.module.ts:892

Parameters ​

listener ​

(state) => void

Returns ​

() => void


supportsWalletConnect() ​

supportsWalletConnect(provider): boolean

Defined in: src/modules/wallets/wallets.module.ts:362

Parameters ​

provider ​

IntegrationProvider

Returns ​

boolean


switchChain() ​

switchChain(walletId, chainId, options?): Promise<WalletConnection>

Defined in: src/modules/wallets/wallets.module.ts:820

Parameters ​

walletId ​

string

chainId ​

`eip155:${string}` | `solana:${string}` | `bip122:${string}`

options? ​
forcePopup? ​

boolean

popupIfUnavailable? ​

boolean

Returns ​

Promise<WalletConnection>


watchAvailability() ​

watchAvailability(listener): () => void

Defined in: src/modules/wallets/wallets.module.ts:403

Notify when page install detection or iframe visibility changes.

Parameters ​

listener ​

() => void

Returns ​

() => void

Properties ​

transfer ​

readonly transfer: WalletsTransfer

Defined in: src/modules/wallets/wallets.module.ts:163

High-level deposit flows (direct / swap / bridge).