@kasarlabs/vesu-mcp 0.1.2 → 0.1.4
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/build/index.js +86 -6
- package/build/index.js.map +1 -1
- package/build/interfaces/index.d.ts +661 -8
- package/build/interfaces/index.js +57 -1
- package/build/interfaces/index.js.map +1 -1
- package/build/lib/abis/ekuboCore.d.ts +92 -0
- package/build/lib/abis/ekuboCore.js +1341 -0
- package/build/lib/abis/ekuboCore.js.map +1 -0
- package/build/lib/abis/multiplyAbi.d.ts +245 -0
- package/build/lib/abis/multiplyAbi.js +341 -0
- package/build/lib/abis/multiplyAbi.js.map +1 -0
- package/build/lib/abis/poolAbi.d.ts +289 -0
- package/build/lib/abis/poolAbi.js +402 -0
- package/build/lib/abis/poolAbi.js.map +1 -0
- package/build/lib/abis/routerAbi.d.ts +88 -0
- package/build/lib/abis/routerAbi.js +86 -0
- package/build/lib/abis/routerAbi.js.map +1 -0
- package/build/lib/constants/index.d.ts +9 -3
- package/build/lib/constants/index.js +8 -3
- package/build/lib/constants/index.js.map +1 -1
- package/build/lib/utils/contracts.d.ts +535 -89
- package/build/lib/utils/contracts.js +39 -5
- package/build/lib/utils/contracts.js.map +1 -1
- package/build/lib/utils/ekubo.d.ts +55 -0
- package/build/lib/utils/ekubo.js +81 -0
- package/build/lib/utils/ekubo.js.map +1 -0
- package/build/lib/utils/getEkuboQuote.d.ts +4 -0
- package/build/lib/utils/getEkuboQuote.js +116 -0
- package/build/lib/utils/getEkuboQuote.js.map +1 -0
- package/build/lib/utils/math.d.ts +8 -0
- package/build/lib/utils/math.js +22 -0
- package/build/lib/utils/math.js.map +1 -0
- package/build/lib/utils/multiplyCalls.d.ts +10 -0
- package/build/lib/utils/multiplyCalls.js +248 -0
- package/build/lib/utils/multiplyCalls.js.map +1 -0
- package/build/lib/utils/pools.d.ts +8 -0
- package/build/lib/utils/pools.js +72 -0
- package/build/lib/utils/pools.js.map +1 -0
- package/build/lib/utils/tokens.d.ts +6 -0
- package/build/lib/utils/tokens.js +23 -0
- package/build/lib/utils/tokens.js.map +1 -0
- package/build/schemas/index.d.ts +176 -0
- package/build/schemas/index.js +201 -1
- package/build/schemas/index.js.map +1 -1
- package/build/tools/read/getPools.d.ts +3 -0
- package/build/tools/read/getPools.js +57 -0
- package/build/tools/read/getPools.js.map +1 -0
- package/build/tools/read/getPositions.d.ts +3 -0
- package/build/tools/read/getPositions.js +43 -0
- package/build/tools/read/getPositions.js.map +1 -0
- package/build/tools/read/getTokens.d.ts +3 -0
- package/build/tools/read/getTokens.js +50 -0
- package/build/tools/read/getTokens.js.map +1 -0
- package/build/tools/write/deposit_borrow.d.ts +10 -0
- package/build/tools/write/deposit_borrow.js +312 -0
- package/build/tools/write/deposit_borrow.js.map +1 -0
- package/build/tools/write/deposit_earn.d.ts +10 -0
- package/build/tools/write/deposit_earn.js +82 -0
- package/build/tools/write/deposit_earn.js.map +1 -0
- package/build/tools/write/deposit_multiply.d.ts +10 -0
- package/build/tools/write/deposit_multiply.js +140 -0
- package/build/tools/write/deposit_multiply.js.map +1 -0
- package/build/tools/write/repay_borrow.d.ts +10 -0
- package/build/tools/write/repay_borrow.js +358 -0
- package/build/tools/write/repay_borrow.js.map +1 -0
- package/build/tools/write/update_multiply.d.ts +10 -0
- package/build/tools/write/update_multiply.js +264 -0
- package/build/tools/write/update_multiply.js.map +1 -0
- package/build/tools/write/withdraw_earn.d.ts +10 -0
- package/build/tools/write/withdraw_earn.js +116 -0
- package/build/tools/write/withdraw_earn.js.map +1 -0
- package/build/tools/write/withdraw_multiply.d.ts +9 -0
- package/build/tools/write/withdraw_multiply.js +187 -0
- package/build/tools/write/withdraw_multiply.js.map +1 -0
- package/package.json +6 -5
- package/build/lib/abis/erc20Abi.d.ts +0 -89
- package/build/lib/abis/erc20Abi.js +0 -128
- package/build/lib/abis/erc20Abi.js.map +0 -1
- package/build/tools/depositService.d.ts +0 -19
- package/build/tools/depositService.js +0 -117
- package/build/tools/depositService.js.map +0 -1
- package/build/tools/withdrawService.d.ts +0 -20
- package/build/tools/withdrawService.js +0 -122
- package/build/tools/withdrawService.js.map +0 -1
|
@@ -1,93 +1,5 @@
|
|
|
1
1
|
import { Address } from '../../interfaces/index.js';
|
|
2
|
-
export declare const getErc20Contract: (address: Address) => import("starknet").TypedContractV2<
|
|
3
|
-
readonly type: "function";
|
|
4
|
-
readonly name: "name";
|
|
5
|
-
readonly inputs: readonly [];
|
|
6
|
-
readonly outputs: readonly [{
|
|
7
|
-
readonly type: "core::felt252";
|
|
8
|
-
}];
|
|
9
|
-
readonly state_mutability: "view";
|
|
10
|
-
}, {
|
|
11
|
-
readonly type: "function";
|
|
12
|
-
readonly name: "symbol";
|
|
13
|
-
readonly inputs: readonly [];
|
|
14
|
-
readonly outputs: readonly [{
|
|
15
|
-
readonly type: "core::felt252";
|
|
16
|
-
}];
|
|
17
|
-
readonly state_mutability: "view";
|
|
18
|
-
}, {
|
|
19
|
-
readonly type: "function";
|
|
20
|
-
readonly name: "decimals";
|
|
21
|
-
readonly inputs: readonly [];
|
|
22
|
-
readonly outputs: readonly [{
|
|
23
|
-
readonly type: "core::integer::u8";
|
|
24
|
-
}];
|
|
25
|
-
readonly state_mutability: "view";
|
|
26
|
-
}, {
|
|
27
|
-
readonly type: "function";
|
|
28
|
-
readonly name: "balance_of";
|
|
29
|
-
readonly inputs: readonly [{
|
|
30
|
-
readonly name: "account";
|
|
31
|
-
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
32
|
-
}];
|
|
33
|
-
readonly outputs: readonly [{
|
|
34
|
-
readonly type: "core::integer::u256";
|
|
35
|
-
}];
|
|
36
|
-
readonly state_mutability: "view";
|
|
37
|
-
}, {
|
|
38
|
-
readonly type: "function";
|
|
39
|
-
readonly name: "balanceOf";
|
|
40
|
-
readonly inputs: readonly [{
|
|
41
|
-
readonly name: "account";
|
|
42
|
-
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
43
|
-
}];
|
|
44
|
-
readonly outputs: readonly [{
|
|
45
|
-
readonly type: "core::integer::u256";
|
|
46
|
-
}];
|
|
47
|
-
readonly state_mutability: "view";
|
|
48
|
-
}, {
|
|
49
|
-
readonly type: "function";
|
|
50
|
-
readonly name: "allowance";
|
|
51
|
-
readonly inputs: readonly [{
|
|
52
|
-
readonly name: "owner";
|
|
53
|
-
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
54
|
-
}, {
|
|
55
|
-
readonly name: "spender";
|
|
56
|
-
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
57
|
-
}];
|
|
58
|
-
readonly outputs: readonly [{
|
|
59
|
-
readonly type: "core::integer::u256";
|
|
60
|
-
}];
|
|
61
|
-
readonly state_mutability: "view";
|
|
62
|
-
}, {
|
|
63
|
-
readonly type: "function";
|
|
64
|
-
readonly name: "approve";
|
|
65
|
-
readonly inputs: readonly [{
|
|
66
|
-
readonly name: "spender";
|
|
67
|
-
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
68
|
-
}, {
|
|
69
|
-
readonly name: "amount";
|
|
70
|
-
readonly type: "core::integer::u256";
|
|
71
|
-
}];
|
|
72
|
-
readonly outputs: readonly [{
|
|
73
|
-
readonly type: "core::bool";
|
|
74
|
-
}];
|
|
75
|
-
readonly state_mutability: "external";
|
|
76
|
-
}, {
|
|
77
|
-
readonly type: "function";
|
|
78
|
-
readonly name: "transfer";
|
|
79
|
-
readonly inputs: readonly [{
|
|
80
|
-
readonly name: "recipient";
|
|
81
|
-
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
82
|
-
}, {
|
|
83
|
-
readonly name: "amount";
|
|
84
|
-
readonly type: "core::integer::u256";
|
|
85
|
-
}];
|
|
86
|
-
readonly outputs: readonly [{
|
|
87
|
-
readonly type: "core::bool";
|
|
88
|
-
}];
|
|
89
|
-
readonly state_mutability: "external";
|
|
90
|
-
}]>;
|
|
2
|
+
export declare const getErc20Contract: (address: Address) => import("starknet").TypedContractV2<any[]>;
|
|
91
3
|
export declare const getVTokenContract: (address: Address) => import("starknet").TypedContractV2<readonly [{
|
|
92
4
|
readonly name: "VToken";
|
|
93
5
|
readonly type: "impl";
|
|
@@ -3456,3 +3368,537 @@ export declare const getExtensionContract: (address: Address) => import("starkne
|
|
|
3456
3368
|
readonly type: "vesu::extension::default_extension::DefaultExtension::SetPoolOwner";
|
|
3457
3369
|
}];
|
|
3458
3370
|
}]>;
|
|
3371
|
+
export declare const getMultiplyContract: (address: Address) => import("starknet").TypedContractV2<readonly [{
|
|
3372
|
+
readonly name: "LockerImpl";
|
|
3373
|
+
readonly type: "impl";
|
|
3374
|
+
readonly interface_name: "ekubo::interfaces::core::ILocker";
|
|
3375
|
+
}, {
|
|
3376
|
+
readonly name: "core::array::Span::<core::felt252>";
|
|
3377
|
+
readonly type: "struct";
|
|
3378
|
+
readonly members: readonly [{
|
|
3379
|
+
readonly name: "snapshot";
|
|
3380
|
+
readonly type: "@core::array::Array::<core::felt252>";
|
|
3381
|
+
}];
|
|
3382
|
+
}, {
|
|
3383
|
+
readonly name: "ekubo::interfaces::core::ILocker";
|
|
3384
|
+
readonly type: "interface";
|
|
3385
|
+
readonly items: readonly [{
|
|
3386
|
+
readonly name: "locked";
|
|
3387
|
+
readonly type: "function";
|
|
3388
|
+
readonly inputs: readonly [{
|
|
3389
|
+
readonly name: "id";
|
|
3390
|
+
readonly type: "core::integer::u32";
|
|
3391
|
+
}, {
|
|
3392
|
+
readonly name: "data";
|
|
3393
|
+
readonly type: "core::array::Span::<core::felt252>";
|
|
3394
|
+
}];
|
|
3395
|
+
readonly outputs: readonly [{
|
|
3396
|
+
readonly type: "core::array::Span::<core::felt252>";
|
|
3397
|
+
}];
|
|
3398
|
+
readonly state_mutability: "external";
|
|
3399
|
+
}];
|
|
3400
|
+
}, {
|
|
3401
|
+
readonly name: "MultiplyImpl";
|
|
3402
|
+
readonly type: "impl";
|
|
3403
|
+
readonly interface_name: "vesu_v2_periphery::multiply::IMultiply";
|
|
3404
|
+
}, {
|
|
3405
|
+
readonly name: "ekubo::types::keys::PoolKey";
|
|
3406
|
+
readonly type: "struct";
|
|
3407
|
+
readonly members: readonly [{
|
|
3408
|
+
readonly name: "token0";
|
|
3409
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3410
|
+
}, {
|
|
3411
|
+
readonly name: "token1";
|
|
3412
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3413
|
+
}, {
|
|
3414
|
+
readonly name: "fee";
|
|
3415
|
+
readonly type: "core::integer::u128";
|
|
3416
|
+
}, {
|
|
3417
|
+
readonly name: "tick_spacing";
|
|
3418
|
+
readonly type: "core::integer::u128";
|
|
3419
|
+
}, {
|
|
3420
|
+
readonly name: "extension";
|
|
3421
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3422
|
+
}];
|
|
3423
|
+
}, {
|
|
3424
|
+
readonly name: "core::integer::u256";
|
|
3425
|
+
readonly type: "struct";
|
|
3426
|
+
readonly members: readonly [{
|
|
3427
|
+
readonly name: "low";
|
|
3428
|
+
readonly type: "core::integer::u128";
|
|
3429
|
+
}, {
|
|
3430
|
+
readonly name: "high";
|
|
3431
|
+
readonly type: "core::integer::u128";
|
|
3432
|
+
}];
|
|
3433
|
+
}, {
|
|
3434
|
+
readonly name: "vesu_v2_periphery::swap::RouteNode";
|
|
3435
|
+
readonly type: "struct";
|
|
3436
|
+
readonly members: readonly [{
|
|
3437
|
+
readonly name: "pool_key";
|
|
3438
|
+
readonly type: "ekubo::types::keys::PoolKey";
|
|
3439
|
+
}, {
|
|
3440
|
+
readonly name: "sqrt_ratio_limit";
|
|
3441
|
+
readonly type: "core::integer::u256";
|
|
3442
|
+
}, {
|
|
3443
|
+
readonly name: "skip_ahead";
|
|
3444
|
+
readonly type: "core::integer::u128";
|
|
3445
|
+
}];
|
|
3446
|
+
}, {
|
|
3447
|
+
readonly name: "core::bool";
|
|
3448
|
+
readonly type: "enum";
|
|
3449
|
+
readonly variants: readonly [{
|
|
3450
|
+
readonly name: "False";
|
|
3451
|
+
readonly type: "()";
|
|
3452
|
+
}, {
|
|
3453
|
+
readonly name: "True";
|
|
3454
|
+
readonly type: "()";
|
|
3455
|
+
}];
|
|
3456
|
+
}, {
|
|
3457
|
+
readonly name: "ekubo::types::i129::i129";
|
|
3458
|
+
readonly type: "struct";
|
|
3459
|
+
readonly members: readonly [{
|
|
3460
|
+
readonly name: "mag";
|
|
3461
|
+
readonly type: "core::integer::u128";
|
|
3462
|
+
}, {
|
|
3463
|
+
readonly name: "sign";
|
|
3464
|
+
readonly type: "core::bool";
|
|
3465
|
+
}];
|
|
3466
|
+
}, {
|
|
3467
|
+
readonly name: "vesu_v2_periphery::swap::TokenAmount";
|
|
3468
|
+
readonly type: "struct";
|
|
3469
|
+
readonly members: readonly [{
|
|
3470
|
+
readonly name: "token";
|
|
3471
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3472
|
+
}, {
|
|
3473
|
+
readonly name: "amount";
|
|
3474
|
+
readonly type: "ekubo::types::i129::i129";
|
|
3475
|
+
}];
|
|
3476
|
+
}, {
|
|
3477
|
+
readonly name: "vesu_v2_periphery::swap::Swap";
|
|
3478
|
+
readonly type: "struct";
|
|
3479
|
+
readonly members: readonly [{
|
|
3480
|
+
readonly name: "route";
|
|
3481
|
+
readonly type: "core::array::Array::<vesu_v2_periphery::swap::RouteNode>";
|
|
3482
|
+
}, {
|
|
3483
|
+
readonly name: "token_amount";
|
|
3484
|
+
readonly type: "vesu_v2_periphery::swap::TokenAmount";
|
|
3485
|
+
}];
|
|
3486
|
+
}, {
|
|
3487
|
+
readonly name: "vesu_v2_periphery::multiply::IncreaseLeverParams";
|
|
3488
|
+
readonly type: "struct";
|
|
3489
|
+
readonly members: readonly [{
|
|
3490
|
+
readonly name: "pool";
|
|
3491
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3492
|
+
}, {
|
|
3493
|
+
readonly name: "collateral_asset";
|
|
3494
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3495
|
+
}, {
|
|
3496
|
+
readonly name: "debt_asset";
|
|
3497
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3498
|
+
}, {
|
|
3499
|
+
readonly name: "user";
|
|
3500
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3501
|
+
}, {
|
|
3502
|
+
readonly name: "add_margin";
|
|
3503
|
+
readonly type: "core::integer::u128";
|
|
3504
|
+
}, {
|
|
3505
|
+
readonly name: "margin_swap";
|
|
3506
|
+
readonly type: "core::array::Array::<vesu_v2_periphery::swap::Swap>";
|
|
3507
|
+
}, {
|
|
3508
|
+
readonly name: "margin_swap_limit_amount";
|
|
3509
|
+
readonly type: "core::integer::u128";
|
|
3510
|
+
}, {
|
|
3511
|
+
readonly name: "lever_swap";
|
|
3512
|
+
readonly type: "core::array::Array::<vesu_v2_periphery::swap::Swap>";
|
|
3513
|
+
}, {
|
|
3514
|
+
readonly name: "lever_swap_limit_amount";
|
|
3515
|
+
readonly type: "core::integer::u128";
|
|
3516
|
+
}];
|
|
3517
|
+
}, {
|
|
3518
|
+
readonly name: "vesu_v2_periphery::multiply::DecreaseLeverParams";
|
|
3519
|
+
readonly type: "struct";
|
|
3520
|
+
readonly members: readonly [{
|
|
3521
|
+
readonly name: "pool";
|
|
3522
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3523
|
+
}, {
|
|
3524
|
+
readonly name: "collateral_asset";
|
|
3525
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3526
|
+
}, {
|
|
3527
|
+
readonly name: "debt_asset";
|
|
3528
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3529
|
+
}, {
|
|
3530
|
+
readonly name: "user";
|
|
3531
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3532
|
+
}, {
|
|
3533
|
+
readonly name: "sub_margin";
|
|
3534
|
+
readonly type: "core::integer::u128";
|
|
3535
|
+
}, {
|
|
3536
|
+
readonly name: "recipient";
|
|
3537
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3538
|
+
}, {
|
|
3539
|
+
readonly name: "lever_swap";
|
|
3540
|
+
readonly type: "core::array::Array::<vesu_v2_periphery::swap::Swap>";
|
|
3541
|
+
}, {
|
|
3542
|
+
readonly name: "lever_swap_limit_amount";
|
|
3543
|
+
readonly type: "core::integer::u128";
|
|
3544
|
+
}, {
|
|
3545
|
+
readonly name: "lever_swap_weights";
|
|
3546
|
+
readonly type: "core::array::Array::<core::integer::u128>";
|
|
3547
|
+
}, {
|
|
3548
|
+
readonly name: "withdraw_swap";
|
|
3549
|
+
readonly type: "core::array::Array::<vesu_v2_periphery::swap::Swap>";
|
|
3550
|
+
}, {
|
|
3551
|
+
readonly name: "withdraw_swap_limit_amount";
|
|
3552
|
+
readonly type: "core::integer::u128";
|
|
3553
|
+
}, {
|
|
3554
|
+
readonly name: "withdraw_swap_weights";
|
|
3555
|
+
readonly type: "core::array::Array::<core::integer::u128>";
|
|
3556
|
+
}, {
|
|
3557
|
+
readonly name: "close_position";
|
|
3558
|
+
readonly type: "core::bool";
|
|
3559
|
+
}];
|
|
3560
|
+
}, {
|
|
3561
|
+
readonly name: "vesu_v2_periphery::multiply::ModifyLeverAction";
|
|
3562
|
+
readonly type: "enum";
|
|
3563
|
+
readonly variants: readonly [{
|
|
3564
|
+
readonly name: "IncreaseLever";
|
|
3565
|
+
readonly type: "vesu_v2_periphery::multiply::IncreaseLeverParams";
|
|
3566
|
+
}, {
|
|
3567
|
+
readonly name: "DecreaseLever";
|
|
3568
|
+
readonly type: "vesu_v2_periphery::multiply::DecreaseLeverParams";
|
|
3569
|
+
}];
|
|
3570
|
+
}, {
|
|
3571
|
+
readonly name: "vesu_v2_periphery::multiply::ModifyLeverParams";
|
|
3572
|
+
readonly type: "struct";
|
|
3573
|
+
readonly members: readonly [{
|
|
3574
|
+
readonly name: "action";
|
|
3575
|
+
readonly type: "vesu_v2_periphery::multiply::ModifyLeverAction";
|
|
3576
|
+
}];
|
|
3577
|
+
}, {
|
|
3578
|
+
readonly name: "alexandria_math::i257::i257";
|
|
3579
|
+
readonly type: "struct";
|
|
3580
|
+
readonly members: readonly [{
|
|
3581
|
+
readonly name: "abs";
|
|
3582
|
+
readonly type: "core::integer::u256";
|
|
3583
|
+
}, {
|
|
3584
|
+
readonly name: "is_negative";
|
|
3585
|
+
readonly type: "core::bool";
|
|
3586
|
+
}];
|
|
3587
|
+
}, {
|
|
3588
|
+
readonly name: "vesu_v2_periphery::multiply::ModifyLeverResponse";
|
|
3589
|
+
readonly type: "struct";
|
|
3590
|
+
readonly members: readonly [{
|
|
3591
|
+
readonly name: "collateral_delta";
|
|
3592
|
+
readonly type: "alexandria_math::i257::i257";
|
|
3593
|
+
}, {
|
|
3594
|
+
readonly name: "debt_delta";
|
|
3595
|
+
readonly type: "alexandria_math::i257::i257";
|
|
3596
|
+
}, {
|
|
3597
|
+
readonly name: "margin_delta";
|
|
3598
|
+
readonly type: "alexandria_math::i257::i257";
|
|
3599
|
+
}];
|
|
3600
|
+
}, {
|
|
3601
|
+
readonly name: "vesu_v2_periphery::multiply::IMultiply";
|
|
3602
|
+
readonly type: "interface";
|
|
3603
|
+
readonly items: readonly [{
|
|
3604
|
+
readonly name: "modify_lever";
|
|
3605
|
+
readonly type: "function";
|
|
3606
|
+
readonly inputs: readonly [{
|
|
3607
|
+
readonly name: "modify_lever_params";
|
|
3608
|
+
readonly type: "vesu_v2_periphery::multiply::ModifyLeverParams";
|
|
3609
|
+
}];
|
|
3610
|
+
readonly outputs: readonly [{
|
|
3611
|
+
readonly type: "vesu_v2_periphery::multiply::ModifyLeverResponse";
|
|
3612
|
+
}];
|
|
3613
|
+
readonly state_mutability: "external";
|
|
3614
|
+
}];
|
|
3615
|
+
}]>;
|
|
3616
|
+
export declare const getPoolContract: (address: Address) => import("starknet").TypedContractV2<readonly [{
|
|
3617
|
+
readonly type: "impl";
|
|
3618
|
+
readonly name: "PoolImpl";
|
|
3619
|
+
readonly interface_name: "vesu::pool::IPool";
|
|
3620
|
+
}, {
|
|
3621
|
+
readonly type: "struct";
|
|
3622
|
+
readonly name: "core::integer::u256";
|
|
3623
|
+
readonly members: readonly [{
|
|
3624
|
+
readonly name: "low";
|
|
3625
|
+
readonly type: "core::integer::u128";
|
|
3626
|
+
}, {
|
|
3627
|
+
readonly name: "high";
|
|
3628
|
+
readonly type: "core::integer::u128";
|
|
3629
|
+
}];
|
|
3630
|
+
}, {
|
|
3631
|
+
readonly type: "enum";
|
|
3632
|
+
readonly name: "core::bool";
|
|
3633
|
+
readonly variants: readonly [{
|
|
3634
|
+
readonly name: "False";
|
|
3635
|
+
readonly type: "()";
|
|
3636
|
+
}, {
|
|
3637
|
+
readonly name: "True";
|
|
3638
|
+
readonly type: "()";
|
|
3639
|
+
}];
|
|
3640
|
+
}, {
|
|
3641
|
+
readonly type: "struct";
|
|
3642
|
+
readonly name: "vesu::data_model::AssetConfig";
|
|
3643
|
+
readonly members: readonly [{
|
|
3644
|
+
readonly name: "total_collateral_shares";
|
|
3645
|
+
readonly type: "core::integer::u256";
|
|
3646
|
+
}, {
|
|
3647
|
+
readonly name: "total_nominal_debt";
|
|
3648
|
+
readonly type: "core::integer::u256";
|
|
3649
|
+
}, {
|
|
3650
|
+
readonly name: "reserve";
|
|
3651
|
+
readonly type: "core::integer::u256";
|
|
3652
|
+
}, {
|
|
3653
|
+
readonly name: "max_utilization";
|
|
3654
|
+
readonly type: "core::integer::u256";
|
|
3655
|
+
}, {
|
|
3656
|
+
readonly name: "floor";
|
|
3657
|
+
readonly type: "core::integer::u256";
|
|
3658
|
+
}, {
|
|
3659
|
+
readonly name: "scale";
|
|
3660
|
+
readonly type: "core::integer::u256";
|
|
3661
|
+
}, {
|
|
3662
|
+
readonly name: "is_legacy";
|
|
3663
|
+
readonly type: "core::bool";
|
|
3664
|
+
}, {
|
|
3665
|
+
readonly name: "last_updated";
|
|
3666
|
+
readonly type: "core::integer::u64";
|
|
3667
|
+
}, {
|
|
3668
|
+
readonly name: "last_rate_accumulator";
|
|
3669
|
+
readonly type: "core::integer::u256";
|
|
3670
|
+
}, {
|
|
3671
|
+
readonly name: "last_full_utilization_rate";
|
|
3672
|
+
readonly type: "core::integer::u256";
|
|
3673
|
+
}, {
|
|
3674
|
+
readonly name: "fee_rate";
|
|
3675
|
+
readonly type: "core::integer::u256";
|
|
3676
|
+
}, {
|
|
3677
|
+
readonly name: "fee_shares";
|
|
3678
|
+
readonly type: "core::integer::u256";
|
|
3679
|
+
}];
|
|
3680
|
+
}, {
|
|
3681
|
+
readonly type: "struct";
|
|
3682
|
+
readonly name: "vesu::data_model::AssetPrice";
|
|
3683
|
+
readonly members: readonly [{
|
|
3684
|
+
readonly name: "value";
|
|
3685
|
+
readonly type: "core::integer::u256";
|
|
3686
|
+
}, {
|
|
3687
|
+
readonly name: "is_valid";
|
|
3688
|
+
readonly type: "core::bool";
|
|
3689
|
+
}];
|
|
3690
|
+
}, {
|
|
3691
|
+
readonly type: "struct";
|
|
3692
|
+
readonly name: "vesu::data_model::Position";
|
|
3693
|
+
readonly members: readonly [{
|
|
3694
|
+
readonly name: "collateral_shares";
|
|
3695
|
+
readonly type: "core::integer::u256";
|
|
3696
|
+
}, {
|
|
3697
|
+
readonly name: "nominal_debt";
|
|
3698
|
+
readonly type: "core::integer::u256";
|
|
3699
|
+
}];
|
|
3700
|
+
}, {
|
|
3701
|
+
readonly type: "struct";
|
|
3702
|
+
readonly name: "vesu::data_model::Context";
|
|
3703
|
+
readonly members: readonly [{
|
|
3704
|
+
readonly name: "collateral_asset";
|
|
3705
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3706
|
+
}, {
|
|
3707
|
+
readonly name: "debt_asset";
|
|
3708
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3709
|
+
}, {
|
|
3710
|
+
readonly name: "collateral_asset_config";
|
|
3711
|
+
readonly type: "vesu::data_model::AssetConfig";
|
|
3712
|
+
}, {
|
|
3713
|
+
readonly name: "debt_asset_config";
|
|
3714
|
+
readonly type: "vesu::data_model::AssetConfig";
|
|
3715
|
+
}, {
|
|
3716
|
+
readonly name: "collateral_asset_price";
|
|
3717
|
+
readonly type: "vesu::data_model::AssetPrice";
|
|
3718
|
+
}, {
|
|
3719
|
+
readonly name: "debt_asset_price";
|
|
3720
|
+
readonly type: "vesu::data_model::AssetPrice";
|
|
3721
|
+
}, {
|
|
3722
|
+
readonly name: "max_ltv";
|
|
3723
|
+
readonly type: "core::integer::u64";
|
|
3724
|
+
}, {
|
|
3725
|
+
readonly name: "user";
|
|
3726
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3727
|
+
}, {
|
|
3728
|
+
readonly name: "position";
|
|
3729
|
+
readonly type: "vesu::data_model::Position";
|
|
3730
|
+
}];
|
|
3731
|
+
}, {
|
|
3732
|
+
readonly type: "struct";
|
|
3733
|
+
readonly name: "alexandria_math::i257::i257";
|
|
3734
|
+
readonly members: readonly [{
|
|
3735
|
+
readonly name: "abs";
|
|
3736
|
+
readonly type: "core::integer::u256";
|
|
3737
|
+
}, {
|
|
3738
|
+
readonly name: "is_negative";
|
|
3739
|
+
readonly type: "core::bool";
|
|
3740
|
+
}];
|
|
3741
|
+
}, {
|
|
3742
|
+
readonly type: "enum";
|
|
3743
|
+
readonly name: "vesu::data_model::AmountDenomination";
|
|
3744
|
+
readonly variants: readonly [{
|
|
3745
|
+
readonly name: "Native";
|
|
3746
|
+
readonly type: "()";
|
|
3747
|
+
}, {
|
|
3748
|
+
readonly name: "Assets";
|
|
3749
|
+
readonly type: "()";
|
|
3750
|
+
}];
|
|
3751
|
+
}, {
|
|
3752
|
+
readonly type: "struct";
|
|
3753
|
+
readonly name: "vesu::data_model::Amount";
|
|
3754
|
+
readonly members: readonly [{
|
|
3755
|
+
readonly name: "denomination";
|
|
3756
|
+
readonly type: "vesu::data_model::AmountDenomination";
|
|
3757
|
+
}, {
|
|
3758
|
+
readonly name: "value";
|
|
3759
|
+
readonly type: "alexandria_math::i257::i257";
|
|
3760
|
+
}];
|
|
3761
|
+
}, {
|
|
3762
|
+
readonly type: "struct";
|
|
3763
|
+
readonly name: "vesu::data_model::ModifyPositionParams";
|
|
3764
|
+
readonly members: readonly [{
|
|
3765
|
+
readonly name: "collateral_asset";
|
|
3766
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3767
|
+
}, {
|
|
3768
|
+
readonly name: "debt_asset";
|
|
3769
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3770
|
+
}, {
|
|
3771
|
+
readonly name: "user";
|
|
3772
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3773
|
+
}, {
|
|
3774
|
+
readonly name: "collateral";
|
|
3775
|
+
readonly type: "vesu::data_model::Amount";
|
|
3776
|
+
}, {
|
|
3777
|
+
readonly name: "debt";
|
|
3778
|
+
readonly type: "vesu::data_model::Amount";
|
|
3779
|
+
}];
|
|
3780
|
+
}, {
|
|
3781
|
+
readonly type: "struct";
|
|
3782
|
+
readonly name: "vesu::data_model::UpdatePositionResponse";
|
|
3783
|
+
readonly members: readonly [{
|
|
3784
|
+
readonly name: "collateral_delta";
|
|
3785
|
+
readonly type: "alexandria_math::i257::i257";
|
|
3786
|
+
}, {
|
|
3787
|
+
readonly name: "collateral_shares_delta";
|
|
3788
|
+
readonly type: "alexandria_math::i257::i257";
|
|
3789
|
+
}, {
|
|
3790
|
+
readonly name: "debt_delta";
|
|
3791
|
+
readonly type: "alexandria_math::i257::i257";
|
|
3792
|
+
}, {
|
|
3793
|
+
readonly name: "nominal_debt_delta";
|
|
3794
|
+
readonly type: "alexandria_math::i257::i257";
|
|
3795
|
+
}, {
|
|
3796
|
+
readonly name: "bad_debt";
|
|
3797
|
+
readonly type: "core::integer::u256";
|
|
3798
|
+
}];
|
|
3799
|
+
}, {
|
|
3800
|
+
readonly type: "struct";
|
|
3801
|
+
readonly name: "vesu::data_model::LiquidatePositionParams";
|
|
3802
|
+
readonly members: readonly [{
|
|
3803
|
+
readonly name: "collateral_asset";
|
|
3804
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3805
|
+
}, {
|
|
3806
|
+
readonly name: "debt_asset";
|
|
3807
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3808
|
+
}, {
|
|
3809
|
+
readonly name: "user";
|
|
3810
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3811
|
+
}, {
|
|
3812
|
+
readonly name: "min_collateral_to_receive";
|
|
3813
|
+
readonly type: "core::integer::u256";
|
|
3814
|
+
}, {
|
|
3815
|
+
readonly name: "debt_to_repay";
|
|
3816
|
+
readonly type: "core::integer::u256";
|
|
3817
|
+
}];
|
|
3818
|
+
}, {
|
|
3819
|
+
readonly type: "struct";
|
|
3820
|
+
readonly name: "vesu::data_model::Pair";
|
|
3821
|
+
readonly members: readonly [{
|
|
3822
|
+
readonly name: "total_collateral_shares";
|
|
3823
|
+
readonly type: "core::integer::u256";
|
|
3824
|
+
}, {
|
|
3825
|
+
readonly name: "total_nominal_debt";
|
|
3826
|
+
readonly type: "core::integer::u256";
|
|
3827
|
+
}];
|
|
3828
|
+
}, {
|
|
3829
|
+
readonly type: "struct";
|
|
3830
|
+
readonly name: "vesu::data_model::PairConfig";
|
|
3831
|
+
readonly members: readonly [{
|
|
3832
|
+
readonly name: "max_ltv";
|
|
3833
|
+
readonly type: "core::integer::u64";
|
|
3834
|
+
}, {
|
|
3835
|
+
readonly name: "liquidation_factor";
|
|
3836
|
+
readonly type: "core::integer::u64";
|
|
3837
|
+
}, {
|
|
3838
|
+
readonly name: "debt_cap";
|
|
3839
|
+
readonly type: "core::integer::u128";
|
|
3840
|
+
}];
|
|
3841
|
+
}, {
|
|
3842
|
+
readonly type: "interface";
|
|
3843
|
+
readonly name: "vesu::pool::IPool";
|
|
3844
|
+
readonly items: readonly [{
|
|
3845
|
+
readonly type: "function";
|
|
3846
|
+
readonly name: "pair_config";
|
|
3847
|
+
readonly inputs: readonly [{
|
|
3848
|
+
readonly name: "collateral_asset";
|
|
3849
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3850
|
+
}, {
|
|
3851
|
+
readonly name: "debt_asset";
|
|
3852
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3853
|
+
}];
|
|
3854
|
+
readonly outputs: readonly [{
|
|
3855
|
+
readonly type: "vesu::data_model::PairConfig";
|
|
3856
|
+
}];
|
|
3857
|
+
readonly state_mutability: "view";
|
|
3858
|
+
}, {
|
|
3859
|
+
readonly type: "function";
|
|
3860
|
+
readonly name: "price";
|
|
3861
|
+
readonly inputs: readonly [{
|
|
3862
|
+
readonly name: "asset";
|
|
3863
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3864
|
+
}];
|
|
3865
|
+
readonly outputs: readonly [{
|
|
3866
|
+
readonly type: "vesu::data_model::AssetPrice";
|
|
3867
|
+
}];
|
|
3868
|
+
readonly state_mutability: "view";
|
|
3869
|
+
}, {
|
|
3870
|
+
readonly type: "function";
|
|
3871
|
+
readonly name: "asset_config";
|
|
3872
|
+
readonly inputs: readonly [{
|
|
3873
|
+
readonly name: "asset";
|
|
3874
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3875
|
+
}];
|
|
3876
|
+
readonly outputs: readonly [{
|
|
3877
|
+
readonly type: "vesu::data_model::AssetConfig";
|
|
3878
|
+
}];
|
|
3879
|
+
readonly state_mutability: "view";
|
|
3880
|
+
}, {
|
|
3881
|
+
readonly type: "function";
|
|
3882
|
+
readonly name: "modify_position";
|
|
3883
|
+
readonly inputs: readonly [{
|
|
3884
|
+
readonly name: "params";
|
|
3885
|
+
readonly type: "vesu::data_model::ModifyPositionParams";
|
|
3886
|
+
}];
|
|
3887
|
+
readonly outputs: readonly [{
|
|
3888
|
+
readonly type: "vesu::data_model::UpdatePositionResponse";
|
|
3889
|
+
}];
|
|
3890
|
+
readonly state_mutability: "external";
|
|
3891
|
+
}, {
|
|
3892
|
+
readonly type: "function";
|
|
3893
|
+
readonly name: "modify_delegation";
|
|
3894
|
+
readonly inputs: readonly [{
|
|
3895
|
+
readonly name: "delegatee";
|
|
3896
|
+
readonly type: "core::starknet::contract_address::ContractAddress";
|
|
3897
|
+
}, {
|
|
3898
|
+
readonly name: "delegation";
|
|
3899
|
+
readonly type: "core::bool";
|
|
3900
|
+
}];
|
|
3901
|
+
readonly outputs: readonly [];
|
|
3902
|
+
readonly state_mutability: "external";
|
|
3903
|
+
}];
|
|
3904
|
+
}]>;
|
|
@@ -2,21 +2,55 @@ import { Contract, RpcProvider } from 'starknet';
|
|
|
2
2
|
import { vTokenAbi } from '../abis/vTokenAbi.js';
|
|
3
3
|
import { singletonAbi } from '../abis/singletonAbi.js';
|
|
4
4
|
import { extensionAbi } from '../abis/extensionAbi.js';
|
|
5
|
-
import { erc20Abi } from '
|
|
5
|
+
import { erc20Abi } from '@kasarlabs/ask-starknet-core';
|
|
6
|
+
import { multiplyAbi } from '../abis/multiplyAbi.js';
|
|
7
|
+
import { poolAbi } from '../abis/poolAbi.js';
|
|
6
8
|
export const getErc20Contract = (address) => {
|
|
7
9
|
const provider = new RpcProvider({ nodeUrl: process.env.STARKNET_RPC_URL });
|
|
8
|
-
return new Contract(
|
|
10
|
+
return new Contract({
|
|
11
|
+
abi: erc20Abi,
|
|
12
|
+
address,
|
|
13
|
+
providerOrAccount: provider,
|
|
14
|
+
}).typedv2(erc20Abi);
|
|
9
15
|
};
|
|
10
16
|
export const getVTokenContract = (address) => {
|
|
11
17
|
const provider = new RpcProvider({ nodeUrl: process.env.STARKNET_RPC_URL });
|
|
12
|
-
return new Contract(
|
|
18
|
+
return new Contract({
|
|
19
|
+
abi: vTokenAbi,
|
|
20
|
+
address,
|
|
21
|
+
providerOrAccount: provider,
|
|
22
|
+
}).typedv2(vTokenAbi);
|
|
13
23
|
};
|
|
14
24
|
export const getSingletonContract = (address) => {
|
|
15
25
|
const provider = new RpcProvider({ nodeUrl: process.env.STARKNET_RPC_URL });
|
|
16
|
-
return new Contract(
|
|
26
|
+
return new Contract({
|
|
27
|
+
abi: singletonAbi,
|
|
28
|
+
address,
|
|
29
|
+
providerOrAccount: provider,
|
|
30
|
+
}).typedv2(singletonAbi);
|
|
17
31
|
};
|
|
18
32
|
export const getExtensionContract = (address) => {
|
|
19
33
|
const provider = new RpcProvider({ nodeUrl: process.env.STARKNET_RPC_URL });
|
|
20
|
-
return new Contract(
|
|
34
|
+
return new Contract({
|
|
35
|
+
abi: extensionAbi,
|
|
36
|
+
address,
|
|
37
|
+
providerOrAccount: provider,
|
|
38
|
+
}).typedv2(extensionAbi);
|
|
39
|
+
};
|
|
40
|
+
export const getMultiplyContract = (address) => {
|
|
41
|
+
const provider = new RpcProvider({ nodeUrl: process.env.STARKNET_RPC_URL });
|
|
42
|
+
return new Contract({
|
|
43
|
+
abi: multiplyAbi,
|
|
44
|
+
address,
|
|
45
|
+
providerOrAccount: provider,
|
|
46
|
+
}).typedv2(multiplyAbi);
|
|
47
|
+
};
|
|
48
|
+
export const getPoolContract = (address) => {
|
|
49
|
+
const provider = new RpcProvider({ nodeUrl: process.env.STARKNET_RPC_URL });
|
|
50
|
+
return new Contract({
|
|
51
|
+
abi: poolAbi,
|
|
52
|
+
address,
|
|
53
|
+
providerOrAccount: provider,
|
|
54
|
+
}).typedv2(poolAbi);
|
|
21
55
|
};
|
|
22
56
|
//# sourceMappingURL=contracts.js.map
|