4.3.4 • Published 5 months ago

@coinbase/wallet-sdk v4.3.4

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
5 months ago

Coinbase Wallet SDK

Coinbase Wallet SDK lets developers connect their dapps to Coinbase Wallet in the following ways:

  1. Coinbase Smart Wallet
  2. Coinbase Wallet mobile for Android and iOS
    • Desktop: Users can connect to your dapp by scanning a QR code
    • Mobile: Users can connect to your mobile dapp through a deeplink to the dapp browser
  3. Coinbase Wallet extension for Chrome and Brave
    • Desktop: Users can connect by clicking the connect with extension option.

Installing Wallet SDK

  1. Check available versions:

      # yarn
      yarn info @coinbase/wallet-sdk versions
    
      # npm
      npm view @coinbase/wallet-sdk versions
  2. Install latest version:

    # yarn
    yarn add @coinbase/wallet-sdk
    
    # npm
    npm install @coinbase/wallet-sdk
  3. Check installed version:

    # yarn
    yarn list @coinbase/wallet-sdk
    
    # npm
    npm list @coinbase/wallet-sdk

Upgrading Wallet SDK

Upgrade Coinbase Wallet SDK using yarn or npm.

yarn/npm

  1. Compare installed version with latest:

    # yarn
    yarn outdated @coinbase/wallet-sdk
    
    # npm
    npm outdated @coinbase/wallet-sdk
  2. Update to latest:

    # yarn
    yarn upgrade @coinbase/wallet-sdk --latest
    
    # npm
    npm update @coinbase/wallet-sdk

Basic Usage

  1. Initialize SDK

    const sdk = new CoinbaseWalletSDK({
      appName: 'SDK Playground',
    });
  2. Make web3 Provider

    const provider = sdk.makeWeb3Provider();
  3. Request accounts to initialize connection to wallet

    const addresses = provider.request({
      method: 'eth_requestAccounts',
    });
  4. Make more requests

    provider.request('personal_sign', [
      `0x${Buffer.from('test message', 'utf8').toString('hex')}`,
      addresses[0],
    ]);
  5. Handle provider events

    provider.on('connect', (info) => {
      setConnect(info);
    });
    
    provider.on('disconnect', (error) => {
      setDisconnect({ code: error.code, message: error.message });
    });
    
    provider.on('accountsChanged', (accounts) => {
      setAccountsChanged(accounts);
    });
    
    provider.on('chainChanged', (chainId) => {
      setChainChanged(chainId);
    });
    
    provider.on('message', (message) => {
      setMessage(message);
    });

Developing locally and running the test dapp

@banditbadgod/react@plgwagmi/connectors@inv3rse/react-sdkweb3-walets@slashauth/slashauth-react-betaevm-ext-walletseriscrypt-connector-plugin@infinitebrahmanuniverse/nolb-_coi@everything-registry/sub-chunk-188@subwallet_connect/coinbase@dogswapdefi/react-mintmeweb3modal-ethers-depityweb3modal-ethers-deputyweb3modal-web3-testwagmi-banksocialwagmi-barkwagmi-cb-beta-connectorswalletlink-connectorv6wammiwallet-connector-extensionwallet-connector-extentionweb3-provider-testw3m-custom-qrweb3-wallets-reactweb3-wallet-contextweb3-walletsweb3modal-web3jstesting-wagmi-connectorsthirdwebvite-gardenutquodvents-thirdweb-fixvcool-connect-walletvue-dapp-connectorvue-dapp-temp@boeschj/wallet-managementiuresitith-react-providersjxom-wagmihipo-walletlock-pluginlifty-sdkmapoofano@wagmi/connectors@w3vm/coinbase@wallet01/evm@web5modal/ethers@web5modal/ethers5@web3sdkio/wallets@web3widgets/react@web4modal/ethers@web4modal/ethers5@web3sdks/wallets@web3-onboard/coinbase@web3modal/ethers@web3modal/ethers-5@web3modal/ethers5@web3-vue3/walletlink-connector@web3inno/appkit-ethers@web3inno/appkit-ethers5@web3modal-x/ethers5@web3-react/walletlink-connector@web3-react-widgets/core@web3-wallets-kit/coinbase-connector@vue-dapp/coinbase@vue-ethereum-hooks/hooks@web3modal-x/ethers@xircus-web3/sdk@thinkincoin/swap@thirdweb-dev/checkouts@thirdweb-dev/wallets@tg-wagmi/connectors@vethers/core@viaprotocol/web3-wallets@upacyxou/stores@uxuyalpha/connectors@wagmi-ekoios/connectors@usecapsule/evm-wallet-connectors@usecapsule/rainbowkit@xyfinance/widget@xyzk/wagmi-connectors@zalastax/nolb-_coiandrewtheswag228andrewtheswag230aarc-deposit-widgetautemfacere@civic/civic-link@clerk/clerk-js@gotbit/evm-wallets@b-ee/web3-connect@clypto/wallet-coinbase@e_labs/web3provider@egiftcard/wallets@cocos-labs/web3modal-ethers5@alexayan/web3modal-ethereum@alhaqhassan/wallet-kit@fun-xyz/react@baseswapfi/react-wallet-lib@bitoftrade/crypto-trading-widget-sdk@bytom-js/wagmi
4.4.0-canary.1

8 months ago

4.3.2

7 months ago

4.3.1

7 months ago

4.3.4

5 months ago

4.3.3

5 months ago

4.3.0

9 months ago

4.2.3

12 months ago

4.2.2

12 months ago

4.2.4

11 months ago

4.2.1

12 months ago

4.2.0

12 months ago

4.1.0

1 year ago

4.0.4

1 year ago

4.0.1

1 year ago

4.0.3

1 year ago

4.0.2

1 year ago

4.0.0

1 year ago

4.0.0-beta.14

1 year ago

4.0.0-rc.3

1 year ago

4.0.0-beta.13

1 year ago

4.0.0-rc.2

1 year ago

4.0.0-beta.11

2 years ago

4.0.0-beta.12

2 years ago

4.0.0-rc.1

2 years ago

4.0.0-rc.0

2 years ago

4.0.0-beta.10

2 years ago

4.0.0-beta.9

2 years ago

4.0.0-beta.8

2 years ago

4.0.0-beta.7

2 years ago

4.0.0-beta.6

2 years ago

4.0.0-beta.5

2 years ago

4.0.0-beta.4

2 years ago

4.0.0-beta.3

2 years ago

4.0.0-beta.2

2 years ago

4.0.0-beta.1

2 years ago

3.9.3

2 years ago

4.0.0-beta.0

2 years ago

3.9.2

2 years ago

3.9.1

2 years ago

3.7.2-canary.0

2 years ago

3.9.0

2 years ago

3.7.2

2 years ago

3.9.0-canary.0

2 years ago

3.9.0-canary.1

2 years ago

3.9.0-canary.2

2 years ago

3.9.0-canary.3

2 years ago

3.9.0-canary.4

2 years ago

3.9.0-canary.5

2 years ago

3.9.0-canary.6

2 years ago

3.8.0-beta.2

2 years ago

3.8.0-beta.3

2 years ago

3.8.0-beta.0

2 years ago

3.8.0-beta.1

2 years ago

3.6.6

3 years ago

3.7.1

3 years ago

3.6.5

3 years ago

3.7.0

3 years ago

3.7.0-canary.1

3 years ago

3.7.0-canary.0

3 years ago

3.6.4

3 years ago

3.6.3

3 years ago

3.5.4

3 years ago

3.6.2

3 years ago

3.6.1

3 years ago

3.6.0

3 years ago

3.6.0-beta1

3 years ago

3.5.3

3 years ago

3.5.2

3 years ago

3.5.1

3 years ago

3.5.0

3 years ago

3.4.0

3 years ago

3.3.0

3 years ago

3.4.2

3 years ago

3.4.1

3 years ago

3.2.0

3 years ago

3.0.12

3 years ago

3.0.10

4 years ago

3.1.0

3 years ago

3.0.11

3 years ago

3.0.9

4 years ago

3.0.4

4 years ago

3.0.3

4 years ago

3.0.8

4 years ago

3.0.7

4 years ago

3.0.6

4 years ago

3.0.5

4 years ago

3.0.2

4 years ago

3.0.1

4 years ago

3.0.0

4 years ago