@pendle/sdk-boros 0.1.35 → 0.1.37

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/README.md CHANGED
@@ -1,20 +1,36 @@
1
1
  # Pendle SDK Boros
2
2
 
3
- The `Exchange` class provides an interface for interacting with the Boros trading platform. It handles operations such as placing orders, modifying orders, managing positions, and interacting with the blockchain.
3
+ ## Overview
4
4
 
5
5
  Below is the documentation for the SDK. For more details about the overall architecture, contracts, API, and more, please refer to the [documentation](documentation/) folder.
6
6
 
7
+ The repository is organized as follows:
8
+
9
+ - [documentation](documentation/):
10
+ - [lite-paper](documentation/lite-paper.md): lite paper for how boros works
11
+ - [contracts-docs](documentation/contracts-docs/): contains the documentation to deep dive into the contracts, the overall architecture, and terminology
12
+ - [API.docs.md](documentation/API.docs.md): API documentation
13
+ - [SDK.docs.md](documentation/SDK.docs.md): SDK documentation
14
+ - [example](documentation/example/): example code for the SDK
15
+ - [src](src/): contains the source code of the SDK
16
+
7
17
  You can start with the [lite paper](documentation/lite-paper.md) to understand the overall architecture and mechanics of the platform.
18
+
8
19
  Then you can go to the [API docs](documentation/API.docs.md) to understand the API and parameters.
9
20
  After that, you can refer to [SDK docs](documentation/SDK.docs.md) and [example](documentation/example/) to see how to use the SDK.
10
21
 
11
22
  ## Installation
12
23
 
24
+ To use the SDK, you can install it using yarn. Our SDK is yet to be published to npm, so you need to config private credentials to install it. Can have a look at [.yarnrc.yml](.yarnrc.yml) for more details.
25
+
13
26
  ```bash
27
+ export PENDLE_SDK_BOROS_NPM_AUTH_TOKEN=<your-npm-auth-token>
28
+ # config your .yarnrc.yml follow our .yarnrc.yml file
29
+ # then install the package
14
30
  yarn add @pendle/sdk-boros
15
-
16
31
  ```
17
32
 
33
+
18
34
  ## Initialization
19
35
 
20
36
  ```typescript
@@ -1,3 +1,4 @@
1
1
  export * from './exchange';
2
2
  export * from './types';
3
3
  export * from './tickIndexPowMath';
4
+ export * from './utils';
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./exchange"), exports);
18
18
  __exportStar(require("./types"), exports);
19
19
  __exportStar(require("./tickIndexPowMath"), exports);
20
+ __exportStar(require("./utils"), exports);
20
21
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/exchange/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,0CAAwB;AACxB,qDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/entities/exchange/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6CAA2B;AAC3B,0CAAwB;AACxB,qDAAoC;AACpC,0CAAwB"}
@@ -1,4 +1,5 @@
1
- import { Hex, Log } from 'viem';
1
+ import { Address, Hex, Log, PublicClient } from 'viem';
2
+ import { SimulateReturnType } from 'viem/actions';
2
3
  export declare function parseEvents(txHash: Hex): Promise<{
3
4
  hub: import("viem").ParseEventLogsReturnType<readonly [{
4
5
  readonly anonymous: false;
@@ -2742,3 +2743,862 @@ export declare function decodeLog(log: Log<bigint, number, false>): {
2742
2743
  costOut: bigint;
2743
2744
  };
2744
2745
  } | null;
2746
+ export declare function getTransactionData(txHash: Hex): Promise<{
2747
+ decodedLogs: ({
2748
+ eventName: "CashTransfer";
2749
+ args: {
2750
+ from: `0x${string}`;
2751
+ to: `0x${string}`;
2752
+ amount: bigint;
2753
+ } | {
2754
+ from: `0x${string}`;
2755
+ to: `0x${string}`;
2756
+ amount: bigint;
2757
+ } | {
2758
+ from: `0x${string}`;
2759
+ to: `0x${string}`;
2760
+ amount: bigint;
2761
+ };
2762
+ } | {
2763
+ eventName: "CollectFee";
2764
+ args: {
2765
+ tokenId: number;
2766
+ amount: bigint;
2767
+ } | {
2768
+ tokenId: number;
2769
+ amount: bigint;
2770
+ } | {
2771
+ tokenId: number;
2772
+ amount: bigint;
2773
+ };
2774
+ } | {
2775
+ eventName: "EnterMarket";
2776
+ args: {
2777
+ user: `0x${string}`;
2778
+ marketId: number;
2779
+ } | {
2780
+ user: `0x${string}`;
2781
+ marketId: number;
2782
+ } | {
2783
+ user: `0x${string}`;
2784
+ marketId: number;
2785
+ };
2786
+ } | {
2787
+ eventName: "ExitMarket";
2788
+ args: {
2789
+ user: `0x${string}`;
2790
+ marketId: number;
2791
+ } | {
2792
+ user: `0x${string}`;
2793
+ marketId: number;
2794
+ } | {
2795
+ user: `0x${string}`;
2796
+ marketId: number;
2797
+ };
2798
+ } | {
2799
+ eventName: "MaxAllowedSubaccountUpdated";
2800
+ args: {
2801
+ root: `0x${string}`;
2802
+ maxAllowedSubaccountIdOld: number;
2803
+ maxAllowedSubaccountIdNew: number;
2804
+ } | {
2805
+ root: `0x${string}`;
2806
+ maxAllowedSubaccountIdOld: number;
2807
+ maxAllowedSubaccountIdNew: number;
2808
+ } | {
2809
+ root: `0x${string}`;
2810
+ maxAllowedSubaccountIdOld: number;
2811
+ maxAllowedSubaccountIdNew: number;
2812
+ };
2813
+ } | {
2814
+ eventName: "TokenAdded";
2815
+ args: {
2816
+ tokenId: number;
2817
+ tokenAddress: `0x${string}`;
2818
+ } | {
2819
+ tokenId: number;
2820
+ tokenAddress: `0x${string}`;
2821
+ } | {
2822
+ tokenId: number;
2823
+ tokenAddress: `0x${string}`;
2824
+ };
2825
+ } | {
2826
+ eventName: "VaultTransfer";
2827
+ args: {
2828
+ root: `0x${string}`;
2829
+ tokenId: number;
2830
+ unscaledAmount: bigint;
2831
+ } | {
2832
+ root: `0x${string}`;
2833
+ tokenId: number;
2834
+ unscaledAmount: bigint;
2835
+ } | {
2836
+ root: `0x${string}`;
2837
+ tokenId: number;
2838
+ unscaledAmount: bigint;
2839
+ };
2840
+ } | {
2841
+ eventName: "MarketCreated";
2842
+ args: {
2843
+ market: `0x${string}`;
2844
+ immData: {
2845
+ name: string;
2846
+ symbol: string;
2847
+ k_isIsolatedOnly: boolean;
2848
+ k_maturity: number;
2849
+ k_tokenId: number;
2850
+ k_marketId: number;
2851
+ k_tickStep: number;
2852
+ };
2853
+ config: {
2854
+ maxOpenOrders: number;
2855
+ markRateOracle: `0x${string}`;
2856
+ fIndexOracle: `0x${string}`;
2857
+ OICap: bigint;
2858
+ takerFee: bigint;
2859
+ otcFee: bigint;
2860
+ liqIncentive: {
2861
+ base: bigint;
2862
+ slope: bigint;
2863
+ };
2864
+ IMFactor: bigint;
2865
+ MMFactor: bigint;
2866
+ minMarginIndexRate: bigint;
2867
+ minMarginIndexDuration: number;
2868
+ };
2869
+ };
2870
+ } | {
2871
+ eventName: "AddLiquidityDualToAmm";
2872
+ args: {
2873
+ user: `0x${string}`;
2874
+ ammAddr: `0x${string}`;
2875
+ exactSizeIn: bigint;
2876
+ netLpOut: bigint;
2877
+ mintCashIn: bigint;
2878
+ netCashUsed: bigint;
2879
+ } | {
2880
+ user: `0x${string}`;
2881
+ ammAddr: `0x${string}`;
2882
+ exactSizeIn: bigint;
2883
+ netLpOut: bigint;
2884
+ mintCashIn: bigint;
2885
+ netCashUsed: bigint;
2886
+ } | {
2887
+ user: `0x${string}`;
2888
+ ammAddr: `0x${string}`;
2889
+ exactSizeIn: bigint;
2890
+ netLpOut: bigint;
2891
+ mintCashIn: bigint;
2892
+ netCashUsed: bigint;
2893
+ };
2894
+ } | {
2895
+ eventName: "AddLiquiditySingleCashToAmm";
2896
+ args: {
2897
+ user: `0x${string}`;
2898
+ ammAddr: `0x${string}`;
2899
+ netLpOut: bigint;
2900
+ netCashUsed: bigint;
2901
+ netSizeInterm: bigint;
2902
+ } | {
2903
+ user: `0x${string}`;
2904
+ ammAddr: `0x${string}`;
2905
+ netLpOut: bigint;
2906
+ netCashUsed: bigint;
2907
+ netSizeInterm: bigint;
2908
+ } | {
2909
+ user: `0x${string}`;
2910
+ ammAddr: `0x${string}`;
2911
+ netLpOut: bigint;
2912
+ netCashUsed: bigint;
2913
+ netSizeInterm: bigint;
2914
+ };
2915
+ } | {
2916
+ eventName: "AgentApproved";
2917
+ args: {
2918
+ account: `0x${string}`;
2919
+ agent: `0x${string}`;
2920
+ expiry: bigint;
2921
+ } | {
2922
+ account: `0x${string}`;
2923
+ agent: `0x${string}`;
2924
+ expiry: bigint;
2925
+ } | {
2926
+ account: `0x${string}`;
2927
+ agent: `0x${string}`;
2928
+ expiry: bigint;
2929
+ };
2930
+ } | {
2931
+ eventName: "AgentRevoked";
2932
+ args: {
2933
+ account: `0x${string}`;
2934
+ agent: `0x${string}`;
2935
+ } | {
2936
+ account: `0x${string}`;
2937
+ agent: `0x${string}`;
2938
+ } | {
2939
+ account: `0x${string}`;
2940
+ agent: `0x${string}`;
2941
+ };
2942
+ } | {
2943
+ eventName: "MarketIdAmmSet";
2944
+ args: {
2945
+ marketId: number;
2946
+ amm: `0x${string}`;
2947
+ };
2948
+ } | {
2949
+ eventName: "NewAccManagerSet";
2950
+ args: {
2951
+ account: `0x${string}`;
2952
+ newAccManager: `0x${string}`;
2953
+ } | {
2954
+ account: `0x${string}`;
2955
+ newAccManager: `0x${string}`;
2956
+ } | {
2957
+ account: `0x${string}`;
2958
+ newAccManager: `0x${string}`;
2959
+ };
2960
+ } | {
2961
+ eventName: "NumTicksToTryAtOnceUpdated";
2962
+ args: {
2963
+ newNumTicksToTryAtOnce: number;
2964
+ };
2965
+ } | {
2966
+ eventName: "RemoveLiquidityDualFromAmm";
2967
+ args: {
2968
+ user: `0x${string}`;
2969
+ ammAddr: `0x${string}`;
2970
+ lpToRemove: bigint;
2971
+ burnCashOut: bigint;
2972
+ netSizeOut: bigint;
2973
+ netCashOut: bigint;
2974
+ } | {
2975
+ user: `0x${string}`;
2976
+ ammAddr: `0x${string}`;
2977
+ lpToRemove: bigint;
2978
+ burnCashOut: bigint;
2979
+ netSizeOut: bigint;
2980
+ netCashOut: bigint;
2981
+ } | {
2982
+ user: `0x${string}`;
2983
+ ammAddr: `0x${string}`;
2984
+ lpToRemove: bigint;
2985
+ burnCashOut: bigint;
2986
+ netSizeOut: bigint;
2987
+ netCashOut: bigint;
2988
+ };
2989
+ } | {
2990
+ eventName: "RemoveLiquiditySingleCashFromAmm";
2991
+ args: {
2992
+ user: `0x${string}`;
2993
+ ammAddr: `0x${string}`;
2994
+ lpToRemove: bigint;
2995
+ netCashOut: bigint;
2996
+ netSizeInterm: bigint;
2997
+ } | {
2998
+ user: `0x${string}`;
2999
+ ammAddr: `0x${string}`;
3000
+ lpToRemove: bigint;
3001
+ netCashOut: bigint;
3002
+ netSizeInterm: bigint;
3003
+ } | {
3004
+ user: `0x${string}`;
3005
+ ammAddr: `0x${string}`;
3006
+ lpToRemove: bigint;
3007
+ netCashOut: bigint;
3008
+ netSizeInterm: bigint;
3009
+ };
3010
+ } | {
3011
+ eventName: "TryAggregateCallFailed";
3012
+ args: {
3013
+ index: bigint;
3014
+ };
3015
+ } | {
3016
+ eventName: "TryAggregateCallSucceeded";
3017
+ args: {
3018
+ index: bigint;
3019
+ };
3020
+ } | {
3021
+ eventName: "FIndexUpdated";
3022
+ args: {
3023
+ newIndex: `0x${string}`;
3024
+ } | {
3025
+ newIndex: `0x${string}`;
3026
+ } | {
3027
+ newIndex: `0x${string}`;
3028
+ } | {
3029
+ newIndex: `0x${string}`;
3030
+ } | {
3031
+ newIndex: `0x${string}`;
3032
+ } | {
3033
+ newIndex: `0x${string}`;
3034
+ } | {
3035
+ newIndex: `0x${string}`;
3036
+ };
3037
+ } | {
3038
+ eventName: "ForceCancel";
3039
+ args: {
3040
+ user: `0x${string}`;
3041
+ isCancelAll: boolean;
3042
+ removedIds: readonly bigint[];
3043
+ } | {
3044
+ user: `0x${string}`;
3045
+ isCancelAll: boolean;
3046
+ removedIds: readonly bigint[];
3047
+ } | {
3048
+ user: `0x${string}`;
3049
+ isCancelAll: boolean;
3050
+ removedIds: readonly bigint[];
3051
+ } | {
3052
+ user: `0x${string}`;
3053
+ isCancelAll: boolean;
3054
+ removedIds: readonly bigint[];
3055
+ } | {
3056
+ user: `0x${string}`;
3057
+ isCancelAll: boolean;
3058
+ removedIds: readonly bigint[];
3059
+ } | {
3060
+ user: `0x${string}`;
3061
+ isCancelAll: boolean;
3062
+ removedIds: readonly bigint[];
3063
+ } | {
3064
+ user: `0x${string}`;
3065
+ isCancelAll: boolean;
3066
+ removedIds: readonly bigint[];
3067
+ };
3068
+ } | {
3069
+ eventName: "ForceDeleverage";
3070
+ args: {
3071
+ winningUser: `0x${string}`;
3072
+ losingUser: `0x${string}`;
3073
+ trade: bigint;
3074
+ } | {
3075
+ winningUser: `0x${string}`;
3076
+ losingUser: `0x${string}`;
3077
+ trade: bigint;
3078
+ } | {
3079
+ winningUser: `0x${string}`;
3080
+ losingUser: `0x${string}`;
3081
+ trade: bigint;
3082
+ } | {
3083
+ winningUser: `0x${string}`;
3084
+ losingUser: `0x${string}`;
3085
+ trade: bigint;
3086
+ } | {
3087
+ winningUser: `0x${string}`;
3088
+ losingUser: `0x${string}`;
3089
+ trade: bigint;
3090
+ } | {
3091
+ winningUser: `0x${string}`;
3092
+ losingUser: `0x${string}`;
3093
+ trade: bigint;
3094
+ } | {
3095
+ winningUser: `0x${string}`;
3096
+ losingUser: `0x${string}`;
3097
+ trade: bigint;
3098
+ };
3099
+ } | {
3100
+ eventName: "ImpliedRateObservationWindowUpdated";
3101
+ args: {
3102
+ newWindow: number;
3103
+ } | {
3104
+ newWindow: number;
3105
+ } | {
3106
+ newWindow: number;
3107
+ } | {
3108
+ newWindow: number;
3109
+ } | {
3110
+ newWindow: number;
3111
+ } | {
3112
+ newWindow: number;
3113
+ } | {
3114
+ newWindow: number;
3115
+ } | {
3116
+ newWindow: number;
3117
+ };
3118
+ } | {
3119
+ eventName: "LimitOrderCancelled";
3120
+ args: {
3121
+ orderIds: readonly bigint[];
3122
+ } | {
3123
+ orderIds: readonly bigint[];
3124
+ } | {
3125
+ orderIds: readonly bigint[];
3126
+ } | {
3127
+ orderIds: readonly bigint[];
3128
+ } | {
3129
+ orderIds: readonly bigint[];
3130
+ } | {
3131
+ orderIds: readonly bigint[];
3132
+ } | {
3133
+ orderIds: readonly bigint[];
3134
+ };
3135
+ } | {
3136
+ eventName: "LimitOrderFilled";
3137
+ args: {
3138
+ from: bigint;
3139
+ to: bigint;
3140
+ } | {
3141
+ from: bigint;
3142
+ to: bigint;
3143
+ } | {
3144
+ from: bigint;
3145
+ to: bigint;
3146
+ } | {
3147
+ from: bigint;
3148
+ to: bigint;
3149
+ } | {
3150
+ from: bigint;
3151
+ to: bigint;
3152
+ } | {
3153
+ from: bigint;
3154
+ to: bigint;
3155
+ } | {
3156
+ from: bigint;
3157
+ to: bigint;
3158
+ };
3159
+ } | {
3160
+ eventName: "LimitOrderPartiallyFilled";
3161
+ args: {
3162
+ orderId: bigint;
3163
+ filledSize: bigint;
3164
+ } | {
3165
+ orderId: bigint;
3166
+ filledSize: bigint;
3167
+ } | {
3168
+ orderId: bigint;
3169
+ filledSize: bigint;
3170
+ } | {
3171
+ orderId: bigint;
3172
+ filledSize: bigint;
3173
+ } | {
3174
+ orderId: bigint;
3175
+ filledSize: bigint;
3176
+ } | {
3177
+ orderId: bigint;
3178
+ filledSize: bigint;
3179
+ } | {
3180
+ orderId: bigint;
3181
+ filledSize: bigint;
3182
+ };
3183
+ } | {
3184
+ eventName: "LimitOrderPlaced";
3185
+ args: {
3186
+ maker: `0x${string}`;
3187
+ orderIds: readonly bigint[];
3188
+ sizes: readonly bigint[];
3189
+ } | {
3190
+ maker: `0x${string}`;
3191
+ orderIds: readonly bigint[];
3192
+ sizes: readonly bigint[];
3193
+ } | {
3194
+ maker: `0x${string}`;
3195
+ orderIds: readonly bigint[];
3196
+ sizes: readonly bigint[];
3197
+ } | {
3198
+ maker: `0x${string}`;
3199
+ orderIds: readonly bigint[];
3200
+ sizes: readonly bigint[];
3201
+ } | {
3202
+ maker: `0x${string}`;
3203
+ orderIds: readonly bigint[];
3204
+ sizes: readonly bigint[];
3205
+ } | {
3206
+ maker: `0x${string}`;
3207
+ orderIds: readonly bigint[];
3208
+ sizes: readonly bigint[];
3209
+ } | {
3210
+ maker: `0x${string}`;
3211
+ orderIds: readonly bigint[];
3212
+ sizes: readonly bigint[];
3213
+ };
3214
+ } | {
3215
+ eventName: "Liquidate";
3216
+ args: {
3217
+ liquidator: `0x${string}`;
3218
+ violator: `0x${string}`;
3219
+ liqTrade: bigint;
3220
+ fees: bigint;
3221
+ } | {
3222
+ liquidator: `0x${string}`;
3223
+ violator: `0x${string}`;
3224
+ liqTrade: bigint;
3225
+ fees: bigint;
3226
+ } | {
3227
+ liquidator: `0x${string}`;
3228
+ violator: `0x${string}`;
3229
+ liqTrade: bigint;
3230
+ fees: bigint;
3231
+ } | {
3232
+ liquidator: `0x${string}`;
3233
+ violator: `0x${string}`;
3234
+ liqTrade: bigint;
3235
+ fees: bigint;
3236
+ } | {
3237
+ liquidator: `0x${string}`;
3238
+ violator: `0x${string}`;
3239
+ liqTrade: bigint;
3240
+ fees: bigint;
3241
+ } | {
3242
+ liquidator: `0x${string}`;
3243
+ violator: `0x${string}`;
3244
+ liqTrade: bigint;
3245
+ fees: bigint;
3246
+ } | {
3247
+ liquidator: `0x${string}`;
3248
+ violator: `0x${string}`;
3249
+ liqTrade: bigint;
3250
+ fees: bigint;
3251
+ };
3252
+ } | {
3253
+ eventName: "MarketConfigUpdated";
3254
+ args: {
3255
+ newConfig: {
3256
+ maxOpenOrders: number;
3257
+ markRateOracle: `0x${string}`;
3258
+ fIndexOracle: `0x${string}`;
3259
+ OICap: bigint;
3260
+ takerFee: bigint;
3261
+ otcFee: bigint;
3262
+ liqIncentive: {
3263
+ base: bigint;
3264
+ slope: bigint;
3265
+ };
3266
+ IMFactor: bigint;
3267
+ MMFactor: bigint;
3268
+ minMarginIndexRate: bigint;
3269
+ minMarginIndexDuration: number;
3270
+ };
3271
+ } | {
3272
+ newConfig: {
3273
+ maxOpenOrders: number;
3274
+ markRateOracle: `0x${string}`;
3275
+ fIndexOracle: `0x${string}`;
3276
+ OICap: bigint;
3277
+ takerFee: bigint;
3278
+ otcFee: bigint;
3279
+ liqIncentive: {
3280
+ base: bigint;
3281
+ slope: bigint;
3282
+ };
3283
+ IMFactor: bigint;
3284
+ MMFactor: bigint;
3285
+ minMarginIndexRate: bigint;
3286
+ minMarginIndexDuration: number;
3287
+ };
3288
+ } | {
3289
+ newConfig: {
3290
+ maxOpenOrders: number;
3291
+ markRateOracle: `0x${string}`;
3292
+ fIndexOracle: `0x${string}`;
3293
+ OICap: bigint;
3294
+ takerFee: bigint;
3295
+ otcFee: bigint;
3296
+ liqIncentive: {
3297
+ base: bigint;
3298
+ slope: bigint;
3299
+ };
3300
+ IMFactor: bigint;
3301
+ MMFactor: bigint;
3302
+ minMarginIndexRate: bigint;
3303
+ minMarginIndexDuration: number;
3304
+ };
3305
+ } | {
3306
+ newConfig: {
3307
+ maxOpenOrders: number;
3308
+ markRateOracle: `0x${string}`;
3309
+ fIndexOracle: `0x${string}`;
3310
+ OICap: bigint;
3311
+ takerFee: bigint;
3312
+ otcFee: bigint;
3313
+ liqIncentive: {
3314
+ base: bigint;
3315
+ slope: bigint;
3316
+ };
3317
+ IMFactor: bigint;
3318
+ MMFactor: bigint;
3319
+ minMarginIndexRate: bigint;
3320
+ minMarginIndexDuration: number;
3321
+ };
3322
+ } | {
3323
+ newConfig: {
3324
+ maxOpenOrders: number;
3325
+ markRateOracle: `0x${string}`;
3326
+ fIndexOracle: `0x${string}`;
3327
+ OICap: bigint;
3328
+ takerFee: bigint;
3329
+ otcFee: bigint;
3330
+ liqIncentive: {
3331
+ base: bigint;
3332
+ slope: bigint;
3333
+ };
3334
+ IMFactor: bigint;
3335
+ MMFactor: bigint;
3336
+ minMarginIndexRate: bigint;
3337
+ minMarginIndexDuration: number;
3338
+ };
3339
+ } | {
3340
+ newConfig: {
3341
+ maxOpenOrders: number;
3342
+ markRateOracle: `0x${string}`;
3343
+ fIndexOracle: `0x${string}`;
3344
+ OICap: bigint;
3345
+ takerFee: bigint;
3346
+ otcFee: bigint;
3347
+ liqIncentive: {
3348
+ base: bigint;
3349
+ slope: bigint;
3350
+ };
3351
+ IMFactor: bigint;
3352
+ MMFactor: bigint;
3353
+ minMarginIndexRate: bigint;
3354
+ minMarginIndexDuration: number;
3355
+ };
3356
+ } | {
3357
+ newConfig: {
3358
+ maxOpenOrders: number;
3359
+ markRateOracle: `0x${string}`;
3360
+ fIndexOracle: `0x${string}`;
3361
+ OICap: bigint;
3362
+ takerFee: bigint;
3363
+ otcFee: bigint;
3364
+ liqIncentive: {
3365
+ base: bigint;
3366
+ slope: bigint;
3367
+ };
3368
+ IMFactor: bigint;
3369
+ MMFactor: bigint;
3370
+ minMarginIndexRate: bigint;
3371
+ minMarginIndexDuration: number;
3372
+ };
3373
+ };
3374
+ } | {
3375
+ eventName: "MarketOrdersFilled";
3376
+ args: {
3377
+ user: `0x${string}`;
3378
+ totalTrade: bigint;
3379
+ totalFees: bigint;
3380
+ } | {
3381
+ user: `0x${string}`;
3382
+ totalTrade: bigint;
3383
+ totalFees: bigint;
3384
+ } | {
3385
+ user: `0x${string}`;
3386
+ totalTrade: bigint;
3387
+ totalFees: bigint;
3388
+ } | {
3389
+ user: `0x${string}`;
3390
+ totalTrade: bigint;
3391
+ totalFees: bigint;
3392
+ } | {
3393
+ user: `0x${string}`;
3394
+ totalTrade: bigint;
3395
+ totalFees: bigint;
3396
+ } | {
3397
+ user: `0x${string}`;
3398
+ totalTrade: bigint;
3399
+ totalFees: bigint;
3400
+ } | {
3401
+ user: `0x${string}`;
3402
+ totalTrade: bigint;
3403
+ totalFees: bigint;
3404
+ };
3405
+ } | {
3406
+ eventName: "OtcSwap";
3407
+ args: {
3408
+ user: `0x${string}`;
3409
+ counterParty: `0x${string}`;
3410
+ trade: bigint;
3411
+ fees: bigint;
3412
+ } | {
3413
+ user: `0x${string}`;
3414
+ counterParty: `0x${string}`;
3415
+ trade: bigint;
3416
+ fees: bigint;
3417
+ } | {
3418
+ user: `0x${string}`;
3419
+ counterParty: `0x${string}`;
3420
+ trade: bigint;
3421
+ fees: bigint;
3422
+ } | {
3423
+ user: `0x${string}`;
3424
+ counterParty: `0x${string}`;
3425
+ trade: bigint;
3426
+ fees: bigint;
3427
+ } | {
3428
+ user: `0x${string}`;
3429
+ counterParty: `0x${string}`;
3430
+ trade: bigint;
3431
+ fees: bigint;
3432
+ } | {
3433
+ user: `0x${string}`;
3434
+ counterParty: `0x${string}`;
3435
+ trade: bigint;
3436
+ fees: bigint;
3437
+ } | {
3438
+ user: `0x${string}`;
3439
+ counterParty: `0x${string}`;
3440
+ trade: bigint;
3441
+ fees: bigint;
3442
+ };
3443
+ } | {
3444
+ eventName: "PaymentFromSettlement";
3445
+ args: {
3446
+ user: `0x${string}`;
3447
+ lastFTime: bigint;
3448
+ latestFTime: bigint;
3449
+ payment: bigint;
3450
+ fees: bigint;
3451
+ } | {
3452
+ user: `0x${string}`;
3453
+ lastFTime: bigint;
3454
+ latestFTime: bigint;
3455
+ payment: bigint;
3456
+ fees: bigint;
3457
+ } | {
3458
+ user: `0x${string}`;
3459
+ lastFTime: bigint;
3460
+ latestFTime: bigint;
3461
+ payment: bigint;
3462
+ fees: bigint;
3463
+ } | {
3464
+ user: `0x${string}`;
3465
+ lastFTime: bigint;
3466
+ latestFTime: bigint;
3467
+ payment: bigint;
3468
+ fees: bigint;
3469
+ } | {
3470
+ user: `0x${string}`;
3471
+ lastFTime: bigint;
3472
+ latestFTime: bigint;
3473
+ payment: bigint;
3474
+ fees: bigint;
3475
+ } | {
3476
+ user: `0x${string}`;
3477
+ lastFTime: bigint;
3478
+ latestFTime: bigint;
3479
+ payment: bigint;
3480
+ fees: bigint;
3481
+ } | {
3482
+ user: `0x${string}`;
3483
+ lastFTime: bigint;
3484
+ latestFTime: bigint;
3485
+ payment: bigint;
3486
+ fees: bigint;
3487
+ };
3488
+ } | {
3489
+ eventName: "PersonalDiscRatesUpdated";
3490
+ args: {
3491
+ user: `0x${string}`;
3492
+ newTakerDisc: bigint;
3493
+ newOtcDisc: bigint;
3494
+ } | {
3495
+ user: `0x${string}`;
3496
+ newTakerDisc: bigint;
3497
+ newOtcDisc: bigint;
3498
+ } | {
3499
+ user: `0x${string}`;
3500
+ newTakerDisc: bigint;
3501
+ newOtcDisc: bigint;
3502
+ } | {
3503
+ user: `0x${string}`;
3504
+ newTakerDisc: bigint;
3505
+ newOtcDisc: bigint;
3506
+ } | {
3507
+ user: `0x${string}`;
3508
+ newTakerDisc: bigint;
3509
+ newOtcDisc: bigint;
3510
+ } | {
3511
+ user: `0x${string}`;
3512
+ newTakerDisc: bigint;
3513
+ newOtcDisc: bigint;
3514
+ } | {
3515
+ user: `0x${string}`;
3516
+ newTakerDisc: bigint;
3517
+ newOtcDisc: bigint;
3518
+ };
3519
+ } | {
3520
+ eventName: "PersonalMarginConfigUpdated";
3521
+ args: {
3522
+ user: `0x${string}`;
3523
+ newIMFactor: bigint;
3524
+ newMMFactor: bigint;
3525
+ } | {
3526
+ user: `0x${string}`;
3527
+ newIMFactor: bigint;
3528
+ newMMFactor: bigint;
3529
+ } | {
3530
+ user: `0x${string}`;
3531
+ newIMFactor: bigint;
3532
+ newMMFactor: bigint;
3533
+ } | {
3534
+ user: `0x${string}`;
3535
+ newIMFactor: bigint;
3536
+ newMMFactor: bigint;
3537
+ } | {
3538
+ user: `0x${string}`;
3539
+ newIMFactor: bigint;
3540
+ newMMFactor: bigint;
3541
+ } | {
3542
+ user: `0x${string}`;
3543
+ newIMFactor: bigint;
3544
+ newMMFactor: bigint;
3545
+ } | {
3546
+ user: `0x${string}`;
3547
+ newIMFactor: bigint;
3548
+ newMMFactor: bigint;
3549
+ };
3550
+ } | {
3551
+ eventName: "ConfigUpdated";
3552
+ args: {
3553
+ newSettleFeeRate: bigint;
3554
+ newUpdatePeriod: number;
3555
+ newMaxUpdateDelay: number;
3556
+ };
3557
+ } | {
3558
+ eventName: "AMMConfigUpdated";
3559
+ args: {
3560
+ minAbsRate: bigint;
3561
+ maxAbsRate: bigint;
3562
+ cutOffTimestamp: number;
3563
+ };
3564
+ } | {
3565
+ eventName: "BOROS20Transfer";
3566
+ args: {
3567
+ from: `0x${string}`;
3568
+ to: `0x${string}`;
3569
+ value: bigint;
3570
+ } | {
3571
+ from: `0x${string}`;
3572
+ to: `0x${string}`;
3573
+ value: bigint;
3574
+ };
3575
+ } | {
3576
+ eventName: "Burn";
3577
+ args: {
3578
+ payer: `0x${string}`;
3579
+ netLpBurned: bigint;
3580
+ netCashOut: bigint;
3581
+ netSizeOut: bigint;
3582
+ };
3583
+ } | {
3584
+ eventName: "FeeRateUpdated";
3585
+ args: {
3586
+ newFeeRate: bigint;
3587
+ };
3588
+ } | {
3589
+ eventName: "Mint";
3590
+ args: {
3591
+ receiver: `0x${string}`;
3592
+ netLpMinted: bigint;
3593
+ netCashIn: bigint;
3594
+ netSizeIn: bigint;
3595
+ };
3596
+ } | {
3597
+ eventName: "Swap";
3598
+ args: {
3599
+ sizeOut: bigint;
3600
+ costOut: bigint;
3601
+ };
3602
+ } | null)[];
3603
+ }>;
3604
+ export declare function simulate(publicClient: PublicClient, to: Address, data: Hex): Promise<SimulateReturnType>;
@@ -35,6 +35,8 @@ var __importStar = (this && this.__importStar) || (function () {
35
35
  Object.defineProperty(exports, "__esModule", { value: true });
36
36
  exports.parseEvents = parseEvents;
37
37
  exports.decodeLog = decodeLog;
38
+ exports.getTransactionData = getTransactionData;
39
+ exports.simulate = simulate;
38
40
  const viem_1 = require("viem");
39
41
  const Abis = __importStar(require("../../contracts/viemAbis"));
40
42
  const publicClient_1 = require("../publicClient");
@@ -55,7 +57,22 @@ function decodeLog(log) {
55
57
  continue;
56
58
  }
57
59
  }
58
- console.log('Could not decode log with any ABI:', log);
59
60
  return null;
60
61
  }
62
+ async function getTransactionData(txHash) {
63
+ const receipt = await publicClient_1.publicClient.getTransactionReceipt({ hash: txHash });
64
+ const decodedLogs = receipt.logs.map((log) => decodeLog(log));
65
+ return { decodedLogs };
66
+ }
67
+ async function simulate(publicClient, to, data) {
68
+ const result = await publicClient.simulate({
69
+ blocks: [{
70
+ calls: [{
71
+ to,
72
+ data,
73
+ }]
74
+ }]
75
+ });
76
+ return result;
77
+ }
61
78
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/entities/exchange/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,kCAMC;AAED,8BAWC;AAvBD,+BAAgE;AAChE,+DAAiD;AACjD,kDAA+C;AAExC,KAAK,UAAU,WAAW,CAAC,MAAW;IAC3C,MAAM,OAAO,GAAG,MAAM,2BAAY,CAAC,yBAAyB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/E,OAAO;QACL,GAAG,EAAE,IAAA,qBAAc,EAAC,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;QACpE,MAAM,EAAE,IAAA,qBAAc,EAAC,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;KACxE,CAAC;AACJ,CAAC;AAED,SAAgB,SAAS,CAAC,GAA+B;IACvD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC;YACH,OAAO,IAAA,qBAAc,EAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACrE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS;QACX,CAAC;IACH,CAAC;IACD,OAAO,CAAC,GAAG,CAAC,oCAAoC,EAAE,GAAG,CAAC,CAAC;IACvD,OAAO,IAAI,CAAC;AACd,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/entities/exchange/utils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,kCAMC;AAED,8BAUC;AAED,gDAIC;AAED,4BAUC;AAzCD,+BAAuF;AACvF,+DAAiD;AACjD,kDAA+C;AAGxC,KAAK,UAAU,WAAW,CAAC,MAAW;IAC3C,MAAM,OAAO,GAAG,MAAM,2BAAY,CAAC,yBAAyB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC/E,OAAO;QACL,GAAG,EAAE,IAAA,qBAAc,EAAC,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;QACpE,MAAM,EAAE,IAAA,qBAAc,EAAC,EAAE,GAAG,EAAE,IAAI,CAAC,aAAa,EAAE,IAAI,EAAE,OAAO,CAAC,IAAI,EAAE,CAAC;KACxE,CAAC;AACJ,CAAC;AAED,SAAgB,SAAS,CAAC,GAA+B;IACvD,MAAM,IAAI,GAAG,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC;IAC7C,KAAK,MAAM,GAAG,IAAI,IAAI,EAAE,CAAC;QACvB,IAAI,CAAC;YACH,OAAO,IAAA,qBAAc,EAAC,EAAE,GAAG,EAAE,IAAI,EAAE,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,CAAC,CAAC;QACrE,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,SAAS;QACX,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAEM,KAAK,UAAU,kBAAkB,CAAC,MAAW;IAClD,MAAM,OAAO,GAAG,MAAM,2BAAY,CAAC,qBAAqB,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;IAC3E,MAAM,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,CAAC;IAC9D,OAAO,EAAE,WAAW,EAAE,CAAC;AACzB,CAAC;AAEM,KAAK,UAAU,QAAQ,CAAC,YAA0B,EAAE,EAAW,EAAE,IAAS;IAC/E,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC;QACzC,MAAM,EAAE,CAAC;gBACP,KAAK,EAAE,CAAC;wBACN,EAAE;wBACF,IAAI;qBACL,CAAC;aACH,CAAC;KACH,CAAC,CAAC;IACH,OAAO,MAAM,CAAC;AAChB,CAAC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@pendle/sdk-boros",
3
3
  "description": "Pendle SDK for Boros",
4
4
  "license": "MIT",
5
- "version": "0.1.35",
5
+ "version": "0.1.37",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
8
  "files": [