diff --git a/src/coinbase/wallet.ts b/src/coinbase/wallet.ts index 23cddb82..09edd5e8 100644 --- a/src/coinbase/wallet.ts +++ b/src/coinbase/wallet.ts @@ -8,8 +8,17 @@ import { Address } from "./address"; import { Coinbase } from "./coinbase"; import { ArgumentError, InternalError } from "./errors"; import { FaucetTransaction } from "./faucet_transaction"; +import { AddressAPIClient, WalletAPIClient } from "./types"; import { convertStringToHex } from "./utils"; +/** + * The Wallet API client types. + */ +type WalletClients = { + wallet: WalletAPIClient; + address: AddressAPIClient; +}; + /** * A representation of a Wallet. Wallets come with a single default Address, but can expand to have a set of Addresses, * each of which can hold a balance of one or more Assets. Wallets can create new Addresses, list their addresses, @@ -41,6 +50,7 @@ export class Wallet { * Instead, use User.createWallet. * * @constructs Wallet + * @throws {ArgumentError} If the model or client is not provided. * @throws {InternalError} - If address derivation or caching fails. * @throws {APIError} - If the request fails. * @returns A promise that resolves with the new Wallet object. @@ -52,7 +62,7 @@ export class Wallet { }, }); - const wallet = await Wallet.init(walletData.data!); + const wallet = await Wallet.init(walletData.data); await wallet.createAddress(); await wallet.reload(); @@ -80,7 +90,6 @@ export class Wallet { if (!model) { throw new ArgumentError("Wallet model cannot be empty"); } - if (!seed) { seed = bip39.generateMnemonic(); }