@strkfarm/sdk 1.0.62 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -103,11 +103,11 @@ export class VesuRebalance extends BaseStrategy<
103
103
  this.metadata = metadata;
104
104
  this.address = metadata.address;
105
105
 
106
- this.contract = new Contract(
107
- VesuRebalanceAbi,
108
- this.address.address,
109
- this.config.provider
110
- );
106
+ this.contract = new Contract({
107
+ abi: VesuRebalanceAbi,
108
+ address: this.address.address,
109
+ providerOrAccount: this.config.provider
110
+ });
111
111
  }
112
112
 
113
113
  /**
@@ -123,11 +123,11 @@ export class VesuRebalance extends BaseStrategy<
123
123
  amountInfo.tokenInfo.address.eq(this.asset().address),
124
124
  "Deposit token mismatch"
125
125
  );
126
- const assetContract = new Contract(
127
- VesuRebalanceAbi,
128
- this.asset().address.address,
129
- this.config.provider
130
- );
126
+ const assetContract = new Contract({
127
+ abi: VesuRebalanceAbi,
128
+ address: this.asset().address.address,
129
+ providerOrAccount: this.config.provider
130
+ });
131
131
  const call1 = assetContract.populate("approve", [
132
132
  this.address.address,
133
133
  uint256.bnToUint256(amountInfo.amount.toWei())
@@ -284,11 +284,11 @@ export class VesuRebalance extends BaseStrategy<
284
284
  `Asset ${this.asset().address.toString()} not found in pool ${p.pool_id.address.toString()}`
285
285
  );
286
286
  }
287
- let vTokenContract = new Contract(
288
- VesuRebalanceAbi,
289
- p.v_token.address,
290
- this.config.provider
291
- );
287
+ let vTokenContract = new Contract({
288
+ abi: VesuRebalanceAbi,
289
+ address: p.v_token.address,
290
+ providerOrAccount: this.config.provider
291
+ });
292
292
  const bal = await vTokenContract.balanceOf(this.address.address);
293
293
  const assets = await vTokenContract.convert_to_assets(
294
294
  uint256.bnToUint256(bal.toString())
@@ -96,7 +96,7 @@ export class Store {
96
96
  logger.warn(`⚠️=========================================⚠️`);
97
97
  }
98
98
 
99
- getAccount(accountKey: string, txVersion: "0x2" | "0x3" = constants.TRANSACTION_VERSION.V2) {
99
+ getAccount(accountKey: string, txVersion: undefined | "0x3") {
100
100
  const accounts = this.loadAccounts();
101
101
  logger.verbose(`nAccounts loaded for network: ${Object.keys(accounts).length}`);
102
102
  const data = accounts[accountKey];
@@ -105,7 +105,14 @@ export class Store {
105
105
  }
106
106
  logger.verbose(`Account loaded: ${accountKey} from network: ${this.config.network}`);
107
107
  logger.verbose(`Address: ${data.address}`);
108
- const acc = new Account(<any>this.config.provider, data.address, data.pk, undefined, txVersion);
108
+
109
+ const acc = new Account({
110
+ provider: <any>this.config.provider,
111
+ address: data.address,
112
+ signer: data.pk,
113
+ cairoVersion: undefined,
114
+ transactionVersion: txVersion
115
+ });
109
116
  return acc;
110
117
  }
111
118