Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring Clients usage #20

Merged
merged 11 commits into from
May 21, 2024
Prev Previous commit
Next Next commit
Updating Wallet model usage
  • Loading branch information
erdimaden committed May 20, 2024
commit ce39bc71b769db4100373922f23599c6711f8c0d
1 change: 0 additions & 1 deletion src/coinbase/user.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { User as UserModel } from "./../client/api";
import { Coinbase } from "./coinbase";
import { Wallet } from "./wallet";

/**
4 changes: 2 additions & 2 deletions src/coinbase/wallet.ts
Original file line number Diff line number Diff line change
@@ -41,6 +41,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 +53,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 +81,6 @@ export class Wallet {
if (!model) {
throw new ArgumentError("Wallet model cannot be empty");
}

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