-
Notifications
You must be signed in to change notification settings - Fork 274
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4897 from BitGo/feature/CS-3707-bulk-accept-walle…
…tShare feat(sdk-core): add bulkAcceptShare function
- Loading branch information
Showing
4 changed files
with
328 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
/** | ||
* Accept multiple wallet shares. | ||
* This makes use of the convenience function wallets().bulkAcceptShare() | ||
* | ||
* This tool will help you see how to use the BitGo API to easily list your | ||
* BitGo wallets. | ||
* | ||
* Copyright 2022, BitGo, Inc. All Rights Reserved. | ||
*/ | ||
import { BitGoAPI } from '@bitgo/sdk-api'; | ||
import { Tltc } from '@bitgo/sdk-coin-ltc'; | ||
require('dotenv').config({ path: '../../.env' }); | ||
|
||
const bitgo = new BitGoAPI({ | ||
accessToken: process.env.TESTNET_ACCESS_TOKEN, | ||
env: 'test', | ||
}); | ||
|
||
const coin = 'tltc'; | ||
bitgo.register(coin, Tltc.createInstance); | ||
|
||
const walletShareIds = ['']; // add the shareIds which needs to be accepted | ||
const userLoginPassword = ''; // add the user login password | ||
|
||
async function main() { | ||
const acceptShare = await bitgo.coin(coin).wallets().bulkAcceptShare({ | ||
walletShareIds: walletShareIds, | ||
userLoginPassword: userLoginPassword, | ||
}); | ||
console.dir(acceptShare); | ||
} | ||
|
||
main().catch((e) => console.error(e)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.