PHP WebShell
Текущая директория: /opt/BitGoJS/examples/ts
Просмотр файла: create-tss-custodial-wallet.ts
/**
* Create a TSS Custodial wallet at BitGo.
* This makes use of the convenience function generateWallet
* Requires the common keychain and the bitgo key id from the keycard generated by the UI and OVC
*
* Copyright 2022, BitGo, Inc. All Rights Reserved.
*/
const BitGoJS = require('bitgo');
const bitgo = new BitGoJS.BitGo({ env: 'test' });
// TODO: set your access token here
const accessToken = '';
// TODO: set the enterpriseId here
const enterprise = '5f...';
// TODO: set a label for your new wallet here
const label = 'Testing Wallet';
const coin = 'tsol';
// Create the wallet
async function main() {
bitgo.authenticateWithAccessToken({ accessToken });
const walletOptions = {
label,
enterprise,
multisigType: 'tss',
type: 'custodial',
};
const wallet = await bitgo.coin(coin).wallets().generateWallet(walletOptions);
const walletInstance = wallet.wallet;
console.log(`Wallet ID: ${walletInstance.id()}`);
console.log(`Wallet data: ${JSON.stringify(wallet)}`);
}
main().catch((e) => console.error(e));
Выполнить команду
Для локальной разработки. Не используйте в интернете!