@strkfarm/sdk 2.0.0-dev.33 → 2.0.0-dev.35
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/index.browser.global.js +1708 -141
- package/dist/index.browser.mjs +1762 -194
- package/dist/index.d.ts +104 -2
- package/dist/index.js +1600 -29
- package/dist/index.mjs +1873 -305
- package/package.json +1 -1
- package/src/data/redeem-request-nft.abi.json +752 -0
- package/src/strategies/index.ts +1 -0
- package/src/strategies/svk-strategy.ts +3 -2
- package/src/strategies/universal-adapters/adapter-utils.ts +2 -0
- package/src/strategies/universal-adapters/avnu-adapter.ts +3 -2
- package/src/strategies/universal-adapters/extended-adapter.ts +25 -0
- package/src/strategies/universal-adapters/svk-troves-adapter.ts +141 -7
- package/src/strategies/universal-adapters/vesu-modify-position-adapter.ts +69 -39
- package/src/strategies/usdc-boosted-strategy.tsx +693 -0
- package/src/strategies/vesu-extended-strategy/services/executionService.ts +1 -0
- package/src/strategies/vesu-extended-strategy/services/extended-vesu-state-manager.ts +172 -5
|
@@ -3926,8 +3926,8 @@ var strkfarm_risk_engine = (() => {
|
|
|
3926
3926
|
}
|
|
3927
3927
|
}
|
|
3928
3928
|
exports.output = output2;
|
|
3929
|
-
var
|
|
3930
|
-
exports.default =
|
|
3929
|
+
var assert6 = { number: number2, bool, bytes: bytes2, hash: hash3, exists: exists2, output: output2 };
|
|
3930
|
+
exports.default = assert6;
|
|
3931
3931
|
}
|
|
3932
3932
|
});
|
|
3933
3933
|
|
|
@@ -12885,8 +12885,8 @@ ${r2}}` : "}", l2;
|
|
|
12885
12885
|
}
|
|
12886
12886
|
}
|
|
12887
12887
|
exports.output = output2;
|
|
12888
|
-
var
|
|
12889
|
-
exports.default =
|
|
12888
|
+
var assert6 = { number: number2, bool, bytes: bytes2, hash: hash3, exists: exists2, output: output2 };
|
|
12889
|
+
exports.default = assert6;
|
|
12890
12890
|
}
|
|
12891
12891
|
});
|
|
12892
12892
|
|
|
@@ -17772,7 +17772,7 @@ ${r2}}` : "}", l2;
|
|
|
17772
17772
|
return BlockTag22;
|
|
17773
17773
|
})(BlockTag2 || {});
|
|
17774
17774
|
var import_starknet_types_07 = require_cjs();
|
|
17775
|
-
function
|
|
17775
|
+
function assert6(condition, message) {
|
|
17776
17776
|
if (!condition) {
|
|
17777
17777
|
throw new Error(message || "Assertion failure");
|
|
17778
17778
|
}
|
|
@@ -17800,7 +17800,7 @@ ${r2}}` : "}", l2;
|
|
|
17800
17800
|
toHexString: () => toHexString2,
|
|
17801
17801
|
toStorageKey: () => toStorageKey2
|
|
17802
17802
|
});
|
|
17803
|
-
var
|
|
17803
|
+
var import_utils164 = require_utils();
|
|
17804
17804
|
function isHex3(hex) {
|
|
17805
17805
|
return /^0x[0-9a-f]*$/i.test(hex);
|
|
17806
17806
|
}
|
|
@@ -17828,7 +17828,7 @@ ${r2}}` : "}", l2;
|
|
|
17828
17828
|
const inputBigInt = BigInt(input);
|
|
17829
17829
|
const lowerBoundBigInt = BigInt(lowerBound);
|
|
17830
17830
|
const upperBoundBigInt = BigInt(upperBound);
|
|
17831
|
-
|
|
17831
|
+
assert6(
|
|
17832
17832
|
inputBigInt >= lowerBoundBigInt && inputBigInt <= upperBoundBigInt,
|
|
17833
17833
|
`Message not signable, ${messageSuffix}.`
|
|
17834
17834
|
);
|
|
@@ -17873,7 +17873,7 @@ ${r2}}` : "}", l2;
|
|
|
17873
17873
|
if (adaptedValue.length % 2 !== 0) {
|
|
17874
17874
|
adaptedValue = `0${adaptedValue}`;
|
|
17875
17875
|
}
|
|
17876
|
-
return (0,
|
|
17876
|
+
return (0, import_utils164.hexToBytes)(adaptedValue);
|
|
17877
17877
|
}
|
|
17878
17878
|
function addPercent2(number22, percent) {
|
|
17879
17879
|
const bigIntNum = BigInt(number22);
|
|
@@ -17892,14 +17892,14 @@ ${r2}}` : "}", l2;
|
|
|
17892
17892
|
keccakBn: () => keccakBn2,
|
|
17893
17893
|
starknetKeccak: () => starknetKeccak2
|
|
17894
17894
|
});
|
|
17895
|
-
var
|
|
17895
|
+
var import_starknet42 = require_lib2();
|
|
17896
17896
|
function keccakBn2(value) {
|
|
17897
17897
|
const hexWithoutPrefix = removeHexPrefix2(toHex3(BigInt(value)));
|
|
17898
17898
|
const evenHex = hexWithoutPrefix.length % 2 === 0 ? hexWithoutPrefix : `0${hexWithoutPrefix}`;
|
|
17899
|
-
return addHexPrefix2((0,
|
|
17899
|
+
return addHexPrefix2((0, import_starknet42.keccak)(hexToBytes5(addHexPrefix2(evenHex))).toString(16));
|
|
17900
17900
|
}
|
|
17901
17901
|
function keccakHex2(str) {
|
|
17902
|
-
return addHexPrefix2((0,
|
|
17902
|
+
return addHexPrefix2((0, import_starknet42.keccak)(utf8ToArray2(str)).toString(16));
|
|
17903
17903
|
}
|
|
17904
17904
|
function starknetKeccak2(str) {
|
|
17905
17905
|
const hash3 = BigInt(keccakHex2(str));
|
|
@@ -19261,37 +19261,37 @@ ${r2}}` : "}", l2;
|
|
|
19261
19261
|
}
|
|
19262
19262
|
}
|
|
19263
19263
|
var validateFelt2 = (parameter, input) => {
|
|
19264
|
-
|
|
19264
|
+
assert6(
|
|
19265
19265
|
isString3(parameter) || isNumber4(parameter) || isBigInt2(parameter),
|
|
19266
19266
|
`Validate: arg ${input.name} should be a felt typed as (String, Number or BigInt)`
|
|
19267
19267
|
);
|
|
19268
19268
|
if (isString3(parameter) && !isHex3(parameter))
|
|
19269
19269
|
return;
|
|
19270
19270
|
const param = BigInt(parameter.toString(10));
|
|
19271
|
-
|
|
19271
|
+
assert6(
|
|
19272
19272
|
// from : https://github.com/starkware-libs/starknet-specs/blob/29bab650be6b1847c92d4461d4c33008b5e50b1a/api/starknet_api_openrpc.json#L1266
|
|
19273
19273
|
param >= 0n && param <= 2n ** 252n - 1n,
|
|
19274
19274
|
`Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^252-1]`
|
|
19275
19275
|
);
|
|
19276
19276
|
};
|
|
19277
19277
|
var validateBytes31 = (parameter, input) => {
|
|
19278
|
-
|
|
19279
|
-
|
|
19278
|
+
assert6(isString3(parameter), `Validate: arg ${input.name} should be a string.`);
|
|
19279
|
+
assert6(
|
|
19280
19280
|
parameter.length < 32,
|
|
19281
19281
|
`Validate: arg ${input.name} cairo typed ${input.type} should be a string of less than 32 characters.`
|
|
19282
19282
|
);
|
|
19283
19283
|
};
|
|
19284
19284
|
var validateByteArray = (parameter, input) => {
|
|
19285
|
-
|
|
19285
|
+
assert6(isString3(parameter), `Validate: arg ${input.name} should be a string.`);
|
|
19286
19286
|
};
|
|
19287
19287
|
var validateUint2 = (parameter, input) => {
|
|
19288
19288
|
if (isNumber4(parameter)) {
|
|
19289
|
-
|
|
19289
|
+
assert6(
|
|
19290
19290
|
parameter <= Number.MAX_SAFE_INTEGER,
|
|
19291
19291
|
`Validation: Parameter is to large to be typed as Number use (BigInt or String)`
|
|
19292
19292
|
);
|
|
19293
19293
|
}
|
|
19294
|
-
|
|
19294
|
+
assert6(
|
|
19295
19295
|
isString3(parameter) || isNumber4(parameter) || isBigInt2(parameter) || typeof parameter === "object" && "low" in parameter && "high" in parameter || typeof parameter === "object" && ["limb0", "limb1", "limb2", "limb3"].every((key) => key in parameter),
|
|
19296
19296
|
`Validate: arg ${input.name} of cairo type ${input.type} should be type (String, Number or BigInt), but is ${typeof parameter} ${parameter}.`
|
|
19297
19297
|
);
|
|
@@ -19308,60 +19308,60 @@ ${r2}}` : "}", l2;
|
|
|
19308
19308
|
}
|
|
19309
19309
|
switch (input.type) {
|
|
19310
19310
|
case "core::integer::u8":
|
|
19311
|
-
|
|
19311
|
+
assert6(
|
|
19312
19312
|
param >= 0n && param <= 255n,
|
|
19313
19313
|
`Validate: arg ${input.name} cairo typed ${input.type} should be in range [0 - 255]`
|
|
19314
19314
|
);
|
|
19315
19315
|
break;
|
|
19316
19316
|
case "core::integer::u16":
|
|
19317
|
-
|
|
19317
|
+
assert6(
|
|
19318
19318
|
param >= 0n && param <= 65535n,
|
|
19319
19319
|
`Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 65535]`
|
|
19320
19320
|
);
|
|
19321
19321
|
break;
|
|
19322
19322
|
case "core::integer::u32":
|
|
19323
|
-
|
|
19323
|
+
assert6(
|
|
19324
19324
|
param >= 0n && param <= 4294967295n,
|
|
19325
19325
|
`Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 4294967295]`
|
|
19326
19326
|
);
|
|
19327
19327
|
break;
|
|
19328
19328
|
case "core::integer::u64":
|
|
19329
|
-
|
|
19329
|
+
assert6(
|
|
19330
19330
|
param >= 0n && param <= 2n ** 64n - 1n,
|
|
19331
19331
|
`Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^64-1]`
|
|
19332
19332
|
);
|
|
19333
19333
|
break;
|
|
19334
19334
|
case "core::integer::u128":
|
|
19335
|
-
|
|
19335
|
+
assert6(
|
|
19336
19336
|
param >= 0n && param <= 2n ** 128n - 1n,
|
|
19337
19337
|
`Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^128-1]`
|
|
19338
19338
|
);
|
|
19339
19339
|
break;
|
|
19340
19340
|
case "core::integer::u256":
|
|
19341
|
-
|
|
19341
|
+
assert6(
|
|
19342
19342
|
param >= 0n && param <= 2n ** 256n - 1n,
|
|
19343
19343
|
`Validate: arg ${input.name} is ${input.type} 0 - 2^256-1`
|
|
19344
19344
|
);
|
|
19345
19345
|
break;
|
|
19346
19346
|
case "core::integer::u512":
|
|
19347
|
-
|
|
19347
|
+
assert6(CairoUint5122.is(param), `Validate: arg ${input.name} is ${input.type} 0 - 2^512-1`);
|
|
19348
19348
|
break;
|
|
19349
19349
|
case "core::starknet::class_hash::ClassHash":
|
|
19350
|
-
|
|
19350
|
+
assert6(
|
|
19351
19351
|
// from : https://github.com/starkware-libs/starknet-specs/blob/29bab650be6b1847c92d4461d4c33008b5e50b1a/api/starknet_api_openrpc.json#L1670
|
|
19352
19352
|
param >= 0n && param <= 2n ** 252n - 1n,
|
|
19353
19353
|
`Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^252-1]`
|
|
19354
19354
|
);
|
|
19355
19355
|
break;
|
|
19356
19356
|
case "core::starknet::contract_address::ContractAddress":
|
|
19357
|
-
|
|
19357
|
+
assert6(
|
|
19358
19358
|
// from : https://github.com/starkware-libs/starknet-specs/blob/29bab650be6b1847c92d4461d4c33008b5e50b1a/api/starknet_api_openrpc.json#L1245
|
|
19359
19359
|
param >= 0n && param <= 2n ** 252n - 1n,
|
|
19360
19360
|
`Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^252-1]`
|
|
19361
19361
|
);
|
|
19362
19362
|
break;
|
|
19363
19363
|
case "core::starknet::secp256k1::Secp256k1Point": {
|
|
19364
|
-
|
|
19364
|
+
assert6(
|
|
19365
19365
|
param >= 0n && param <= 2n ** 512n - 1n,
|
|
19366
19366
|
`Validate: arg ${input.name} must be ${input.type} : a 512 bits number.`
|
|
19367
19367
|
);
|
|
@@ -19372,7 +19372,7 @@ ${r2}}` : "}", l2;
|
|
|
19372
19372
|
}
|
|
19373
19373
|
};
|
|
19374
19374
|
var validateBool2 = (parameter, input) => {
|
|
19375
|
-
|
|
19375
|
+
assert6(
|
|
19376
19376
|
isBoolean3(parameter),
|
|
19377
19377
|
`Validate: arg ${input.name} of cairo type ${input.type} should be type (Boolean)`
|
|
19378
19378
|
);
|
|
@@ -19383,31 +19383,31 @@ ${r2}}` : "}", l2;
|
|
|
19383
19383
|
return;
|
|
19384
19384
|
}
|
|
19385
19385
|
if (input.type === "core::starknet::eth_address::EthAddress") {
|
|
19386
|
-
|
|
19386
|
+
assert6(
|
|
19387
19387
|
typeof parameter !== "object",
|
|
19388
19388
|
`EthAddress type is waiting a BigNumberish. Got ${parameter}`
|
|
19389
19389
|
);
|
|
19390
19390
|
const param = BigInt(parameter.toString(10));
|
|
19391
|
-
|
|
19391
|
+
assert6(
|
|
19392
19392
|
// from : https://github.com/starkware-libs/starknet-specs/blob/29bab650be6b1847c92d4461d4c33008b5e50b1a/api/starknet_api_openrpc.json#L1259
|
|
19393
19393
|
param >= 0n && param <= 2n ** 160n - 1n,
|
|
19394
19394
|
`Validate: arg ${input.name} cairo typed ${input.type} should be in range [0, 2^160-1]`
|
|
19395
19395
|
);
|
|
19396
19396
|
return;
|
|
19397
19397
|
}
|
|
19398
|
-
|
|
19398
|
+
assert6(
|
|
19399
19399
|
typeof parameter === "object" && !Array.isArray(parameter),
|
|
19400
19400
|
`Validate: arg ${input.name} is cairo type struct (${input.type}), and should be defined as js object (not array)`
|
|
19401
19401
|
);
|
|
19402
19402
|
structs[input.type].members.forEach(({ name }) => {
|
|
19403
|
-
|
|
19403
|
+
assert6(
|
|
19404
19404
|
Object.keys(parameter).includes(name),
|
|
19405
19405
|
`Validate: arg ${input.name} should have a property ${name}`
|
|
19406
19406
|
);
|
|
19407
19407
|
});
|
|
19408
19408
|
};
|
|
19409
19409
|
var validateEnum2 = (parameter, input) => {
|
|
19410
|
-
|
|
19410
|
+
assert6(
|
|
19411
19411
|
typeof parameter === "object" && !Array.isArray(parameter),
|
|
19412
19412
|
`Validate: arg ${input.name} is cairo type Enum (${input.type}), and should be defined as js object (not array)`
|
|
19413
19413
|
);
|
|
@@ -19427,7 +19427,7 @@ ${r2}}` : "}", l2;
|
|
|
19427
19427
|
);
|
|
19428
19428
|
};
|
|
19429
19429
|
var validateTuple2 = (parameter, input) => {
|
|
19430
|
-
|
|
19430
|
+
assert6(
|
|
19431
19431
|
typeof parameter === "object" && !Array.isArray(parameter),
|
|
19432
19432
|
`Validate: arg ${input.name} should be a tuple (defined as object)`
|
|
19433
19433
|
);
|
|
@@ -19437,7 +19437,7 @@ ${r2}}` : "}", l2;
|
|
|
19437
19437
|
if (isTypeFelt2(baseType) && isLongText2(parameter)) {
|
|
19438
19438
|
return;
|
|
19439
19439
|
}
|
|
19440
|
-
|
|
19440
|
+
assert6(Array.isArray(parameter), `Validate: arg ${input.name} should be an Array`);
|
|
19441
19441
|
switch (true) {
|
|
19442
19442
|
case isTypeFelt2(baseType):
|
|
19443
19443
|
parameter.forEach((param) => validateFelt2(param, input));
|
|
@@ -19472,14 +19472,14 @@ ${r2}}` : "}", l2;
|
|
|
19472
19472
|
};
|
|
19473
19473
|
var validateNonZero2 = (parameter, input) => {
|
|
19474
19474
|
const baseType = getArrayType2(input.type);
|
|
19475
|
-
|
|
19475
|
+
assert6(
|
|
19476
19476
|
isTypeUint2(baseType) && baseType !== CairoUint5122.abiSelector || isTypeFelt2(baseType),
|
|
19477
19477
|
`Validate: ${input.name} type is not authorized for NonZero type.`
|
|
19478
19478
|
);
|
|
19479
19479
|
switch (true) {
|
|
19480
19480
|
case isTypeFelt2(baseType):
|
|
19481
19481
|
validateFelt2(parameter, input);
|
|
19482
|
-
|
|
19482
|
+
assert6(
|
|
19483
19483
|
BigInt(parameter.toString(10)) > 0,
|
|
19484
19484
|
"Validate: value 0 is not authorized in NonZero felt252 type."
|
|
19485
19485
|
);
|
|
@@ -19488,13 +19488,13 @@ ${r2}}` : "}", l2;
|
|
|
19488
19488
|
validateUint2(parameter, { name: "", type: baseType });
|
|
19489
19489
|
switch (input.type) {
|
|
19490
19490
|
case "core::integer::u256":
|
|
19491
|
-
|
|
19491
|
+
assert6(
|
|
19492
19492
|
new CairoUint2562(parameter).toBigInt() > 0,
|
|
19493
19493
|
"Validate: value 0 is not authorized in NonZero uint256 type."
|
|
19494
19494
|
);
|
|
19495
19495
|
break;
|
|
19496
19496
|
default:
|
|
19497
|
-
|
|
19497
|
+
assert6(
|
|
19498
19498
|
toBigInt5(parameter) > 0,
|
|
19499
19499
|
"Validate: value 0 is not authorized in NonZero uint type."
|
|
19500
19500
|
);
|
|
@@ -19575,7 +19575,7 @@ ${r2}}` : "}", l2;
|
|
|
19575
19575
|
const isView = abi.stateMutability === "view" || abi.state_mutability === "view";
|
|
19576
19576
|
return type === "INVOKE" ? !isView : isView;
|
|
19577
19577
|
}).map((abi) => abi.name);
|
|
19578
|
-
|
|
19578
|
+
assert6(
|
|
19579
19579
|
invocableFunctionNames.includes(method),
|
|
19580
19580
|
`${type === "INVOKE" ? "invocable" : "viewable"} method not found in abi`
|
|
19581
19581
|
);
|
|
@@ -20272,7 +20272,7 @@ ${r2}}` : "}", l2;
|
|
|
20272
20272
|
toTransactionVersion: () => toTransactionVersion2,
|
|
20273
20273
|
v3Details: () => v3Details2
|
|
20274
20274
|
});
|
|
20275
|
-
var
|
|
20275
|
+
var import_starknet43 = require_lib2();
|
|
20276
20276
|
var import_pako2 = require_pako();
|
|
20277
20277
|
function compressProgram2(jsonProgram) {
|
|
20278
20278
|
const stringified = isString3(jsonProgram) ? jsonProgram : stringify22(jsonProgram);
|
|
@@ -20286,8 +20286,8 @@ ${r2}}` : "}", l2;
|
|
|
20286
20286
|
return parse22(decompressed);
|
|
20287
20287
|
}
|
|
20288
20288
|
function randomAddress2() {
|
|
20289
|
-
const randomKeyPair =
|
|
20290
|
-
return (0,
|
|
20289
|
+
const randomKeyPair = import_starknet43.utils.randomPrivateKey();
|
|
20290
|
+
return (0, import_starknet43.getStarkKey)(randomKeyPair);
|
|
20291
20291
|
}
|
|
20292
20292
|
function makeAddress(input) {
|
|
20293
20293
|
return addHexPrefix2(input).toLowerCase();
|
|
@@ -20419,7 +20419,7 @@ ${r2}}` : "}", l2;
|
|
|
20419
20419
|
function validateAndParseEthAddress2(address) {
|
|
20420
20420
|
assertInRange2(address, ZERO2, 2n ** 160n - 1n, "Ethereum Address ");
|
|
20421
20421
|
const result2 = addHexPrefix2(removeHexPrefix2(toHex3(address)).padStart(40, "0"));
|
|
20422
|
-
|
|
20422
|
+
assert6(Boolean(result2.match(/^(0x)?[0-9a-f]{40}$/)), "Invalid Ethereum Address Format");
|
|
20423
20423
|
return result2;
|
|
20424
20424
|
}
|
|
20425
20425
|
var import_fetch_cookie = __toESM2(require_cjs2());
|
|
@@ -21978,7 +21978,7 @@ ${r2}}` : "}", l2;
|
|
|
21978
21978
|
}
|
|
21979
21979
|
async getL1MessageHash(l2TxHash) {
|
|
21980
21980
|
const transaction2 = await this.channel.getTransactionByHash(l2TxHash);
|
|
21981
|
-
|
|
21981
|
+
assert6(transaction2.type === "L1_HANDLER", "This L2 transaction is not a L1 message.");
|
|
21982
21982
|
const { calldata, contract_address, entry_point_selector, nonce } = transaction2;
|
|
21983
21983
|
const params = [
|
|
21984
21984
|
calldata[0],
|
|
@@ -22773,7 +22773,7 @@ ${r2}}` : "}", l2;
|
|
|
22773
22773
|
};
|
|
22774
22774
|
function assertRange2(data, type, { min, max }) {
|
|
22775
22775
|
const value = BigInt(data);
|
|
22776
|
-
|
|
22776
|
+
assert6(value >= min && value <= max, `${value} (${type}) is out of bounds [${min}, ${max}]`);
|
|
22777
22777
|
}
|
|
22778
22778
|
function identifyRevision2({ types: types2, domain }) {
|
|
22779
22779
|
if (revisionConfiguration2[import_starknet_types_07.TypedDataRevision.ACTIVE].domain in types2 && domain.revision === import_starknet_types_07.TypedDataRevision.ACTIVE)
|
|
@@ -22968,7 +22968,7 @@ ${r2}}` : "}", l2;
|
|
|
22968
22968
|
}
|
|
22969
22969
|
case "bool": {
|
|
22970
22970
|
if (revision === import_starknet_types_07.TypedDataRevision.ACTIVE) {
|
|
22971
|
-
|
|
22971
|
+
assert6(typeof data === "boolean", `Type mismatch for ${type} ${data}`);
|
|
22972
22972
|
}
|
|
22973
22973
|
return [type, getHex2(data)];
|
|
22974
22974
|
}
|
|
@@ -23337,7 +23337,7 @@ ${r2}}` : "}", l2;
|
|
|
23337
23337
|
}
|
|
23338
23338
|
while (!abiEvent.name) {
|
|
23339
23339
|
const hashName = recEvent.keys.shift();
|
|
23340
|
-
|
|
23340
|
+
assert6(!!hashName, 'Not enough data in "key" property of this event.');
|
|
23341
23341
|
abiEvent = abiEvent[hashName];
|
|
23342
23342
|
}
|
|
23343
23343
|
const parsedEvent = {};
|
|
@@ -24349,7 +24349,7 @@ ${r2}}` : "}", l2;
|
|
|
24349
24349
|
formatResponse = void 0,
|
|
24350
24350
|
blockIdentifier = void 0
|
|
24351
24351
|
} = {}) {
|
|
24352
|
-
|
|
24352
|
+
assert6(this.address !== null, "contract is not connected to an address");
|
|
24353
24353
|
const calldata = getCalldata(args, () => {
|
|
24354
24354
|
if (parseRequest) {
|
|
24355
24355
|
this.callData.validate("CALL", method, args);
|
|
@@ -24376,7 +24376,7 @@ ${r2}}` : "}", l2;
|
|
|
24376
24376
|
});
|
|
24377
24377
|
}
|
|
24378
24378
|
invoke(method, args = [], { parseRequest = true, maxFee, nonce, signature } = {}) {
|
|
24379
|
-
|
|
24379
|
+
assert6(this.address !== null, "contract is not connected to an address");
|
|
24380
24380
|
const calldata = getCalldata(args, () => {
|
|
24381
24381
|
if (parseRequest) {
|
|
24382
24382
|
this.callData.validate("INVOKE", method, args);
|
|
@@ -24410,7 +24410,7 @@ ${r2}}` : "}", l2;
|
|
|
24410
24410
|
);
|
|
24411
24411
|
}
|
|
24412
24412
|
async estimate(method, args = []) {
|
|
24413
|
-
|
|
24413
|
+
assert6(this.address !== null, "contract is not connected to an address");
|
|
24414
24414
|
if (!getCalldata(args, () => false)) {
|
|
24415
24415
|
this.callData.validate("INVOKE", method, args);
|
|
24416
24416
|
}
|
|
@@ -24508,7 +24508,7 @@ ${r2}}` : "}", l2;
|
|
|
24508
24508
|
constructorCalldata,
|
|
24509
24509
|
salt: options.addressSalt
|
|
24510
24510
|
});
|
|
24511
|
-
|
|
24511
|
+
assert6(Boolean(contract_address), "Deployment of the contract failed");
|
|
24512
24512
|
const contractInstance = new Contract3(
|
|
24513
24513
|
this.compiledContract.abi,
|
|
24514
24514
|
contract_address,
|
|
@@ -28729,6 +28729,7 @@ ${r2}}` : "}", l2;
|
|
|
28729
28729
|
SIMPLE_SANITIZER: () => SIMPLE_SANITIZER,
|
|
28730
28730
|
SIMPLE_SANITIZER_V2: () => SIMPLE_SANITIZER_V2,
|
|
28731
28731
|
SIMPLE_SANITIZER_VESU_V1_DELEGATIONS: () => SIMPLE_SANITIZER_VESU_V1_DELEGATIONS,
|
|
28732
|
+
SVK_SIMPLE_SANITIZER: () => SVK_SIMPLE_SANITIZER,
|
|
28732
28733
|
SenseiStrategies: () => SenseiStrategies,
|
|
28733
28734
|
SenseiVault: () => SenseiVault,
|
|
28734
28735
|
SolveBudget: () => SolveBudget,
|
|
@@ -28745,6 +28746,8 @@ ${r2}}` : "}", l2;
|
|
|
28745
28746
|
TokenTransferAdapter: () => TokenTransferAdapter,
|
|
28746
28747
|
UNIVERSAL_ADAPTERS: () => UNIVERSAL_ADAPTERS,
|
|
28747
28748
|
UNIVERSAL_MANAGE_IDS: () => UNIVERSAL_MANAGE_IDS,
|
|
28749
|
+
USDCBoostedStrategies: () => USDCBoostedStrategies,
|
|
28750
|
+
USDCBoostedStrategy: () => USDCBoostedStrategy,
|
|
28748
28751
|
UniversalLstMultiplierStrategy: () => UniversalLstMultiplierStrategy,
|
|
28749
28752
|
UniversalStrategies: () => UniversalStrategies,
|
|
28750
28753
|
UniversalStrategy: () => UniversalStrategy,
|
|
@@ -79268,10 +79271,10 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
79268
79271
|
return old;
|
|
79269
79272
|
}
|
|
79270
79273
|
|
|
79271
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/version.js
|
|
79274
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/version.js
|
|
79272
79275
|
var version4 = "3.11.8";
|
|
79273
79276
|
|
|
79274
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/globals/maybe.js
|
|
79277
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/globals/maybe.js
|
|
79275
79278
|
function maybe(thunk) {
|
|
79276
79279
|
try {
|
|
79277
79280
|
return thunk();
|
|
@@ -79279,7 +79282,7 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
79279
79282
|
}
|
|
79280
79283
|
}
|
|
79281
79284
|
|
|
79282
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/globals/global.js
|
|
79285
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/globals/global.js
|
|
79283
79286
|
var global_default = maybe(function() {
|
|
79284
79287
|
return globalThis;
|
|
79285
79288
|
}) || maybe(function() {
|
|
@@ -79298,7 +79301,7 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
79298
79301
|
return maybe.constructor("return this")();
|
|
79299
79302
|
});
|
|
79300
79303
|
|
|
79301
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/makeUniqueId.js
|
|
79304
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/makeUniqueId.js
|
|
79302
79305
|
var prefixCounts = /* @__PURE__ */ new Map();
|
|
79303
79306
|
function makeUniqueId(prefix) {
|
|
79304
79307
|
var count = prefixCounts.get(prefix) || 1;
|
|
@@ -79306,7 +79309,7 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
79306
79309
|
return "".concat(prefix, ":").concat(count, ":").concat(Math.random().toString(36).slice(2));
|
|
79307
79310
|
}
|
|
79308
79311
|
|
|
79309
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/stringifyForDisplay.js
|
|
79312
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/stringifyForDisplay.js
|
|
79310
79313
|
function stringifyForDisplay(value, space) {
|
|
79311
79314
|
if (space === void 0) {
|
|
79312
79315
|
space = 0;
|
|
@@ -79317,7 +79320,7 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
79317
79320
|
}, space).split(JSON.stringify(undefId)).join("<undefined>");
|
|
79318
79321
|
}
|
|
79319
79322
|
|
|
79320
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/globals/invariantWrappers.js
|
|
79323
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/globals/invariantWrappers.js
|
|
79321
79324
|
function wrap(fn) {
|
|
79322
79325
|
return function(message) {
|
|
79323
79326
|
var args = [];
|
|
@@ -79388,7 +79391,7 @@ ${JSON.stringify(data, null, 2)}`;
|
|
|
79388
79391
|
})));
|
|
79389
79392
|
}
|
|
79390
79393
|
|
|
79391
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/globals/index.js
|
|
79394
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/globals/index.js
|
|
79392
79395
|
var DEV = globalThis.__DEV__ !== false;
|
|
79393
79396
|
|
|
79394
79397
|
// node_modules/.pnpm/graphql@16.9.0/node_modules/graphql/jsutils/devAssert.mjs
|
|
@@ -82463,7 +82466,7 @@ spurious results.`);
|
|
|
82463
82466
|
return node.kind === Kind.FIELD || node.kind === Kind.FRAGMENT_SPREAD || node.kind === Kind.INLINE_FRAGMENT;
|
|
82464
82467
|
}
|
|
82465
82468
|
|
|
82466
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/graphql/directives.js
|
|
82469
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/graphql/directives.js
|
|
82467
82470
|
function shouldInclude(_a22, variables) {
|
|
82468
82471
|
var directives = _a22.directives;
|
|
82469
82472
|
if (!directives || !directives.length) {
|
|
@@ -82591,7 +82594,7 @@ spurious results.`);
|
|
|
82591
82594
|
return false;
|
|
82592
82595
|
}
|
|
82593
82596
|
|
|
82594
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/canUse.js
|
|
82597
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/canUse.js
|
|
82595
82598
|
var isReactNative = maybe(function() {
|
|
82596
82599
|
return navigator.product;
|
|
82597
82600
|
}) == "ReactNative";
|
|
@@ -82616,12 +82619,12 @@ spurious results.`);
|
|
|
82616
82619
|
}) || false
|
|
82617
82620
|
);
|
|
82618
82621
|
|
|
82619
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/objects.js
|
|
82622
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/objects.js
|
|
82620
82623
|
function isNonNullObject(obj) {
|
|
82621
82624
|
return obj !== null && typeof obj === "object";
|
|
82622
82625
|
}
|
|
82623
82626
|
|
|
82624
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/graphql/fragments.js
|
|
82627
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/graphql/fragments.js
|
|
82625
82628
|
function getFragmentQueryDocument(document2, fragmentName) {
|
|
82626
82629
|
var actualFragmentName = fragmentName;
|
|
82627
82630
|
var fragments = [];
|
|
@@ -82917,7 +82920,7 @@ spurious results.`);
|
|
|
82917
82920
|
}
|
|
82918
82921
|
};
|
|
82919
82922
|
|
|
82920
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/caching/caches.js
|
|
82923
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/caching/caches.js
|
|
82921
82924
|
var scheduledCleanup = /* @__PURE__ */ new WeakSet();
|
|
82922
82925
|
function schedule(cache) {
|
|
82923
82926
|
if (cache.size <= (cache.max || -1)) {
|
|
@@ -82950,11 +82953,11 @@ spurious results.`);
|
|
|
82950
82953
|
return cache;
|
|
82951
82954
|
};
|
|
82952
82955
|
|
|
82953
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/caching/sizes.js
|
|
82956
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/caching/sizes.js
|
|
82954
82957
|
var cacheSizeSymbol = Symbol.for("apollo.cacheSize");
|
|
82955
82958
|
var cacheSizes = __assign({}, global_default[cacheSizeSymbol]);
|
|
82956
82959
|
|
|
82957
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/caching/getMemoryInternals.js
|
|
82960
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/caching/getMemoryInternals.js
|
|
82958
82961
|
var globalCaches = {};
|
|
82959
82962
|
function registerGlobalCache(name, getSize) {
|
|
82960
82963
|
globalCaches[name] = getSize;
|
|
@@ -83044,7 +83047,7 @@ spurious results.`);
|
|
|
83044
83047
|
], linkInfo(link === null || link === void 0 ? void 0 : link.left), true), linkInfo(link === null || link === void 0 ? void 0 : link.right), true).filter(isDefined) : [];
|
|
83045
83048
|
}
|
|
83046
83049
|
|
|
83047
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/canonicalStringify.js
|
|
83050
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/canonicalStringify.js
|
|
83048
83051
|
var canonicalStringify = Object.assign(function canonicalStringify2(value) {
|
|
83049
83052
|
return JSON.stringify(value, stableObjectReplacer);
|
|
83050
83053
|
}, {
|
|
@@ -83091,7 +83094,7 @@ spurious results.`);
|
|
|
83091
83094
|
return i === 0 || keys[i - 1] <= key;
|
|
83092
83095
|
}
|
|
83093
83096
|
|
|
83094
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/graphql/storeUtils.js
|
|
83097
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/graphql/storeUtils.js
|
|
83095
83098
|
function makeReference(id2) {
|
|
83096
83099
|
return { __ref: String(id2) };
|
|
83097
83100
|
}
|
|
@@ -83276,7 +83279,7 @@ spurious results.`);
|
|
|
83276
83279
|
return selection.kind === "InlineFragment";
|
|
83277
83280
|
}
|
|
83278
83281
|
|
|
83279
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/graphql/getFromAST.js
|
|
83282
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/graphql/getFromAST.js
|
|
83280
83283
|
function checkDocument(doc) {
|
|
83281
83284
|
invariant2(doc && doc.kind === "Document", 77);
|
|
83282
83285
|
var operations = doc.definitions.filter(function(d) {
|
|
@@ -83835,7 +83838,7 @@ spurious results.`);
|
|
|
83835
83838
|
return Object.freeze(optimistic);
|
|
83836
83839
|
}
|
|
83837
83840
|
|
|
83838
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/graphql/DocumentTransform.js
|
|
83841
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/graphql/DocumentTransform.js
|
|
83839
83842
|
function identity(document2) {
|
|
83840
83843
|
return document2;
|
|
83841
83844
|
}
|
|
@@ -83919,7 +83922,7 @@ spurious results.`);
|
|
|
83919
83922
|
})()
|
|
83920
83923
|
);
|
|
83921
83924
|
|
|
83922
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/graphql/print.js
|
|
83925
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/graphql/print.js
|
|
83923
83926
|
var printCache;
|
|
83924
83927
|
var print2 = Object.assign(function(ast) {
|
|
83925
83928
|
var result2 = printCache.get(ast);
|
|
@@ -83943,13 +83946,13 @@ spurious results.`);
|
|
|
83943
83946
|
});
|
|
83944
83947
|
}
|
|
83945
83948
|
|
|
83946
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/arrays.js
|
|
83949
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/arrays.js
|
|
83947
83950
|
var isArray2 = Array.isArray;
|
|
83948
83951
|
function isNonEmptyArray(value) {
|
|
83949
83952
|
return Array.isArray(value) && value.length > 0;
|
|
83950
83953
|
}
|
|
83951
83954
|
|
|
83952
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/graphql/transform.js
|
|
83955
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/graphql/transform.js
|
|
83953
83956
|
var TYPENAME_FIELD = {
|
|
83954
83957
|
kind: Kind.FIELD,
|
|
83955
83958
|
name: {
|
|
@@ -84241,7 +84244,7 @@ spurious results.`);
|
|
|
84241
84244
|
return modifiedDoc;
|
|
84242
84245
|
}
|
|
84243
84246
|
|
|
84244
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/mergeDeep.js
|
|
84247
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/mergeDeep.js
|
|
84245
84248
|
var hasOwnProperty4 = Object.prototype.hasOwnProperty;
|
|
84246
84249
|
function mergeDeep() {
|
|
84247
84250
|
var sources = [];
|
|
@@ -84877,7 +84880,7 @@ spurious results.`);
|
|
|
84877
84880
|
}
|
|
84878
84881
|
var result = symbolObservablePonyfill(root);
|
|
84879
84882
|
|
|
84880
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/observables/Observable.js
|
|
84883
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/observables/Observable.js
|
|
84881
84884
|
var prototype2 = Observable.prototype;
|
|
84882
84885
|
var fakeObsSymbol = "@@observable";
|
|
84883
84886
|
if (!prototype2[fakeObsSymbol]) {
|
|
@@ -84886,7 +84889,7 @@ spurious results.`);
|
|
|
84886
84889
|
};
|
|
84887
84890
|
}
|
|
84888
84891
|
|
|
84889
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/cloneDeep.js
|
|
84892
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/cloneDeep.js
|
|
84890
84893
|
var toString5 = Object.prototype.toString;
|
|
84891
84894
|
function cloneDeep(value) {
|
|
84892
84895
|
return cloneDeepHelper(value);
|
|
@@ -84920,7 +84923,7 @@ spurious results.`);
|
|
|
84920
84923
|
}
|
|
84921
84924
|
}
|
|
84922
84925
|
|
|
84923
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/maybeDeepFreeze.js
|
|
84926
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/maybeDeepFreeze.js
|
|
84924
84927
|
function deepFreeze(value) {
|
|
84925
84928
|
var workSet = /* @__PURE__ */ new Set([value]);
|
|
84926
84929
|
workSet.forEach(function(obj) {
|
|
@@ -84952,7 +84955,7 @@ spurious results.`);
|
|
|
84952
84955
|
return obj;
|
|
84953
84956
|
}
|
|
84954
84957
|
|
|
84955
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/observables/iteration.js
|
|
84958
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/observables/iteration.js
|
|
84956
84959
|
function iterateObserversSafely(observers, method, argument) {
|
|
84957
84960
|
var observersWithMethod = [];
|
|
84958
84961
|
observers.forEach(function(obs) {
|
|
@@ -84963,7 +84966,7 @@ spurious results.`);
|
|
|
84963
84966
|
});
|
|
84964
84967
|
}
|
|
84965
84968
|
|
|
84966
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/observables/asyncMap.js
|
|
84969
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/observables/asyncMap.js
|
|
84967
84970
|
function asyncMap(observable, mapFn, catchFn) {
|
|
84968
84971
|
return new Observable(function(observer) {
|
|
84969
84972
|
var promiseQueue = {
|
|
@@ -85011,7 +85014,7 @@ spurious results.`);
|
|
|
85011
85014
|
});
|
|
85012
85015
|
}
|
|
85013
85016
|
|
|
85014
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/observables/subclassing.js
|
|
85017
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/observables/subclassing.js
|
|
85015
85018
|
function fixObservableSubclass(subclass) {
|
|
85016
85019
|
function set(key) {
|
|
85017
85020
|
Object.defineProperty(subclass, key, { value: Observable });
|
|
@@ -85023,7 +85026,7 @@ spurious results.`);
|
|
|
85023
85026
|
return subclass;
|
|
85024
85027
|
}
|
|
85025
85028
|
|
|
85026
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/observables/Concast.js
|
|
85029
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/observables/Concast.js
|
|
85027
85030
|
function isPromiseLike(value) {
|
|
85028
85031
|
return value && typeof value.then === "function";
|
|
85029
85032
|
}
|
|
@@ -85164,7 +85167,7 @@ spurious results.`);
|
|
|
85164
85167
|
);
|
|
85165
85168
|
fixObservableSubclass(Concast);
|
|
85166
85169
|
|
|
85167
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/incrementalResult.js
|
|
85170
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/incrementalResult.js
|
|
85168
85171
|
function isExecutionPatchIncrementalResult(value) {
|
|
85169
85172
|
return "incremental" in value;
|
|
85170
85173
|
}
|
|
@@ -85196,7 +85199,7 @@ spurious results.`);
|
|
|
85196
85199
|
return mergedData;
|
|
85197
85200
|
}
|
|
85198
85201
|
|
|
85199
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/errorHandling.js
|
|
85202
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/errorHandling.js
|
|
85200
85203
|
function graphQLResultHasError(result2) {
|
|
85201
85204
|
var errors2 = getGraphQLErrorsFromResult(result2);
|
|
85202
85205
|
return isNonEmptyArray(errors2);
|
|
@@ -85213,7 +85216,7 @@ spurious results.`);
|
|
|
85213
85216
|
return graphQLErrors;
|
|
85214
85217
|
}
|
|
85215
85218
|
|
|
85216
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/compact.js
|
|
85219
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/compact.js
|
|
85217
85220
|
function compact() {
|
|
85218
85221
|
var objects = [];
|
|
85219
85222
|
for (var _i = 0; _i < arguments.length; _i++) {
|
|
@@ -85233,21 +85236,21 @@ spurious results.`);
|
|
|
85233
85236
|
return result2;
|
|
85234
85237
|
}
|
|
85235
85238
|
|
|
85236
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/utilities/common/mergeOptions.js
|
|
85239
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/utilities/common/mergeOptions.js
|
|
85237
85240
|
function mergeOptions(defaults2, options) {
|
|
85238
85241
|
return compact(defaults2, options, options.variables && {
|
|
85239
85242
|
variables: compact(__assign(__assign({}, defaults2 && defaults2.variables), options.variables))
|
|
85240
85243
|
});
|
|
85241
85244
|
}
|
|
85242
85245
|
|
|
85243
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/utils/fromError.js
|
|
85246
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/utils/fromError.js
|
|
85244
85247
|
function fromError(errorValue) {
|
|
85245
85248
|
return new Observable(function(observer) {
|
|
85246
85249
|
observer.error(errorValue);
|
|
85247
85250
|
});
|
|
85248
85251
|
}
|
|
85249
85252
|
|
|
85250
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/utils/throwServerError.js
|
|
85253
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/utils/throwServerError.js
|
|
85251
85254
|
var throwServerError = function(response, result2, message) {
|
|
85252
85255
|
var error2 = new Error(message);
|
|
85253
85256
|
error2.name = "ServerError";
|
|
@@ -85257,7 +85260,7 @@ spurious results.`);
|
|
|
85257
85260
|
throw error2;
|
|
85258
85261
|
};
|
|
85259
85262
|
|
|
85260
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/utils/validateOperation.js
|
|
85263
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/utils/validateOperation.js
|
|
85261
85264
|
function validateOperation(operation) {
|
|
85262
85265
|
var OPERATION_FIELDS = [
|
|
85263
85266
|
"query",
|
|
@@ -85275,7 +85278,7 @@ spurious results.`);
|
|
|
85275
85278
|
return operation;
|
|
85276
85279
|
}
|
|
85277
85280
|
|
|
85278
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/utils/createOperation.js
|
|
85281
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/utils/createOperation.js
|
|
85279
85282
|
function createOperation(starting, operation) {
|
|
85280
85283
|
var context = __assign({}, starting);
|
|
85281
85284
|
var setContext = function(next) {
|
|
@@ -85299,7 +85302,7 @@ spurious results.`);
|
|
|
85299
85302
|
return operation;
|
|
85300
85303
|
}
|
|
85301
85304
|
|
|
85302
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/utils/transformOperation.js
|
|
85305
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/utils/transformOperation.js
|
|
85303
85306
|
function transformOperation(operation) {
|
|
85304
85307
|
var transformedOperation = {
|
|
85305
85308
|
variables: operation.variables || {},
|
|
@@ -85313,7 +85316,7 @@ spurious results.`);
|
|
|
85313
85316
|
return transformedOperation;
|
|
85314
85317
|
}
|
|
85315
85318
|
|
|
85316
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/utils/filterOperationVariables.js
|
|
85319
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/utils/filterOperationVariables.js
|
|
85317
85320
|
function filterOperationVariables(variables, query) {
|
|
85318
85321
|
var result2 = __assign({}, variables);
|
|
85319
85322
|
var unusedNames = new Set(Object.keys(variables));
|
|
@@ -85330,7 +85333,7 @@ spurious results.`);
|
|
|
85330
85333
|
return result2;
|
|
85331
85334
|
}
|
|
85332
85335
|
|
|
85333
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/core/ApolloLink.js
|
|
85336
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/core/ApolloLink.js
|
|
85334
85337
|
function passthrough(op, forward) {
|
|
85335
85338
|
return forward ? forward(op) : Observable.of();
|
|
85336
85339
|
}
|
|
@@ -85424,10 +85427,10 @@ spurious results.`);
|
|
|
85424
85427
|
})()
|
|
85425
85428
|
);
|
|
85426
85429
|
|
|
85427
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/core/execute.js
|
|
85430
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/core/execute.js
|
|
85428
85431
|
var execute = ApolloLink.execute;
|
|
85429
85432
|
|
|
85430
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/iterators/async.js
|
|
85433
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/iterators/async.js
|
|
85431
85434
|
function asyncIterator(source) {
|
|
85432
85435
|
var _a22;
|
|
85433
85436
|
var iterator2 = source[Symbol.asyncIterator]();
|
|
@@ -85440,7 +85443,7 @@ spurious results.`);
|
|
|
85440
85443
|
}, _a22;
|
|
85441
85444
|
}
|
|
85442
85445
|
|
|
85443
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/iterators/nodeStream.js
|
|
85446
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/iterators/nodeStream.js
|
|
85444
85447
|
function nodeStreamIterator(stream) {
|
|
85445
85448
|
var cleanup = null;
|
|
85446
85449
|
var error2 = null;
|
|
@@ -85511,7 +85514,7 @@ spurious results.`);
|
|
|
85511
85514
|
return iterator2;
|
|
85512
85515
|
}
|
|
85513
85516
|
|
|
85514
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/iterators/promise.js
|
|
85517
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/iterators/promise.js
|
|
85515
85518
|
function promiseIterator(promise) {
|
|
85516
85519
|
var resolved = false;
|
|
85517
85520
|
var iterator2 = {
|
|
@@ -85537,7 +85540,7 @@ spurious results.`);
|
|
|
85537
85540
|
return iterator2;
|
|
85538
85541
|
}
|
|
85539
85542
|
|
|
85540
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/iterators/reader.js
|
|
85543
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/iterators/reader.js
|
|
85541
85544
|
function readerIterator(reader) {
|
|
85542
85545
|
var iterator2 = {
|
|
85543
85546
|
next: function() {
|
|
@@ -85552,7 +85555,7 @@ spurious results.`);
|
|
|
85552
85555
|
return iterator2;
|
|
85553
85556
|
}
|
|
85554
85557
|
|
|
85555
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/responseIterator.js
|
|
85558
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/responseIterator.js
|
|
85556
85559
|
function isNodeResponse(value) {
|
|
85557
85560
|
return !!value.body;
|
|
85558
85561
|
}
|
|
@@ -85589,7 +85592,7 @@ spurious results.`);
|
|
|
85589
85592
|
throw new Error("Unknown body type for responseIterator. Please pass a streamable response.");
|
|
85590
85593
|
}
|
|
85591
85594
|
|
|
85592
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/errors/index.js
|
|
85595
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/errors/index.js
|
|
85593
85596
|
var PROTOCOL_ERRORS_SYMBOL = Symbol();
|
|
85594
85597
|
function graphQLResultHasProtocolErrors(result2) {
|
|
85595
85598
|
if (result2.extensions) {
|
|
@@ -85634,7 +85637,7 @@ spurious results.`);
|
|
|
85634
85637
|
})(Error)
|
|
85635
85638
|
);
|
|
85636
85639
|
|
|
85637
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js
|
|
85640
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/parseAndCheckHttpResponse.js
|
|
85638
85641
|
var hasOwnProperty5 = Object.prototype.hasOwnProperty;
|
|
85639
85642
|
function readMultipartBody(response, nextValue) {
|
|
85640
85643
|
return __awaiter(this, void 0, void 0, function() {
|
|
@@ -85778,7 +85781,7 @@ spurious results.`);
|
|
|
85778
85781
|
};
|
|
85779
85782
|
}
|
|
85780
85783
|
|
|
85781
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/serializeFetchParameter.js
|
|
85784
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/serializeFetchParameter.js
|
|
85782
85785
|
var serializeFetchParameter = function(p, label) {
|
|
85783
85786
|
var serialized;
|
|
85784
85787
|
try {
|
|
@@ -85791,7 +85794,7 @@ spurious results.`);
|
|
|
85791
85794
|
return serialized;
|
|
85792
85795
|
};
|
|
85793
85796
|
|
|
85794
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js
|
|
85797
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/selectHttpOptionsAndBody.js
|
|
85795
85798
|
var defaultHttpOptions = {
|
|
85796
85799
|
includeQuery: true,
|
|
85797
85800
|
includeExtensions: false,
|
|
@@ -85875,14 +85878,14 @@ spurious results.`);
|
|
|
85875
85878
|
return normalizedHeaders;
|
|
85876
85879
|
}
|
|
85877
85880
|
|
|
85878
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/checkFetcher.js
|
|
85881
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/checkFetcher.js
|
|
85879
85882
|
var checkFetcher = function(fetcher) {
|
|
85880
85883
|
if (!fetcher && typeof fetch === "undefined") {
|
|
85881
85884
|
throw newInvariantError(38);
|
|
85882
85885
|
}
|
|
85883
85886
|
};
|
|
85884
85887
|
|
|
85885
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/selectURI.js
|
|
85888
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/selectURI.js
|
|
85886
85889
|
var selectURI = function(operation, fallbackURI) {
|
|
85887
85890
|
var context = operation.getContext();
|
|
85888
85891
|
var contextURI = context.uri;
|
|
@@ -85895,7 +85898,7 @@ spurious results.`);
|
|
|
85895
85898
|
}
|
|
85896
85899
|
};
|
|
85897
85900
|
|
|
85898
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/rewriteURIForGET.js
|
|
85901
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/rewriteURIForGET.js
|
|
85899
85902
|
function rewriteURIForGET(chosenURI, body) {
|
|
85900
85903
|
var queryParams = [];
|
|
85901
85904
|
var addQueryParam = function(key, value) {
|
|
@@ -85936,7 +85939,7 @@ spurious results.`);
|
|
|
85936
85939
|
return { newURI };
|
|
85937
85940
|
}
|
|
85938
85941
|
|
|
85939
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/createHttpLink.js
|
|
85942
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/createHttpLink.js
|
|
85940
85943
|
var backupFetch = maybe(function() {
|
|
85941
85944
|
return fetch;
|
|
85942
85945
|
});
|
|
@@ -86056,7 +86059,7 @@ spurious results.`);
|
|
|
86056
86059
|
});
|
|
86057
86060
|
};
|
|
86058
86061
|
|
|
86059
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/link/http/HttpLink.js
|
|
86062
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/link/http/HttpLink.js
|
|
86060
86063
|
var HttpLink = (
|
|
86061
86064
|
/** @class */
|
|
86062
86065
|
(function(_super) {
|
|
@@ -86209,7 +86212,7 @@ spurious results.`);
|
|
|
86209
86212
|
return false;
|
|
86210
86213
|
}
|
|
86211
86214
|
|
|
86212
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/core/equalByQuery.js
|
|
86215
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/core/equalByQuery.js
|
|
86213
86216
|
function equalByQuery(query, _a22, _b, variables) {
|
|
86214
86217
|
var aData = _a22.data, aRest = __rest(_a22, ["data"]);
|
|
86215
86218
|
var bData = _b.data, bRest = __rest(_b, ["data"]);
|
|
@@ -86282,7 +86285,7 @@ spurious results.`);
|
|
|
86282
86285
|
return dir.name.value === "nonreactive";
|
|
86283
86286
|
}
|
|
86284
86287
|
|
|
86285
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/core/cache.js
|
|
86288
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/core/cache.js
|
|
86286
86289
|
var ApolloCache = (
|
|
86287
86290
|
/** @class */
|
|
86288
86291
|
(function() {
|
|
@@ -86414,7 +86417,7 @@ spurious results.`);
|
|
|
86414
86417
|
ApolloCache.prototype.getMemoryInternals = getApolloCacheMemoryInternals;
|
|
86415
86418
|
}
|
|
86416
86419
|
|
|
86417
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/core/types/common.js
|
|
86420
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/core/types/common.js
|
|
86418
86421
|
var MissingFieldError = (
|
|
86419
86422
|
/** @class */
|
|
86420
86423
|
(function(_super) {
|
|
@@ -86441,7 +86444,7 @@ spurious results.`);
|
|
|
86441
86444
|
})(Error)
|
|
86442
86445
|
);
|
|
86443
86446
|
|
|
86444
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/inmemory/helpers.js
|
|
86447
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/inmemory/helpers.js
|
|
86445
86448
|
var hasOwn = Object.prototype.hasOwnProperty;
|
|
86446
86449
|
function isNullish(value) {
|
|
86447
86450
|
return value === null || value === void 0;
|
|
@@ -86517,7 +86520,7 @@ spurious results.`);
|
|
|
86517
86520
|
};
|
|
86518
86521
|
}
|
|
86519
86522
|
|
|
86520
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/inmemory/entityStore.js
|
|
86523
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/inmemory/entityStore.js
|
|
86521
86524
|
var DELETE = /* @__PURE__ */ Object.create(null);
|
|
86522
86525
|
var delModifier = function() {
|
|
86523
86526
|
return DELETE;
|
|
@@ -87034,7 +87037,7 @@ spurious results.`);
|
|
|
87034
87037
|
return !!(store instanceof EntityStore && store.group.caching);
|
|
87035
87038
|
}
|
|
87036
87039
|
|
|
87037
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/inmemory/object-canon.js
|
|
87040
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/inmemory/object-canon.js
|
|
87038
87041
|
function shallowCopy(value) {
|
|
87039
87042
|
if (isNonNullObject(value)) {
|
|
87040
87043
|
return isArray2(value) ? value.slice(0) : __assign({ __proto__: Object.getPrototypeOf(value) }, value);
|
|
@@ -87128,7 +87131,7 @@ spurious results.`);
|
|
|
87128
87131
|
})()
|
|
87129
87132
|
);
|
|
87130
87133
|
|
|
87131
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/inmemory/readFromStore.js
|
|
87134
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/inmemory/readFromStore.js
|
|
87132
87135
|
function execSelectionSetKeyArgs(options) {
|
|
87133
87136
|
return [
|
|
87134
87137
|
options.selectionSet,
|
|
@@ -87397,7 +87400,7 @@ spurious results.`);
|
|
|
87397
87400
|
}
|
|
87398
87401
|
}
|
|
87399
87402
|
|
|
87400
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/inmemory/reactiveVars.js
|
|
87403
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/inmemory/reactiveVars.js
|
|
87401
87404
|
var cacheSlot = new Slot();
|
|
87402
87405
|
var cacheInfoMap = /* @__PURE__ */ new WeakMap();
|
|
87403
87406
|
function getCacheInfo(cache) {
|
|
@@ -87468,7 +87471,7 @@ spurious results.`);
|
|
|
87468
87471
|
}
|
|
87469
87472
|
}
|
|
87470
87473
|
|
|
87471
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/inmemory/key-extractor.js
|
|
87474
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/inmemory/key-extractor.js
|
|
87472
87475
|
var specifierInfoCache = /* @__PURE__ */ Object.create(null);
|
|
87473
87476
|
function lookupSpecifierInfo(spec) {
|
|
87474
87477
|
var cacheKey = JSON.stringify(spec);
|
|
@@ -87601,7 +87604,7 @@ spurious results.`);
|
|
|
87601
87604
|
return value;
|
|
87602
87605
|
}
|
|
87603
87606
|
|
|
87604
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/inmemory/policies.js
|
|
87607
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/inmemory/policies.js
|
|
87605
87608
|
function argsFromFieldSpecifier(spec) {
|
|
87606
87609
|
return spec.args !== void 0 ? spec.args : spec.field ? argumentsObjectFromField(spec.field, spec.variables) : null;
|
|
87607
87610
|
}
|
|
@@ -88036,7 +88039,7 @@ spurious results.`);
|
|
|
88036
88039
|
};
|
|
88037
88040
|
}
|
|
88038
88041
|
|
|
88039
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/inmemory/writeToStore.js
|
|
88042
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/inmemory/writeToStore.js
|
|
88040
88043
|
function getContextFlavor(context, clientOnly, deferred) {
|
|
88041
88044
|
var key = "".concat(clientOnly).concat(deferred);
|
|
88042
88045
|
var flavored = context.flavors.get(key);
|
|
@@ -88441,7 +88444,7 @@ spurious results.`);
|
|
|
88441
88444
|
globalThis.__DEV__ !== false && invariant2.warn(14, fieldName, parentType, childTypenames.length ? "either ensure all objects of type " + childTypenames.join(" and ") + " have an ID or a custom merge function, or " : "", typeDotName, __assign({}, existing), __assign({}, incoming));
|
|
88442
88445
|
}
|
|
88443
88446
|
|
|
88444
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/cache/inmemory/inMemoryCache.js
|
|
88447
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/cache/inmemory/inMemoryCache.js
|
|
88445
88448
|
var InMemoryCache = (
|
|
88446
88449
|
/** @class */
|
|
88447
88450
|
(function(_super) {
|
|
@@ -88750,7 +88753,7 @@ spurious results.`);
|
|
|
88750
88753
|
InMemoryCache.prototype.getMemoryInternals = getInMemoryCacheMemoryInternals;
|
|
88751
88754
|
}
|
|
88752
88755
|
|
|
88753
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/core/networkStatus.js
|
|
88756
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/core/networkStatus.js
|
|
88754
88757
|
var NetworkStatus;
|
|
88755
88758
|
(function(NetworkStatus2) {
|
|
88756
88759
|
NetworkStatus2[NetworkStatus2["loading"] = 1] = "loading";
|
|
@@ -88765,7 +88768,7 @@ spurious results.`);
|
|
|
88765
88768
|
return networkStatus ? networkStatus < 7 : false;
|
|
88766
88769
|
}
|
|
88767
88770
|
|
|
88768
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/core/ObservableQuery.js
|
|
88771
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/core/ObservableQuery.js
|
|
88769
88772
|
var assign2 = Object.assign;
|
|
88770
88773
|
var hasOwnProperty7 = Object.hasOwnProperty;
|
|
88771
88774
|
var ObservableQuery = (
|
|
@@ -89373,7 +89376,7 @@ spurious results.`);
|
|
|
89373
89376
|
return fetchPolicy === "network-only" || fetchPolicy === "no-cache" || fetchPolicy === "standby";
|
|
89374
89377
|
}
|
|
89375
89378
|
|
|
89376
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/core/QueryInfo.js
|
|
89379
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/core/QueryInfo.js
|
|
89377
89380
|
var destructiveMethodCounts = new (canUseWeakMap ? WeakMap : Map)();
|
|
89378
89381
|
function wrapDestructiveCacheMethod(cache, methodName) {
|
|
89379
89382
|
var original = cache[methodName];
|
|
@@ -89665,7 +89668,7 @@ spurious results.`);
|
|
|
89665
89668
|
return writeWithErrors;
|
|
89666
89669
|
}
|
|
89667
89670
|
|
|
89668
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/core/QueryManager.js
|
|
89671
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/core/QueryManager.js
|
|
89669
89672
|
var hasOwnProperty8 = Object.prototype.hasOwnProperty;
|
|
89670
89673
|
var IGNORE = /* @__PURE__ */ Object.create(null);
|
|
89671
89674
|
var QueryManager = (
|
|
@@ -90651,7 +90654,7 @@ spurious results.`);
|
|
|
90651
90654
|
})()
|
|
90652
90655
|
);
|
|
90653
90656
|
|
|
90654
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/core/LocalState.js
|
|
90657
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/core/LocalState.js
|
|
90655
90658
|
var LocalState = (
|
|
90656
90659
|
/** @class */
|
|
90657
90660
|
(function() {
|
|
@@ -91001,7 +91004,7 @@ spurious results.`);
|
|
|
91001
91004
|
})()
|
|
91002
91005
|
);
|
|
91003
91006
|
|
|
91004
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/core/ApolloClient.js
|
|
91007
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/core/ApolloClient.js
|
|
91005
91008
|
var hasSuggestedDevtools = false;
|
|
91006
91009
|
var ApolloClient = (
|
|
91007
91010
|
/** @class */
|
|
@@ -91403,7 +91406,7 @@ spurious results.`);
|
|
|
91403
91406
|
})(gql || (gql = {}));
|
|
91404
91407
|
gql["default"] = gql;
|
|
91405
91408
|
|
|
91406
|
-
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0/node_modules/@apollo/client/core/index.js
|
|
91409
|
+
// node_modules/.pnpm/@apollo+client@3.11.8_@types+react@19.1.11_graphql@16.9.0_react@19.1.0/node_modules/@apollo/client/core/index.js
|
|
91407
91410
|
setVerbosity(globalThis.__DEV__ !== false ? "log" : "silent");
|
|
91408
91411
|
|
|
91409
91412
|
// src/modules/apollo-client-config.ts
|
|
@@ -109341,6 +109344,7 @@ spurious results.`);
|
|
|
109341
109344
|
|
|
109342
109345
|
// src/strategies/universal-adapters/adapter-utils.ts
|
|
109343
109346
|
var SIMPLE_SANITIZER = ContractAddr.from("0x5a2e3ceb3da368b983a8717898427ab7b6daf04014b70f321e777f9aad940b4");
|
|
109347
|
+
var SVK_SIMPLE_SANITIZER = ContractAddr.from("0x03dcde04343257c3ce14574676cb9c5b2eda16e332c1b8caf5dc4c95ac568d2f");
|
|
109344
109348
|
var EXTENDED_SANITIZER = ContractAddr.from("0x65891708362b24dcf4c40c8e218cce6e82d1d6b3a3404c9ab00a48f08e2c110");
|
|
109345
109349
|
var AVNU_LEGACY_SANITIZER = ContractAddr.from("0x0656fBE853f116DD53956176a553eDe8fE65632252f8aceB50C1B9B6c8237309");
|
|
109346
109350
|
var SIMPLE_SANITIZER_V2 = ContractAddr.from("0x7b6f98311af8aa425278570e62abf523e6462eaa01a38c1feab9b2f416492e2");
|
|
@@ -123194,7 +123198,14 @@ spurious results.`);
|
|
|
123194
123198
|
}
|
|
123195
123199
|
const normalizedDebtAmount = this._normalizeDebtAmountFromHelper(
|
|
123196
123200
|
helperOutput
|
|
123197
|
-
);
|
|
123201
|
+
).minus(state.currentDebt);
|
|
123202
|
+
if (normalizedDebtAmount.lessThan(0)) {
|
|
123203
|
+
logger2.warn(`VesuModifyPositionAdapter: deposit debt delta is negative (${normalizedDebtAmount.toNumber()}), clamping to zero`);
|
|
123204
|
+
return {
|
|
123205
|
+
collateral: this._toSigned(collateralToAdd, false),
|
|
123206
|
+
debt: this._toSigned(Web3Number.fromWei(0, this.config.debt.decimals), false)
|
|
123207
|
+
};
|
|
123208
|
+
}
|
|
123198
123209
|
return {
|
|
123199
123210
|
collateral: this._toSigned(collateralToAdd, false),
|
|
123200
123211
|
debt: this._toSigned(normalizedDebtAmount, false)
|
|
@@ -123212,8 +123223,8 @@ spurious results.`);
|
|
|
123212
123223
|
state.debtPrice,
|
|
123213
123224
|
this.config.debt
|
|
123214
123225
|
);
|
|
123215
|
-
if (!helperOutput || helperOutput.
|
|
123216
|
-
throw new Error(`Failed to calculate
|
|
123226
|
+
if (!helperOutput || helperOutput.lessThan(0)) {
|
|
123227
|
+
throw new Error(`Failed to calculate max debt amount for withdraw: ${helperOutput?.toNumber()}`);
|
|
123217
123228
|
}
|
|
123218
123229
|
const normalizedDebtAmount = this._normalizeDebtAmountFromHelper(
|
|
123219
123230
|
helperOutput
|
|
@@ -123410,6 +123421,24 @@ spurious results.`);
|
|
|
123410
123421
|
this._prepareVesuAdapter();
|
|
123411
123422
|
return this._vesuAdapter.getHealthFactor();
|
|
123412
123423
|
}
|
|
123424
|
+
/**
|
|
123425
|
+
* Simulates a deposit of `depositAmount` collateral and returns how much
|
|
123426
|
+
* debt (STRK) would be incrementally borrowed to reach the target LTV.
|
|
123427
|
+
* Used upstream to size the AVNU swap call in the same transaction batch.
|
|
123428
|
+
*/
|
|
123429
|
+
async getExpectedDepositDebtDelta(depositAmount) {
|
|
123430
|
+
const defaults2 = await this._buildDefaultDepositDeltas({ amount: depositAmount });
|
|
123431
|
+
return defaults2.debt.amount;
|
|
123432
|
+
}
|
|
123433
|
+
/**
|
|
123434
|
+
* Simulates a withdrawal of `withdrawAmount` collateral and returns the
|
|
123435
|
+
* incremental debt delta needed to keep the target health factor.
|
|
123436
|
+
* Positive means borrow, negative means repay.
|
|
123437
|
+
*/
|
|
123438
|
+
async getExpectedWithdrawDebtDelta(withdrawAmount) {
|
|
123439
|
+
const defaults2 = await this._buildDefaultWithdrawDeltas({ amount: withdrawAmount });
|
|
123440
|
+
return defaults2.debt.amount;
|
|
123441
|
+
}
|
|
123413
123442
|
};
|
|
123414
123443
|
|
|
123415
123444
|
// src/strategies/universal-adapters/extended-adapter.ts
|
|
@@ -123469,6 +123498,25 @@ spurious results.`);
|
|
|
123469
123498
|
return { success: false, data: [] };
|
|
123470
123499
|
}
|
|
123471
123500
|
}
|
|
123501
|
+
/** Account funding payment history via `GET /api/v1/account/funding-payments` (USDC amounts). */
|
|
123502
|
+
async getFundingPayments(side, startTime, limit) {
|
|
123503
|
+
try {
|
|
123504
|
+
const response = await this.client.getUserFundingPayments(
|
|
123505
|
+
this.config.extendedMarketName,
|
|
123506
|
+
side,
|
|
123507
|
+
startTime ?? Date.now() - 30 * 24 * 60 * 60 * 1e3,
|
|
123508
|
+
limit ?? 200
|
|
123509
|
+
);
|
|
123510
|
+
if (response.status !== "OK") {
|
|
123511
|
+
logger2.error("error getting funding payments", response.data);
|
|
123512
|
+
return { success: false, data: [] };
|
|
123513
|
+
}
|
|
123514
|
+
return { success: true, data: response.data ?? [] };
|
|
123515
|
+
} catch (err2) {
|
|
123516
|
+
logger2.error("error getting funding payments", err2);
|
|
123517
|
+
return { success: false, data: [] };
|
|
123518
|
+
}
|
|
123519
|
+
}
|
|
123472
123520
|
async getPosition(supportedPosition) {
|
|
123473
123521
|
const holdings = await this.getExtendedDepositAmount();
|
|
123474
123522
|
if (!holdings) {
|
|
@@ -126102,6 +126150,760 @@ spurious results.`);
|
|
|
126102
126150
|
}
|
|
126103
126151
|
];
|
|
126104
126152
|
|
|
126153
|
+
// src/data/redeem-request-nft.abi.json
|
|
126154
|
+
var redeem_request_nft_abi_default = [
|
|
126155
|
+
{
|
|
126156
|
+
type: "impl",
|
|
126157
|
+
name: "RedeemRequestImpl",
|
|
126158
|
+
interface_name: "vault::redeem_request::interface::IRedeemRequest"
|
|
126159
|
+
},
|
|
126160
|
+
{
|
|
126161
|
+
type: "struct",
|
|
126162
|
+
name: "core::integer::u256",
|
|
126163
|
+
members: [
|
|
126164
|
+
{
|
|
126165
|
+
name: "low",
|
|
126166
|
+
type: "core::integer::u128"
|
|
126167
|
+
},
|
|
126168
|
+
{
|
|
126169
|
+
name: "high",
|
|
126170
|
+
type: "core::integer::u128"
|
|
126171
|
+
}
|
|
126172
|
+
]
|
|
126173
|
+
},
|
|
126174
|
+
{
|
|
126175
|
+
type: "struct",
|
|
126176
|
+
name: "vault::redeem_request::interface::RedeemRequestInfo",
|
|
126177
|
+
members: [
|
|
126178
|
+
{
|
|
126179
|
+
name: "epoch",
|
|
126180
|
+
type: "core::integer::u256"
|
|
126181
|
+
},
|
|
126182
|
+
{
|
|
126183
|
+
name: "nominal",
|
|
126184
|
+
type: "core::integer::u256"
|
|
126185
|
+
}
|
|
126186
|
+
]
|
|
126187
|
+
},
|
|
126188
|
+
{
|
|
126189
|
+
type: "interface",
|
|
126190
|
+
name: "vault::redeem_request::interface::IRedeemRequest",
|
|
126191
|
+
items: [
|
|
126192
|
+
{
|
|
126193
|
+
type: "function",
|
|
126194
|
+
name: "vault",
|
|
126195
|
+
inputs: [],
|
|
126196
|
+
outputs: [
|
|
126197
|
+
{
|
|
126198
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126199
|
+
}
|
|
126200
|
+
],
|
|
126201
|
+
state_mutability: "view"
|
|
126202
|
+
},
|
|
126203
|
+
{
|
|
126204
|
+
type: "function",
|
|
126205
|
+
name: "id_to_info",
|
|
126206
|
+
inputs: [
|
|
126207
|
+
{
|
|
126208
|
+
name: "id",
|
|
126209
|
+
type: "core::integer::u256"
|
|
126210
|
+
}
|
|
126211
|
+
],
|
|
126212
|
+
outputs: [
|
|
126213
|
+
{
|
|
126214
|
+
type: "vault::redeem_request::interface::RedeemRequestInfo"
|
|
126215
|
+
}
|
|
126216
|
+
],
|
|
126217
|
+
state_mutability: "view"
|
|
126218
|
+
},
|
|
126219
|
+
{
|
|
126220
|
+
type: "function",
|
|
126221
|
+
name: "id_len",
|
|
126222
|
+
inputs: [],
|
|
126223
|
+
outputs: [
|
|
126224
|
+
{
|
|
126225
|
+
type: "core::integer::u256"
|
|
126226
|
+
}
|
|
126227
|
+
],
|
|
126228
|
+
state_mutability: "view"
|
|
126229
|
+
},
|
|
126230
|
+
{
|
|
126231
|
+
type: "function",
|
|
126232
|
+
name: "mint",
|
|
126233
|
+
inputs: [
|
|
126234
|
+
{
|
|
126235
|
+
name: "to",
|
|
126236
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126237
|
+
},
|
|
126238
|
+
{
|
|
126239
|
+
name: "redeem_request_info",
|
|
126240
|
+
type: "vault::redeem_request::interface::RedeemRequestInfo"
|
|
126241
|
+
}
|
|
126242
|
+
],
|
|
126243
|
+
outputs: [
|
|
126244
|
+
{
|
|
126245
|
+
type: "core::integer::u256"
|
|
126246
|
+
}
|
|
126247
|
+
],
|
|
126248
|
+
state_mutability: "external"
|
|
126249
|
+
},
|
|
126250
|
+
{
|
|
126251
|
+
type: "function",
|
|
126252
|
+
name: "burn",
|
|
126253
|
+
inputs: [
|
|
126254
|
+
{
|
|
126255
|
+
name: "id",
|
|
126256
|
+
type: "core::integer::u256"
|
|
126257
|
+
}
|
|
126258
|
+
],
|
|
126259
|
+
outputs: [],
|
|
126260
|
+
state_mutability: "external"
|
|
126261
|
+
}
|
|
126262
|
+
]
|
|
126263
|
+
},
|
|
126264
|
+
{
|
|
126265
|
+
type: "impl",
|
|
126266
|
+
name: "UpgradeableImpl",
|
|
126267
|
+
interface_name: "openzeppelin_interfaces::upgrades::IUpgradeable"
|
|
126268
|
+
},
|
|
126269
|
+
{
|
|
126270
|
+
type: "interface",
|
|
126271
|
+
name: "openzeppelin_interfaces::upgrades::IUpgradeable",
|
|
126272
|
+
items: [
|
|
126273
|
+
{
|
|
126274
|
+
type: "function",
|
|
126275
|
+
name: "upgrade",
|
|
126276
|
+
inputs: [
|
|
126277
|
+
{
|
|
126278
|
+
name: "new_class_hash",
|
|
126279
|
+
type: "core::starknet::class_hash::ClassHash"
|
|
126280
|
+
}
|
|
126281
|
+
],
|
|
126282
|
+
outputs: [],
|
|
126283
|
+
state_mutability: "external"
|
|
126284
|
+
}
|
|
126285
|
+
]
|
|
126286
|
+
},
|
|
126287
|
+
{
|
|
126288
|
+
type: "impl",
|
|
126289
|
+
name: "ERC721MixinImpl",
|
|
126290
|
+
interface_name: "openzeppelin_interfaces::token::erc721::ERC721ABI"
|
|
126291
|
+
},
|
|
126292
|
+
{
|
|
126293
|
+
type: "struct",
|
|
126294
|
+
name: "core::array::Span::<core::felt252>",
|
|
126295
|
+
members: [
|
|
126296
|
+
{
|
|
126297
|
+
name: "snapshot",
|
|
126298
|
+
type: "@core::array::Array::<core::felt252>"
|
|
126299
|
+
}
|
|
126300
|
+
]
|
|
126301
|
+
},
|
|
126302
|
+
{
|
|
126303
|
+
type: "enum",
|
|
126304
|
+
name: "core::bool",
|
|
126305
|
+
variants: [
|
|
126306
|
+
{
|
|
126307
|
+
name: "False",
|
|
126308
|
+
type: "()"
|
|
126309
|
+
},
|
|
126310
|
+
{
|
|
126311
|
+
name: "True",
|
|
126312
|
+
type: "()"
|
|
126313
|
+
}
|
|
126314
|
+
]
|
|
126315
|
+
},
|
|
126316
|
+
{
|
|
126317
|
+
type: "struct",
|
|
126318
|
+
name: "core::byte_array::ByteArray",
|
|
126319
|
+
members: [
|
|
126320
|
+
{
|
|
126321
|
+
name: "data",
|
|
126322
|
+
type: "core::array::Array::<core::bytes_31::bytes31>"
|
|
126323
|
+
},
|
|
126324
|
+
{
|
|
126325
|
+
name: "pending_word",
|
|
126326
|
+
type: "core::felt252"
|
|
126327
|
+
},
|
|
126328
|
+
{
|
|
126329
|
+
name: "pending_word_len",
|
|
126330
|
+
type: "core::integer::u32"
|
|
126331
|
+
}
|
|
126332
|
+
]
|
|
126333
|
+
},
|
|
126334
|
+
{
|
|
126335
|
+
type: "interface",
|
|
126336
|
+
name: "openzeppelin_interfaces::token::erc721::ERC721ABI",
|
|
126337
|
+
items: [
|
|
126338
|
+
{
|
|
126339
|
+
type: "function",
|
|
126340
|
+
name: "balance_of",
|
|
126341
|
+
inputs: [
|
|
126342
|
+
{
|
|
126343
|
+
name: "account",
|
|
126344
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126345
|
+
}
|
|
126346
|
+
],
|
|
126347
|
+
outputs: [
|
|
126348
|
+
{
|
|
126349
|
+
type: "core::integer::u256"
|
|
126350
|
+
}
|
|
126351
|
+
],
|
|
126352
|
+
state_mutability: "view"
|
|
126353
|
+
},
|
|
126354
|
+
{
|
|
126355
|
+
type: "function",
|
|
126356
|
+
name: "owner_of",
|
|
126357
|
+
inputs: [
|
|
126358
|
+
{
|
|
126359
|
+
name: "token_id",
|
|
126360
|
+
type: "core::integer::u256"
|
|
126361
|
+
}
|
|
126362
|
+
],
|
|
126363
|
+
outputs: [
|
|
126364
|
+
{
|
|
126365
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126366
|
+
}
|
|
126367
|
+
],
|
|
126368
|
+
state_mutability: "view"
|
|
126369
|
+
},
|
|
126370
|
+
{
|
|
126371
|
+
type: "function",
|
|
126372
|
+
name: "safe_transfer_from",
|
|
126373
|
+
inputs: [
|
|
126374
|
+
{
|
|
126375
|
+
name: "from",
|
|
126376
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126377
|
+
},
|
|
126378
|
+
{
|
|
126379
|
+
name: "to",
|
|
126380
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126381
|
+
},
|
|
126382
|
+
{
|
|
126383
|
+
name: "token_id",
|
|
126384
|
+
type: "core::integer::u256"
|
|
126385
|
+
},
|
|
126386
|
+
{
|
|
126387
|
+
name: "data",
|
|
126388
|
+
type: "core::array::Span::<core::felt252>"
|
|
126389
|
+
}
|
|
126390
|
+
],
|
|
126391
|
+
outputs: [],
|
|
126392
|
+
state_mutability: "external"
|
|
126393
|
+
},
|
|
126394
|
+
{
|
|
126395
|
+
type: "function",
|
|
126396
|
+
name: "transfer_from",
|
|
126397
|
+
inputs: [
|
|
126398
|
+
{
|
|
126399
|
+
name: "from",
|
|
126400
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126401
|
+
},
|
|
126402
|
+
{
|
|
126403
|
+
name: "to",
|
|
126404
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126405
|
+
},
|
|
126406
|
+
{
|
|
126407
|
+
name: "token_id",
|
|
126408
|
+
type: "core::integer::u256"
|
|
126409
|
+
}
|
|
126410
|
+
],
|
|
126411
|
+
outputs: [],
|
|
126412
|
+
state_mutability: "external"
|
|
126413
|
+
},
|
|
126414
|
+
{
|
|
126415
|
+
type: "function",
|
|
126416
|
+
name: "approve",
|
|
126417
|
+
inputs: [
|
|
126418
|
+
{
|
|
126419
|
+
name: "to",
|
|
126420
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126421
|
+
},
|
|
126422
|
+
{
|
|
126423
|
+
name: "token_id",
|
|
126424
|
+
type: "core::integer::u256"
|
|
126425
|
+
}
|
|
126426
|
+
],
|
|
126427
|
+
outputs: [],
|
|
126428
|
+
state_mutability: "external"
|
|
126429
|
+
},
|
|
126430
|
+
{
|
|
126431
|
+
type: "function",
|
|
126432
|
+
name: "set_approval_for_all",
|
|
126433
|
+
inputs: [
|
|
126434
|
+
{
|
|
126435
|
+
name: "operator",
|
|
126436
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126437
|
+
},
|
|
126438
|
+
{
|
|
126439
|
+
name: "approved",
|
|
126440
|
+
type: "core::bool"
|
|
126441
|
+
}
|
|
126442
|
+
],
|
|
126443
|
+
outputs: [],
|
|
126444
|
+
state_mutability: "external"
|
|
126445
|
+
},
|
|
126446
|
+
{
|
|
126447
|
+
type: "function",
|
|
126448
|
+
name: "get_approved",
|
|
126449
|
+
inputs: [
|
|
126450
|
+
{
|
|
126451
|
+
name: "token_id",
|
|
126452
|
+
type: "core::integer::u256"
|
|
126453
|
+
}
|
|
126454
|
+
],
|
|
126455
|
+
outputs: [
|
|
126456
|
+
{
|
|
126457
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126458
|
+
}
|
|
126459
|
+
],
|
|
126460
|
+
state_mutability: "view"
|
|
126461
|
+
},
|
|
126462
|
+
{
|
|
126463
|
+
type: "function",
|
|
126464
|
+
name: "is_approved_for_all",
|
|
126465
|
+
inputs: [
|
|
126466
|
+
{
|
|
126467
|
+
name: "owner",
|
|
126468
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126469
|
+
},
|
|
126470
|
+
{
|
|
126471
|
+
name: "operator",
|
|
126472
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126473
|
+
}
|
|
126474
|
+
],
|
|
126475
|
+
outputs: [
|
|
126476
|
+
{
|
|
126477
|
+
type: "core::bool"
|
|
126478
|
+
}
|
|
126479
|
+
],
|
|
126480
|
+
state_mutability: "view"
|
|
126481
|
+
},
|
|
126482
|
+
{
|
|
126483
|
+
type: "function",
|
|
126484
|
+
name: "supports_interface",
|
|
126485
|
+
inputs: [
|
|
126486
|
+
{
|
|
126487
|
+
name: "interface_id",
|
|
126488
|
+
type: "core::felt252"
|
|
126489
|
+
}
|
|
126490
|
+
],
|
|
126491
|
+
outputs: [
|
|
126492
|
+
{
|
|
126493
|
+
type: "core::bool"
|
|
126494
|
+
}
|
|
126495
|
+
],
|
|
126496
|
+
state_mutability: "view"
|
|
126497
|
+
},
|
|
126498
|
+
{
|
|
126499
|
+
type: "function",
|
|
126500
|
+
name: "name",
|
|
126501
|
+
inputs: [],
|
|
126502
|
+
outputs: [
|
|
126503
|
+
{
|
|
126504
|
+
type: "core::byte_array::ByteArray"
|
|
126505
|
+
}
|
|
126506
|
+
],
|
|
126507
|
+
state_mutability: "view"
|
|
126508
|
+
},
|
|
126509
|
+
{
|
|
126510
|
+
type: "function",
|
|
126511
|
+
name: "symbol",
|
|
126512
|
+
inputs: [],
|
|
126513
|
+
outputs: [
|
|
126514
|
+
{
|
|
126515
|
+
type: "core::byte_array::ByteArray"
|
|
126516
|
+
}
|
|
126517
|
+
],
|
|
126518
|
+
state_mutability: "view"
|
|
126519
|
+
},
|
|
126520
|
+
{
|
|
126521
|
+
type: "function",
|
|
126522
|
+
name: "token_uri",
|
|
126523
|
+
inputs: [
|
|
126524
|
+
{
|
|
126525
|
+
name: "token_id",
|
|
126526
|
+
type: "core::integer::u256"
|
|
126527
|
+
}
|
|
126528
|
+
],
|
|
126529
|
+
outputs: [
|
|
126530
|
+
{
|
|
126531
|
+
type: "core::byte_array::ByteArray"
|
|
126532
|
+
}
|
|
126533
|
+
],
|
|
126534
|
+
state_mutability: "view"
|
|
126535
|
+
},
|
|
126536
|
+
{
|
|
126537
|
+
type: "function",
|
|
126538
|
+
name: "balanceOf",
|
|
126539
|
+
inputs: [
|
|
126540
|
+
{
|
|
126541
|
+
name: "account",
|
|
126542
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126543
|
+
}
|
|
126544
|
+
],
|
|
126545
|
+
outputs: [
|
|
126546
|
+
{
|
|
126547
|
+
type: "core::integer::u256"
|
|
126548
|
+
}
|
|
126549
|
+
],
|
|
126550
|
+
state_mutability: "view"
|
|
126551
|
+
},
|
|
126552
|
+
{
|
|
126553
|
+
type: "function",
|
|
126554
|
+
name: "ownerOf",
|
|
126555
|
+
inputs: [
|
|
126556
|
+
{
|
|
126557
|
+
name: "tokenId",
|
|
126558
|
+
type: "core::integer::u256"
|
|
126559
|
+
}
|
|
126560
|
+
],
|
|
126561
|
+
outputs: [
|
|
126562
|
+
{
|
|
126563
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126564
|
+
}
|
|
126565
|
+
],
|
|
126566
|
+
state_mutability: "view"
|
|
126567
|
+
},
|
|
126568
|
+
{
|
|
126569
|
+
type: "function",
|
|
126570
|
+
name: "safeTransferFrom",
|
|
126571
|
+
inputs: [
|
|
126572
|
+
{
|
|
126573
|
+
name: "from",
|
|
126574
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126575
|
+
},
|
|
126576
|
+
{
|
|
126577
|
+
name: "to",
|
|
126578
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126579
|
+
},
|
|
126580
|
+
{
|
|
126581
|
+
name: "tokenId",
|
|
126582
|
+
type: "core::integer::u256"
|
|
126583
|
+
},
|
|
126584
|
+
{
|
|
126585
|
+
name: "data",
|
|
126586
|
+
type: "core::array::Span::<core::felt252>"
|
|
126587
|
+
}
|
|
126588
|
+
],
|
|
126589
|
+
outputs: [],
|
|
126590
|
+
state_mutability: "external"
|
|
126591
|
+
},
|
|
126592
|
+
{
|
|
126593
|
+
type: "function",
|
|
126594
|
+
name: "transferFrom",
|
|
126595
|
+
inputs: [
|
|
126596
|
+
{
|
|
126597
|
+
name: "from",
|
|
126598
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126599
|
+
},
|
|
126600
|
+
{
|
|
126601
|
+
name: "to",
|
|
126602
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126603
|
+
},
|
|
126604
|
+
{
|
|
126605
|
+
name: "tokenId",
|
|
126606
|
+
type: "core::integer::u256"
|
|
126607
|
+
}
|
|
126608
|
+
],
|
|
126609
|
+
outputs: [],
|
|
126610
|
+
state_mutability: "external"
|
|
126611
|
+
},
|
|
126612
|
+
{
|
|
126613
|
+
type: "function",
|
|
126614
|
+
name: "setApprovalForAll",
|
|
126615
|
+
inputs: [
|
|
126616
|
+
{
|
|
126617
|
+
name: "operator",
|
|
126618
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126619
|
+
},
|
|
126620
|
+
{
|
|
126621
|
+
name: "approved",
|
|
126622
|
+
type: "core::bool"
|
|
126623
|
+
}
|
|
126624
|
+
],
|
|
126625
|
+
outputs: [],
|
|
126626
|
+
state_mutability: "external"
|
|
126627
|
+
},
|
|
126628
|
+
{
|
|
126629
|
+
type: "function",
|
|
126630
|
+
name: "getApproved",
|
|
126631
|
+
inputs: [
|
|
126632
|
+
{
|
|
126633
|
+
name: "tokenId",
|
|
126634
|
+
type: "core::integer::u256"
|
|
126635
|
+
}
|
|
126636
|
+
],
|
|
126637
|
+
outputs: [
|
|
126638
|
+
{
|
|
126639
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126640
|
+
}
|
|
126641
|
+
],
|
|
126642
|
+
state_mutability: "view"
|
|
126643
|
+
},
|
|
126644
|
+
{
|
|
126645
|
+
type: "function",
|
|
126646
|
+
name: "isApprovedForAll",
|
|
126647
|
+
inputs: [
|
|
126648
|
+
{
|
|
126649
|
+
name: "owner",
|
|
126650
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126651
|
+
},
|
|
126652
|
+
{
|
|
126653
|
+
name: "operator",
|
|
126654
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126655
|
+
}
|
|
126656
|
+
],
|
|
126657
|
+
outputs: [
|
|
126658
|
+
{
|
|
126659
|
+
type: "core::bool"
|
|
126660
|
+
}
|
|
126661
|
+
],
|
|
126662
|
+
state_mutability: "view"
|
|
126663
|
+
},
|
|
126664
|
+
{
|
|
126665
|
+
type: "function",
|
|
126666
|
+
name: "tokenURI",
|
|
126667
|
+
inputs: [
|
|
126668
|
+
{
|
|
126669
|
+
name: "tokenId",
|
|
126670
|
+
type: "core::integer::u256"
|
|
126671
|
+
}
|
|
126672
|
+
],
|
|
126673
|
+
outputs: [
|
|
126674
|
+
{
|
|
126675
|
+
type: "core::byte_array::ByteArray"
|
|
126676
|
+
}
|
|
126677
|
+
],
|
|
126678
|
+
state_mutability: "view"
|
|
126679
|
+
}
|
|
126680
|
+
]
|
|
126681
|
+
},
|
|
126682
|
+
{
|
|
126683
|
+
type: "impl",
|
|
126684
|
+
name: "ERC721EnumerableImpl",
|
|
126685
|
+
interface_name: "openzeppelin_interfaces::token::erc721::IERC721Enumerable"
|
|
126686
|
+
},
|
|
126687
|
+
{
|
|
126688
|
+
type: "interface",
|
|
126689
|
+
name: "openzeppelin_interfaces::token::erc721::IERC721Enumerable",
|
|
126690
|
+
items: [
|
|
126691
|
+
{
|
|
126692
|
+
type: "function",
|
|
126693
|
+
name: "total_supply",
|
|
126694
|
+
inputs: [],
|
|
126695
|
+
outputs: [
|
|
126696
|
+
{
|
|
126697
|
+
type: "core::integer::u256"
|
|
126698
|
+
}
|
|
126699
|
+
],
|
|
126700
|
+
state_mutability: "view"
|
|
126701
|
+
},
|
|
126702
|
+
{
|
|
126703
|
+
type: "function",
|
|
126704
|
+
name: "token_by_index",
|
|
126705
|
+
inputs: [
|
|
126706
|
+
{
|
|
126707
|
+
name: "index",
|
|
126708
|
+
type: "core::integer::u256"
|
|
126709
|
+
}
|
|
126710
|
+
],
|
|
126711
|
+
outputs: [
|
|
126712
|
+
{
|
|
126713
|
+
type: "core::integer::u256"
|
|
126714
|
+
}
|
|
126715
|
+
],
|
|
126716
|
+
state_mutability: "view"
|
|
126717
|
+
},
|
|
126718
|
+
{
|
|
126719
|
+
type: "function",
|
|
126720
|
+
name: "token_of_owner_by_index",
|
|
126721
|
+
inputs: [
|
|
126722
|
+
{
|
|
126723
|
+
name: "owner",
|
|
126724
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126725
|
+
},
|
|
126726
|
+
{
|
|
126727
|
+
name: "index",
|
|
126728
|
+
type: "core::integer::u256"
|
|
126729
|
+
}
|
|
126730
|
+
],
|
|
126731
|
+
outputs: [
|
|
126732
|
+
{
|
|
126733
|
+
type: "core::integer::u256"
|
|
126734
|
+
}
|
|
126735
|
+
],
|
|
126736
|
+
state_mutability: "view"
|
|
126737
|
+
}
|
|
126738
|
+
]
|
|
126739
|
+
},
|
|
126740
|
+
{
|
|
126741
|
+
type: "constructor",
|
|
126742
|
+
name: "constructor",
|
|
126743
|
+
inputs: [
|
|
126744
|
+
{
|
|
126745
|
+
name: "owner",
|
|
126746
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126747
|
+
},
|
|
126748
|
+
{
|
|
126749
|
+
name: "vault",
|
|
126750
|
+
type: "core::starknet::contract_address::ContractAddress"
|
|
126751
|
+
}
|
|
126752
|
+
]
|
|
126753
|
+
},
|
|
126754
|
+
{
|
|
126755
|
+
type: "event",
|
|
126756
|
+
name: "openzeppelin_token::erc721::erc721::ERC721Component::Transfer",
|
|
126757
|
+
kind: "struct",
|
|
126758
|
+
members: [
|
|
126759
|
+
{
|
|
126760
|
+
name: "from",
|
|
126761
|
+
type: "core::starknet::contract_address::ContractAddress",
|
|
126762
|
+
kind: "key"
|
|
126763
|
+
},
|
|
126764
|
+
{
|
|
126765
|
+
name: "to",
|
|
126766
|
+
type: "core::starknet::contract_address::ContractAddress",
|
|
126767
|
+
kind: "key"
|
|
126768
|
+
},
|
|
126769
|
+
{
|
|
126770
|
+
name: "token_id",
|
|
126771
|
+
type: "core::integer::u256",
|
|
126772
|
+
kind: "key"
|
|
126773
|
+
}
|
|
126774
|
+
]
|
|
126775
|
+
},
|
|
126776
|
+
{
|
|
126777
|
+
type: "event",
|
|
126778
|
+
name: "openzeppelin_token::erc721::erc721::ERC721Component::Approval",
|
|
126779
|
+
kind: "struct",
|
|
126780
|
+
members: [
|
|
126781
|
+
{
|
|
126782
|
+
name: "owner",
|
|
126783
|
+
type: "core::starknet::contract_address::ContractAddress",
|
|
126784
|
+
kind: "key"
|
|
126785
|
+
},
|
|
126786
|
+
{
|
|
126787
|
+
name: "approved",
|
|
126788
|
+
type: "core::starknet::contract_address::ContractAddress",
|
|
126789
|
+
kind: "key"
|
|
126790
|
+
},
|
|
126791
|
+
{
|
|
126792
|
+
name: "token_id",
|
|
126793
|
+
type: "core::integer::u256",
|
|
126794
|
+
kind: "key"
|
|
126795
|
+
}
|
|
126796
|
+
]
|
|
126797
|
+
},
|
|
126798
|
+
{
|
|
126799
|
+
type: "event",
|
|
126800
|
+
name: "openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll",
|
|
126801
|
+
kind: "struct",
|
|
126802
|
+
members: [
|
|
126803
|
+
{
|
|
126804
|
+
name: "owner",
|
|
126805
|
+
type: "core::starknet::contract_address::ContractAddress",
|
|
126806
|
+
kind: "key"
|
|
126807
|
+
},
|
|
126808
|
+
{
|
|
126809
|
+
name: "operator",
|
|
126810
|
+
type: "core::starknet::contract_address::ContractAddress",
|
|
126811
|
+
kind: "key"
|
|
126812
|
+
},
|
|
126813
|
+
{
|
|
126814
|
+
name: "approved",
|
|
126815
|
+
type: "core::bool",
|
|
126816
|
+
kind: "data"
|
|
126817
|
+
}
|
|
126818
|
+
]
|
|
126819
|
+
},
|
|
126820
|
+
{
|
|
126821
|
+
type: "event",
|
|
126822
|
+
name: "openzeppelin_token::erc721::erc721::ERC721Component::Event",
|
|
126823
|
+
kind: "enum",
|
|
126824
|
+
variants: [
|
|
126825
|
+
{
|
|
126826
|
+
name: "Transfer",
|
|
126827
|
+
type: "openzeppelin_token::erc721::erc721::ERC721Component::Transfer",
|
|
126828
|
+
kind: "nested"
|
|
126829
|
+
},
|
|
126830
|
+
{
|
|
126831
|
+
name: "Approval",
|
|
126832
|
+
type: "openzeppelin_token::erc721::erc721::ERC721Component::Approval",
|
|
126833
|
+
kind: "nested"
|
|
126834
|
+
},
|
|
126835
|
+
{
|
|
126836
|
+
name: "ApprovalForAll",
|
|
126837
|
+
type: "openzeppelin_token::erc721::erc721::ERC721Component::ApprovalForAll",
|
|
126838
|
+
kind: "nested"
|
|
126839
|
+
}
|
|
126840
|
+
]
|
|
126841
|
+
},
|
|
126842
|
+
{
|
|
126843
|
+
type: "event",
|
|
126844
|
+
name: "openzeppelin_token::erc721::extensions::erc721_enumerable::erc721_enumerable::ERC721EnumerableComponent::Event",
|
|
126845
|
+
kind: "enum",
|
|
126846
|
+
variants: []
|
|
126847
|
+
},
|
|
126848
|
+
{
|
|
126849
|
+
type: "event",
|
|
126850
|
+
name: "openzeppelin_introspection::src5::SRC5Component::Event",
|
|
126851
|
+
kind: "enum",
|
|
126852
|
+
variants: []
|
|
126853
|
+
},
|
|
126854
|
+
{
|
|
126855
|
+
type: "event",
|
|
126856
|
+
name: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded",
|
|
126857
|
+
kind: "struct",
|
|
126858
|
+
members: [
|
|
126859
|
+
{
|
|
126860
|
+
name: "class_hash",
|
|
126861
|
+
type: "core::starknet::class_hash::ClassHash",
|
|
126862
|
+
kind: "data"
|
|
126863
|
+
}
|
|
126864
|
+
]
|
|
126865
|
+
},
|
|
126866
|
+
{
|
|
126867
|
+
type: "event",
|
|
126868
|
+
name: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event",
|
|
126869
|
+
kind: "enum",
|
|
126870
|
+
variants: [
|
|
126871
|
+
{
|
|
126872
|
+
name: "Upgraded",
|
|
126873
|
+
type: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Upgraded",
|
|
126874
|
+
kind: "nested"
|
|
126875
|
+
}
|
|
126876
|
+
]
|
|
126877
|
+
},
|
|
126878
|
+
{
|
|
126879
|
+
type: "event",
|
|
126880
|
+
name: "vault::redeem_request::redeem_request::RedeemRequest::Event",
|
|
126881
|
+
kind: "enum",
|
|
126882
|
+
variants: [
|
|
126883
|
+
{
|
|
126884
|
+
name: "ERC721Event",
|
|
126885
|
+
type: "openzeppelin_token::erc721::erc721::ERC721Component::Event",
|
|
126886
|
+
kind: "flat"
|
|
126887
|
+
},
|
|
126888
|
+
{
|
|
126889
|
+
name: "ERC721EnumerableEvent",
|
|
126890
|
+
type: "openzeppelin_token::erc721::extensions::erc721_enumerable::erc721_enumerable::ERC721EnumerableComponent::Event",
|
|
126891
|
+
kind: "flat"
|
|
126892
|
+
},
|
|
126893
|
+
{
|
|
126894
|
+
name: "SRC5Event",
|
|
126895
|
+
type: "openzeppelin_introspection::src5::SRC5Component::Event",
|
|
126896
|
+
kind: "flat"
|
|
126897
|
+
},
|
|
126898
|
+
{
|
|
126899
|
+
name: "UpgradeableEvent",
|
|
126900
|
+
type: "openzeppelin_upgrades::upgradeable::UpgradeableComponent::Event",
|
|
126901
|
+
kind: "flat"
|
|
126902
|
+
}
|
|
126903
|
+
]
|
|
126904
|
+
}
|
|
126905
|
+
];
|
|
126906
|
+
|
|
126105
126907
|
// src/strategies/universal-adapters/svk-troves-adapter.ts
|
|
126106
126908
|
var DEFAULT_TROVES_STRATEGIES_API = "https://app.troves.fi/api/strategies";
|
|
126107
126909
|
function parseTrovesApyField(raw) {
|
|
@@ -126215,6 +127017,100 @@ spurious results.`);
|
|
|
126215
127017
|
throw error2;
|
|
126216
127018
|
}
|
|
126217
127019
|
}
|
|
127020
|
+
async getPendingAssetsFromOwner(owner = this._positionOwner(), decimals = this.config.baseToken.decimals) {
|
|
127021
|
+
const vault = new Contract({
|
|
127022
|
+
abi: universal_vault_abi_default,
|
|
127023
|
+
address: this.config.strategyVault.address,
|
|
127024
|
+
providerOrAccount: this.config.networkConfig.provider
|
|
127025
|
+
});
|
|
127026
|
+
try {
|
|
127027
|
+
const dueRaw = await vault.call("due_assets_from_owner", [owner.address]);
|
|
127028
|
+
return Web3Number.fromWei(dueRaw.toString(), decimals);
|
|
127029
|
+
} catch (e) {
|
|
127030
|
+
logger2.warn(
|
|
127031
|
+
`${_SvkTrovesAdapter.name}::getPendingAssetsFromOwner: due_assets_from_owner failed (treating as 0): ${e.message}`
|
|
127032
|
+
);
|
|
127033
|
+
return Web3Number.fromWei("0", decimals);
|
|
127034
|
+
}
|
|
127035
|
+
}
|
|
127036
|
+
/**
|
|
127037
|
+
* Get pending assets from owner by scanning redeem request NFTs.
|
|
127038
|
+
* This method iterates backwards through NFT IDs to find all pending redemptions for a specific owner.
|
|
127039
|
+
*
|
|
127040
|
+
* @param redeemRequestNFT - The redeem request NFT contract address
|
|
127041
|
+
* @param owner - The owner address to check for pending redemptions (defaults to positionOwner)
|
|
127042
|
+
* @param decimals - Token decimals for conversion (defaults to baseToken decimals)
|
|
127043
|
+
* @returns Total pending assets from all NFTs owned by the specified address
|
|
127044
|
+
*/
|
|
127045
|
+
async getPendingAssetsFromOwnerNFTMethod(redeemRequestNFT, owner = this._positionOwner(), decimals = this.config.baseToken.decimals) {
|
|
127046
|
+
try {
|
|
127047
|
+
const nftContract = new Contract({
|
|
127048
|
+
abi: redeem_request_nft_abi_default,
|
|
127049
|
+
address: redeemRequestNFT.address,
|
|
127050
|
+
providerOrAccount: this.config.networkConfig.provider
|
|
127051
|
+
});
|
|
127052
|
+
const idLenRaw = await nftContract.id_len();
|
|
127053
|
+
const latestId = BigInt(idLenRaw.toString());
|
|
127054
|
+
if (latestId === 0n) {
|
|
127055
|
+
logger2.info(
|
|
127056
|
+
`${_SvkTrovesAdapter.name}::getPendingAssetsFromOwnerNFTMethod: No NFTs minted yet`
|
|
127057
|
+
);
|
|
127058
|
+
return Web3Number.fromWei("0", decimals);
|
|
127059
|
+
}
|
|
127060
|
+
const matchingIds = [];
|
|
127061
|
+
let currentId = latestId - 1n;
|
|
127062
|
+
while (currentId >= 0n) {
|
|
127063
|
+
try {
|
|
127064
|
+
const idU256 = uint256_exports.bnToUint256(currentId);
|
|
127065
|
+
const ownerRaw = await nftContract.owner_of(idU256);
|
|
127066
|
+
const nftOwnerAddr = ContractAddr.from(ownerRaw.toString());
|
|
127067
|
+
if (nftOwnerAddr.eq(owner)) {
|
|
127068
|
+
matchingIds.push(currentId);
|
|
127069
|
+
logger2.debug(
|
|
127070
|
+
`${_SvkTrovesAdapter.name}::getPendingAssetsFromOwnerNFTMethod: Found matching NFT ID ${currentId} for owner ${owner.address}`
|
|
127071
|
+
);
|
|
127072
|
+
}
|
|
127073
|
+
currentId--;
|
|
127074
|
+
} catch (e) {
|
|
127075
|
+
logger2.info(
|
|
127076
|
+
`${_SvkTrovesAdapter.name}::getPendingAssetsFromOwnerNFTMethod: Reached last pending NFT at id ${currentId}`
|
|
127077
|
+
);
|
|
127078
|
+
break;
|
|
127079
|
+
}
|
|
127080
|
+
}
|
|
127081
|
+
if (matchingIds.length === 0) {
|
|
127082
|
+
logger2.info(
|
|
127083
|
+
`${_SvkTrovesAdapter.name}::getPendingAssetsFromOwnerNFTMethod: No matching NFTs found for owner ${owner.address}`
|
|
127084
|
+
);
|
|
127085
|
+
return Web3Number.fromWei("0", decimals);
|
|
127086
|
+
}
|
|
127087
|
+
let totalNominal = 0n;
|
|
127088
|
+
for (const nftId of matchingIds) {
|
|
127089
|
+
try {
|
|
127090
|
+
const idU256 = uint256_exports.bnToUint256(nftId);
|
|
127091
|
+
const infoRaw = await nftContract.id_to_info(idU256);
|
|
127092
|
+
const nominal = BigInt(infoRaw.nominal.toString());
|
|
127093
|
+
totalNominal += nominal;
|
|
127094
|
+
logger2.debug(
|
|
127095
|
+
`${_SvkTrovesAdapter.name}::getPendingAssetsFromOwnerNFTMethod: NFT ID ${nftId} has nominal ${nominal}`
|
|
127096
|
+
);
|
|
127097
|
+
} catch (e) {
|
|
127098
|
+
logger2.warn(
|
|
127099
|
+
`${_SvkTrovesAdapter.name}::getPendingAssetsFromOwnerNFTMethod: Failed to get info for NFT ID ${nftId}: ${e.message}`
|
|
127100
|
+
);
|
|
127101
|
+
}
|
|
127102
|
+
}
|
|
127103
|
+
logger2.info(
|
|
127104
|
+
`${_SvkTrovesAdapter.name}::getPendingAssetsFromOwnerNFTMethod: Found ${matchingIds.length} NFTs with total nominal ${totalNominal}`
|
|
127105
|
+
);
|
|
127106
|
+
return Web3Number.fromWei(totalNominal.toString(), decimals);
|
|
127107
|
+
} catch (error2) {
|
|
127108
|
+
logger2.error(
|
|
127109
|
+
`${_SvkTrovesAdapter.name}::getPendingAssetsFromOwnerNFTMethod: ${error2.message}`
|
|
127110
|
+
);
|
|
127111
|
+
return Web3Number.fromWei("0", decimals);
|
|
127112
|
+
}
|
|
127113
|
+
}
|
|
126218
127114
|
async maxDeposit(amount) {
|
|
126219
127115
|
const baseToken = this.config.baseToken;
|
|
126220
127116
|
if (!amount) {
|
|
@@ -126279,9 +127175,9 @@ spurious results.`);
|
|
|
126279
127175
|
return [
|
|
126280
127176
|
{
|
|
126281
127177
|
target: strategyVault,
|
|
126282
|
-
method: "
|
|
127178
|
+
method: "request_redeem",
|
|
126283
127179
|
packedArguments: [recv.toBigInt(), owner.toBigInt()],
|
|
126284
|
-
sanitizer:
|
|
127180
|
+
sanitizer: SVK_SIMPLE_SANITIZER,
|
|
126285
127181
|
id: this._withdrawCallProofReadableId()
|
|
126286
127182
|
}
|
|
126287
127183
|
];
|
|
@@ -126343,16 +127239,23 @@ spurious results.`);
|
|
|
126343
127239
|
const uint256Amount = uint256_exports.bnToUint256(amount.toWei());
|
|
126344
127240
|
const recv = this.config.vaultAllocator;
|
|
126345
127241
|
const owner = this.config.vaultAllocator;
|
|
127242
|
+
const vault = new Contract({
|
|
127243
|
+
abi: universal_vault_abi_default,
|
|
127244
|
+
address: strategyVault.address,
|
|
127245
|
+
providerOrAccount: this.config.networkConfig.provider
|
|
127246
|
+
});
|
|
127247
|
+
const sharesRaw = await vault.convert_to_shares(uint256Amount);
|
|
127248
|
+
const sharesU256 = uint256_exports.bnToUint256(sharesRaw.toString());
|
|
126346
127249
|
return [
|
|
126347
127250
|
{
|
|
126348
127251
|
proofReadableId: this._withdrawCallProofReadableId(),
|
|
126349
|
-
sanitizer:
|
|
127252
|
+
sanitizer: SVK_SIMPLE_SANITIZER,
|
|
126350
127253
|
call: {
|
|
126351
127254
|
contractAddress: strategyVault,
|
|
126352
|
-
selector: hash_exports.getSelectorFromName("
|
|
127255
|
+
selector: hash_exports.getSelectorFromName("request_redeem"),
|
|
126353
127256
|
calldata: [
|
|
126354
|
-
toBigInt3(
|
|
126355
|
-
toBigInt3(
|
|
127257
|
+
toBigInt3(sharesU256.low.toString()),
|
|
127258
|
+
toBigInt3(sharesU256.high.toString()),
|
|
126356
127259
|
recv.toBigInt(),
|
|
126357
127260
|
owner.toBigInt()
|
|
126358
127261
|
]
|
|
@@ -128133,9 +129036,9 @@ spurious results.`);
|
|
|
128133
129036
|
* Builds a manage call from an adapter's proof tree.
|
|
128134
129037
|
* DRY helper for the repeated getProofs → getManageCall pattern.
|
|
128135
129038
|
*/
|
|
128136
|
-
async buildManageCallFromAdapter(adapter2, isDeposit, amount) {
|
|
129039
|
+
async buildManageCallFromAdapter(adapter2, isDeposit, amount, additionalParams) {
|
|
128137
129040
|
const proofsInfo = adapter2.getProofs(isDeposit, this.getMerkleTree());
|
|
128138
|
-
const manageCalls = await proofsInfo.callConstructor({ amount });
|
|
129041
|
+
const manageCalls = await proofsInfo.callConstructor({ amount, ...additionalParams });
|
|
128139
129042
|
return this.getManageCall(
|
|
128140
129043
|
this.getProofGroupsForManageCalls(manageCalls),
|
|
128141
129044
|
manageCalls
|
|
@@ -129324,6 +130227,525 @@ spurious results.`);
|
|
|
129324
130227
|
getStrategySettings("mRe7YIELD", "mRe7YIELD", hypermRe7YIELD, false, false)
|
|
129325
130228
|
];
|
|
129326
130229
|
|
|
130230
|
+
// src/strategies/usdc-boosted-strategy.tsx
|
|
130231
|
+
var USDCBoostedStrategy = class _USDCBoostedStrategy extends SVKStrategy {
|
|
130232
|
+
constructor(config3, pricer, metadata) {
|
|
130233
|
+
super(config3, pricer, metadata);
|
|
130234
|
+
this.metadata.additionalInfo.adapters.forEach((adapter2) => {
|
|
130235
|
+
adapter2.adapter.config.networkConfig = this.config;
|
|
130236
|
+
adapter2.adapter.config.pricer = this.pricer;
|
|
130237
|
+
if (adapter2.adapter._vesuAdapter) {
|
|
130238
|
+
adapter2.adapter._vesuAdapter.networkConfig = this.config;
|
|
130239
|
+
adapter2.adapter._vesuAdapter.pricer = this.pricer;
|
|
130240
|
+
}
|
|
130241
|
+
});
|
|
130242
|
+
}
|
|
130243
|
+
getTag() {
|
|
130244
|
+
return `${_USDCBoostedStrategy.name}:${this.metadata.name}`;
|
|
130245
|
+
}
|
|
130246
|
+
getAdapterById(id2) {
|
|
130247
|
+
const entry = this.metadata.additionalInfo.adapters.find(
|
|
130248
|
+
(a) => a.id === id2
|
|
130249
|
+
);
|
|
130250
|
+
if (!entry) {
|
|
130251
|
+
throw new Error(
|
|
130252
|
+
`${this.getTag()}::getAdapterById: adapter not found for id "${id2}"`
|
|
130253
|
+
);
|
|
130254
|
+
}
|
|
130255
|
+
return entry.adapter;
|
|
130256
|
+
}
|
|
130257
|
+
async getVesuModifyPositionCall(params) {
|
|
130258
|
+
logger2.verbose(
|
|
130259
|
+
`${this.getTag()}::getVesuModifyPositionCall isDeposit=${params.isDeposit}, amount=${params.leg1DepositAmount}, debtAmount=${params.debtAmount?.toNumber()}`
|
|
130260
|
+
);
|
|
130261
|
+
return this.buildManageCallFromAdapter(
|
|
130262
|
+
this.getAdapterById("vesu_usdc_strk"),
|
|
130263
|
+
params.isDeposit,
|
|
130264
|
+
params.leg1DepositAmount,
|
|
130265
|
+
params.debtAmount ? { debtAmount: params.debtAmount } : void 0
|
|
130266
|
+
);
|
|
130267
|
+
}
|
|
130268
|
+
async getVesuPositions() {
|
|
130269
|
+
const positions = await this.getAdapterById(
|
|
130270
|
+
"vesu_usdc_strk"
|
|
130271
|
+
).getPositions();
|
|
130272
|
+
return positions.map((p) => ({
|
|
130273
|
+
amount: p.amount,
|
|
130274
|
+
usdValue: p.usdValue,
|
|
130275
|
+
remarks: p.remarks ?? "",
|
|
130276
|
+
token: p.tokenInfo,
|
|
130277
|
+
protocol: p.protocol
|
|
130278
|
+
}));
|
|
130279
|
+
}
|
|
130280
|
+
async getVesuHealthFactor(blockNumber = "latest") {
|
|
130281
|
+
const vesuAdapter = this.getAdapterById("vesu_usdc_strk");
|
|
130282
|
+
return await vesuAdapter._vesuAdapter.getHealthFactor(blockNumber);
|
|
130283
|
+
}
|
|
130284
|
+
// TODO: will have to still modify for instant withdrawals as of now
|
|
130285
|
+
async getModifyHyperPositionCall(params) {
|
|
130286
|
+
logger2.verbose(
|
|
130287
|
+
`${this.getTag()}::getModifyHyperPositionCall isDeposit=${params.isDeposit}, amount=${params.amount}`
|
|
130288
|
+
);
|
|
130289
|
+
return this.buildManageCallFromAdapter(
|
|
130290
|
+
this.getAdapterById("hyper_xstrk"),
|
|
130291
|
+
params.isDeposit,
|
|
130292
|
+
params.amount
|
|
130293
|
+
);
|
|
130294
|
+
}
|
|
130295
|
+
async getAvnuSwapCall(params) {
|
|
130296
|
+
logger2.verbose(
|
|
130297
|
+
`${this.getTag()}::getAvnuSwapCall isDeposit=${params.isDeposit}, amount=${params.amount}`
|
|
130298
|
+
);
|
|
130299
|
+
return this.buildManageCallFromAdapter(
|
|
130300
|
+
this.getAdapterById("avnu_strk_xstrk"),
|
|
130301
|
+
params.isDeposit,
|
|
130302
|
+
params.amount
|
|
130303
|
+
);
|
|
130304
|
+
}
|
|
130305
|
+
/**
|
|
130306
|
+
* Returns the USDC balance sitting idle inside the vault contract itself.
|
|
130307
|
+
* This balance can offset the required liquidity during withdrawal processing.
|
|
130308
|
+
*/
|
|
130309
|
+
async getUnusedBalanceVault() {
|
|
130310
|
+
const collateralToken = this.metadata.additionalInfo.collateralToken;
|
|
130311
|
+
return new ERC20(this.config).balanceOf(
|
|
130312
|
+
collateralToken.address,
|
|
130313
|
+
this.metadata.additionalInfo.vaultAddress,
|
|
130314
|
+
collateralToken.decimals
|
|
130315
|
+
);
|
|
130316
|
+
}
|
|
130317
|
+
/**
|
|
130318
|
+
* Returns the current STRK balance sitting unused in the vault allocator.
|
|
130319
|
+
* This covers STRK from prior borrow cycles that hasn't been swapped yet.
|
|
130320
|
+
*/
|
|
130321
|
+
// Technically we can use this or we can even use the avnu-adapter to get the unused debt
|
|
130322
|
+
async getUnusedDebt() {
|
|
130323
|
+
const debtToken = this.metadata.additionalInfo.debtToken;
|
|
130324
|
+
return new ERC20(this.config).balanceOf(
|
|
130325
|
+
debtToken.address,
|
|
130326
|
+
this.metadata.additionalInfo.vaultAllocator,
|
|
130327
|
+
debtToken.decimals
|
|
130328
|
+
);
|
|
130329
|
+
}
|
|
130330
|
+
/**
|
|
130331
|
+
* Returns the xSTRK balance sitting in the vault allocator.
|
|
130332
|
+
* This is non-zero when the previous cycle's request_redeem on the HyperPosition
|
|
130333
|
+
* has been settled — the redeemed xSTRK lands here and is ready to be swapped.
|
|
130334
|
+
*/
|
|
130335
|
+
async getxSTRKInVault() {
|
|
130336
|
+
const xstrkToken = Global.getDefaultTokens().find(
|
|
130337
|
+
(t) => t.symbol === "xSTRK"
|
|
130338
|
+
);
|
|
130339
|
+
if (!xstrkToken) {
|
|
130340
|
+
throw new Error(`${this.getTag()}:: xSTRK token not found`);
|
|
130341
|
+
}
|
|
130342
|
+
return new ERC20(this.config).balanceOf(
|
|
130343
|
+
xstrkToken.address.address,
|
|
130344
|
+
this.metadata.additionalInfo.vaultAllocator,
|
|
130345
|
+
xstrkToken.decimals
|
|
130346
|
+
);
|
|
130347
|
+
}
|
|
130348
|
+
/**
|
|
130349
|
+
* Simulates depositing `depositAmount` USDC on Vesu and returns the
|
|
130350
|
+
* incremental STRK that would be borrowed. Needed to size the AVNU swap
|
|
130351
|
+
* call that is batched together with the Vesu call in the same transaction.
|
|
130352
|
+
*/
|
|
130353
|
+
async computeVesuDepositBorrowAmount(depositAmount) {
|
|
130354
|
+
return this.getAdapterById(
|
|
130355
|
+
"vesu_usdc_strk"
|
|
130356
|
+
).getExpectedDepositDebtDelta(depositAmount);
|
|
130357
|
+
}
|
|
130358
|
+
async computeVesuWithdrawDebtDelta(withdrawAmount) {
|
|
130359
|
+
return this.getAdapterById(
|
|
130360
|
+
"vesu_usdc_strk"
|
|
130361
|
+
).getExpectedWithdrawDebtDelta(withdrawAmount);
|
|
130362
|
+
}
|
|
130363
|
+
async getPendingHyperAssets() {
|
|
130364
|
+
const xstrkToken = Global.getDefaultTokens().find(
|
|
130365
|
+
(t) => t.symbol === "xSTRK"
|
|
130366
|
+
);
|
|
130367
|
+
const hyperXstrkRedeemNFT = ContractAddr.from(
|
|
130368
|
+
"0x51e40b839dc0c2feca923f863072673b94abfa2483345be3b30b457a90d095"
|
|
130369
|
+
);
|
|
130370
|
+
return this.getAdapterById(
|
|
130371
|
+
"hyper_xstrk"
|
|
130372
|
+
).getPendingAssetsFromOwnerNFTMethod(
|
|
130373
|
+
hyperXstrkRedeemNFT,
|
|
130374
|
+
this.metadata.additionalInfo.vaultAllocator,
|
|
130375
|
+
xstrkToken.decimals
|
|
130376
|
+
);
|
|
130377
|
+
}
|
|
130378
|
+
// TODO: rn we are just making these functions in the strategy itself but
|
|
130379
|
+
// later on we will move them to the SVKStrategy for generalization
|
|
130380
|
+
async getUserTVL(user, blockIdentifier = "latest") {
|
|
130381
|
+
const shares = await this.contract.call("balanceOf", [user.address], {
|
|
130382
|
+
blockIdentifier
|
|
130383
|
+
});
|
|
130384
|
+
const assets = await this.contract.call(
|
|
130385
|
+
"convert_to_assets",
|
|
130386
|
+
[uint256_exports.bnToUint256(shares)],
|
|
130387
|
+
{ blockIdentifier }
|
|
130388
|
+
);
|
|
130389
|
+
const amount = Web3Number.fromWei(
|
|
130390
|
+
assets.toString(),
|
|
130391
|
+
this.metadata.depositTokens[0].decimals
|
|
130392
|
+
);
|
|
130393
|
+
const blockNumber = typeof blockIdentifier === "number" || typeof blockIdentifier === "bigint" ? Number(blockIdentifier) : void 0;
|
|
130394
|
+
const price = await this.pricer.getPrice(
|
|
130395
|
+
this.metadata.depositTokens[0].symbol,
|
|
130396
|
+
blockNumber
|
|
130397
|
+
);
|
|
130398
|
+
const usdValue = Number(amount.toFixed(6)) * price.price;
|
|
130399
|
+
return {
|
|
130400
|
+
tokenInfo: this.asset(),
|
|
130401
|
+
amount,
|
|
130402
|
+
usdValue
|
|
130403
|
+
};
|
|
130404
|
+
}
|
|
130405
|
+
async getTVL() {
|
|
130406
|
+
const assets = await this.contract.total_assets();
|
|
130407
|
+
const amount = Web3Number.fromWei(
|
|
130408
|
+
assets.toString(),
|
|
130409
|
+
this.metadata.depositTokens[0].decimals
|
|
130410
|
+
);
|
|
130411
|
+
const price = await this.pricer.getPrice(
|
|
130412
|
+
this.metadata.depositTokens[0].symbol
|
|
130413
|
+
);
|
|
130414
|
+
const usdValue = Number(amount.toFixed(6)) * price.price;
|
|
130415
|
+
return {
|
|
130416
|
+
tokenInfo: this.asset(),
|
|
130417
|
+
amount,
|
|
130418
|
+
usdValue
|
|
130419
|
+
};
|
|
130420
|
+
}
|
|
130421
|
+
async getAUM() {
|
|
130422
|
+
const underlying = this.asset();
|
|
130423
|
+
const usdcPrice = await this.pricer.getPrice(underlying.symbol);
|
|
130424
|
+
const allPositions = [];
|
|
130425
|
+
for (const adapter2 of this.metadata.additionalInfo.adapters) {
|
|
130426
|
+
const positions = await adapter2.adapter.getPositions();
|
|
130427
|
+
allPositions.push(...positions);
|
|
130428
|
+
}
|
|
130429
|
+
let netAUM = new Web3Number(0, underlying.decimals);
|
|
130430
|
+
for (const position of allPositions) {
|
|
130431
|
+
if (position.tokenInfo.address.eq(underlying.address)) {
|
|
130432
|
+
netAUM = netAUM.plus(position.amount);
|
|
130433
|
+
} else {
|
|
130434
|
+
const valueInUSDC = position.usdValue;
|
|
130435
|
+
netAUM = netAUM.plus(valueInUSDC);
|
|
130436
|
+
}
|
|
130437
|
+
}
|
|
130438
|
+
const unusedBalance = await this.getUnusedBalance();
|
|
130439
|
+
logger2.verbose(
|
|
130440
|
+
`${this.getTag()} unused balance: ${unusedBalance.amount.toNumber()}`
|
|
130441
|
+
);
|
|
130442
|
+
netAUM = netAUM.plus(unusedBalance.amount);
|
|
130443
|
+
const prevAum = await this.getPrevAUM();
|
|
130444
|
+
logger2.verbose(`${this.getTag()} AUM: ${netAUM}`);
|
|
130445
|
+
const realAUM = {
|
|
130446
|
+
tokenInfo: underlying,
|
|
130447
|
+
amount: netAUM,
|
|
130448
|
+
usdValue: netAUM.toNumber() * usdcPrice.price,
|
|
130449
|
+
apy: { apy: 0, type: "base" /* BASE */ },
|
|
130450
|
+
remarks: "finalised" /* FINALISED */,
|
|
130451
|
+
protocol: Protocols.NONE
|
|
130452
|
+
};
|
|
130453
|
+
const estimatedAUMDelta = {
|
|
130454
|
+
tokenInfo: underlying,
|
|
130455
|
+
amount: Web3Number.fromWei("0", underlying.decimals),
|
|
130456
|
+
usdValue: 0,
|
|
130457
|
+
apy: { apy: 0, type: "base" /* BASE */ },
|
|
130458
|
+
remarks: "defispring" /* DEFISPRING */,
|
|
130459
|
+
protocol: Protocols.NONE
|
|
130460
|
+
};
|
|
130461
|
+
return {
|
|
130462
|
+
net: {
|
|
130463
|
+
tokenInfo: underlying,
|
|
130464
|
+
amount: netAUM,
|
|
130465
|
+
usdValue: netAUM.toNumber() * usdcPrice.price
|
|
130466
|
+
},
|
|
130467
|
+
prevAum,
|
|
130468
|
+
splits: [realAUM, estimatedAUMDelta]
|
|
130469
|
+
};
|
|
130470
|
+
}
|
|
130471
|
+
// TODO: can refactor later but seems redundant since not being used ANYWHERE
|
|
130472
|
+
// Most of the fund management done through adapters only
|
|
130473
|
+
async getFundManagementCall(params) {
|
|
130474
|
+
logger2.verbose(
|
|
130475
|
+
`${this.getTag()}::getFundManagementCall params: ${JSON.stringify(params)}`
|
|
130476
|
+
);
|
|
130477
|
+
const allAdapters = this.metadata.additionalInfo.adapters.map(
|
|
130478
|
+
(a) => a.adapter
|
|
130479
|
+
);
|
|
130480
|
+
if (!params.isDeposit) {
|
|
130481
|
+
const unusedBalance = await this.getUnusedBalance();
|
|
130482
|
+
logger2.verbose(
|
|
130483
|
+
`${this.getTag()}::getFundManagementCall unusedBalance: ${unusedBalance.amount}, required: ${params.leg1DepositAmount}`
|
|
130484
|
+
);
|
|
130485
|
+
if (unusedBalance.amount.gte(params.leg1DepositAmount)) {
|
|
130486
|
+
return null;
|
|
130487
|
+
}
|
|
130488
|
+
const adapters2 = await AdapterOptimizer.getAdapterToUse(
|
|
130489
|
+
allAdapters,
|
|
130490
|
+
false,
|
|
130491
|
+
params.leg1DepositAmount
|
|
130492
|
+
);
|
|
130493
|
+
if (adapters2.length > 0) {
|
|
130494
|
+
const proofsInfo = adapters2.map(
|
|
130495
|
+
(adapter2) => adapter2.getProofs(false, this.getMerkleTree())
|
|
130496
|
+
);
|
|
130497
|
+
const calls = [];
|
|
130498
|
+
for (const info of proofsInfo) {
|
|
130499
|
+
const manageCalls = await info.callConstructor({
|
|
130500
|
+
amount: params.leg1DepositAmount
|
|
130501
|
+
});
|
|
130502
|
+
const call = this.getManageCall(
|
|
130503
|
+
this.getProofGroupsForManageCalls(manageCalls),
|
|
130504
|
+
manageCalls
|
|
130505
|
+
);
|
|
130506
|
+
calls.push(call);
|
|
130507
|
+
}
|
|
130508
|
+
return calls;
|
|
130509
|
+
}
|
|
130510
|
+
throw new Error(
|
|
130511
|
+
`${this.getTag()}::getFundManagementCall: no adapters for withdraw: ${unusedBalance.amount}`
|
|
130512
|
+
);
|
|
130513
|
+
}
|
|
130514
|
+
const adapters = await AdapterOptimizer.getAdapterToUse(
|
|
130515
|
+
allAdapters,
|
|
130516
|
+
true,
|
|
130517
|
+
params.leg1DepositAmount
|
|
130518
|
+
);
|
|
130519
|
+
if (adapters.length > 0) {
|
|
130520
|
+
const proofsInfo = adapters.map(
|
|
130521
|
+
(adapter2) => adapter2.getProofs(true, this.getMerkleTree())
|
|
130522
|
+
);
|
|
130523
|
+
const calls = [];
|
|
130524
|
+
for (const info of proofsInfo) {
|
|
130525
|
+
const manageCalls = await info.callConstructor({
|
|
130526
|
+
amount: params.leg1DepositAmount
|
|
130527
|
+
});
|
|
130528
|
+
const call = this.getManageCall(
|
|
130529
|
+
this.getProofGroupsForManageCalls(manageCalls),
|
|
130530
|
+
manageCalls
|
|
130531
|
+
);
|
|
130532
|
+
calls.push(call);
|
|
130533
|
+
}
|
|
130534
|
+
return calls;
|
|
130535
|
+
}
|
|
130536
|
+
throw new Error(
|
|
130537
|
+
`${this.getTag()}::getFundManagementCall: no adapters for deposit: ${params.leg1DepositAmount}`
|
|
130538
|
+
);
|
|
130539
|
+
}
|
|
130540
|
+
};
|
|
130541
|
+
function getUSDCBoostedSettings(vaultSettings) {
|
|
130542
|
+
vaultSettings.leafAdapters = [];
|
|
130543
|
+
const xSTRKToken = Global.getDefaultTokens().find(
|
|
130544
|
+
(t) => t.symbol === "xSTRK"
|
|
130545
|
+
);
|
|
130546
|
+
const USDCToken = Global.getDefaultTokens().find((t) => t.symbol === "USDC");
|
|
130547
|
+
const STRKToken = Global.getDefaultTokens().find((t) => t.symbol === "STRK");
|
|
130548
|
+
const baseAdapterConfig = {
|
|
130549
|
+
baseToken: USDCToken,
|
|
130550
|
+
supportedPositions: [{ asset: USDCToken, isDebt: false }],
|
|
130551
|
+
networkConfig: getMainnetConfig(),
|
|
130552
|
+
pricer: new PricerFromApi(getMainnetConfig(), Global.getDefaultTokens()),
|
|
130553
|
+
vaultAllocator: vaultSettings.vaultAllocator,
|
|
130554
|
+
vaultAddress: vaultSettings.vaultAddress
|
|
130555
|
+
};
|
|
130556
|
+
const vesuModifyPositionAdapter = new VesuModifyPositionAdapter({
|
|
130557
|
+
poolId: vaultSettings.vesuPoolId,
|
|
130558
|
+
collateral: vaultSettings.collateralToken,
|
|
130559
|
+
debt: vaultSettings.debtToken,
|
|
130560
|
+
targetLtv: vaultSettings.targetLTV,
|
|
130561
|
+
maxLtv: vaultSettings.maxLTV,
|
|
130562
|
+
...baseAdapterConfig,
|
|
130563
|
+
supportedPositions: [
|
|
130564
|
+
{ asset: USDCToken, isDebt: false },
|
|
130565
|
+
{ asset: STRKToken, isDebt: true }
|
|
130566
|
+
]
|
|
130567
|
+
});
|
|
130568
|
+
const avnuAdapter = new AvnuAdapter({
|
|
130569
|
+
baseUrl: AVNU_QUOTE_URL,
|
|
130570
|
+
avnuContract: AVNU_EXCHANGE,
|
|
130571
|
+
slippage: 0.01,
|
|
130572
|
+
minimumExtendedPriceDifferenceForSwapOpen: 0,
|
|
130573
|
+
maximumExtendedPriceDifferenceForSwapClosing: 0,
|
|
130574
|
+
...baseAdapterConfig,
|
|
130575
|
+
baseToken: STRKToken,
|
|
130576
|
+
supportedPositions: [
|
|
130577
|
+
{ asset: STRKToken, isDebt: false },
|
|
130578
|
+
{ asset: xSTRKToken, isDebt: false }
|
|
130579
|
+
]
|
|
130580
|
+
});
|
|
130581
|
+
const svkTrovesAdapter = new SvkTrovesAdapter({
|
|
130582
|
+
...baseAdapterConfig,
|
|
130583
|
+
baseToken: xSTRKToken,
|
|
130584
|
+
supportedPositions: [{ asset: xSTRKToken, isDebt: false }],
|
|
130585
|
+
strategyVault: vaultSettings.hyperxSTRKVaultAddress,
|
|
130586
|
+
trovesStrategyId: "hyper_xstrk"
|
|
130587
|
+
});
|
|
130588
|
+
const usdcTransferAdapter = new TokenTransferAdapter({
|
|
130589
|
+
...baseAdapterConfig,
|
|
130590
|
+
fromAddress: vaultSettings.vaultAllocator,
|
|
130591
|
+
toAddress: vaultSettings.vaultAddress
|
|
130592
|
+
});
|
|
130593
|
+
const commonAdapter = new CommonAdapter({
|
|
130594
|
+
id: "flash_loan_init" /* FLASH_LOAN */,
|
|
130595
|
+
vaultAddress: vaultSettings.vaultAddress,
|
|
130596
|
+
vaultAllocator: vaultSettings.vaultAllocator,
|
|
130597
|
+
manager: vaultSettings.manager,
|
|
130598
|
+
asset: USDCToken.address
|
|
130599
|
+
});
|
|
130600
|
+
vaultSettings.adapters.push(
|
|
130601
|
+
// TODO: generalize the ids
|
|
130602
|
+
{ id: "vesu_usdc_strk", adapter: vesuModifyPositionAdapter },
|
|
130603
|
+
// Used to track swapped funds in vaultAllocator
|
|
130604
|
+
{ id: "avnu_strk_xstrk", adapter: avnuAdapter },
|
|
130605
|
+
{ id: "hyper_xstrk", adapter: svkTrovesAdapter },
|
|
130606
|
+
{ id: "usdc_transfer", adapter: usdcTransferAdapter }
|
|
130607
|
+
);
|
|
130608
|
+
vaultSettings.leafAdapters.push(
|
|
130609
|
+
() => vesuModifyPositionAdapter.getDepositLeaf()
|
|
130610
|
+
);
|
|
130611
|
+
vaultSettings.leafAdapters.push(
|
|
130612
|
+
() => vesuModifyPositionAdapter.getWithdrawLeaf()
|
|
130613
|
+
);
|
|
130614
|
+
vaultSettings.leafAdapters.push(() => avnuAdapter.getDepositLeaf());
|
|
130615
|
+
vaultSettings.leafAdapters.push(() => avnuAdapter.getWithdrawLeaf());
|
|
130616
|
+
vaultSettings.leafAdapters.push(() => svkTrovesAdapter.getDepositLeaf());
|
|
130617
|
+
vaultSettings.leafAdapters.push(() => svkTrovesAdapter.getWithdrawLeaf());
|
|
130618
|
+
vaultSettings.leafAdapters.push(
|
|
130619
|
+
commonAdapter.getApproveAdapter(
|
|
130620
|
+
USDCToken.address,
|
|
130621
|
+
vaultSettings.vaultAddress,
|
|
130622
|
+
"approve_bring_liquidity" /* APPROVE_BRING_LIQUIDITY */
|
|
130623
|
+
).bind(commonAdapter)
|
|
130624
|
+
);
|
|
130625
|
+
vaultSettings.leafAdapters.push(
|
|
130626
|
+
commonAdapter.getBringLiquidityAdapter("bring_liquidity" /* BRING_LIQUIDITY */).bind(commonAdapter)
|
|
130627
|
+
);
|
|
130628
|
+
return vaultSettings;
|
|
130629
|
+
}
|
|
130630
|
+
var usdcBoostedSettings = {
|
|
130631
|
+
vaultAddress: ContractAddr.from(
|
|
130632
|
+
"0xcdb0e3b2e076a2cdc4ee958b726b47c066239ef91c5ac80c94cf814147b84"
|
|
130633
|
+
),
|
|
130634
|
+
manager: ContractAddr.from(
|
|
130635
|
+
"0x72eea9bac9fa8cfffda637d3b990851446860c6fd8987d6cb50e659b01ee50f"
|
|
130636
|
+
),
|
|
130637
|
+
vaultAllocator: ContractAddr.from(
|
|
130638
|
+
"0x6d3101cff7f821412a99ebe23bb31a1950f93276285102eb4313e3601f5f927"
|
|
130639
|
+
),
|
|
130640
|
+
redeemRequestNFT: ContractAddr.from(
|
|
130641
|
+
"0x47dcc6889ca8db4e9eea8f55421e10f8ce7e356ccb45260a1c49a76f733c309"
|
|
130642
|
+
),
|
|
130643
|
+
// TODO: not applicable in our case -> remove later ( make it optional if needed)
|
|
130644
|
+
aumOracle: ContractAddr.from("0x0"),
|
|
130645
|
+
leafAdapters: [],
|
|
130646
|
+
adapters: [],
|
|
130647
|
+
// Calc using the maxLTV / targetLTV (0.5)
|
|
130648
|
+
targetHealthFactor: 1.32,
|
|
130649
|
+
// Calc using the maxLTV / maxAcceptableLTV (0.55)
|
|
130650
|
+
minHealthFactor: 1.2,
|
|
130651
|
+
vesuPoolId: VesuPools.Prime,
|
|
130652
|
+
collateralToken: Global.getDefaultTokens().find((t) => t.symbol === "USDC"),
|
|
130653
|
+
debtToken: Global.getDefaultTokens().find((t) => t.symbol === "STRK"),
|
|
130654
|
+
maxLTV: 0.66,
|
|
130655
|
+
targetLTV: 0.5,
|
|
130656
|
+
hyperxSTRKVaultAddress: ContractAddr.from(
|
|
130657
|
+
"0x46c7a54c82b1fe374353859f554a40b8bd31d3e30f742901579e7b57b1b5960"
|
|
130658
|
+
)
|
|
130659
|
+
};
|
|
130660
|
+
function getStrategySettings2(settings2) {
|
|
130661
|
+
const USDCToken = Global.getDefaultTokens().find((t) => t.symbol === "USDC");
|
|
130662
|
+
const STRKToken = Global.getDefaultTokens().find((t) => t.symbol === "STRK");
|
|
130663
|
+
return {
|
|
130664
|
+
id: "usdc_boosted",
|
|
130665
|
+
name: "USDC Boosted",
|
|
130666
|
+
description: "Deposits USDC as collateral on Vesu, borrows STRK, swaps to xSTRK, and deposits into Hyper-xSTRK for boosted yield",
|
|
130667
|
+
address: settings2.vaultAddress,
|
|
130668
|
+
launchBlock: 8742931,
|
|
130669
|
+
type: "ERC4626",
|
|
130670
|
+
vaultType: {
|
|
130671
|
+
// TODO: can change as per need
|
|
130672
|
+
type: "Meta Vault" /* META_VAULT */,
|
|
130673
|
+
description: "Deposits USDC as collateral on Vesu, borrows STRK, swaps to xSTRK, and deposits into Hyper-xSTRK for boosted yield"
|
|
130674
|
+
},
|
|
130675
|
+
depositTokens: [USDCToken],
|
|
130676
|
+
additionalInfo: getUSDCBoostedSettings(settings2),
|
|
130677
|
+
// TODO: config lateron
|
|
130678
|
+
risk: {
|
|
130679
|
+
riskFactor: [],
|
|
130680
|
+
netRisk: 0,
|
|
130681
|
+
notARisks: []
|
|
130682
|
+
},
|
|
130683
|
+
protocols: [Protocols.VESU, Protocols.TROVES],
|
|
130684
|
+
curator: {
|
|
130685
|
+
name: "Unwrap Labs",
|
|
130686
|
+
logo: "https://assets.troves.fi/integrations/unwraplabs/white.png"
|
|
130687
|
+
},
|
|
130688
|
+
settings: {
|
|
130689
|
+
maxTVL: Web3Number.fromWei(0, USDCToken.decimals),
|
|
130690
|
+
isPaused: false,
|
|
130691
|
+
isAudited: false,
|
|
130692
|
+
isInstantWithdrawal: false,
|
|
130693
|
+
hideHarvestInfo: true,
|
|
130694
|
+
quoteToken: USDCToken,
|
|
130695
|
+
alerts: [
|
|
130696
|
+
{
|
|
130697
|
+
tab: "withdraw",
|
|
130698
|
+
text: "On withdrawal, you will receive an NFT representing your withdrawal request. The funds will be automatically sent to your wallet (NFT owner) in 1-2 hours. You can monitor the status in transactions tab.",
|
|
130699
|
+
type: "info"
|
|
130700
|
+
}
|
|
130701
|
+
]
|
|
130702
|
+
},
|
|
130703
|
+
contractDetails: getContractDetails(settings2),
|
|
130704
|
+
// TODO: config later
|
|
130705
|
+
faqs: [],
|
|
130706
|
+
investmentSteps: [
|
|
130707
|
+
"Deposit USDC into the vault",
|
|
130708
|
+
"USDC is supplied as collateral on Vesu, STRK is borrowed",
|
|
130709
|
+
"Borrowed STRK is swapped to xSTRK via Avnu",
|
|
130710
|
+
"xSTRK is deposited into the Hyper-xSTRK vault for additional yield",
|
|
130711
|
+
"On withdrawal, the pipeline reverses to return USDC"
|
|
130712
|
+
],
|
|
130713
|
+
// TODO: config later
|
|
130714
|
+
tags: ["Meta Vaults" /* META_VAULT */],
|
|
130715
|
+
security: {
|
|
130716
|
+
auditStatus: "Audited" /* AUDITED */,
|
|
130717
|
+
sourceCode: {
|
|
130718
|
+
type: "Closed Source" /* CLOSED_SOURCE */,
|
|
130719
|
+
contractLink: "https://github.com/trovesfi/troves-contracts"
|
|
130720
|
+
},
|
|
130721
|
+
accessControl: {
|
|
130722
|
+
type: "Standard Account" /* STANDARD_ACCOUNT */,
|
|
130723
|
+
addresses: [ContractAddr.from("0x0")],
|
|
130724
|
+
timeLock: "2 Days"
|
|
130725
|
+
}
|
|
130726
|
+
},
|
|
130727
|
+
redemptionInfo: {
|
|
130728
|
+
instantWithdrawalVault: "No" /* NO */,
|
|
130729
|
+
redemptionsInfo: [
|
|
130730
|
+
{
|
|
130731
|
+
title: "Typical Duration",
|
|
130732
|
+
description: "1-2 hours"
|
|
130733
|
+
}
|
|
130734
|
+
],
|
|
130735
|
+
alerts: [
|
|
130736
|
+
{
|
|
130737
|
+
type: "info",
|
|
130738
|
+
text: "Redemption times are estimates and may vary based on network conditions and liquidity requirements.",
|
|
130739
|
+
tab: "withdraw"
|
|
130740
|
+
}
|
|
130741
|
+
]
|
|
130742
|
+
},
|
|
130743
|
+
usualTimeToEarnings: null,
|
|
130744
|
+
usualTimeToEarningsDescription: null
|
|
130745
|
+
};
|
|
130746
|
+
}
|
|
130747
|
+
var USDCBoostedStrategies = [getStrategySettings2(usdcBoostedSettings)];
|
|
130748
|
+
|
|
129327
130749
|
// src/strategies/vesu-extended-strategy/services/ltv-imbalance-rebalance-math.ts
|
|
129328
130750
|
function ceilBtc(v, precision) {
|
|
129329
130751
|
const f2 = 10 ** precision;
|
|
@@ -130721,6 +132143,142 @@ spurious results.`);
|
|
|
130721
132143
|
}
|
|
130722
132144
|
return budget;
|
|
130723
132145
|
}
|
|
132146
|
+
function assertRouteSanityAndAdjust(route, availableAmount) {
|
|
132147
|
+
if (!route.amount) {
|
|
132148
|
+
throw new Error(`Invalid route given to assertRouteSanityAndAdjust: ${JSON.stringify(route)}`);
|
|
132149
|
+
}
|
|
132150
|
+
const routeAmount = route.amount.toNumber();
|
|
132151
|
+
if (routeAmount <= availableAmount) {
|
|
132152
|
+
return route;
|
|
132153
|
+
}
|
|
132154
|
+
if (routeAmount - availableAmount <= CASE_THRESHOLD_USD) {
|
|
132155
|
+
return { ...route, amount: new Web3Number(availableAmount, route.amount.decimals) };
|
|
132156
|
+
}
|
|
132157
|
+
throw new Error(`Route amount ${routeAmount} exceeds available amount ${availableAmount}, Route name: ${route.type}`);
|
|
132158
|
+
}
|
|
132159
|
+
function assertVesuMultiplyRouteSanityAndAdjust(route, availableAmount, state, isIncrease) {
|
|
132160
|
+
const btcPrice = state.vesuPoolState.collateralPrice;
|
|
132161
|
+
const totalCollateralAmount = isIncrease ? route.marginAmount.plus(route.swappedCollateralAmount).plus(state.vesuPoolState.collateralAmount) : state.vesuPoolState.collateralAmount.minus(route.marginAmount.plus(route.swappedCollateralAmount));
|
|
132162
|
+
const totalDebtAmount = isIncrease ? route.debtAmount.plus(state.vesuPoolState.debtAmount) : state.vesuPoolState.debtAmount.minus(route.debtAmount);
|
|
132163
|
+
const newHF = HealthFactorMath.getHealthFactor(
|
|
132164
|
+
totalCollateralAmount,
|
|
132165
|
+
btcPrice,
|
|
132166
|
+
VesuConfig.maxLtv,
|
|
132167
|
+
totalDebtAmount,
|
|
132168
|
+
state.vesuPoolState.debtPrice
|
|
132169
|
+
);
|
|
132170
|
+
const idealHF = VesuConfig.maxLtv / VesuConfig.targetLtv - 0.05;
|
|
132171
|
+
assert3(newHF >= idealHF, `SolveBudget::applyRoutesAndVerifyLtvState newHF=${newHF} < idealHF=${idealHF}`);
|
|
132172
|
+
}
|
|
132173
|
+
function applyRoutesAndVerifyLtvState(state, routes) {
|
|
132174
|
+
const btcPrice = state.vesuPoolState.collateralPrice;
|
|
132175
|
+
const adjustedRouters = [...routes];
|
|
132176
|
+
let index = 0;
|
|
132177
|
+
for (const r of routes) {
|
|
132178
|
+
switch (r.type) {
|
|
132179
|
+
case "WALLET_TO_VA" /* WALLET_TO_VA */: {
|
|
132180
|
+
const adjustedRoute = assertRouteSanityAndAdjust(r, state.walletUsd);
|
|
132181
|
+
const amt = adjustedRoute.amount.toNumber();
|
|
132182
|
+
state.spendWallet(amt);
|
|
132183
|
+
state.addToVA(amt);
|
|
132184
|
+
break;
|
|
132185
|
+
}
|
|
132186
|
+
case "VESU_REPAY" /* VESU_REPAY */: {
|
|
132187
|
+
const adjustedRoute = assertRouteSanityAndAdjust(r, state.vaRawUsd);
|
|
132188
|
+
const amt = Math.abs(adjustedRoute.amount.toNumber());
|
|
132189
|
+
state.repayVesuBorrowCapacity(amt);
|
|
132190
|
+
state.spendVA(amt);
|
|
132191
|
+
break;
|
|
132192
|
+
}
|
|
132193
|
+
case "EXTENDED_TO_WALLET" /* EXTENDED_TO_WALLET */: {
|
|
132194
|
+
const adjustedRoute = assertRouteSanityAndAdjust(r, state.extAvailWithdraw);
|
|
132195
|
+
const amt = adjustedRoute.amount.toNumber();
|
|
132196
|
+
state.addToWallet(amt);
|
|
132197
|
+
state.spendExtAvailTrade(amt);
|
|
132198
|
+
break;
|
|
132199
|
+
}
|
|
132200
|
+
case "REALISE_PNL" /* REALISE_PNL */: {
|
|
132201
|
+
const amt = r.amount.toNumber();
|
|
132202
|
+
state.spendExtAvailUpnl(amt);
|
|
132203
|
+
state.addToExtAvailTrade(amt);
|
|
132204
|
+
break;
|
|
132205
|
+
}
|
|
132206
|
+
case "VA_TO_EXTENDED" /* VA_TO_EXTENDED */: {
|
|
132207
|
+
const adjustedRoute = assertRouteSanityAndAdjust(r, state.vaRawUsd);
|
|
132208
|
+
const amt = adjustedRoute.amount.toNumber();
|
|
132209
|
+
state.spendVA(amt);
|
|
132210
|
+
state.addToExtAvailTrade(amt);
|
|
132211
|
+
break;
|
|
132212
|
+
}
|
|
132213
|
+
case "WALLET_TO_EXTENDED" /* WALLET_TO_EXTENDED */: {
|
|
132214
|
+
const adjustedRoute = assertRouteSanityAndAdjust(r, state.walletUsd);
|
|
132215
|
+
const amt = adjustedRoute.amount.toNumber();
|
|
132216
|
+
state.spendWallet(amt);
|
|
132217
|
+
state.addToExtAvailTrade(amt);
|
|
132218
|
+
break;
|
|
132219
|
+
}
|
|
132220
|
+
case "VESU_BORROW" /* VESU_BORROW */: {
|
|
132221
|
+
const borrowedAmount = r.amount.toNumber();
|
|
132222
|
+
const currentCollateralAmount = state.vesuPoolState.collateralAmount.toNumber();
|
|
132223
|
+
const currentDebtAmount = state.vesuPoolState.debtAmount.toNumber();
|
|
132224
|
+
const maxDebtAmount = HealthFactorMath.getMaxDebtAmount(
|
|
132225
|
+
new Web3Number(currentCollateralAmount, state.vesuPoolState.collateralToken.decimals),
|
|
132226
|
+
state.vesuPoolState.collateralPrice,
|
|
132227
|
+
VesuConfig.maxLtv,
|
|
132228
|
+
VesuConfig.maxLtv / VesuConfig.targetLtv - 0.05,
|
|
132229
|
+
// e.g. if ideal HF is 1.4, upto 1.35 is ok.
|
|
132230
|
+
state.vesuPoolState.debtPrice,
|
|
132231
|
+
state.vesuPoolState.debtToken
|
|
132232
|
+
);
|
|
132233
|
+
const availableDebtAmount = maxDebtAmount.minus(new Web3Number(currentDebtAmount, state.vesuPoolState.debtToken.decimals));
|
|
132234
|
+
if (!availableDebtAmount.plus(CASE_THRESHOLD_USD).greaterThan(borrowedAmount)) {
|
|
132235
|
+
throw new Error(`SolveBudget::applyRoutesAndVerifyLtvState availableDebtAmount=${availableDebtAmount.toNumber()} < borrowedAmount=${borrowedAmount}`);
|
|
132236
|
+
}
|
|
132237
|
+
state.spendVesuBorrowCapacity(borrowedAmount);
|
|
132238
|
+
state.addToVA(borrowedAmount);
|
|
132239
|
+
break;
|
|
132240
|
+
}
|
|
132241
|
+
case "VESU_MULTIPLY_INCREASE_LEVER" /* VESU_MULTIPLY_INCREASE_LEVER */: {
|
|
132242
|
+
const mr = r;
|
|
132243
|
+
assertVesuMultiplyRouteSanityAndAdjust(mr, state.vaRawUsd, state, true);
|
|
132244
|
+
state.applyVesuDelta(
|
|
132245
|
+
mr.poolId,
|
|
132246
|
+
mr.collateralToken,
|
|
132247
|
+
mr.debtToken,
|
|
132248
|
+
mr.marginAmount.plus(mr.swappedCollateralAmount),
|
|
132249
|
+
mr.debtAmount
|
|
132250
|
+
);
|
|
132251
|
+
state.spendVA(mr.marginAmount.toNumber() * btcPrice);
|
|
132252
|
+
break;
|
|
132253
|
+
}
|
|
132254
|
+
case "VESU_MULTIPLY_DECREASE_LEVER" /* VESU_MULTIPLY_DECREASE_LEVER */: {
|
|
132255
|
+
const mr = r;
|
|
132256
|
+
assertVesuMultiplyRouteSanityAndAdjust(mr, state.vaRawUsd, state, false);
|
|
132257
|
+
state.applyVesuDelta(
|
|
132258
|
+
mr.poolId,
|
|
132259
|
+
mr.collateralToken,
|
|
132260
|
+
mr.debtToken,
|
|
132261
|
+
new Web3Number(mr.marginAmount.negated().minus(mr.swappedCollateralAmount).toFixed(8), mr.marginAmount.decimals),
|
|
132262
|
+
mr.debtAmount
|
|
132263
|
+
);
|
|
132264
|
+
const marginBtc = mr.marginAmount.toNumber();
|
|
132265
|
+
if (marginBtc > 10 ** -COLLATERAL_PRECISION) {
|
|
132266
|
+
state.addToVA(marginBtc * btcPrice);
|
|
132267
|
+
}
|
|
132268
|
+
break;
|
|
132269
|
+
}
|
|
132270
|
+
case "EXTENDED_DECREASE_LEVER" /* EXTENDED_DECREASE_LEVER */:
|
|
132271
|
+
case "EXTENDED_INCREASE_LEVER" /* EXTENDED_INCREASE_LEVER */: {
|
|
132272
|
+
const er = r;
|
|
132273
|
+
state.applyExtendedExposureDelta(er.instrument, er.amount, btcPrice);
|
|
132274
|
+
break;
|
|
132275
|
+
}
|
|
132276
|
+
case "RETURN_TO_WAIT" /* RETURN_TO_WAIT */:
|
|
132277
|
+
break;
|
|
132278
|
+
}
|
|
132279
|
+
index++;
|
|
132280
|
+
}
|
|
132281
|
+
}
|
|
130724
132282
|
var ExtendedSVKVesuStateManager = class {
|
|
130725
132283
|
constructor(config3) {
|
|
130726
132284
|
this._tag = "ExtendedSVKVesuStateManager";
|
|
@@ -130739,13 +132297,19 @@ spurious results.`);
|
|
|
130739
132297
|
* Pass 0 (default) for normal investment / rebalancing cycles.
|
|
130740
132298
|
*/
|
|
130741
132299
|
async solve(withdrawAmount = new Web3Number(0, USDC_TOKEN_DECIMALS)) {
|
|
130742
|
-
await this._refresh();
|
|
132300
|
+
const gaurdrailBudget = await this._refresh();
|
|
130743
132301
|
if (Math.abs(this._budget.extPendingDeposit) > 0) {
|
|
130744
132302
|
logger2.warn(`${this._tag}::solve extPendingDeposit=${this._budget.extPendingDeposit}`);
|
|
130745
132303
|
return null;
|
|
130746
132304
|
}
|
|
130747
132305
|
this._validateRefreshedState();
|
|
130748
132306
|
const cases = this._classifyCases(withdrawAmount);
|
|
132307
|
+
for (const c of cases) {
|
|
132308
|
+
applyRoutesAndVerifyLtvState(gaurdrailBudget, c.routes);
|
|
132309
|
+
}
|
|
132310
|
+
const extendedPositionSize = gaurdrailBudget.extendedPositionsView[0].size.toNumber();
|
|
132311
|
+
const vesuPositionSize = gaurdrailBudget.vesuPoolState.collateralAmount.toNumber();
|
|
132312
|
+
assert3(Math.abs(extendedPositionSize - vesuPositionSize) <= 1e-5, "extended positions size mismatch");
|
|
130749
132313
|
const result2 = {
|
|
130750
132314
|
cases,
|
|
130751
132315
|
// ignore these fields for now. only cases are relevant.
|
|
@@ -130793,7 +132357,7 @@ spurious results.`);
|
|
|
130793
132357
|
vaultUsdcBalance,
|
|
130794
132358
|
walletBalance
|
|
130795
132359
|
);
|
|
130796
|
-
|
|
132360
|
+
const data = {
|
|
130797
132361
|
assetToken: this._config.assetToken,
|
|
130798
132362
|
usdcToken: this._config.usdcToken,
|
|
130799
132363
|
unusedBalance,
|
|
@@ -130810,7 +132374,9 @@ spurious results.`);
|
|
|
130810
132374
|
pendingDeposit: extendedBalance?.pendingDeposit || new Web3Number(0, USDC_TOKEN_DECIMALS)
|
|
130811
132375
|
},
|
|
130812
132376
|
vesuPoolStates
|
|
130813
|
-
}
|
|
132377
|
+
};
|
|
132378
|
+
this._budget = createSolveBudgetFromRawState(data);
|
|
132379
|
+
const gaurdrailBudget = createSolveBudgetFromRawState({ ...data });
|
|
130814
132380
|
this._budget.logStateSummary();
|
|
130815
132381
|
const totalUnusedUsd = unusedBalance.reduce(
|
|
130816
132382
|
(acc, b2) => acc + b2.usdValue,
|
|
@@ -130819,6 +132385,7 @@ spurious results.`);
|
|
|
130819
132385
|
logger2.info(
|
|
130820
132386
|
`${this._tag}::_refresh completed \u2014 unusedBalances: ${unusedBalance.length} tokens [${unusedBalance.map((b2) => `${b2.token.symbol}=$${b2.usdValue.toFixed(2)}`).join(", ")}], totalUnusedUsd: ${totalUnusedUsd.toFixed(2)}, extendedPositions: ${extendedPositions.length} [${extendedPositions.map((p) => `${p.instrument}=${p.size.toFixed(6)} ${p.side}, ${p.valueUsd.toFixed(6)} ${p.instrument}`).join(", ")}], vesuPools: ${vesuPoolStates.length} [${vesuPoolStates.map((p) => `${p.poolId.shortString()}=${p.debtAmount.toFixed(6)} ${p.debtToken.symbol}, ${p.collateralAmount.toFixed(6)} ${p.collateralToken.symbol}`).join(", ")}], availableForTrade: ${extendedBalance?.availableForTrade.toNumber()} - availableForWithdrawal: ${extendedBalance?.availableForWithdrawal.toNumber()} - unrealisedPnl: ${extendedBalance?.unrealisedPnl.toNumber()} - extendedBalance::balance: ${extendedBalance?.balance.toNumber()} - extendedBalance::pendingDeposit: ${extendedBalance?.pendingDeposit.toNumber()} - extendedBalance::equity: ${extendedBalance?.equity.toNumber()}`
|
|
130821
132387
|
);
|
|
132388
|
+
return gaurdrailBudget;
|
|
130822
132389
|
}
|
|
130823
132390
|
// todo add communication check with python server of extended. if not working, throw error in solve function.
|
|
130824
132391
|
/** True when strategy asset and USDC share one token — VA idle balance is tracked as USDC, not as asset. */
|