@gainsnetwork/sdk 1.5.0-rc6 → 1.6.0-rc2

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.
@@ -67,6 +67,11 @@ const _abi = [
67
67
  name: "InvalidAddresses",
68
68
  type: "error",
69
69
  },
70
+ {
71
+ inputs: [],
72
+ name: "InvalidAmount",
73
+ type: "error",
74
+ },
70
75
  {
71
76
  inputs: [],
72
77
  name: "InvalidCollateralIndex",
@@ -3050,6 +3055,11 @@ const _abi = [
3050
3055
  name: "PointsOverflow",
3051
3056
  type: "error",
3052
3057
  },
3058
+ {
3059
+ inputs: [],
3060
+ name: "StakingCooldownActive",
3061
+ type: "error",
3062
+ },
3053
3063
  {
3054
3064
  inputs: [],
3055
3065
  name: "WrongFeeTier",
@@ -3087,6 +3097,130 @@ const _abi = [
3087
3097
  type: "event",
3088
3098
  signature: "0xa6ec87cc1a516d9ebb5c03260f77d2bd8c22dc8d28d71e740b320fbd4d704131",
3089
3099
  },
3100
+ {
3101
+ anonymous: false,
3102
+ inputs: [
3103
+ {
3104
+ indexed: true,
3105
+ internalType: "address",
3106
+ name: "trader",
3107
+ type: "address",
3108
+ },
3109
+ {
3110
+ indexed: false,
3111
+ internalType: "uint88",
3112
+ name: "amountGns",
3113
+ type: "uint88",
3114
+ },
3115
+ {
3116
+ indexed: false,
3117
+ internalType: "uint88",
3118
+ name: "amountVaultGns",
3119
+ type: "uint88",
3120
+ },
3121
+ ],
3122
+ name: "GnsStaked",
3123
+ type: "event",
3124
+ signature: "0x1572ab8bd4939834be841ad61814e46728c8626304444e4fe13785ec0d316e80",
3125
+ },
3126
+ {
3127
+ anonymous: false,
3128
+ inputs: [
3129
+ {
3130
+ indexed: false,
3131
+ internalType: "address[]",
3132
+ name: "traders",
3133
+ type: "address[]",
3134
+ },
3135
+ {
3136
+ indexed: false,
3137
+ internalType: "uint24[]",
3138
+ name: "bonusAmounts",
3139
+ type: "uint24[]",
3140
+ },
3141
+ ],
3142
+ name: "GnsStakingBonusUpdated",
3143
+ type: "event",
3144
+ signature: "0xfa08bbe7335087f9f4d2c27dca8b1312c8a8195db34979a83bb2d463a97279be",
3145
+ },
3146
+ {
3147
+ anonymous: false,
3148
+ inputs: [
3149
+ {
3150
+ indexed: true,
3151
+ internalType: "address",
3152
+ name: "trader",
3153
+ type: "address",
3154
+ },
3155
+ {
3156
+ indexed: false,
3157
+ internalType: "uint32",
3158
+ name: "feeMultiplier",
3159
+ type: "uint32",
3160
+ },
3161
+ ],
3162
+ name: "GnsStakingFeeMultiplierCached",
3163
+ type: "event",
3164
+ signature: "0xa9fbb96ba38987da4f58bd420ebbdc55816bc5e540af63d12405534a196ad864",
3165
+ },
3166
+ {
3167
+ anonymous: false,
3168
+ inputs: [
3169
+ {
3170
+ indexed: false,
3171
+ internalType: "uint256[]",
3172
+ name: "indices",
3173
+ type: "uint256[]",
3174
+ },
3175
+ {
3176
+ components: [
3177
+ {
3178
+ internalType: "uint32",
3179
+ name: "feeMultiplier",
3180
+ type: "uint32",
3181
+ },
3182
+ {
3183
+ internalType: "uint32",
3184
+ name: "pointsThreshold",
3185
+ type: "uint32",
3186
+ },
3187
+ ],
3188
+ indexed: false,
3189
+ internalType: "struct IFeeTiers.FeeTier[]",
3190
+ name: "tiers",
3191
+ type: "tuple[]",
3192
+ },
3193
+ ],
3194
+ name: "GnsStakingTiersUpdated",
3195
+ type: "event",
3196
+ signature: "0x40afc8b8f728c4a695936b6bfe036bb178dbd8a6dd6e3d63e5e4d412c81d0456",
3197
+ },
3198
+ {
3199
+ anonymous: false,
3200
+ inputs: [
3201
+ {
3202
+ indexed: true,
3203
+ internalType: "address",
3204
+ name: "trader",
3205
+ type: "address",
3206
+ },
3207
+ {
3208
+ indexed: false,
3209
+ internalType: "uint88",
3210
+ name: "amountGns",
3211
+ type: "uint88",
3212
+ },
3213
+ {
3214
+ indexed: false,
3215
+ internalType: "uint88",
3216
+ name: "amountVaultGns",
3217
+ type: "uint88",
3218
+ },
3219
+ ],
3220
+ name: "GnsUnstaked",
3221
+ type: "event",
3222
+ signature: "0x763947071ca0263b300ff705128fd0dce3e2c0760f6c39d599db3bca2b6ba676",
3223
+ },
3090
3224
  {
3091
3225
  anonymous: false,
3092
3226
  inputs: [
@@ -3333,6 +3467,20 @@ const _abi = [
3333
3467
  type: "event",
3334
3468
  signature: "0x8b1dd1669c243ea81885b90c31d292a58996045d48bd261b3aea98a09cd66f1e",
3335
3469
  },
3470
+ {
3471
+ anonymous: false,
3472
+ inputs: [
3473
+ {
3474
+ indexed: false,
3475
+ internalType: "bool",
3476
+ name: "newValue",
3477
+ type: "bool",
3478
+ },
3479
+ ],
3480
+ name: "UseGnsVaultBalanceUpdated",
3481
+ type: "event",
3482
+ signature: "0x3282cd4f9f91a1fc19b31cc01b7134108206936b80c54493edc3b75ab7ac68ae",
3483
+ },
3336
3484
  {
3337
3485
  inputs: [
3338
3486
  {
@@ -3414,6 +3562,32 @@ const _abi = [
3414
3562
  type: "function",
3415
3563
  signature: "0xeccea3e2",
3416
3564
  },
3565
+ {
3566
+ inputs: [],
3567
+ name: "getFeeTiers",
3568
+ outputs: [
3569
+ {
3570
+ components: [
3571
+ {
3572
+ internalType: "uint32",
3573
+ name: "feeMultiplier",
3574
+ type: "uint32",
3575
+ },
3576
+ {
3577
+ internalType: "uint32",
3578
+ name: "pointsThreshold",
3579
+ type: "uint32",
3580
+ },
3581
+ ],
3582
+ internalType: "struct IFeeTiers.FeeTier[]",
3583
+ name: "",
3584
+ type: "tuple[]",
3585
+ },
3586
+ ],
3587
+ stateMutability: "view",
3588
+ type: "function",
3589
+ signature: "0xe9a4d24f",
3590
+ },
3417
3591
  {
3418
3592
  inputs: [],
3419
3593
  name: "getFeeTiersCount",
@@ -3497,6 +3671,186 @@ const _abi = [
3497
3671
  type: "function",
3498
3672
  signature: "0xacbaaf33",
3499
3673
  },
3674
+ {
3675
+ inputs: [
3676
+ {
3677
+ internalType: "address",
3678
+ name: "_trader",
3679
+ type: "address",
3680
+ },
3681
+ ],
3682
+ name: "getGnsStakingInfo",
3683
+ outputs: [
3684
+ {
3685
+ components: [
3686
+ {
3687
+ internalType: "uint88",
3688
+ name: "stakedGns",
3689
+ type: "uint88",
3690
+ },
3691
+ {
3692
+ internalType: "uint88",
3693
+ name: "stakedVaultGns",
3694
+ type: "uint88",
3695
+ },
3696
+ {
3697
+ internalType: "uint24",
3698
+ name: "bonusAmount",
3699
+ type: "uint24",
3700
+ },
3701
+ {
3702
+ internalType: "uint32",
3703
+ name: "stakeTimestamp",
3704
+ type: "uint32",
3705
+ },
3706
+ {
3707
+ internalType: "uint32",
3708
+ name: "feeMultiplierCache",
3709
+ type: "uint32",
3710
+ },
3711
+ ],
3712
+ internalType: "struct IFeeTiers.GnsStakingInfo",
3713
+ name: "",
3714
+ type: "tuple",
3715
+ },
3716
+ ],
3717
+ stateMutability: "view",
3718
+ type: "function",
3719
+ signature: "0xe7546b44",
3720
+ },
3721
+ {
3722
+ inputs: [
3723
+ {
3724
+ internalType: "address[]",
3725
+ name: "_traders",
3726
+ type: "address[]",
3727
+ },
3728
+ ],
3729
+ name: "getGnsStakingInfos",
3730
+ outputs: [
3731
+ {
3732
+ components: [
3733
+ {
3734
+ internalType: "uint88",
3735
+ name: "stakedGns",
3736
+ type: "uint88",
3737
+ },
3738
+ {
3739
+ internalType: "uint88",
3740
+ name: "stakedVaultGns",
3741
+ type: "uint88",
3742
+ },
3743
+ {
3744
+ internalType: "uint24",
3745
+ name: "bonusAmount",
3746
+ type: "uint24",
3747
+ },
3748
+ {
3749
+ internalType: "uint32",
3750
+ name: "stakeTimestamp",
3751
+ type: "uint32",
3752
+ },
3753
+ {
3754
+ internalType: "uint32",
3755
+ name: "feeMultiplierCache",
3756
+ type: "uint32",
3757
+ },
3758
+ ],
3759
+ internalType: "struct IFeeTiers.GnsStakingInfo[]",
3760
+ name: "",
3761
+ type: "tuple[]",
3762
+ },
3763
+ ],
3764
+ stateMutability: "view",
3765
+ type: "function",
3766
+ signature: "0x84d2ba26",
3767
+ },
3768
+ {
3769
+ inputs: [
3770
+ {
3771
+ internalType: "uint256",
3772
+ name: "_tierIndex",
3773
+ type: "uint256",
3774
+ },
3775
+ ],
3776
+ name: "getGnsStakingTier",
3777
+ outputs: [
3778
+ {
3779
+ components: [
3780
+ {
3781
+ internalType: "uint32",
3782
+ name: "feeMultiplier",
3783
+ type: "uint32",
3784
+ },
3785
+ {
3786
+ internalType: "uint32",
3787
+ name: "pointsThreshold",
3788
+ type: "uint32",
3789
+ },
3790
+ ],
3791
+ internalType: "struct IFeeTiers.FeeTier",
3792
+ name: "",
3793
+ type: "tuple",
3794
+ },
3795
+ ],
3796
+ stateMutability: "view",
3797
+ type: "function",
3798
+ signature: "0x5d839b43",
3799
+ },
3800
+ {
3801
+ inputs: [],
3802
+ name: "getGnsStakingTiers",
3803
+ outputs: [
3804
+ {
3805
+ components: [
3806
+ {
3807
+ internalType: "uint32",
3808
+ name: "feeMultiplier",
3809
+ type: "uint32",
3810
+ },
3811
+ {
3812
+ internalType: "uint32",
3813
+ name: "pointsThreshold",
3814
+ type: "uint32",
3815
+ },
3816
+ ],
3817
+ internalType: "struct IFeeTiers.FeeTier[]",
3818
+ name: "",
3819
+ type: "tuple[]",
3820
+ },
3821
+ ],
3822
+ stateMutability: "view",
3823
+ type: "function",
3824
+ signature: "0x394a0319",
3825
+ },
3826
+ {
3827
+ inputs: [],
3828
+ name: "getGnsStakingTiersCount",
3829
+ outputs: [
3830
+ {
3831
+ internalType: "uint256",
3832
+ name: "",
3833
+ type: "uint256",
3834
+ },
3835
+ ],
3836
+ stateMutability: "view",
3837
+ type: "function",
3838
+ signature: "0xdb9f024c",
3839
+ },
3840
+ {
3841
+ inputs: [],
3842
+ name: "getGnsVaultAddress",
3843
+ outputs: [
3844
+ {
3845
+ internalType: "address",
3846
+ name: "",
3847
+ type: "address",
3848
+ },
3849
+ ],
3850
+ stateMutability: "view",
3851
+ type: "function",
3852
+ signature: "0x65e1672a",
3853
+ },
3500
3854
  {
3501
3855
  inputs: [
3502
3856
  {
@@ -3517,6 +3871,46 @@ const _abi = [
3517
3871
  type: "function",
3518
3872
  signature: "0x31ca4887",
3519
3873
  },
3874
+ {
3875
+ inputs: [
3876
+ {
3877
+ internalType: "uint256[]",
3878
+ name: "_groupIndices",
3879
+ type: "uint256[]",
3880
+ },
3881
+ ],
3882
+ name: "getGroupVolumeMultipliers",
3883
+ outputs: [
3884
+ {
3885
+ internalType: "uint256[]",
3886
+ name: "",
3887
+ type: "uint256[]",
3888
+ },
3889
+ ],
3890
+ stateMutability: "view",
3891
+ type: "function",
3892
+ signature: "0x1c1fd1c9",
3893
+ },
3894
+ {
3895
+ inputs: [
3896
+ {
3897
+ internalType: "uint88",
3898
+ name: "_stakedVaultGns",
3899
+ type: "uint88",
3900
+ },
3901
+ ],
3902
+ name: "getStakedVaultGnsValue",
3903
+ outputs: [
3904
+ {
3905
+ internalType: "uint256",
3906
+ name: "",
3907
+ type: "uint256",
3908
+ },
3909
+ ],
3910
+ stateMutability: "view",
3911
+ type: "function",
3912
+ signature: "0x49e06735",
3913
+ },
3520
3914
  {
3521
3915
  inputs: [
3522
3916
  {
@@ -3569,6 +3963,20 @@ const _abi = [
3569
3963
  type: "function",
3570
3964
  signature: "0x84e3ebe2",
3571
3965
  },
3966
+ {
3967
+ inputs: [],
3968
+ name: "getUseGnsVaultBalance",
3969
+ outputs: [
3970
+ {
3971
+ internalType: "bool",
3972
+ name: "",
3973
+ type: "bool",
3974
+ },
3975
+ ],
3976
+ stateMutability: "view",
3977
+ type: "function",
3978
+ signature: "0x0e6d35df",
3979
+ },
3572
3980
  {
3573
3981
  inputs: [
3574
3982
  {
@@ -3610,6 +4018,47 @@ const _abi = [
3610
4018
  type: "function",
3611
4019
  signature: "0x33534de2",
3612
4020
  },
4021
+ {
4022
+ inputs: [
4023
+ {
4024
+ internalType: "uint256[]",
4025
+ name: "_tierIndices",
4026
+ type: "uint256[]",
4027
+ },
4028
+ {
4029
+ components: [
4030
+ {
4031
+ internalType: "uint32",
4032
+ name: "feeMultiplier",
4033
+ type: "uint32",
4034
+ },
4035
+ {
4036
+ internalType: "uint32",
4037
+ name: "pointsThreshold",
4038
+ type: "uint32",
4039
+ },
4040
+ ],
4041
+ internalType: "struct IFeeTiers.FeeTier[]",
4042
+ name: "_tiers",
4043
+ type: "tuple[]",
4044
+ },
4045
+ {
4046
+ internalType: "address",
4047
+ name: "_gnsVaultAddress",
4048
+ type: "address",
4049
+ },
4050
+ {
4051
+ internalType: "bool",
4052
+ name: "_useGnsVaultBalance",
4053
+ type: "bool",
4054
+ },
4055
+ ],
4056
+ name: "initializeGnsStakingTiers",
4057
+ outputs: [],
4058
+ stateMutability: "nonpayable",
4059
+ type: "function",
4060
+ signature: "0x46947b62",
4061
+ },
3613
4062
  {
3614
4063
  inputs: [
3615
4064
  {
@@ -3641,6 +4090,56 @@ const _abi = [
3641
4090
  type: "function",
3642
4091
  signature: "0xeced5249",
3643
4092
  },
4093
+ {
4094
+ inputs: [
4095
+ {
4096
+ internalType: "address[]",
4097
+ name: "_traders",
4098
+ type: "address[]",
4099
+ },
4100
+ {
4101
+ internalType: "uint24[]",
4102
+ name: "_bonusAmounts",
4103
+ type: "uint24[]",
4104
+ },
4105
+ ],
4106
+ name: "setGnsStakingBonusAmounts",
4107
+ outputs: [],
4108
+ stateMutability: "nonpayable",
4109
+ type: "function",
4110
+ signature: "0x6d221a5e",
4111
+ },
4112
+ {
4113
+ inputs: [
4114
+ {
4115
+ internalType: "uint256[]",
4116
+ name: "_tierIndices",
4117
+ type: "uint256[]",
4118
+ },
4119
+ {
4120
+ components: [
4121
+ {
4122
+ internalType: "uint32",
4123
+ name: "feeMultiplier",
4124
+ type: "uint32",
4125
+ },
4126
+ {
4127
+ internalType: "uint32",
4128
+ name: "pointsThreshold",
4129
+ type: "uint32",
4130
+ },
4131
+ ],
4132
+ internalType: "struct IFeeTiers.FeeTier[]",
4133
+ name: "_tiers",
4134
+ type: "tuple[]",
4135
+ },
4136
+ ],
4137
+ name: "setGnsStakingTiers",
4138
+ outputs: [],
4139
+ stateMutability: "nonpayable",
4140
+ type: "function",
4141
+ signature: "0xdf877dc3",
4142
+ },
3644
4143
  {
3645
4144
  inputs: [
3646
4145
  {
@@ -3691,6 +4190,72 @@ const _abi = [
3691
4190
  type: "function",
3692
4191
  signature: "0x88f16bd1",
3693
4192
  },
4193
+ {
4194
+ inputs: [
4195
+ {
4196
+ internalType: "bool",
4197
+ name: "_useGnsVaultBalance",
4198
+ type: "bool",
4199
+ },
4200
+ ],
4201
+ name: "setUseGnsVaultBalance",
4202
+ outputs: [],
4203
+ stateMutability: "nonpayable",
4204
+ type: "function",
4205
+ signature: "0x0c80b352",
4206
+ },
4207
+ {
4208
+ inputs: [
4209
+ {
4210
+ internalType: "uint88",
4211
+ name: "_amountGns",
4212
+ type: "uint88",
4213
+ },
4214
+ {
4215
+ internalType: "uint88",
4216
+ name: "_amountVaultGns",
4217
+ type: "uint88",
4218
+ },
4219
+ ],
4220
+ name: "stakeGns",
4221
+ outputs: [],
4222
+ stateMutability: "nonpayable",
4223
+ type: "function",
4224
+ signature: "0x0470a632",
4225
+ },
4226
+ {
4227
+ inputs: [
4228
+ {
4229
+ internalType: "address[]",
4230
+ name: "_traders",
4231
+ type: "address[]",
4232
+ },
4233
+ ],
4234
+ name: "syncGnsStakingTiers",
4235
+ outputs: [],
4236
+ stateMutability: "nonpayable",
4237
+ type: "function",
4238
+ signature: "0x6c2c263c",
4239
+ },
4240
+ {
4241
+ inputs: [
4242
+ {
4243
+ internalType: "uint88",
4244
+ name: "_amountGns",
4245
+ type: "uint88",
4246
+ },
4247
+ {
4248
+ internalType: "uint88",
4249
+ name: "_amountVaultGns",
4250
+ type: "uint88",
4251
+ },
4252
+ ],
4253
+ name: "unstakeGns",
4254
+ outputs: [],
4255
+ stateMutability: "nonpayable",
4256
+ type: "function",
4257
+ signature: "0xb7f46fe6",
4258
+ },
3694
4259
  {
3695
4260
  inputs: [
3696
4261
  {
@@ -3,7 +3,7 @@
3
3
  * @dev All BigNumber values are normalized to floats with appropriate precision
4
4
  */
5
5
  import { IFeeTiers } from "../../../contracts/types/generated/GNSMultiCollatDiamond";
6
- import { FeeTier, TraderInfo, TraderEnrollment } from "./types";
6
+ import { FeeTier, TraderInfo, TraderEnrollment, StakingInfo } from "./types";
7
7
  /**
8
8
  * @dev Converts contract fee tier data to SDK format
9
9
  * @param contractData Contract FeeTier struct
@@ -28,27 +28,37 @@ export declare const convertTraderInfo: (contractData: IFeeTiers.TraderInfoStruc
28
28
  * @returns Normalized trader enrollment
29
29
  */
30
30
  export declare const convertTraderEnrollment: (contractData: IFeeTiers.TraderEnrollmentStructOutput) => TraderEnrollment;
31
+ /**
32
+ * @dev Converts contract gns staking info to SDK format
33
+ * @param contractData Contract GnsStakingInfo struct
34
+ * @returns Normalized gns staking info
35
+ */
36
+ export declare const convertStakingInfo: (contractData: IFeeTiers.GnsStakingInfoStructOutput) => StakingInfo;
31
37
  /**
32
38
  * @dev Converts the complete fee tiers configuration from contract format
33
- * @param tiers Array of fee tiers from contract
39
+ * @param tiers Array of volume fee tiers from contract
34
40
  * @param groupVolumeMultipliers Array of group volume multipliers
35
41
  * @param currentDay Current day from contract
42
+ * @param stakingTiers Array of staking fee tiers from contract
36
43
  * @returns Complete fee tiers configuration
37
44
  */
38
- export declare const convertFeeTiersConfig: (tiers: IFeeTiers.FeeTierStructOutput[], groupVolumeMultipliers: readonly bigint[], currentDay: bigint) => {
45
+ export declare const convertFeeTiersConfig: (tiers: IFeeTiers.FeeTierStructOutput[], groupVolumeMultipliers: readonly bigint[], currentDay: bigint, stakingTiers: IFeeTiers.FeeTierStructOutput[]) => {
39
46
  tiers: FeeTier[];
40
47
  groupVolumeMultipliers: number[];
41
48
  currentDay: number;
49
+ stakingTiers: FeeTier[];
42
50
  };
43
51
  /**
44
- * @dev Converts trader's fee tier data from contract format
52
+ * @dev Converts trader's volume and staking fee tier data from contract format
45
53
  * @param traderInfo Trader info from contract
46
54
  * @param traderDailyInfo Array of daily points info
47
55
  * @param traderEnrollment Enrollment status from contract
48
- * @returns Complete trader fee tier data
56
+ * @param stakingInfo Staking info from contract
57
+ * @returns Complete trader volume and staking fee tier data
49
58
  */
50
- export declare const convertTraderFeeTiersData: (traderInfo: IFeeTiers.TraderInfoStructOutput, traderDailyInfo: readonly bigint[], traderEnrollment: IFeeTiers.TraderEnrollmentStructOutput) => {
59
+ export declare const convertTraderFeeTiersData: (traderInfo: IFeeTiers.TraderInfoStructOutput, traderDailyInfo: readonly bigint[], traderEnrollment: IFeeTiers.TraderEnrollmentStructOutput, stakingInfo: IFeeTiers.GnsStakingInfoStructOutput) => {
51
60
  traderInfo: TraderInfo;
52
61
  dailyPoints: number[];
53
62
  traderEnrollment: TraderEnrollment;
63
+ stakingInfo: StakingInfo;
54
64
  };