Skip to content

@swapped/connect-sdk / core / Wallets

Interface: Wallets

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

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

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

Parameters

request

ConnectWalletRequest

Returns

Promise<WalletConnection | null>


disconnect()

disconnect(walletId): Promise<void>

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

Parameters

walletId

string

Returns

Promise<void>


disconnectAll()

disconnectAll(): Promise<void>

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

Returns

Promise<void>


disconnectProvider()

disconnectProvider(provider): Promise<void>

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

Parameters

provider

IntegrationProvider

Returns

Promise<void>


getAddresses()

getAddresses(): WalletAccount & object[]

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

Returns

WalletAccount & object[]


getAvailable()

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

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

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

Parameters

options?
forceRefetch?

boolean

Returns

Promise<WalletBalancesForWallet[]>


getCachedBalances()

getCachedBalances(): WalletBalancesForWallet[]

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

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

Returns

WalletBalancesForWallet[]


getConnection()

getConnection(walletId): WalletConnection | null

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

Parameters

walletId

string

Returns

WalletConnection | null


getConnections()

getConnections(options?): WalletConnection[]

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

Parameters

options?
sort?

WalletConnectionsSort

Returns

WalletConnection[]


getConnectionsByProvider()

getConnectionsByProvider(provider): WalletConnection[]

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

Parameters

provider

IntegrationProvider

Returns

WalletConnection[]


getConnectionState()

getConnectionState(): WalletsConnectionState

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

Returns

WalletsConnectionState


getDeepLinkUrl()

getDeepLinkUrl(provider): string | null

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

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

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

Parameters

provider

IntegrationProvider

Returns

boolean


openDeepLink(provider): string | null

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

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

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

Parameters

provider

IntegrationProvider

Returns

boolean


sendTransaction()

sendTransaction(request): Promise<SendWalletTransactionResult>

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

Parameters

request

SendWalletTransactionRequest

Returns

Promise<SendWalletTransactionResult>


signMessage()

signMessage(request): Promise<string>

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

Parameters

request

SignWalletMessageRequest

Returns

Promise<string>


subscribe()

subscribe(listener): () => void

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

Parameters

listener

(state) => void

Returns

() => void


supportsWalletConnect()

supportsWalletConnect(provider): boolean

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

Parameters

provider

IntegrationProvider

Returns

boolean


switchChain()

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

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

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

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

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