Skip to content

@swapped/connect-sdk / core / Wallets

Interface: Wallets

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

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:520

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:428

Parameters

request

ConnectWalletRequest

Returns

Promise<WalletConnection | null>


disconnect()

disconnect(walletId): Promise<void>

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

Parameters

walletId

string

Returns

Promise<void>


disconnectAll()

disconnectAll(): Promise<void>

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

Returns

Promise<void>


disconnectProvider()

disconnectProvider(provider): Promise<void>

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

Parameters

provider

IntegrationProvider

Returns

Promise<void>


getAddresses()

getAddresses(): WalletAccount & object[]

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

Returns

WalletAccount & object[]


getAvailable()

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

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

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:634

Parameters

options?
forceRefetch?

boolean

Returns

Promise<WalletBalancesForWallet[]>


getCachedBalances()

getCachedBalances(): WalletBalancesForWallet[]

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

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

Returns

WalletBalancesForWallet[]


getConnection()

getConnection(walletId): WalletConnection | null

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

Parameters

walletId

string

Returns

WalletConnection | null


getConnections()

getConnections(options?): WalletConnection[]

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

Parameters

options?
sort?

WalletConnectionsSort

Returns

WalletConnection[]


getConnectionsByProvider()

getConnectionsByProvider(provider): WalletConnection[]

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

Parameters

provider

IntegrationProvider

Returns

WalletConnection[]


getConnectionState()

getConnectionState(): WalletsConnectionState

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

Returns

WalletsConnectionState


getDeepLinkUrl()

getDeepLinkUrl(provider): string | null

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

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:674

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:615

Parameters

provider

IntegrationProvider

Returns

boolean


openDeepLink(provider): string | null

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

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:870

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:375

Parameters

provider

IntegrationProvider

Returns

boolean


sendTransaction()

sendTransaction(request): Promise<SendWalletTransactionResult>

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

Parameters

request

SendWalletTransactionRequest

Returns

Promise<SendWalletTransactionResult>


signMessage()

signMessage(request): Promise<string>

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

Parameters

request

SignWalletMessageRequest

Returns

Promise<string>


subscribe()

subscribe(listener): () => void

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

Parameters

listener

(state) => void

Returns

() => void


supportsWalletConnect()

supportsWalletConnect(provider): boolean

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

Parameters

provider

IntegrationProvider

Returns

boolean


switchChain()

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

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

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:420

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:162

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