@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.
- package/dist/cli.js +8 -2
- package/dist/cli.mjs +9 -3
- package/dist/index.browser.global.js +37782 -36017
- package/dist/index.browser.mjs +241 -92
- package/dist/index.d.ts +23 -4
- package/dist/index.js +247 -92
- package/dist/index.mjs +252 -97
- package/package.json +2 -2
- package/src/interfaces/common.tsx +2 -2
- package/src/modules/erc20.ts +1 -1
- package/src/modules/harvests.ts +6 -4
- package/src/modules/pragma.ts +1 -1
- package/src/modules/pricer.ts +1 -1
- package/src/node/deployer.ts +2 -2
- package/src/strategies/autoCompounderStrk.ts +1 -1
- package/src/strategies/ekubo-cl-vault.tsx +41 -41
- package/src/strategies/sensei.ts +6 -6
- package/src/strategies/universal-adapters/adapter-utils.ts +3 -1
- package/src/strategies/universal-adapters/common-adapter.ts +57 -1
- package/src/strategies/universal-adapters/vesu-adapter.ts +41 -2
- package/src/strategies/universal-strategy.tsx +93 -20
- package/src/strategies/vesu-rebalance.tsx +15 -15
- package/src/utils/store.ts +9 -2
|
@@ -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())
|
package/src/utils/store.ts
CHANGED
|
@@ -96,7 +96,7 @@ export class Store {
|
|
|
96
96
|
logger.warn(`⚠️=========================================⚠️`);
|
|
97
97
|
}
|
|
98
98
|
|
|
99
|
-
getAccount(accountKey: string, txVersion:
|
|
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
|
-
|
|
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
|
|