MCPcopy Create free account
hub / github.com/bitpay/bitcore / createFromTss

Method createFromTss

packages/bitcore-cli/src/wallet.ts:169–194  ·  view source on GitHub ↗
(args: {
    key: TssKeyType;
    chain: string;
    network: Network;
    password: string;
    addressType?: string;
    copayerName: string;
  })

Source from the content-addressed store, hash-verified

167 }
168
169 async createFromTss(args: {
170 key: TssKeyType;
171 chain: string;
172 network: Network;
173 password: string;
174 addressType?: string;
175 copayerName: string;
176 }) {
177 const { key, chain, network, addressType, password } = args;
178 if (!this.client) {
179 await this.getClient({ mustExist: true });
180 }
181 const credentials = key.createCredentials(password, {
182 chain,
183 network,
184 account: 0,
185 addressType
186 });
187 this.client.fromObj(credentials.toObj());
188 this.#walletData = { key, credentials: this.client.credentials };
189 await this.save();
190 // await this.register({ copayerName });
191 // this.load calls openWallet which completes the wallet by fetching any missing info
192 await this.load({ allowCache: true });
193 return { key, credentials: this.client.toObj() };
194 }
195
196 async register(args: { copayerName: string }) {
197 if (!this.client) {

Callers

nothing calls this directly

Calls 6

getClientMethod · 0.95
saveMethod · 0.95
loadMethod · 0.95
createCredentialsMethod · 0.45
fromObjMethod · 0.45
toObjMethod · 0.45

Tested by

no test coverage detected