This project contains scripts which leverage the BitGoJS SDK (sdk-core) to create a wallet, view balances on the wallet, and transfer NFTs to and from the wallet.
- We will create a BitGo wallet for the Polygon Testnet (named Mumbai Testnet).
- A browser extension wallet is needed to interact with Polygonscan. Within Polygonscan (linked in Additional Resources below), we will mint (transfer) an NFT to the BitGo wallet's address.
- Once the NFT is minted to the BitGo wallet, we can view balances and transfer the NFT.
A browser extension wallet (like Metamask) will be used to mint an NFT through Polygonscan to a BitGo multi-sig (TSS) wallet. BitGo wallets can not directly connect to "dApps", therefore we use metamask to connect to a dApp in this case. If you are curious how BitGo wallets can connect to dApps, check out BitGo's integration with Metamask Institutional (MMI)!
- nvm 14.17.5 installed
// install nvm curl -sL https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.0/install.sh -o install_nvm.sh // install v 14.17.5 nvm install 14.17.5
- Have a browser extension wallet like Metamask installed
- You can install metamask for Chrome at https://metamask.io/download/
- After Metamask is installed you will need to add Polygon's Mumbai Testnet to the wallet
- 1 minute set up following instructions from Connect Metamask to Polygon Testnet using Chainlist
- Make sure the Metamask wallet is funded (to pay for gas). Use the MATIC faucet to deposit testnet MATIC into your Metamask wallet.
// clone repo
git clone https://github.com/aaldemir/tss-nft-wallet-demo.git
cd tss-nft-wallet-demo
// use the proper nvm version
nvm use 14.17.5
// install necessary node packages
npm install
// execute script to generate a wallet
// once you generate a wallet, copy the `walletId` into bitgo.ts
npx ts-node generateWallet.ts
// after you mint an NFT to the wallet you can view balances by executing the balances.ts script
npx ts-node balances.ts
// execute script to transfer the NFT
npx ts-node buildAndSend.ts
-
Create an account & enterprise with BitGo Developer Portal
-
THIS IS NOT NEEDED IF YOU ARE FOLLOWING THE DEMO AND USING THIS REPO - you will need to add the remaining portion of the accessToken
- sign up for an account (test account)
- sign in after account creation
- in the app (app.bitgo-test.com) retrieve an API token
- click on "Settings" on the left panel
- click on "Developer Options" on the left panel
- fill out information and check all boxes for "Permission"
- click "Add Access Token"
- copy access token and paste it into
secrets.ts
(create file secret.ts if needed)
- retrieve Enterprise Id and paste it into
bitgo.ts
within theenterprise
object- click on "Settings" on the left panel
- on the "Accounts and Preferences" tab, you will see "Enterprise ID:"
-
-
NFT Faucet: https://mumbai.polygonscan.com/address/0x252b4f5b517057db563e14cf7274b4467289fea8#writeContract
- You will need an extension wallet to interact with the polygonscan app
-
MATIC Faucet: https://faucet.polygon.technology/
- Deposit some MATIC into your new TSS wallet so that you can pay for gas