Skip to content

Commit

Permalink
Updating Wallet model usage
Browse files Browse the repository at this point in the history
  • Loading branch information
erdimaden committed May 20, 2024
1 parent 5dee198 commit ab3bef5
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/coinbase/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {

Check failure on line 17 in src/coinbase/wallet.ts

View workflow job for this annotation

GitHub Actions / lint

'WalletClients' is defined but never used
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,
Expand Down Expand Up @@ -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.
Expand All @@ -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();
Expand Down Expand Up @@ -80,7 +90,6 @@ export class Wallet {
if (!model) {
throw new ArgumentError("Wallet model cannot be empty");
}

if (!seed) {
seed = bip39.generateMnemonic();
}
Expand Down

0 comments on commit ab3bef5

Please sign in to comment.