PHP WebShell

Текущая директория: /opt/BitGoJS/examples/ts

Просмотр файла: create-tss-smc-wallet.ts

/**
 * Create a TSS Self-managed cold 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';

// TODO: set the commonKeychain here
const commonKeychain = '021...049';

// TODO: set bitgoKeyId here
const bitgoKeyId = '5f...';

// TODO(Optional): set the seed here if you want to use a specific seed for the cold wallet
// or reuse the same common keychain for multiple wallets
const coldDerivationSeed: string | undefined = undefined;

const coin = 'tsol';

// Create the wallet
async function main() {
  bitgo.authenticateWithAccessToken({ accessToken });

  const walletOptions = {
    label,
    enterprise,
    multisigType: 'tss',
    type: 'cold',
    commonKeychain,
    bitgoKeyId,
    coldDerivationSeed,
  };

  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));

Выполнить команду


Для локальной разработки. Не используйте в интернете!