mirror of
https://github.com/hanzoai/account-sdk.git
synced 2026-09-24 16:55:42 +00:00
* move readme to legacyDocs dir * add smart wallet connection method, clean up * minor * sdk options * migration guide wip * more details * running locally * address pr feedback
2.5 KiB
2.5 KiB
Coinbase Wallet SDK Migration Guide (v3 to v4)
CoinbaseWalletSDK changes
CoinbaseWalletSDK.disconnect()public instance method is deprecated- still in place but only clears storage and does not reset WalletLink
- dapps should call
CoinbaseWalletProvider.disconnect()instead
CoinbaseWalletSDK.setAppInfo()public instance method is deprecated for non-extension use cases- Dapps should pass in
appNameandappLogoUrlviaCoinbaseWalletSDKOptionsat SDK initialization
- Dapps should pass in
CoinbaseWalletSDKOptions changes
// v4
export interface CoinbaseWalletSDKOptions {
appName: string;
appLogoUrl?: string;
chainIds?: number[];
smartWalletOnly?: boolean;
}
deprecated options from v3:
enableMobileWalletLink(enabled by default in v4)jsonRpcUrlreloadOnDisconnectuiConstructoroverrideIsMetaMaskoverrideIsCoinbaseWalletdiagnosticLoggerreloadOnDisconnectheadlessMode
new options included in v4:
chainIds?: number[]- An array of chain ids your dapp supports
- The first chain in this array will be used as the default chain.
- Removes the need for non-mainnet dapps to request switching chains immediately.
- Default value is
[1](mainnet)
smartWalletOnly?: boolean;- If
true, hides options to connect via Coinbase Wallet mobile and Coinbase Wallet extension - Default value is
false
- If
present in both v3 and v4
appName: string- Your dapp's name to display in wallet with requests
appLogoUrl?: string- Your dapp's logo
- Favicon is used if unspecified
CoinbaseWalletProvider changes
Eventing fix
- The
connectevent has been fixed to be EIP-1193 compliant in v4.on(event: 'connect', listener: (info: ProviderConnectInfo) => void): this;- v3 returned
chainIdStr-interface ProviderConnectInfo { readonly chainIdStr: string; }
- v4 returns
chainIdinterface ProviderConnectInfo { readonly chainId: string; }
Removed public instance properties
isCoinbaseBrowser: booleanqrUrl?: string | nullreloadOnDisconnect: boolean
Removed public getter methods
selectedAddressnetworkVersionisWalletLinkismetaMaskhost
Removed public methods
disableReloadOnDisconnectsetProviderInfosetAppInfoclose- still in use for extension connectionssendsendAsyncscanQRCodegenericRequestconnectAndSignInselectProvidersupportsSubscriptionssubscribeunsubscribe