From 027aa9563017e2ca2663a7aecec84ce23c5f8629 Mon Sep 17 00:00:00 2001 From: alexstone Date: Tue, 30 Apr 2024 13:12:44 -0700 Subject: [PATCH] [hotfix] Fix user import_wallet This fixes the user import_wallet to ensure that it uses the memoized wallets_api helper. This currently is returning an error when importing a wallet in the following manner: ```ruby user = Coinbase.default_user cb_wallet = user.import_wallet(Coinbase::Wallet::Data.new(wallet.seed, wallet.wallet_id)) ``` --- lib/coinbase/user.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/coinbase/user.rb b/lib/coinbase/user.rb index dbaf989a..b7148716 100644 --- a/lib/coinbase/user.rb +++ b/lib/coinbase/user.rb @@ -39,7 +39,7 @@ def create_wallet # @param data [Coinbase::Wallet::Data] the Wallet data to import # @return [Coinbase::Wallet] the imported Wallet def import_wallet(data) - model = @wallets_api.get_wallet(data.wallet_id) + model = wallets_api.get_wallet(data.wallet_id) address_count = addresses_api.list_addresses(model.id).total_count Wallet.new(model, seed: data.seed, address_count: address_count) end