4.2.0 • Published 8 months ago

@coinbase/wallet-sdk v4.2.0

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 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@dodoex/wallet-web3@dodoex/web3@cocos-labs/web3modal-ethers5@cryptogate/react-providers@common-module/wallet@darthgus/wagmi-connectors@boeschj/wallet-management@prex0/prex-clientiuresitith-react-providersjxom-wagmi@fun-xyz/react@aprilsacil/wallet@ankr.com/provider@ankr.com/provider2@adnbsr/thirdweb@alhaqhassan/wallet-kit@alexayan/web3modal-ethereum@b-ee/web3-connect@baseswapfi/react-wallet-lib@bitoftrade/crypto-trading-widget-sdk@bytom-js/wagmi@c3/crypto@celo/react-celo@civic/civic-link@centrifuge/centrifuge-react@certhis/certhis-wallet@clerk/clerk-js@101xyz/core-lib@aarc-dev/coinbase@aarc-dev/wallet-auth@aarc-xyz/deposit-widget-coinbase@aarc-xyz/wallet-auth@brandonlehmann/web3@dcentralab/wc-coinbase@dcentralab/web3-wallet-connector@dedo_ai/web3modal-ethers@dedo_ai/web3modal-ethers5@depay/coinbase-wallet-sdkyearn-lib-silentwayback-clientvue-wagmivue3-web3modalvue3-dapp-bootvagmiveritatissed@seendsouza/wagmi@e_labs/web3provider@hdream/uniswap-pool@flydax/wagmi@flydaxwagmi/connectors@iandjx/wallet@honeycomb-finance/wallet-connectors@huma-shan/superfluid-widget@huma-shan/widgets@huma-finance/widgets@huma-shan/shared@element-js/wallets@egiftcard/wallets@gamefi-org/id-react@gelatonetwork/gasless-onboarding@forrestg/web3-wallets@gaofq/web@gotbit/evm-wallets@funkit/react
4.2.0

8 months ago

4.1.0

9 months 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

1 year ago

4.0.0-beta.12

1 year ago

4.0.0-rc.1

1 year ago

4.0.0-rc.0

1 year ago

4.0.0-beta.10

1 year ago

4.0.0-beta.9

1 year ago

4.0.0-beta.8

1 year ago

4.0.0-beta.7

1 year ago

4.0.0-beta.6

1 year ago

4.0.0-beta.5

1 year ago

4.0.0-beta.4

1 year ago

4.0.0-beta.3

1 year ago

4.0.0-beta.2

1 year ago

4.0.0-beta.1

1 year ago

3.9.3

1 year ago

4.0.0-beta.0

1 year ago

3.9.2

1 year 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

2 years ago

3.7.1

2 years ago

3.6.5

2 years ago

3.7.0

2 years ago

3.7.0-canary.1

2 years ago

3.7.0-canary.0

2 years ago

3.6.4

2 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

3 years ago

3.1.0

3 years ago

3.0.11

3 years ago

3.0.9

3 years ago

3.0.4

3 years ago

3.0.3

3 years ago

3.0.8

3 years ago

3.0.7

3 years ago

3.0.6

3 years ago

3.0.5

3 years ago

3.0.2

3 years ago

3.0.1

3 years ago

3.0.0

3 years ago