@ape.swap/bonds-sdk 2.6.11 → 2.6.13

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/main.js CHANGED
@@ -18172,6 +18172,7 @@ var types = {};
18172
18172
  exports.defaultBillArtCollection =
18173
18173
  exports.BillArtCollection =
18174
18174
  exports.BillVersion =
18175
+ exports.Wrappers =
18175
18176
  exports.Protocols =
18176
18177
  exports.ZapVersion =
18177
18178
  exports.IchiSupportedDex =
@@ -18309,6 +18310,11 @@ var types = {};
18309
18310
  Protocols[(Protocols['XFAI'] = 8)] = 'XFAI';
18310
18311
  Protocols[(Protocols['Curve'] = 9)] = 'Curve';
18311
18312
  })((Protocols = exports.Protocols || (exports.Protocols = {})));
18313
+ (function (Wrappers) {
18314
+ Wrappers[(Wrappers['Gamma'] = 0)] = 'Gamma';
18315
+ Wrappers[(Wrappers['Ichi'] = 1)] = 'Ichi';
18316
+ Wrappers[(Wrappers['Steer'] = 2)] = 'Steer';
18317
+ })((exports.Wrappers || (exports.Wrappers = {})));
18312
18318
  (function (BillVersion) {
18313
18319
  BillVersion['V1'] = 'V1';
18314
18320
  BillVersion['V2'] = 'V2';
@@ -49146,24 +49152,22 @@ const WNATIVE = {
49146
49152
  },
49147
49153
  };
49148
49154
 
49149
- const ABOND_ADDRESSES = {
49155
+ ({
49150
49156
  [types.ChainId.BSC]: '0x34294AfABCbaFfc616ac6614F6d2e17260b78BEd',
49151
49157
  [types.ChainId.MAINNET]: '0xe6828D65bf5023AE1851D90D8783Cc821ba7eeE1',
49152
49158
  [types.ChainId.MATIC]: '0xe6828D65bf5023AE1851D90D8783Cc821ba7eeE1',
49153
- };
49159
+ });
49154
49160
  const PRICE_GETTER_ADDRESSES = {
49155
- [types.ChainId.BSC_TESTNET]: '0x85d2C626E28a42E184cF8e32db1461013D23331D',
49156
- [types.ChainId.BSC]: '0xF08Fc6d054880699A8a5Ebc363238c98B39FEbC9', // Price getter V2.2
49157
- [types.ChainId.MATIC]: '0x6908356faC751dA36F4ec1B4ADBc56d0B3862155', // Price getter v2.1
49158
- [types.ChainId.MAINNET]: '0x10ffd467e8701fc2887b3df9b9a31adfefd388ec', // Price getter V2.1
49159
- [types.ChainId.TLOS]: '0x85d2C626E28a42E184cF8e32db1461013D23331D',
49160
- [types.ChainId.ARBITRUM]: '0xf1e931A569d8B3Ff5cCd11d2F42422FCABA6DBa4', // Price getter V3 (V2 backwards compatible)
49161
- [types.ChainId.LINEA]: '0x35b1eadAbaDD0Edd26076247f3dEdF9E15De8D5D',
49162
- [types.ChainId.LIGHTLINK]: '0xC22Db8dDe3A3591fFB02be868Ce2901d30671FE4',
49163
- [types.ChainId.IOTA]: '0xC22Db8dDe3A3591fFB02be868Ce2901d30671FE4',
49164
- [types.ChainId.BASE]: '0xE29C74B4DD05A268B5FFaadeF4fdbAa1de6FDe84',
49165
- [types.ChainId.AVAX]: '0x70005Da62E17041977f7F99f91098b125CcDE1a7',
49166
- [types.ChainId.BLAST]: '0x218EB9ACDC721E235969A30f5DA46FB1224Fa7A7',
49161
+ [types.ChainId.BSC]: '0x424356909715afcE9D0263dda0B27f0BC6cc638d', // Price getter V3
49162
+ [types.ChainId.MATIC]: '0xc5331AF02Cb72e5Df07c47f85C89ef9227418f01', // Price getter V3
49163
+ [types.ChainId.MAINNET]: '0xf63e25B5492A856189420724fe6f3573620966f3', // Price getter V3
49164
+ [types.ChainId.ARBITRUM]: '0xf1e931A569d8B3Ff5cCd11d2F42422FCABA6DBa4', // Price getter V3
49165
+ [types.ChainId.LINEA]: '0x4E4746b8Cfc7E57d824Dd91A80146F9C23C36d52', // Price getter V3
49166
+ [types.ChainId.LIGHTLINK]: '0xb4aD8df313109caaF8Fdcde9094e9d1DE41252bc', // Price getter V3
49167
+ [types.ChainId.IOTA]: '0x7D8f0e5964a1D05974EfD9aaff8A4154618B49f3', // Price getter V3
49168
+ [types.ChainId.BASE]: '0xE29C74B4DD05A268B5FFaadeF4fdbAa1de6FDe84', // Price getter V3
49169
+ [types.ChainId.BLAST]: '0x218EB9ACDC721E235969A30f5DA46FB1224Fa7A7', // Price getter V3
49170
+ [types.ChainId.AVAX]: '0x01dadaa586D30d93Ac92C79A5Cb02a8F276a8B4F', // Price getter V3
49167
49171
  };
49168
49172
  const MULTICALL_V2 = {
49169
49173
  [types.ChainId.BSC]: '0x38ce767d81de3940CFa5020B55af1A400ED4F657',
@@ -68048,13 +68052,7 @@ var ERC_20_ABI = [
68048
68052
  }
68049
68053
  ];
68050
68054
 
68051
- var PRICE_GETTER_ABI_LINEA = [
68052
- {
68053
- inputs: [
68054
- ],
68055
- name: "T",
68056
- type: "error"
68057
- },
68055
+ var PRICE_GETTER_V3_ABI = [
68058
68056
  {
68059
68057
  anonymous: false,
68060
68058
  inputs: [
@@ -68089,69 +68087,86 @@ var PRICE_GETTER_ABI_LINEA = [
68089
68087
  },
68090
68088
  {
68091
68089
  inputs: [
68092
- ],
68093
- name: "DECIMALS",
68094
- outputs: [
68095
68090
  {
68096
- internalType: "uint256",
68097
- name: "",
68098
- type: "uint256"
68091
+ internalType: "address[]",
68092
+ name: "newStableUsdTokens",
68093
+ type: "address[]"
68099
68094
  }
68100
68095
  ],
68101
- stateMutability: "pure",
68096
+ name: "addStableUsdTokens",
68097
+ outputs: [
68098
+ ],
68099
+ stateMutability: "nonpayable",
68102
68100
  type: "function"
68103
68101
  },
68104
68102
  {
68105
68103
  inputs: [
68106
- ],
68107
- name: "FACTORY",
68108
- outputs: [
68109
68104
  {
68110
68105
  internalType: "address",
68111
- name: "",
68106
+ name: "lp",
68107
+ type: "address"
68108
+ },
68109
+ {
68110
+ internalType: "enum IPriceGetter.Protocol",
68111
+ name: "protocol",
68112
+ type: "uint8"
68113
+ },
68114
+ {
68115
+ internalType: "address",
68116
+ name: "factory",
68112
68117
  type: "address"
68113
68118
  }
68114
68119
  ],
68115
- stateMutability: "pure",
68116
- type: "function"
68117
- },
68118
- {
68119
- inputs: [
68120
- ],
68121
- name: "INITCODEHASH",
68120
+ name: "getLPPrice",
68122
68121
  outputs: [
68123
68122
  {
68124
- internalType: "bytes32",
68125
- name: "",
68126
- type: "bytes32"
68123
+ internalType: "uint256",
68124
+ name: "price",
68125
+ type: "uint256"
68127
68126
  }
68128
68127
  ],
68129
- stateMutability: "pure",
68128
+ stateMutability: "view",
68130
68129
  type: "function"
68131
68130
  },
68132
68131
  {
68133
68132
  inputs: [
68134
- ],
68135
- name: "defaultFactoryAlgebra",
68136
- outputs: [
68137
68133
  {
68138
- internalType: "contract IAlgebraFactory",
68139
- name: "",
68134
+ internalType: "address",
68135
+ name: "lp",
68136
+ type: "address"
68137
+ },
68138
+ {
68139
+ internalType: "enum IPriceGetter.Protocol",
68140
+ name: "protocol",
68141
+ type: "uint8"
68142
+ },
68143
+ {
68144
+ internalType: "address",
68145
+ name: "factoryV2",
68146
+ type: "address"
68147
+ },
68148
+ {
68149
+ internalType: "address",
68150
+ name: "factoryV3",
68151
+ type: "address"
68152
+ },
68153
+ {
68154
+ internalType: "address",
68155
+ name: "factoryAlgebra",
68156
+ type: "address"
68157
+ },
68158
+ {
68159
+ internalType: "address",
68160
+ name: "factorySolidly",
68140
68161
  type: "address"
68141
68162
  }
68142
68163
  ],
68143
- stateMutability: "view",
68144
- type: "function"
68145
- },
68146
- {
68147
- inputs: [
68148
- ],
68149
- name: "defaultFactorySolidly",
68164
+ name: "getLPPriceFromFactory",
68150
68165
  outputs: [
68151
68166
  {
68152
- internalType: "contract ISolidlyFactory",
68153
- name: "",
68154
- type: "address"
68167
+ internalType: "uint256",
68168
+ name: "lpPrice",
68169
+ type: "uint256"
68155
68170
  }
68156
68171
  ],
68157
68172
  stateMutability: "view",
@@ -68159,27 +68174,48 @@ var PRICE_GETTER_ABI_LINEA = [
68159
68174
  },
68160
68175
  {
68161
68176
  inputs: [
68162
- ],
68163
- name: "defaultFactoryV2",
68164
- outputs: [
68165
68177
  {
68166
- internalType: "contract IApeFactory",
68167
- name: "",
68178
+ internalType: "address",
68179
+ name: "lp",
68180
+ type: "address"
68181
+ },
68182
+ {
68183
+ internalType: "enum IPriceGetter.Protocol",
68184
+ name: "protocol",
68185
+ type: "uint8"
68186
+ },
68187
+ {
68188
+ internalType: "address",
68189
+ name: "factoryV2",
68190
+ type: "address"
68191
+ },
68192
+ {
68193
+ internalType: "address",
68194
+ name: "factoryV3",
68195
+ type: "address"
68196
+ },
68197
+ {
68198
+ internalType: "address",
68199
+ name: "factoryAlgebra",
68200
+ type: "address"
68201
+ },
68202
+ {
68203
+ internalType: "address",
68204
+ name: "factorySolidly",
68205
+ type: "address"
68206
+ },
68207
+ {
68208
+ internalType: "address",
68209
+ name: "factoryXFAI",
68168
68210
  type: "address"
68169
68211
  }
68170
68212
  ],
68171
- stateMutability: "view",
68172
- type: "function"
68173
- },
68174
- {
68175
- inputs: [
68176
- ],
68177
- name: "defaultFactoryV3",
68213
+ name: "getLPPriceFromFactory",
68178
68214
  outputs: [
68179
68215
  {
68180
- internalType: "contract IUniswapV3Factory",
68181
- name: "",
68182
- type: "address"
68216
+ internalType: "uint256",
68217
+ name: "lpPrice",
68218
+ type: "uint256"
68183
68219
  }
68184
68220
  ],
68185
68221
  stateMutability: "view",
@@ -68187,13 +68223,28 @@ var PRICE_GETTER_ABI_LINEA = [
68187
68223
  },
68188
68224
  {
68189
68225
  inputs: [
68226
+ {
68227
+ internalType: "address[]",
68228
+ name: "lps",
68229
+ type: "address[]"
68230
+ },
68231
+ {
68232
+ internalType: "enum IPriceGetter.Protocol",
68233
+ name: "protocol",
68234
+ type: "uint8"
68235
+ },
68236
+ {
68237
+ internalType: "address",
68238
+ name: "factory",
68239
+ type: "address"
68240
+ }
68190
68241
  ],
68191
- name: "defaultFactoryXFAI",
68242
+ name: "getLPPrices",
68192
68243
  outputs: [
68193
68244
  {
68194
- internalType: "contract IXFAIFactory",
68195
- name: "",
68196
- type: "address"
68245
+ internalType: "uint256[]",
68246
+ name: "prices",
68247
+ type: "uint256[]"
68197
68248
  }
68198
68249
  ],
68199
68250
  stateMutability: "view",
@@ -68202,16 +68253,21 @@ var PRICE_GETTER_ABI_LINEA = [
68202
68253
  {
68203
68254
  inputs: [
68204
68255
  {
68205
- internalType: "uint32",
68206
- name: "secondsAgo",
68207
- type: "uint32"
68256
+ internalType: "enum IPriceGetter.Protocol",
68257
+ name: "protocol",
68258
+ type: "uint8"
68259
+ },
68260
+ {
68261
+ internalType: "address",
68262
+ name: "factory",
68263
+ type: "address"
68208
68264
  }
68209
68265
  ],
68210
- name: "getETHPrice",
68266
+ name: "getNativePrice",
68211
68267
  outputs: [
68212
68268
  {
68213
68269
  internalType: "uint256",
68214
- name: "",
68270
+ name: "nativePrice",
68215
68271
  type: "uint256"
68216
68272
  }
68217
68273
  ],
@@ -68220,12 +68276,37 @@ var PRICE_GETTER_ABI_LINEA = [
68220
68276
  },
68221
68277
  {
68222
68278
  inputs: [
68279
+ {
68280
+ internalType: "enum IPriceGetter.Protocol",
68281
+ name: "protocol",
68282
+ type: "uint8"
68283
+ },
68284
+ {
68285
+ internalType: "address",
68286
+ name: "factoryV2",
68287
+ type: "address"
68288
+ },
68289
+ {
68290
+ internalType: "address",
68291
+ name: "factoryV3",
68292
+ type: "address"
68293
+ },
68294
+ {
68295
+ internalType: "address",
68296
+ name: "factoryAlgebra",
68297
+ type: "address"
68298
+ },
68299
+ {
68300
+ internalType: "address",
68301
+ name: "factorySolidly",
68302
+ type: "address"
68303
+ }
68223
68304
  ],
68224
- name: "getETHPrice",
68305
+ name: "getNativePriceFromFactory",
68225
68306
  outputs: [
68226
68307
  {
68227
68308
  internalType: "uint256",
68228
- name: "",
68309
+ name: "nativePrice",
68229
68310
  type: "uint256"
68230
68311
  }
68231
68312
  ],
@@ -68234,22 +68315,42 @@ var PRICE_GETTER_ABI_LINEA = [
68234
68315
  },
68235
68316
  {
68236
68317
  inputs: [
68318
+ {
68319
+ internalType: "enum IPriceGetter.Protocol",
68320
+ name: "protocol",
68321
+ type: "uint8"
68322
+ },
68237
68323
  {
68238
68324
  internalType: "address",
68239
- name: "token",
68325
+ name: "factoryV2",
68240
68326
  type: "address"
68241
68327
  },
68242
68328
  {
68243
- internalType: "uint256",
68244
- name: "_decimals",
68245
- type: "uint256"
68329
+ internalType: "address",
68330
+ name: "factoryV3",
68331
+ type: "address"
68332
+ },
68333
+ {
68334
+ internalType: "address",
68335
+ name: "factoryAlgebra",
68336
+ type: "address"
68337
+ },
68338
+ {
68339
+ internalType: "address",
68340
+ name: "factorySolidly",
68341
+ type: "address"
68342
+ },
68343
+ {
68344
+ internalType: "address",
68345
+ name: "factoryXFAI",
68346
+ type: "address"
68246
68347
  }
68247
68348
  ],
68248
- name: "getLPPrice",
68349
+ name: "getNativePriceFromFactory",
68249
68350
  outputs: [
68250
68351
  {
68251
68352
  internalType: "uint256",
68252
- name: "",
68353
+ name: "nativePrice",
68253
68354
  type: "uint256"
68254
68355
  }
68255
68356
  ],
@@ -68260,16 +68361,11 @@ var PRICE_GETTER_ABI_LINEA = [
68260
68361
  inputs: [
68261
68362
  {
68262
68363
  internalType: "address",
68263
- name: "token0",
68264
- type: "address"
68265
- },
68266
- {
68267
- internalType: "address",
68268
- name: "token1",
68364
+ name: "token",
68269
68365
  type: "address"
68270
68366
  }
68271
68367
  ],
68272
- name: "getLPPriceAlgebra",
68368
+ name: "getOraclePriceNormalized",
68273
68369
  outputs: [
68274
68370
  {
68275
68371
  internalType: "uint256",
@@ -68282,23 +68378,103 @@ var PRICE_GETTER_ABI_LINEA = [
68282
68378
  },
68283
68379
  {
68284
68380
  inputs: [
68381
+ ],
68382
+ name: "getParams",
68383
+ outputs: [
68384
+ {
68385
+ components: [
68386
+ {
68387
+ internalType: "contract IPriceGetter",
68388
+ name: "mainPriceGetter",
68389
+ type: "address"
68390
+ },
68391
+ {
68392
+ components: [
68393
+ {
68394
+ internalType: "address",
68395
+ name: "tokenAddress",
68396
+ type: "address"
68397
+ },
68398
+ {
68399
+ internalType: "uint8",
68400
+ name: "decimals",
68401
+ type: "uint8"
68402
+ }
68403
+ ],
68404
+ internalType: "struct IPriceGetter.TokenAndDecimals",
68405
+ name: "wrappedNative",
68406
+ type: "tuple"
68407
+ },
68408
+ {
68409
+ components: [
68410
+ {
68411
+ internalType: "address",
68412
+ name: "tokenAddress",
68413
+ type: "address"
68414
+ },
68415
+ {
68416
+ internalType: "uint8",
68417
+ name: "decimals",
68418
+ type: "uint8"
68419
+ }
68420
+ ],
68421
+ internalType: "struct IPriceGetter.TokenAndDecimals[]",
68422
+ name: "stableUsdTokens",
68423
+ type: "tuple[]"
68424
+ },
68425
+ {
68426
+ internalType: "uint256",
68427
+ name: "nativeLiquidityThreshold",
68428
+ type: "uint256"
68429
+ }
68430
+ ],
68431
+ internalType: "struct IPriceGetterProtocol.PriceGetterParams",
68432
+ name: "params",
68433
+ type: "tuple"
68434
+ }
68435
+ ],
68436
+ stateMutability: "view",
68437
+ type: "function"
68438
+ },
68439
+ {
68440
+ inputs: [
68441
+ {
68442
+ internalType: "address",
68443
+ name: "token",
68444
+ type: "address"
68445
+ },
68285
68446
  {
68286
- internalType: "contract IAlgebraFactory",
68447
+ internalType: "enum IPriceGetter.Protocol",
68448
+ name: "protocol",
68449
+ type: "uint8"
68450
+ },
68451
+ {
68452
+ internalType: "address",
68453
+ name: "factoryV2",
68454
+ type: "address"
68455
+ },
68456
+ {
68457
+ internalType: "address",
68458
+ name: "factoryV3",
68459
+ type: "address"
68460
+ },
68461
+ {
68462
+ internalType: "address",
68287
68463
  name: "factoryAlgebra",
68288
68464
  type: "address"
68289
68465
  },
68290
68466
  {
68291
68467
  internalType: "address",
68292
- name: "token0",
68468
+ name: "factorySolidly",
68293
68469
  type: "address"
68294
68470
  },
68295
68471
  {
68296
68472
  internalType: "address",
68297
- name: "token1",
68473
+ name: "factoryXFAI",
68298
68474
  type: "address"
68299
68475
  }
68300
68476
  ],
68301
- name: "getLPPriceAlgebraFromFactory",
68477
+ name: "getPriceFromFactory",
68302
68478
  outputs: [
68303
68479
  {
68304
68480
  internalType: "uint256",
@@ -68317,1907 +68493,36 @@ var PRICE_GETTER_ABI_LINEA = [
68317
68493
  type: "address"
68318
68494
  },
68319
68495
  {
68320
- internalType: "enum IPriceGetterV2.Protocol",
68496
+ internalType: "enum IPriceGetter.Protocol",
68321
68497
  name: "protocol",
68322
68498
  type: "uint8"
68323
68499
  },
68324
68500
  {
68325
- internalType: "contract IApeFactory",
68326
- name: "factoryV2",
68327
- type: "address"
68328
- },
68329
- {
68330
- internalType: "contract IUniswapV3Factory",
68331
- name: "factoryV3",
68332
- type: "address"
68333
- },
68334
- {
68335
- internalType: "contract IAlgebraFactory",
68336
- name: "factoryAlgebra",
68337
- type: "address"
68338
- },
68339
- {
68340
- internalType: "contract ISolidlyFactory",
68341
- name: "factorySolidly",
68342
- type: "address"
68343
- }
68344
- ],
68345
- name: "getLPPriceFromFactory",
68346
- outputs: [
68347
- {
68348
- internalType: "uint256",
68349
- name: "price",
68350
- type: "uint256"
68351
- }
68352
- ],
68353
- stateMutability: "view",
68354
- type: "function"
68355
- },
68356
- {
68357
- inputs: [
68358
- {
68359
- internalType: "contract Hypervisor",
68360
- name: "lp",
68361
- type: "address"
68362
- }
68363
- ],
68364
- name: "getLPPriceGamma",
68365
- outputs: [
68366
- {
68367
- internalType: "uint256",
68368
- name: "price",
68369
- type: "uint256"
68370
- }
68371
- ],
68372
- stateMutability: "view",
68373
- type: "function"
68374
- },
68375
- {
68376
- inputs: [
68377
- {
68378
- internalType: "contract IAlgebraFactory",
68379
- name: "factory",
68380
- type: "address"
68381
- },
68382
- {
68383
- internalType: "contract IApeFactory",
68384
- name: "factoryV2",
68385
- type: "address"
68386
- },
68387
- {
68388
- internalType: "contract Hypervisor",
68389
- name: "lp",
68390
- type: "address"
68391
- }
68392
- ],
68393
- name: "getLPPriceGammaFromFactory",
68394
- outputs: [
68395
- {
68396
- internalType: "uint256",
68397
- name: "price",
68398
- type: "uint256"
68399
- }
68400
- ],
68401
- stateMutability: "view",
68402
- type: "function"
68403
- },
68404
- {
68405
- inputs: [
68406
- {
68407
- internalType: "address",
68408
- name: "lp",
68409
- type: "address"
68410
- }
68411
- ],
68412
- name: "getLPPriceSolidly",
68413
- outputs: [
68414
- {
68415
- internalType: "uint256",
68416
- name: "price",
68417
- type: "uint256"
68418
- }
68419
- ],
68420
- stateMutability: "view",
68421
- type: "function"
68422
- },
68423
- {
68424
- inputs: [
68425
- {
68426
- internalType: "contract ISolidlyFactory",
68427
- name: "factorySolidly",
68428
- type: "address"
68429
- },
68430
- {
68431
- internalType: "address",
68432
- name: "lp",
68433
- type: "address"
68434
- }
68435
- ],
68436
- name: "getLPPriceSolidlyFromFactory",
68437
- outputs: [
68438
- {
68439
- internalType: "uint256",
68440
- name: "price",
68441
- type: "uint256"
68442
- }
68443
- ],
68444
- stateMutability: "view",
68445
- type: "function"
68446
- },
68447
- {
68448
- inputs: [
68449
- {
68450
- internalType: "address",
68451
- name: "lp",
68452
- type: "address"
68453
- }
68454
- ],
68455
- name: "getLPPriceV2",
68456
- outputs: [
68457
- {
68458
- internalType: "uint256",
68459
- name: "price",
68460
- type: "uint256"
68461
- }
68462
- ],
68463
- stateMutability: "view",
68464
- type: "function"
68465
- },
68466
- {
68467
- inputs: [
68468
- {
68469
- internalType: "contract IApeFactory",
68470
- name: "factoryV2",
68471
- type: "address"
68472
- },
68473
- {
68474
- internalType: "address",
68475
- name: "lp",
68476
- type: "address"
68477
- }
68478
- ],
68479
- name: "getLPPriceV2FromFactory",
68480
- outputs: [
68481
- {
68482
- internalType: "uint256",
68483
- name: "price",
68484
- type: "uint256"
68485
- }
68486
- ],
68487
- stateMutability: "view",
68488
- type: "function"
68489
- },
68490
- {
68491
- inputs: [
68492
- {
68493
- internalType: "address",
68494
- name: "token0",
68495
- type: "address"
68496
- },
68497
- {
68498
- internalType: "address",
68499
- name: "token1",
68500
- type: "address"
68501
- },
68502
- {
68503
- internalType: "uint24",
68504
- name: "fee",
68505
- type: "uint24"
68506
- }
68507
- ],
68508
- name: "getLPPriceV3",
68509
- outputs: [
68510
- {
68511
- internalType: "uint256",
68512
- name: "price",
68513
- type: "uint256"
68514
- }
68515
- ],
68516
- stateMutability: "view",
68517
- type: "function"
68518
- },
68519
- {
68520
- inputs: [
68521
- {
68522
- internalType: "address",
68523
- name: "factoryV3",
68524
- type: "address"
68525
- },
68526
- {
68527
- internalType: "address",
68528
- name: "token0",
68529
- type: "address"
68530
- },
68531
- {
68532
- internalType: "address",
68533
- name: "token1",
68534
- type: "address"
68535
- },
68536
- {
68537
- internalType: "uint24",
68538
- name: "fee",
68539
- type: "uint24"
68540
- }
68541
- ],
68542
- name: "getLPPriceV3FromFactory",
68543
- outputs: [
68544
- {
68545
- internalType: "uint256",
68546
- name: "price",
68547
- type: "uint256"
68548
- }
68549
- ],
68550
- stateMutability: "view",
68551
- type: "function"
68552
- },
68553
- {
68554
- inputs: [
68555
- {
68556
- internalType: "address",
68557
- name: "lp",
68558
- type: "address"
68559
- }
68560
- ],
68561
- name: "getLPPriceXFAI",
68562
- outputs: [
68563
- {
68564
- internalType: "uint256",
68565
- name: "price",
68566
- type: "uint256"
68567
- }
68568
- ],
68569
- stateMutability: "view",
68570
- type: "function"
68571
- },
68572
- {
68573
- inputs: [
68574
- {
68575
- internalType: "contract IXFAIFactory",
68576
- name: "factoryXFAI",
68577
- type: "address"
68578
- },
68579
- {
68580
- internalType: "address",
68581
- name: "lp",
68582
- type: "address"
68583
- }
68584
- ],
68585
- name: "getLPPriceXFAIFromFactory",
68586
- outputs: [
68587
- {
68588
- internalType: "uint256",
68589
- name: "price",
68590
- type: "uint256"
68591
- }
68592
- ],
68593
- stateMutability: "view",
68594
- type: "function"
68595
- },
68596
- {
68597
- inputs: [
68598
- {
68599
- internalType: "address[]",
68600
- name: "tokens",
68601
- type: "address[]"
68602
- },
68603
- {
68604
- internalType: "uint256",
68605
- name: "_decimals",
68606
- type: "uint256"
68607
- }
68608
- ],
68609
- name: "getLPPrices",
68610
- outputs: [
68611
- {
68612
- internalType: "uint256[]",
68613
- name: "prices",
68614
- type: "uint256[]"
68615
- }
68616
- ],
68617
- stateMutability: "view",
68618
- type: "function"
68619
- },
68620
- {
68621
- inputs: [
68622
- {
68623
- internalType: "address[]",
68624
- name: "tokens",
68625
- type: "address[]"
68626
- }
68627
- ],
68628
- name: "getLPPricesV2",
68629
- outputs: [
68630
- {
68631
- internalType: "uint256[]",
68632
- name: "prices",
68633
- type: "uint256[]"
68634
- }
68635
- ],
68636
- stateMutability: "view",
68637
- type: "function"
68638
- },
68639
- {
68640
- inputs: [
68641
- {
68642
- internalType: "contract IApeFactory",
68643
- name: "factoryV2",
68644
- type: "address"
68645
- },
68646
- {
68647
- internalType: "address[]",
68648
- name: "tokens",
68649
- type: "address[]"
68650
- }
68651
- ],
68652
- name: "getLPPricesV2FromFactory",
68653
- outputs: [
68654
- {
68655
- internalType: "uint256[]",
68656
- name: "prices",
68657
- type: "uint256[]"
68658
- }
68659
- ],
68660
- stateMutability: "view",
68661
- type: "function"
68662
- },
68663
- {
68664
- inputs: [
68665
- {
68666
- internalType: "address[]",
68667
- name: "tokens0",
68668
- type: "address[]"
68669
- },
68670
- {
68671
- internalType: "address[]",
68672
- name: "tokens1",
68673
- type: "address[]"
68674
- },
68675
- {
68676
- internalType: "uint24[]",
68677
- name: "fees",
68678
- type: "uint24[]"
68679
- }
68680
- ],
68681
- name: "getLPPricesV3",
68682
- outputs: [
68683
- {
68684
- internalType: "uint256[]",
68685
- name: "prices",
68686
- type: "uint256[]"
68687
- }
68688
- ],
68689
- stateMutability: "view",
68690
- type: "function"
68691
- },
68692
- {
68693
- inputs: [
68694
- {
68695
- internalType: "contract IUniswapV3Factory",
68696
- name: "factoryV3",
68697
- type: "address"
68698
- },
68699
- {
68700
- internalType: "address[]",
68701
- name: "tokens0",
68702
- type: "address[]"
68703
- },
68704
- {
68705
- internalType: "address[]",
68706
- name: "tokens1",
68707
- type: "address[]"
68708
- },
68709
- {
68710
- internalType: "uint24[]",
68711
- name: "fees",
68712
- type: "uint24[]"
68713
- }
68714
- ],
68715
- name: "getLPPricesV3FromFactory",
68716
- outputs: [
68717
- {
68718
- internalType: "uint256[]",
68719
- name: "prices",
68720
- type: "uint256[]"
68721
- }
68722
- ],
68723
- stateMutability: "view",
68724
- type: "function"
68725
- },
68726
- {
68727
- inputs: [
68728
- ],
68729
- name: "getNativePrice",
68730
- outputs: [
68731
- {
68732
- internalType: "uint256",
68733
- name: "",
68734
- type: "uint256"
68735
- }
68736
- ],
68737
- stateMutability: "view",
68738
- type: "function"
68739
- },
68740
- {
68741
- inputs: [
68742
- {
68743
- internalType: "enum IPriceGetterV2.Protocol",
68744
- name: "protocol",
68745
- type: "uint8"
68746
- }
68747
- ],
68748
- name: "getNativePrice",
68749
- outputs: [
68750
- {
68751
- internalType: "uint256",
68752
- name: "nativePrice",
68753
- type: "uint256"
68754
- }
68755
- ],
68756
- stateMutability: "view",
68757
- type: "function"
68758
- },
68759
- {
68760
- inputs: [
68761
- {
68762
- internalType: "enum IPriceGetterV2.Protocol",
68763
- name: "protocol",
68764
- type: "uint8"
68765
- },
68766
- {
68767
- internalType: "contract IApeFactory",
68768
- name: "factoryV2",
68769
- type: "address"
68770
- },
68771
- {
68772
- internalType: "contract IUniswapV3Factory",
68773
- name: "factoryV3",
68774
- type: "address"
68775
- },
68776
- {
68777
- internalType: "contract ISolidlyFactory",
68778
- name: "factorySolidly",
68779
- type: "address"
68780
- }
68781
- ],
68782
- name: "getNativePriceFromFactory",
68783
- outputs: [
68784
- {
68785
- internalType: "uint256",
68786
- name: "nativePrice",
68787
- type: "uint256"
68788
- }
68789
- ],
68790
- stateMutability: "view",
68791
- type: "function"
68792
- },
68793
- {
68794
- inputs: [
68795
- {
68796
- internalType: "address",
68797
- name: "token",
68798
- type: "address"
68799
- },
68800
- {
68801
- internalType: "uint32",
68802
- name: "secondsAgo",
68803
- type: "uint32"
68804
- }
68805
- ],
68806
- name: "getPrice",
68807
- outputs: [
68808
- {
68809
- internalType: "uint256",
68810
- name: "",
68811
- type: "uint256"
68812
- }
68813
- ],
68814
- stateMutability: "view",
68815
- type: "function"
68816
- },
68817
- {
68818
- inputs: [
68819
- {
68820
- internalType: "address",
68821
- name: "token",
68822
- type: "address"
68823
- },
68824
- {
68825
- internalType: "enum IPriceGetterV2.Protocol",
68826
- name: "protocol",
68827
- type: "uint8"
68828
- }
68829
- ],
68830
- name: "getPrice",
68831
- outputs: [
68832
- {
68833
- internalType: "uint256",
68834
- name: "price",
68835
- type: "uint256"
68836
- }
68837
- ],
68838
- stateMutability: "view",
68839
- type: "function"
68840
- },
68841
- {
68842
- inputs: [
68843
- {
68844
- internalType: "address",
68845
- name: "token",
68846
- type: "address"
68847
- },
68848
- {
68849
- internalType: "uint256",
68850
- name: "_decimals",
68851
- type: "uint256"
68852
- }
68853
- ],
68854
- name: "getPrice",
68855
- outputs: [
68856
- {
68857
- internalType: "uint256",
68858
- name: "",
68859
- type: "uint256"
68860
- }
68861
- ],
68862
- stateMutability: "view",
68863
- type: "function"
68864
- },
68865
- {
68866
- inputs: [
68867
- {
68868
- internalType: "address",
68869
- name: "token",
68870
- type: "address"
68871
- }
68872
- ],
68873
- name: "getPriceAlgebra",
68874
- outputs: [
68875
- {
68876
- internalType: "uint256",
68877
- name: "price",
68878
- type: "uint256"
68879
- }
68880
- ],
68881
- stateMutability: "view",
68882
- type: "function"
68883
- },
68884
- {
68885
- inputs: [
68886
- {
68887
- internalType: "contract IAlgebraFactory",
68888
- name: "factoryAlgebra",
68889
- type: "address"
68890
- },
68891
- {
68892
- internalType: "address",
68893
- name: "token",
68894
- type: "address"
68895
- }
68896
- ],
68897
- name: "getPriceAlgebraFromFactory",
68898
- outputs: [
68899
- {
68900
- internalType: "uint256",
68901
- name: "price",
68902
- type: "uint256"
68903
- }
68904
- ],
68905
- stateMutability: "view",
68906
- type: "function"
68907
- },
68908
- {
68909
- inputs: [
68910
- {
68911
- internalType: "address",
68912
- name: "token",
68913
- type: "address"
68914
- },
68915
- {
68916
- internalType: "enum IPriceGetterV2.Protocol",
68917
- name: "protocol",
68918
- type: "uint8"
68919
- },
68920
- {
68921
- internalType: "contract IApeFactory",
68922
- name: "factoryV2",
68923
- type: "address"
68924
- },
68925
- {
68926
- internalType: "contract IUniswapV3Factory",
68927
- name: "factoryV3",
68928
- type: "address"
68929
- },
68930
- {
68931
- internalType: "contract IAlgebraFactory",
68932
- name: "factoryAlgebra",
68933
- type: "address"
68934
- },
68935
- {
68936
- internalType: "contract ISolidlyFactory",
68937
- name: "factorySolidly",
68938
- type: "address"
68939
- },
68940
- {
68941
- internalType: "contract IXFAIFactory",
68942
- name: "factoryXFAI",
68943
- type: "address"
68944
- }
68945
- ],
68946
- name: "getPriceFromFactory",
68947
- outputs: [
68948
- {
68949
- internalType: "uint256",
68950
- name: "price",
68951
- type: "uint256"
68952
- }
68953
- ],
68954
- stateMutability: "view",
68955
- type: "function"
68956
- },
68957
- {
68958
- inputs: [
68959
- {
68960
- internalType: "address",
68961
- name: "token",
68962
- type: "address"
68963
- }
68964
- ],
68965
- name: "getPriceV2",
68966
- outputs: [
68967
- {
68968
- internalType: "uint256",
68969
- name: "price",
68970
- type: "uint256"
68971
- }
68972
- ],
68973
- stateMutability: "view",
68974
- type: "function"
68975
- },
68976
- {
68977
- inputs: [
68978
- {
68979
- internalType: "contract IApeFactory",
68980
- name: "factoryV2",
68981
- type: "address"
68982
- },
68983
- {
68984
- internalType: "address",
68985
- name: "token",
68986
- type: "address"
68987
- }
68988
- ],
68989
- name: "getPriceV2FromFactory",
68990
- outputs: [
68991
- {
68992
- internalType: "uint256",
68993
- name: "price",
68994
- type: "uint256"
68995
- }
68996
- ],
68997
- stateMutability: "view",
68998
- type: "function"
68999
- },
69000
- {
69001
- inputs: [
69002
- {
69003
- internalType: "address",
69004
- name: "token",
69005
- type: "address"
69006
- }
69007
- ],
69008
- name: "getPriceV3",
69009
- outputs: [
69010
- {
69011
- internalType: "uint256",
69012
- name: "price",
69013
- type: "uint256"
69014
- }
69015
- ],
69016
- stateMutability: "view",
69017
- type: "function"
69018
- },
69019
- {
69020
- inputs: [
69021
- {
69022
- internalType: "contract IUniswapV3Factory",
69023
- name: "factoryV3",
69024
- type: "address"
69025
- },
69026
- {
69027
- internalType: "address",
69028
- name: "token",
69029
- type: "address"
69030
- }
69031
- ],
69032
- name: "getPriceV3FromFactory",
69033
- outputs: [
69034
- {
69035
- internalType: "uint256",
69036
- name: "price",
69037
- type: "uint256"
69038
- }
69039
- ],
69040
- stateMutability: "view",
69041
- type: "function"
69042
- },
69043
- {
69044
- inputs: [
69045
- {
69046
- internalType: "address",
69047
- name: "token",
69048
- type: "address"
69049
- }
69050
- ],
69051
- name: "getPriceXFAI",
69052
- outputs: [
69053
- {
69054
- internalType: "uint256",
69055
- name: "price",
69056
- type: "uint256"
69057
- }
69058
- ],
69059
- stateMutability: "view",
69060
- type: "function"
69061
- },
69062
- {
69063
- inputs: [
69064
- {
69065
- internalType: "contract IXFAIFactory",
69066
- name: "factoryXFAI",
69067
- type: "address"
69068
- },
69069
- {
69070
- internalType: "address",
69071
- name: "token",
69072
- type: "address"
69073
- }
69074
- ],
69075
- name: "getPriceXFAIFromFactory",
69076
- outputs: [
69077
- {
69078
- internalType: "uint256",
69079
- name: "price",
69080
- type: "uint256"
69081
- }
69082
- ],
69083
- stateMutability: "view",
69084
- type: "function"
69085
- },
69086
- {
69087
- inputs: [
69088
- {
69089
- internalType: "address[]",
69090
- name: "tokens",
69091
- type: "address[]"
69092
- },
69093
- {
69094
- internalType: "enum IPriceGetterV2.Protocol",
69095
- name: "protocol",
69096
- type: "uint8"
69097
- }
69098
- ],
69099
- name: "getPrices",
69100
- outputs: [
69101
- {
69102
- internalType: "uint256[]",
69103
- name: "prices",
69104
- type: "uint256[]"
69105
- }
69106
- ],
69107
- stateMutability: "view",
69108
- type: "function"
69109
- },
69110
- {
69111
- inputs: [
69112
- {
69113
- internalType: "address[]",
69114
- name: "tokens",
69115
- type: "address[]"
69116
- },
69117
- {
69118
- internalType: "uint256",
69119
- name: "_decimals",
69120
- type: "uint256"
69121
- }
69122
- ],
69123
- name: "getPrices",
69124
- outputs: [
69125
- {
69126
- internalType: "uint256[]",
69127
- name: "prices",
69128
- type: "uint256[]"
69129
- }
69130
- ],
69131
- stateMutability: "view",
69132
- type: "function"
69133
- },
69134
- {
69135
- inputs: [
69136
- {
69137
- internalType: "address[]",
69138
- name: "tokens",
69139
- type: "address[]"
69140
- },
69141
- {
69142
- internalType: "uint32",
69143
- name: "secondsAgo",
69144
- type: "uint32"
69145
- }
69146
- ],
69147
- name: "getPrices",
69148
- outputs: [
69149
- {
69150
- internalType: "uint256[]",
69151
- name: "prices",
69152
- type: "uint256[]"
69153
- }
69154
- ],
69155
- stateMutability: "view",
69156
- type: "function"
69157
- },
69158
- {
69159
- inputs: [
69160
- {
69161
- internalType: "address[]",
69162
- name: "tokens",
69163
- type: "address[]"
69164
- },
69165
- {
69166
- internalType: "enum IPriceGetterV2.Protocol",
69167
- name: "protocol",
69168
- type: "uint8"
69169
- },
69170
- {
69171
- internalType: "contract IApeFactory",
69172
- name: "factoryV2",
69173
- type: "address"
69174
- },
69175
- {
69176
- internalType: "contract IUniswapV3Factory",
69177
- name: "factoryV3",
69178
- type: "address"
69179
- },
69180
- {
69181
- internalType: "contract IAlgebraFactory",
69182
- name: "factoryAlgebra",
69183
- type: "address"
69184
- },
69185
- {
69186
- internalType: "contract ISolidlyFactory",
69187
- name: "factorySolidly",
69188
- type: "address"
69189
- },
69190
- {
69191
- internalType: "contract IXFAIFactory",
69192
- name: "factoryXFAI",
69193
- type: "address"
69194
- }
69195
- ],
69196
- name: "getPricesFromFactory",
69197
- outputs: [
69198
- {
69199
- internalType: "uint256[]",
69200
- name: "prices",
69201
- type: "uint256[]"
69202
- }
69203
- ],
69204
- stateMutability: "view",
69205
- type: "function"
69206
- },
69207
- {
69208
- inputs: [
69209
- {
69210
- internalType: "address",
69211
- name: "token",
69212
- type: "address"
69213
- }
69214
- ],
69215
- name: "getRawPrice",
69216
- outputs: [
69217
- {
69218
- internalType: "uint256",
69219
- name: "",
69220
- type: "uint256"
69221
- }
69222
- ],
69223
- stateMutability: "view",
69224
- type: "function"
69225
- },
69226
- {
69227
- inputs: [
69228
- {
69229
- internalType: "address[]",
69230
- name: "tokens",
69231
- type: "address[]"
69232
- }
69233
- ],
69234
- name: "getRawPrices",
69235
- outputs: [
69236
- {
69237
- internalType: "uint256[]",
69238
- name: "prices",
69239
- type: "uint256[]"
69240
- }
69241
- ],
69242
- stateMutability: "view",
69243
- type: "function"
69244
- },
69245
- {
69246
- inputs: [
69247
- {
69248
- internalType: "address",
69249
- name: "_wNative",
69250
- type: "address"
69251
- },
69252
- {
69253
- internalType: "uint256",
69254
- name: "_nativeLiquidityThreshold",
69255
- type: "uint256"
69256
- },
69257
- {
69258
- internalType: "contract IApeFactory",
69259
- name: "_defaultFactoryV2",
69260
- type: "address"
69261
- },
69262
- {
69263
- internalType: "contract IUniswapV3Factory",
69264
- name: "_defaultFactoryV3",
69265
- type: "address"
69266
- },
69267
- {
69268
- internalType: "contract IAlgebraFactory",
69269
- name: "_defaultFactoryAlgebra",
69270
- type: "address"
69271
- },
69272
- {
69273
- internalType: "contract ISolidlyFactory",
69274
- name: "_defaultFactorySolidly",
69275
- type: "address"
69276
- },
69277
- {
69278
- internalType: "contract IXFAIFactory",
69279
- name: "_defaultFactoryXFAI",
69280
- type: "address"
69281
- },
69282
- {
69283
- internalType: "address[]",
69284
- name: "_stableUsdTokens",
69285
- type: "address[]"
69286
- },
69287
- {
69288
- internalType: "address[]",
69289
- name: "_oracleTokens",
69290
- type: "address[]"
69291
- },
69292
- {
69293
- internalType: "address[]",
69294
- name: "_oracles",
69295
- type: "address[]"
69296
- }
69297
- ],
69298
- name: "initialize",
69299
- outputs: [
69300
- ],
69301
- stateMutability: "nonpayable",
69302
- type: "function"
69303
- },
69304
- {
69305
- inputs: [
69306
- ],
69307
- name: "nativeLiquidityThreshold",
69308
- outputs: [
69309
- {
69310
- internalType: "uint256",
69311
- name: "",
69312
- type: "uint256"
69313
- }
69314
- ],
69315
- stateMutability: "view",
69316
- type: "function"
69317
- },
69318
- {
69319
- inputs: [
69320
- ],
69321
- name: "owner",
69322
- outputs: [
69323
- {
69324
- internalType: "address",
69325
- name: "",
69326
- type: "address"
69327
- }
69328
- ],
69329
- stateMutability: "view",
69330
- type: "function"
69331
- },
69332
- {
69333
- inputs: [
69334
- {
69335
- internalType: "address",
69336
- name: "token",
69337
- type: "address"
69338
- }
69339
- ],
69340
- name: "removeTokenOracle",
69341
- outputs: [
69342
- ],
69343
- stateMutability: "nonpayable",
69344
- type: "function"
69345
- },
69346
- {
69347
- inputs: [
69348
- ],
69349
- name: "renounceOwnership",
69350
- outputs: [
69351
- ],
69352
- stateMutability: "nonpayable",
69353
- type: "function"
69354
- },
69355
- {
69356
- inputs: [
69357
- ],
69358
- name: "secondsAgo",
69359
- outputs: [
69360
- {
69361
- internalType: "uint24",
69362
- name: "",
69363
- type: "uint24"
69364
- }
69365
- ],
69366
- stateMutability: "view",
69367
- type: "function"
69368
- },
69369
- {
69370
- inputs: [
69371
- {
69372
- internalType: "enum IPriceGetterV2.Protocol",
69373
- name: "_protocol",
69374
- type: "uint8"
69375
- },
69376
- {
69377
- internalType: "address",
69378
- name: "_factory",
69379
- type: "address"
69380
- }
69381
- ],
69382
- name: "setDefaultFactory",
69383
- outputs: [
69384
- ],
69385
- stateMutability: "nonpayable",
69386
- type: "function"
69387
- },
69388
- {
69389
- inputs: [
69390
- {
69391
- internalType: "uint256",
69392
- name: "_nativeLiquidityThreshold",
69393
- type: "uint256"
69394
- }
69395
- ],
69396
- name: "setNativeLiquidityThreshold",
69397
- outputs: [
69398
- ],
69399
- stateMutability: "nonpayable",
69400
- type: "function"
69401
- },
69402
- {
69403
- inputs: [
69404
- {
69405
- internalType: "address",
69406
- name: "token",
69407
- type: "address"
69408
- },
69409
- {
69410
- internalType: "address",
69411
- name: "oracleAddress",
69412
- type: "address"
69413
- },
69414
- {
69415
- internalType: "enum PriceGetterV2.OracleType",
69416
- name: "oracleType",
69417
- type: "uint8"
69418
- }
69419
- ],
69420
- name: "setTokenOracle",
69421
- outputs: [
69422
- ],
69423
- stateMutability: "nonpayable",
69424
- type: "function"
69425
- },
69426
- {
69427
- inputs: [
69428
- {
69429
- internalType: "address",
69430
- name: "",
69431
- type: "address"
69432
- }
69433
- ],
69434
- name: "stableUsdTokenDecimals",
69435
- outputs: [
69436
- {
69437
- internalType: "uint8",
69438
- name: "",
69439
- type: "uint8"
69440
- }
69441
- ],
69442
- stateMutability: "view",
69443
- type: "function"
69444
- },
69445
- {
69446
- inputs: [
69447
- {
69448
- internalType: "uint256",
69449
- name: "",
69450
- type: "uint256"
69451
- }
69452
- ],
69453
- name: "stableUsdTokens",
69454
- outputs: [
69455
- {
69456
- internalType: "address",
69457
- name: "",
69458
- type: "address"
69459
- }
69460
- ],
69461
- stateMutability: "view",
69462
- type: "function"
69463
- },
69464
- {
69465
- inputs: [
69466
- {
69467
- internalType: "address",
69468
- name: "",
69469
- type: "address"
69470
- }
69471
- ],
69472
- name: "tokenOracles",
69473
- outputs: [
69474
- {
69475
- internalType: "enum PriceGetterV2.OracleType",
69476
- name: "oracleType",
69477
- type: "uint8"
69478
- },
69479
- {
69480
- internalType: "address",
69481
- name: "oracleAddress",
69482
- type: "address"
69483
- },
69484
- {
69485
- internalType: "uint8",
69486
- name: "oracleDecimals",
69487
- type: "uint8"
69488
- }
69489
- ],
69490
- stateMutability: "view",
69491
- type: "function"
69492
- },
69493
- {
69494
- inputs: [
69495
- {
69496
- internalType: "address",
69497
- name: "newOwner",
69498
- type: "address"
69499
- }
69500
- ],
69501
- name: "transferOwnership",
69502
- outputs: [
69503
- ],
69504
- stateMutability: "nonpayable",
69505
- type: "function"
69506
- },
69507
- {
69508
- inputs: [
69509
- ],
69510
- name: "wNative",
69511
- outputs: [
69512
- {
69513
- internalType: "address",
69514
- name: "",
69515
- type: "address"
69516
- }
69517
- ],
69518
- stateMutability: "view",
69519
- type: "function"
69520
- }
69521
- ];
69522
-
69523
- var PRICE_GETTER_ABI = [
69524
- {
69525
- inputs: [
69526
- ],
69527
- name: "T",
69528
- type: "error"
69529
- },
69530
- {
69531
- anonymous: false,
69532
- inputs: [
69533
- {
69534
- indexed: false,
69535
- internalType: "uint8",
69536
- name: "version",
69537
- type: "uint8"
69538
- }
69539
- ],
69540
- name: "Initialized",
69541
- type: "event"
69542
- },
69543
- {
69544
- anonymous: false,
69545
- inputs: [
69546
- {
69547
- indexed: true,
69548
- internalType: "address",
69549
- name: "previousOwner",
69550
- type: "address"
69551
- },
69552
- {
69553
- indexed: true,
69554
- internalType: "address",
69555
- name: "newOwner",
69556
- type: "address"
69557
- }
69558
- ],
69559
- name: "OwnershipTransferred",
69560
- type: "event"
69561
- },
69562
- {
69563
- inputs: [
69564
- ],
69565
- name: "DECIMALS",
69566
- outputs: [
69567
- {
69568
- internalType: "uint256",
69569
- name: "",
69570
- type: "uint256"
69571
- }
69572
- ],
69573
- stateMutability: "pure",
69574
- type: "function"
69575
- },
69576
- {
69577
- inputs: [
69578
- ],
69579
- name: "FACTORY",
69580
- outputs: [
69581
- {
69582
- internalType: "address",
69583
- name: "",
69584
- type: "address"
69585
- }
69586
- ],
69587
- stateMutability: "pure",
69588
- type: "function"
69589
- },
69590
- {
69591
- inputs: [
69592
- ],
69593
- name: "INITCODEHASH",
69594
- outputs: [
69595
- {
69596
- internalType: "bytes32",
69597
- name: "",
69598
- type: "bytes32"
69599
- }
69600
- ],
69601
- stateMutability: "pure",
69602
- type: "function"
69603
- },
69604
- {
69605
- inputs: [
69606
- ],
69607
- name: "defaultFactoryAlgebra",
69608
- outputs: [
69609
- {
69610
- internalType: "contract IAlgebraFactory",
69611
- name: "",
69612
- type: "address"
69613
- }
69614
- ],
69615
- stateMutability: "view",
69616
- type: "function"
69617
- },
69618
- {
69619
- inputs: [
69620
- ],
69621
- name: "defaultFactorySolidly",
69622
- outputs: [
69623
- {
69624
- internalType: "contract ISolidlyFactory",
69625
- name: "",
69626
- type: "address"
69627
- }
69628
- ],
69629
- stateMutability: "view",
69630
- type: "function"
69631
- },
69632
- {
69633
- inputs: [
69634
- ],
69635
- name: "defaultFactoryV2",
69636
- outputs: [
69637
- {
69638
- internalType: "contract IApeFactory",
69639
- name: "",
69640
- type: "address"
69641
- }
69642
- ],
69643
- stateMutability: "view",
69644
- type: "function"
69645
- },
69646
- {
69647
- inputs: [
69648
- ],
69649
- name: "defaultFactoryV3",
69650
- outputs: [
69651
- {
69652
- internalType: "contract IUniswapV3Factory",
69653
- name: "",
69654
- type: "address"
69655
- }
69656
- ],
69657
- stateMutability: "view",
69658
- type: "function"
69659
- },
69660
- {
69661
- inputs: [
69662
- {
69663
- internalType: "uint32",
69664
- name: "secondsAgo",
69665
- type: "uint32"
69666
- }
69667
- ],
69668
- name: "getETHPrice",
69669
- outputs: [
69670
- {
69671
- internalType: "uint256",
69672
- name: "",
69673
- type: "uint256"
69674
- }
69675
- ],
69676
- stateMutability: "view",
69677
- type: "function"
69678
- },
69679
- {
69680
- inputs: [
69681
- ],
69682
- name: "getETHPrice",
69683
- outputs: [
69684
- {
69685
- internalType: "uint256",
69686
- name: "",
69687
- type: "uint256"
69688
- }
69689
- ],
69690
- stateMutability: "view",
69691
- type: "function"
69692
- },
69693
- {
69694
- inputs: [
69695
- {
69696
- internalType: "address",
69697
- name: "token",
69698
- type: "address"
69699
- },
69700
- {
69701
- internalType: "uint256",
69702
- name: "_decimals",
69703
- type: "uint256"
69704
- }
69705
- ],
69706
- name: "getLPPrice",
69707
- outputs: [
69708
- {
69709
- internalType: "uint256",
69710
- name: "",
69711
- type: "uint256"
69712
- }
69713
- ],
69714
- stateMutability: "view",
69715
- type: "function"
69716
- },
69717
- {
69718
- inputs: [
69719
- {
69720
- internalType: "address",
69721
- name: "token0",
69722
- type: "address"
69723
- },
69724
- {
69725
- internalType: "address",
69726
- name: "token1",
69727
- type: "address"
69728
- }
69729
- ],
69730
- name: "getLPPriceAlgebra",
69731
- outputs: [
69732
- {
69733
- internalType: "uint256",
69734
- name: "price",
69735
- type: "uint256"
69736
- }
69737
- ],
69738
- stateMutability: "view",
69739
- type: "function"
69740
- },
69741
- {
69742
- inputs: [
69743
- {
69744
- internalType: "contract IAlgebraFactory",
69745
- name: "factoryAlgebra",
69746
- type: "address"
69747
- },
69748
- {
69749
- internalType: "address",
69750
- name: "token0",
69751
- type: "address"
69752
- },
69753
- {
69754
- internalType: "address",
69755
- name: "token1",
69756
- type: "address"
69757
- }
69758
- ],
69759
- name: "getLPPriceAlgebraFromFactory",
69760
- outputs: [
69761
- {
69762
- internalType: "uint256",
69763
- name: "price",
69764
- type: "uint256"
69765
- }
69766
- ],
69767
- stateMutability: "view",
69768
- type: "function"
69769
- },
69770
- {
69771
- inputs: [
69772
- {
69773
- internalType: "address",
69774
- name: "token",
69775
- type: "address"
69776
- },
69777
- {
69778
- internalType: "enum IPriceGetterV2.Protocol",
69779
- name: "protocol",
69780
- type: "uint8"
69781
- },
69782
- {
69783
- internalType: "contract IApeFactory",
69784
- name: "factoryV2",
69785
- type: "address"
69786
- },
69787
- {
69788
- internalType: "contract IUniswapV3Factory",
69789
- name: "factoryV3",
69790
- type: "address"
69791
- },
69792
- {
69793
- internalType: "contract IAlgebraFactory",
69794
- name: "factoryAlgebra",
69795
- type: "address"
69796
- },
69797
- {
69798
- internalType: "contract ISolidlyFactory",
69799
- name: "factorySolidly",
69800
- type: "address"
69801
- }
69802
- ],
69803
- name: "getLPPriceFromFactory",
69804
- outputs: [
69805
- {
69806
- internalType: "uint256",
69807
- name: "price",
69808
- type: "uint256"
69809
- }
69810
- ],
69811
- stateMutability: "view",
69812
- type: "function"
69813
- },
69814
- {
69815
- inputs: [
69816
- {
69817
- internalType: "contract Hypervisor",
69818
- name: "lp",
69819
- type: "address"
69820
- }
69821
- ],
69822
- name: "getLPPriceGamma",
69823
- outputs: [
69824
- {
69825
- internalType: "uint256",
69826
- name: "price",
69827
- type: "uint256"
69828
- }
69829
- ],
69830
- stateMutability: "view",
69831
- type: "function"
69832
- },
69833
- {
69834
- inputs: [
69835
- {
69836
- internalType: "contract IAlgebraFactory",
69837
- name: "factory",
69838
- type: "address"
69839
- },
69840
- {
69841
- internalType: "contract IApeFactory",
69842
- name: "factoryV2",
69843
- type: "address"
69844
- },
69845
- {
69846
- internalType: "contract Hypervisor",
69847
- name: "lp",
69848
- type: "address"
69849
- }
69850
- ],
69851
- name: "getLPPriceGammaFromFactory",
69852
- outputs: [
69853
- {
69854
- internalType: "uint256",
69855
- name: "price",
69856
- type: "uint256"
69857
- }
69858
- ],
69859
- stateMutability: "view",
69860
- type: "function"
69861
- },
69862
- {
69863
- inputs: [
69864
- {
69865
- internalType: "address",
69866
- name: "lp",
69867
- type: "address"
69868
- }
69869
- ],
69870
- name: "getLPPriceSolidly",
69871
- outputs: [
69872
- {
69873
- internalType: "uint256",
69874
- name: "price",
69875
- type: "uint256"
69876
- }
69877
- ],
69878
- stateMutability: "view",
69879
- type: "function"
69880
- },
69881
- {
69882
- inputs: [
69883
- {
69884
- internalType: "contract ISolidlyFactory",
69885
- name: "factorySolidly",
69886
- type: "address"
69887
- },
69888
- {
69889
- internalType: "address",
69890
- name: "lp",
69891
- type: "address"
69892
- }
69893
- ],
69894
- name: "getLPPriceSolidlyFromFactory",
69895
- outputs: [
69896
- {
69897
- internalType: "uint256",
69898
- name: "price",
69899
- type: "uint256"
69900
- }
69901
- ],
69902
- stateMutability: "view",
69903
- type: "function"
69904
- },
69905
- {
69906
- inputs: [
69907
- {
69908
- internalType: "contract IUniswapV3Factory",
69909
- name: "factoryV3",
69910
- type: "address"
69911
- },
69912
- {
69913
- internalType: "contract IApeFactory",
69914
- name: "factoryV2",
69915
- type: "address"
69916
- },
69917
- {
69918
- internalType: "contract ISteerVault",
69919
- name: "lp",
69920
- type: "address"
69921
- }
69922
- ],
69923
- name: "getLPPriceSteerFromFactory",
69924
- outputs: [
69925
- {
69926
- internalType: "uint256",
69927
- name: "price",
69928
- type: "uint256"
69929
- }
69930
- ],
69931
- stateMutability: "view",
69932
- type: "function"
69933
- },
69934
- {
69935
- inputs: [
69936
- {
69937
- internalType: "address",
69938
- name: "lp",
69939
- type: "address"
69940
- }
69941
- ],
69942
- name: "getLPPriceV2",
69943
- outputs: [
69944
- {
69945
- internalType: "uint256",
69946
- name: "price",
69947
- type: "uint256"
69948
- }
69949
- ],
69950
- stateMutability: "view",
69951
- type: "function"
69952
- },
69953
- {
69954
- inputs: [
69955
- {
69956
- internalType: "contract IApeFactory",
69957
- name: "factoryV2",
69958
- type: "address"
69959
- },
69960
- {
69961
- internalType: "address",
69962
- name: "lp",
69963
- type: "address"
69964
- }
69965
- ],
69966
- name: "getLPPriceV2FromFactory",
69967
- outputs: [
69968
- {
69969
- internalType: "uint256",
69970
- name: "price",
69971
- type: "uint256"
69972
- }
69973
- ],
69974
- stateMutability: "view",
69975
- type: "function"
69976
- },
69977
- {
69978
- inputs: [
69979
- {
69980
- internalType: "address",
69981
- name: "token0",
69982
- type: "address"
69983
- },
69984
- {
69985
- internalType: "address",
69986
- name: "token1",
69987
- type: "address"
69988
- },
69989
- {
69990
- internalType: "uint24",
69991
- name: "fee",
69992
- type: "uint24"
69993
- }
69994
- ],
69995
- name: "getLPPriceV3",
69996
- outputs: [
69997
- {
69998
- internalType: "uint256",
69999
- name: "price",
70000
- type: "uint256"
70001
- }
70002
- ],
70003
- stateMutability: "view",
70004
- type: "function"
70005
- },
70006
- {
70007
- inputs: [
70008
- {
70009
- internalType: "address",
70010
- name: "factoryV3",
70011
- type: "address"
70012
- },
70013
- {
70014
- internalType: "address",
70015
- name: "token0",
70016
- type: "address"
70017
- },
70018
- {
70019
- internalType: "address",
70020
- name: "token1",
70021
- type: "address"
70022
- },
70023
- {
70024
- internalType: "uint24",
70025
- name: "fee",
70026
- type: "uint24"
70027
- }
70028
- ],
70029
- name: "getLPPriceV3FromFactory",
70030
- outputs: [
70031
- {
70032
- internalType: "uint256",
70033
- name: "price",
70034
- type: "uint256"
70035
- }
70036
- ],
70037
- stateMutability: "view",
70038
- type: "function"
70039
- },
70040
- {
70041
- inputs: [
70042
- {
70043
- internalType: "address[]",
70044
- name: "tokens",
70045
- type: "address[]"
70046
- },
70047
- {
70048
- internalType: "uint256",
70049
- name: "_decimals",
70050
- type: "uint256"
70051
- }
70052
- ],
70053
- name: "getLPPrices",
70054
- outputs: [
70055
- {
70056
- internalType: "uint256[]",
70057
- name: "prices",
70058
- type: "uint256[]"
70059
- }
70060
- ],
70061
- stateMutability: "view",
70062
- type: "function"
70063
- },
70064
- {
70065
- inputs: [
70066
- {
70067
- internalType: "address[]",
70068
- name: "tokens",
70069
- type: "address[]"
70070
- }
70071
- ],
70072
- name: "getLPPricesSolidly",
70073
- outputs: [
70074
- {
70075
- internalType: "uint256[]",
70076
- name: "prices",
70077
- type: "uint256[]"
70078
- }
70079
- ],
70080
- stateMutability: "view",
70081
- type: "function"
70082
- },
70083
- {
70084
- inputs: [
70085
- {
70086
- internalType: "contract ISolidlyFactory",
70087
- name: "factorySolidly",
70088
- type: "address"
70089
- },
70090
- {
70091
- internalType: "address[]",
70092
- name: "tokens",
70093
- type: "address[]"
70094
- }
70095
- ],
70096
- name: "getLPPricesSolidlyFromFactory",
70097
- outputs: [
70098
- {
70099
- internalType: "uint256[]",
70100
- name: "prices",
70101
- type: "uint256[]"
70102
- }
70103
- ],
70104
- stateMutability: "view",
70105
- type: "function"
70106
- },
70107
- {
70108
- inputs: [
70109
- {
70110
- internalType: "address[]",
70111
- name: "tokens",
70112
- type: "address[]"
70113
- }
70114
- ],
70115
- name: "getLPPricesV2",
70116
- outputs: [
70117
- {
70118
- internalType: "uint256[]",
70119
- name: "prices",
70120
- type: "uint256[]"
70121
- }
70122
- ],
70123
- stateMutability: "view",
70124
- type: "function"
70125
- },
70126
- {
70127
- inputs: [
70128
- {
70129
- internalType: "contract IApeFactory",
68501
+ internalType: "address",
70130
68502
  name: "factoryV2",
70131
68503
  type: "address"
70132
68504
  },
70133
68505
  {
70134
- internalType: "address[]",
70135
- name: "tokens",
70136
- type: "address[]"
70137
- }
70138
- ],
70139
- name: "getLPPricesV2FromFactory",
70140
- outputs: [
70141
- {
70142
- internalType: "uint256[]",
70143
- name: "prices",
70144
- type: "uint256[]"
70145
- }
70146
- ],
70147
- stateMutability: "view",
70148
- type: "function"
70149
- },
70150
- {
70151
- inputs: [
70152
- {
70153
- internalType: "address[]",
70154
- name: "tokens0",
70155
- type: "address[]"
70156
- },
70157
- {
70158
- internalType: "address[]",
70159
- name: "tokens1",
70160
- type: "address[]"
70161
- },
70162
- {
70163
- internalType: "uint24[]",
70164
- name: "fees",
70165
- type: "uint24[]"
70166
- }
70167
- ],
70168
- name: "getLPPricesV3",
70169
- outputs: [
70170
- {
70171
- internalType: "uint256[]",
70172
- name: "prices",
70173
- type: "uint256[]"
70174
- }
70175
- ],
70176
- stateMutability: "view",
70177
- type: "function"
70178
- },
70179
- {
70180
- inputs: [
70181
- {
70182
- internalType: "contract IUniswapV3Factory",
68506
+ internalType: "address",
70183
68507
  name: "factoryV3",
70184
68508
  type: "address"
70185
68509
  },
70186
68510
  {
70187
- internalType: "address[]",
70188
- name: "tokens0",
70189
- type: "address[]"
70190
- },
70191
- {
70192
- internalType: "address[]",
70193
- name: "tokens1",
70194
- type: "address[]"
68511
+ internalType: "address",
68512
+ name: "factoryAlgebra",
68513
+ type: "address"
70195
68514
  },
70196
68515
  {
70197
- internalType: "uint24[]",
70198
- name: "fees",
70199
- type: "uint24[]"
70200
- }
70201
- ],
70202
- name: "getLPPricesV3FromFactory",
70203
- outputs: [
70204
- {
70205
- internalType: "uint256[]",
70206
- name: "prices",
70207
- type: "uint256[]"
68516
+ internalType: "address",
68517
+ name: "factorySolidly",
68518
+ type: "address"
70208
68519
  }
70209
68520
  ],
70210
- stateMutability: "view",
70211
- type: "function"
70212
- },
70213
- {
70214
- inputs: [
70215
- ],
70216
- name: "getNativePrice",
68521
+ name: "getPriceFromFactory",
70217
68522
  outputs: [
70218
68523
  {
70219
68524
  internalType: "uint256",
70220
- name: "",
68525
+ name: "price",
70221
68526
  type: "uint256"
70222
68527
  }
70223
68528
  ],
@@ -70227,53 +68532,19 @@ var PRICE_GETTER_ABI = [
70227
68532
  {
70228
68533
  inputs: [
70229
68534
  {
70230
- internalType: "enum IPriceGetterV2.Protocol",
68535
+ internalType: "enum IPriceGetter.Protocol",
70231
68536
  name: "protocol",
70232
68537
  type: "uint8"
70233
68538
  }
70234
68539
  ],
70235
- name: "getNativePrice",
68540
+ name: "getPriceGetterProtocol",
70236
68541
  outputs: [
70237
68542
  {
70238
- internalType: "uint256",
70239
- name: "nativePrice",
70240
- type: "uint256"
70241
- }
70242
- ],
70243
- stateMutability: "view",
70244
- type: "function"
70245
- },
70246
- {
70247
- inputs: [
70248
- {
70249
- internalType: "enum IPriceGetterV2.Protocol",
70250
- name: "protocol",
70251
- type: "uint8"
70252
- },
70253
- {
70254
- internalType: "contract IApeFactory",
70255
- name: "factoryV2",
70256
- type: "address"
70257
- },
70258
- {
70259
- internalType: "contract IUniswapV3Factory",
70260
- name: "factoryV3",
70261
- type: "address"
70262
- },
70263
- {
70264
- internalType: "contract ISolidlyFactory",
70265
- name: "factorySolidly",
68543
+ internalType: "contract IPriceGetterProtocol",
68544
+ name: "extension",
70266
68545
  type: "address"
70267
68546
  }
70268
68547
  ],
70269
- name: "getNativePriceFromFactory",
70270
- outputs: [
70271
- {
70272
- internalType: "uint256",
70273
- name: "nativePrice",
70274
- type: "uint256"
70275
- }
70276
- ],
70277
68548
  stateMutability: "view",
70278
68549
  type: "function"
70279
68550
  },
@@ -70285,35 +68556,21 @@ var PRICE_GETTER_ABI = [
70285
68556
  type: "address"
70286
68557
  },
70287
68558
  {
70288
- internalType: "uint32",
70289
- name: "secondsAgo",
70290
- type: "uint32"
70291
- }
70292
- ],
70293
- name: "getPrice",
70294
- outputs: [
70295
- {
70296
- internalType: "uint256",
70297
- name: "",
70298
- type: "uint256"
70299
- }
70300
- ],
70301
- stateMutability: "view",
70302
- type: "function"
70303
- },
70304
- {
70305
- inputs: [
68559
+ internalType: "enum IPriceGetter.Protocol",
68560
+ name: "protocol",
68561
+ type: "uint8"
68562
+ },
70306
68563
  {
70307
68564
  internalType: "address",
70308
- name: "token",
68565
+ name: "factory",
70309
68566
  type: "address"
70310
68567
  }
70311
68568
  ],
70312
- name: "getPriceAlgebra",
68569
+ name: "getTokenPrice",
70313
68570
  outputs: [
70314
68571
  {
70315
68572
  internalType: "uint256",
70316
- name: "price",
68573
+ name: "tokenPrice",
70317
68574
  type: "uint256"
70318
68575
  }
70319
68576
  ],
@@ -70323,22 +68580,27 @@ var PRICE_GETTER_ABI = [
70323
68580
  {
70324
68581
  inputs: [
70325
68582
  {
70326
- internalType: "contract IAlgebraFactory",
70327
- name: "factoryAlgebra",
70328
- type: "address"
68583
+ internalType: "address[]",
68584
+ name: "tokens",
68585
+ type: "address[]"
68586
+ },
68587
+ {
68588
+ internalType: "enum IPriceGetter.Protocol",
68589
+ name: "protocol",
68590
+ type: "uint8"
70329
68591
  },
70330
68592
  {
70331
68593
  internalType: "address",
70332
- name: "token",
68594
+ name: "factory",
70333
68595
  type: "address"
70334
68596
  }
70335
68597
  ],
70336
- name: "getPriceAlgebraFromFactory",
68598
+ name: "getTokenPrices",
70337
68599
  outputs: [
70338
68600
  {
70339
- internalType: "uint256",
70340
- name: "price",
70341
- type: "uint256"
68601
+ internalType: "uint256[]",
68602
+ name: "tokenPrices",
68603
+ type: "uint256[]"
70342
68604
  }
70343
68605
  ],
70344
68606
  stateMutability: "view",
@@ -70348,36 +68610,26 @@ var PRICE_GETTER_ABI = [
70348
68610
  inputs: [
70349
68611
  {
70350
68612
  internalType: "address",
70351
- name: "token",
68613
+ name: "lp",
70352
68614
  type: "address"
70353
68615
  },
70354
68616
  {
70355
- internalType: "enum IPriceGetterV2.Protocol",
68617
+ internalType: "enum IPriceGetter.Protocol",
70356
68618
  name: "protocol",
70357
68619
  type: "uint8"
70358
68620
  },
70359
68621
  {
70360
- internalType: "contract IApeFactory",
70361
- name: "factoryV2",
70362
- type: "address"
70363
- },
70364
- {
70365
- internalType: "contract IUniswapV3Factory",
70366
- name: "factoryV3",
70367
- type: "address"
70368
- },
70369
- {
70370
- internalType: "contract IAlgebraFactory",
70371
- name: "factoryAlgebra",
68622
+ internalType: "address",
68623
+ name: "factory",
70372
68624
  type: "address"
70373
68625
  },
70374
68626
  {
70375
- internalType: "contract ISolidlyFactory",
70376
- name: "factorySolidly",
70377
- type: "address"
68627
+ internalType: "enum IPriceGetter.Wrappers",
68628
+ name: "wrapper",
68629
+ type: "uint8"
70378
68630
  }
70379
68631
  ],
70380
- name: "getPriceFromFactory",
68632
+ name: "getWrappedLPPrice",
70381
68633
  outputs: [
70382
68634
  {
70383
68635
  internalType: "uint256",
@@ -70392,58 +68644,44 @@ var PRICE_GETTER_ABI = [
70392
68644
  inputs: [
70393
68645
  {
70394
68646
  internalType: "address",
70395
- name: "token",
68647
+ name: "_wNative",
70396
68648
  type: "address"
70397
- }
70398
- ],
70399
- name: "getPriceV2",
70400
- outputs: [
68649
+ },
70401
68650
  {
70402
68651
  internalType: "uint256",
70403
- name: "price",
68652
+ name: "_nativeLiquidityThreshold",
70404
68653
  type: "uint256"
70405
- }
70406
- ],
70407
- stateMutability: "view",
70408
- type: "function"
70409
- },
70410
- {
70411
- inputs: [
68654
+ },
70412
68655
  {
70413
- internalType: "contract IApeFactory",
70414
- name: "factoryV2",
70415
- type: "address"
68656
+ internalType: "address[]",
68657
+ name: "_stableUsdTokens",
68658
+ type: "address[]"
70416
68659
  },
70417
68660
  {
70418
- internalType: "address",
70419
- name: "token",
70420
- type: "address"
68661
+ internalType: "address[]",
68662
+ name: "_oracleTokens",
68663
+ type: "address[]"
68664
+ },
68665
+ {
68666
+ internalType: "address[]",
68667
+ name: "_oracles",
68668
+ type: "address[]"
70421
68669
  }
70422
68670
  ],
70423
- name: "getPriceV2FromFactory",
68671
+ name: "initialize",
70424
68672
  outputs: [
70425
- {
70426
- internalType: "uint256",
70427
- name: "price",
70428
- type: "uint256"
70429
- }
70430
68673
  ],
70431
- stateMutability: "view",
68674
+ stateMutability: "nonpayable",
70432
68675
  type: "function"
70433
68676
  },
70434
68677
  {
70435
68678
  inputs: [
70436
- {
70437
- internalType: "address",
70438
- name: "token",
70439
- type: "address"
70440
- }
70441
68679
  ],
70442
- name: "getPriceV3",
68680
+ name: "nativeLiquidityThreshold",
70443
68681
  outputs: [
70444
68682
  {
70445
68683
  internalType: "uint256",
70446
- name: "price",
68684
+ name: "",
70447
68685
  type: "uint256"
70448
68686
  }
70449
68687
  ],
@@ -70452,23 +68690,13 @@ var PRICE_GETTER_ABI = [
70452
68690
  },
70453
68691
  {
70454
68692
  inputs: [
70455
- {
70456
- internalType: "contract IUniswapV3Factory",
70457
- name: "factoryV3",
70458
- type: "address"
70459
- },
70460
- {
70461
- internalType: "address",
70462
- name: "token",
70463
- type: "address"
70464
- }
70465
68693
  ],
70466
- name: "getPriceV3FromFactory",
68694
+ name: "owner",
70467
68695
  outputs: [
70468
68696
  {
70469
- internalType: "uint256",
70470
- name: "price",
70471
- type: "uint256"
68697
+ internalType: "address",
68698
+ name: "",
68699
+ type: "address"
70472
68700
  }
70473
68701
  ],
70474
68702
  stateMutability: "view",
@@ -70477,22 +68705,17 @@ var PRICE_GETTER_ABI = [
70477
68705
  {
70478
68706
  inputs: [
70479
68707
  {
70480
- internalType: "address[]",
70481
- name: "tokens",
70482
- type: "address[]"
70483
- },
70484
- {
70485
- internalType: "enum IPriceGetterV2.Protocol",
70486
- name: "protocol",
68708
+ internalType: "enum IPriceGetter.Protocol",
68709
+ name: "",
70487
68710
  type: "uint8"
70488
68711
  }
70489
68712
  ],
70490
- name: "getPrices",
68713
+ name: "protocolPriceGetter",
70491
68714
  outputs: [
70492
68715
  {
70493
- internalType: "uint256[]",
70494
- name: "prices",
70495
- type: "uint256[]"
68716
+ internalType: "contract IPriceGetterProtocol",
68717
+ name: "",
68718
+ type: "address"
70496
68719
  }
70497
68720
  ],
70498
68721
  stateMutability: "view",
@@ -70504,174 +68727,65 @@ var PRICE_GETTER_ABI = [
70504
68727
  internalType: "address[]",
70505
68728
  name: "tokens",
70506
68729
  type: "address[]"
70507
- },
70508
- {
70509
- internalType: "uint256",
70510
- name: "_decimals",
70511
- type: "uint256"
70512
68730
  }
70513
68731
  ],
70514
- name: "getPrices",
68732
+ name: "removeStableUsdTokens",
70515
68733
  outputs: [
70516
- {
70517
- internalType: "uint256[]",
70518
- name: "prices",
70519
- type: "uint256[]"
70520
- }
70521
68734
  ],
70522
- stateMutability: "view",
68735
+ stateMutability: "nonpayable",
70523
68736
  type: "function"
70524
68737
  },
70525
68738
  {
70526
68739
  inputs: [
70527
68740
  {
70528
- internalType: "address[]",
70529
- name: "tokens",
70530
- type: "address[]"
70531
- },
70532
- {
70533
- internalType: "uint32",
70534
- name: "secondsAgo",
70535
- type: "uint32"
68741
+ internalType: "address",
68742
+ name: "token",
68743
+ type: "address"
70536
68744
  }
70537
68745
  ],
70538
- name: "getPrices",
68746
+ name: "removeTokenOracle",
70539
68747
  outputs: [
70540
- {
70541
- internalType: "uint256[]",
70542
- name: "prices",
70543
- type: "uint256[]"
70544
- }
70545
68748
  ],
70546
- stateMutability: "view",
68749
+ stateMutability: "nonpayable",
70547
68750
  type: "function"
70548
68751
  },
70549
68752
  {
70550
68753
  inputs: [
70551
- {
70552
- internalType: "address[]",
70553
- name: "tokens",
70554
- type: "address[]"
70555
- },
70556
- {
70557
- internalType: "enum IPriceGetterV2.Protocol",
70558
- name: "protocol",
70559
- type: "uint8"
70560
- },
70561
- {
70562
- internalType: "contract IApeFactory",
70563
- name: "factoryV2",
70564
- type: "address"
70565
- },
70566
- {
70567
- internalType: "contract IUniswapV3Factory",
70568
- name: "factoryV3",
70569
- type: "address"
70570
- },
70571
- {
70572
- internalType: "contract IAlgebraFactory",
70573
- name: "factoryAlgebra",
70574
- type: "address"
70575
- },
70576
- {
70577
- internalType: "contract ISolidlyFactory",
70578
- name: "factorySolidly",
70579
- type: "address"
70580
- }
70581
68754
  ],
70582
- name: "getPricesFromFactory",
68755
+ name: "renounceOwnership",
70583
68756
  outputs: [
70584
- {
70585
- internalType: "uint256[]",
70586
- name: "prices",
70587
- type: "uint256[]"
70588
- }
70589
68757
  ],
70590
- stateMutability: "view",
68758
+ stateMutability: "nonpayable",
70591
68759
  type: "function"
70592
68760
  },
70593
68761
  {
70594
68762
  inputs: [
70595
- {
70596
- internalType: "address",
70597
- name: "token",
70598
- type: "address"
70599
- }
70600
- ],
70601
- name: "getRawPrice",
70602
- outputs: [
70603
68763
  {
70604
68764
  internalType: "uint256",
70605
- name: "",
68765
+ name: "_nativeLiquidityThreshold",
70606
68766
  type: "uint256"
70607
68767
  }
70608
68768
  ],
70609
- stateMutability: "view",
70610
- type: "function"
70611
- },
70612
- {
70613
- inputs: [
70614
- {
70615
- internalType: "address[]",
70616
- name: "tokens",
70617
- type: "address[]"
70618
- }
70619
- ],
70620
- name: "getRawPrices",
68769
+ name: "setNativeLiquidityThreshold",
70621
68770
  outputs: [
70622
- {
70623
- internalType: "uint256[]",
70624
- name: "prices",
70625
- type: "uint256[]"
70626
- }
70627
68771
  ],
70628
- stateMutability: "view",
68772
+ stateMutability: "nonpayable",
70629
68773
  type: "function"
70630
68774
  },
70631
68775
  {
70632
68776
  inputs: [
70633
68777
  {
70634
- internalType: "address",
70635
- name: "_wNative",
70636
- type: "address"
70637
- },
70638
- {
70639
- internalType: "contract IApeFactory",
70640
- name: "_defaultFactoryV2",
70641
- type: "address"
70642
- },
70643
- {
70644
- internalType: "contract IUniswapV3Factory",
70645
- name: "_defaultFactoryV3",
70646
- type: "address"
70647
- },
70648
- {
70649
- internalType: "contract IAlgebraFactory",
70650
- name: "_defaultFactoryAlgebra",
70651
- type: "address"
68778
+ internalType: "enum IPriceGetter.Protocol",
68779
+ name: "protocol",
68780
+ type: "uint8"
70652
68781
  },
70653
68782
  {
70654
- internalType: "contract ISolidlyFactory",
70655
- name: "_defaultFactorySolidly",
68783
+ internalType: "address",
68784
+ name: "extension",
70656
68785
  type: "address"
70657
- },
70658
- {
70659
- internalType: "address[]",
70660
- name: "_stableUsdTokens",
70661
- type: "address[]"
70662
- },
70663
- {
70664
- internalType: "address[]",
70665
- name: "_oracleTokens",
70666
- type: "address[]"
70667
- },
70668
- {
70669
- internalType: "address[]",
70670
- name: "_oracles",
70671
- type: "address[]"
70672
68786
  }
70673
68787
  ],
70674
- name: "initialize",
68788
+ name: "setPriceGetterProtocol",
70675
68789
  outputs: [
70676
68790
  ],
70677
68791
  stateMutability: "nonpayable",
@@ -70679,55 +68793,23 @@ var PRICE_GETTER_ABI = [
70679
68793
  },
70680
68794
  {
70681
68795
  inputs: [
70682
- ],
70683
- name: "owner",
70684
- outputs: [
70685
68796
  {
70686
- internalType: "address",
70687
- name: "",
70688
- type: "address"
70689
- }
70690
- ],
70691
- stateMutability: "view",
70692
- type: "function"
70693
- },
70694
- {
70695
- inputs: [
68797
+ internalType: "enum IPriceGetter.Protocol[]",
68798
+ name: "protocols",
68799
+ type: "uint8[]"
68800
+ },
70696
68801
  {
70697
- internalType: "address",
70698
- name: "token",
70699
- type: "address"
68802
+ internalType: "address[]",
68803
+ name: "extensions",
68804
+ type: "address[]"
70700
68805
  }
70701
68806
  ],
70702
- name: "removeTokenOracle",
70703
- outputs: [
70704
- ],
70705
- stateMutability: "nonpayable",
70706
- type: "function"
70707
- },
70708
- {
70709
- inputs: [
70710
- ],
70711
- name: "renounceOwnership",
68807
+ name: "setPriceGetterProtocols",
70712
68808
  outputs: [
70713
68809
  ],
70714
68810
  stateMutability: "nonpayable",
70715
68811
  type: "function"
70716
68812
  },
70717
- {
70718
- inputs: [
70719
- ],
70720
- name: "secondsAgo",
70721
- outputs: [
70722
- {
70723
- internalType: "uint24",
70724
- name: "",
70725
- type: "uint24"
70726
- }
70727
- ],
70728
- stateMutability: "view",
70729
- type: "function"
70730
- },
70731
68813
  {
70732
68814
  inputs: [
70733
68815
  {
@@ -70741,7 +68823,7 @@ var PRICE_GETTER_ABI = [
70741
68823
  type: "address"
70742
68824
  },
70743
68825
  {
70744
- internalType: "enum PriceGetterV2.OracleType",
68826
+ internalType: "enum PriceGetter.OracleType",
70745
68827
  name: "oracleType",
70746
68828
  type: "uint8"
70747
68829
  }
@@ -70752,25 +68834,6 @@ var PRICE_GETTER_ABI = [
70752
68834
  stateMutability: "nonpayable",
70753
68835
  type: "function"
70754
68836
  },
70755
- {
70756
- inputs: [
70757
- {
70758
- internalType: "address",
70759
- name: "",
70760
- type: "address"
70761
- }
70762
- ],
70763
- name: "stableUsdTokenDecimals",
70764
- outputs: [
70765
- {
70766
- internalType: "uint8",
70767
- name: "",
70768
- type: "uint8"
70769
- }
70770
- ],
70771
- stateMutability: "view",
70772
- type: "function"
70773
- },
70774
68837
  {
70775
68838
  inputs: [
70776
68839
  {
@@ -70783,8 +68846,13 @@ var PRICE_GETTER_ABI = [
70783
68846
  outputs: [
70784
68847
  {
70785
68848
  internalType: "address",
70786
- name: "",
68849
+ name: "tokenAddress",
70787
68850
  type: "address"
68851
+ },
68852
+ {
68853
+ internalType: "uint8",
68854
+ name: "decimals",
68855
+ type: "uint8"
70788
68856
  }
70789
68857
  ],
70790
68858
  stateMutability: "view",
@@ -70801,7 +68869,7 @@ var PRICE_GETTER_ABI = [
70801
68869
  name: "tokenOracles",
70802
68870
  outputs: [
70803
68871
  {
70804
- internalType: "enum PriceGetterV2.OracleType",
68872
+ internalType: "enum PriceGetter.OracleType",
70805
68873
  name: "oracleType",
70806
68874
  type: "uint8"
70807
68875
  },
@@ -70832,24 +68900,9 @@ var PRICE_GETTER_ABI = [
70832
68900
  ],
70833
68901
  stateMutability: "nonpayable",
70834
68902
  type: "function"
70835
- },
70836
- {
70837
- inputs: [
70838
- ],
70839
- name: "wNative",
70840
- outputs: [
70841
- {
70842
- internalType: "address",
70843
- name: "",
70844
- type: "address"
70845
- }
70846
- ],
70847
- stateMutability: "view",
70848
- type: "function"
70849
68903
  }
70850
68904
  ];
70851
68905
 
70852
- const ZERO_ADDRESS = '0x0000000000000000000000000000000000000000';
70853
68906
  function useTokenPrices() {
70854
68907
  const apeswapListsURL = useURLByEnvironment('apeswapLists');
70855
68908
  return useQuery({
@@ -70864,47 +68917,52 @@ const getTokenPrices = (apeswapListsURL) => __awaiter$9(void 0, void 0, void 0,
70864
68917
  try {
70865
68918
  const response = yield axios.get(`${apeswapListsURL}/config/tokens.json`);
70866
68919
  const tokenList = response.data;
70867
- const prices = [];
70868
- for (let index = 0; index < MAINNET_CHAINS.length; index++) {
70869
- const chain = MAINNET_CHAINS[index];
70870
- prices.push(getAllTokenPrices(chain, tokenList));
70871
- }
70872
- const all = yield Promise.allSettled(prices);
70873
- // Keep only successfully fulfilled promises and discard the rest
70874
- const successfulPromises = all === null || all === void 0 ? void 0 : all.filter((result) => result.status === 'fulfilled');
70875
- const successfulPrices = successfulPromises.map((result) => result.value);
70876
- return successfulPrices.flat();
68920
+ const promises = MAINNET_CHAINS.map((chain) => __awaiter$9(void 0, void 0, void 0, function* () {
68921
+ try {
68922
+ // Directly return the result of fetching prices, or handle any exceptions here
68923
+ return yield getAllTokenPrices(+chain, tokenList);
68924
+ }
68925
+ catch (error) {
68926
+ console.error(`Failed to fetch prices for chain ${chain}:`, error);
68927
+ return null;
68928
+ }
68929
+ }));
68930
+ const responses = yield Promise.allSettled(promises);
68931
+ // Combine the filtering and mapping into a single loop, avoiding dual mapping
68932
+ const flattenedPrices = responses.reduce((acc, result) => {
68933
+ if (result.status === 'fulfilled' && result.value) {
68934
+ acc.push(...result.value);
68935
+ }
68936
+ return acc;
68937
+ }, []);
68938
+ return flattenedPrices;
70877
68939
  }
70878
68940
  catch (_a) {
70879
68941
  return [];
70880
68942
  }
70881
68943
  });
70882
68944
  const getAllTokenPrices = (chainId, tokens) => __awaiter$9(void 0, void 0, void 0, function* () {
70883
- const dexScreenerTokensToCall = Object.fromEntries(Object.entries(tokens).filter(([, token]) => {
70884
- var _a;
70885
- return ((_a = token === null || token === void 0 ? void 0 : token.liquidityDex) === null || _a === void 0 ? void 0 : _a[chainId]) === types.LiquidityDex.External;
70886
- }));
70887
- const filterTokensToCall = Object.fromEntries(Object.entries(tokens).filter(([, token]) => {
70888
- var _a, _b;
70889
- return ((token === null || token === void 0 ? void 0 : token.active) &&
70890
- !(token === null || token === void 0 ? void 0 : token.lpToken) &&
70891
- token.address[chainId] &&
70892
- ((_a = token.decimals) === null || _a === void 0 ? void 0 : _a[chainId]) &&
70893
- ((_b = token === null || token === void 0 ? void 0 : token.liquidityDex) === null || _b === void 0 ? void 0 : _b[chainId]) !== types.LiquidityDex.External);
70894
- }));
70895
- const filterLpTokensToCall = Object.fromEntries(Object.entries(tokens).filter(([, token]) => {
70896
- var _a, _b;
70897
- return ((token === null || token === void 0 ? void 0 : token.active) &&
70898
- (token === null || token === void 0 ? void 0 : token.lpToken) &&
68945
+ const { parsedDexscreenerTokens, filterTokensToCall, arrayFilterTokens } = Object.keys(tokens).reduce((acc, key) => {
68946
+ var _a, _b, _c, _d, _e, _f, _g;
68947
+ const token = tokens[key];
68948
+ if (((_a = token === null || token === void 0 ? void 0 : token.liquidityDex) === null || _a === void 0 ? void 0 : _a[chainId]) === types.LiquidityDex.External) {
68949
+ acc.parsedDexscreenerTokens.push(Object.assign(Object.assign({}, token), { address: (_b = token.address[chainId]) !== null && _b !== void 0 ? _b : '', decimals: (_d = (_c = token === null || token === void 0 ? void 0 : token.decimals) === null || _c === void 0 ? void 0 : _c[chainId]) !== null && _d !== void 0 ? _d : 18, lpToken: (_e = token.lpToken) !== null && _e !== void 0 ? _e : false }));
68950
+ }
68951
+ else if ((token === null || token === void 0 ? void 0 : token.active) &&
70899
68952
  token.address[chainId] &&
70900
- ((_a = token.decimals) === null || _a === void 0 ? void 0 : _a[chainId]) &&
70901
- ((_b = token === null || token === void 0 ? void 0 : token.liquidityDex) === null || _b === void 0 ? void 0 : _b[chainId]) !== types.LiquidityDex.External);
70902
- }));
70903
- const arrayFilterTokens = Object.values(filterTokensToCall);
70904
- const abondIndex = arrayFilterTokens.findIndex((token) => { var _a, _b; return ((_a = token.address[chainId]) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = ABOND_ADDRESSES[chainId]) === null || _b === void 0 ? void 0 : _b.toLowerCase()); });
70905
- const parsedDexscreenerTokens = Object.values(dexScreenerTokensToCall).map((token) => {
70906
- var _a, _b, _c, _d;
70907
- return Object.assign(Object.assign({}, token), { address: (_a = token.address[chainId]) !== null && _a !== void 0 ? _a : '', decimals: (_c = (_b = token === null || token === void 0 ? void 0 : token.decimals) === null || _b === void 0 ? void 0 : _b[chainId]) !== null && _c !== void 0 ? _c : 18, lpToken: (_d = token.lpToken) !== null && _d !== void 0 ? _d : false });
68953
+ ((_f = token.decimals) === null || _f === void 0 ? void 0 : _f[chainId]) &&
68954
+ //@ts-ignore
68955
+ ((_g = token === null || token === void 0 ? void 0 : token.liquidityDex) === null || _g === void 0 ? void 0 : _g[chainId]) !== types.LiquidityDex.External) {
68956
+ acc.filterTokensToCall[key] = token;
68957
+ acc.arrayFilterTokens.push(token);
68958
+ }
68959
+ return acc;
68960
+ },
68961
+ // Accumulator
68962
+ {
68963
+ parsedDexscreenerTokens: [],
68964
+ filterTokensToCall: {},
68965
+ arrayFilterTokens: [],
70908
68966
  });
70909
68967
  if (chainId === types.ChainId.BSC_TESTNET) {
70910
68968
  return arrayFilterTokens.map((token) => {
@@ -70919,32 +68977,19 @@ const getAllTokenPrices = (chainId, tokens) => __awaiter$9(void 0, void 0, void
70919
68977
  });
70920
68978
  }
70921
68979
  const dexScreenerResults = yield getBatchTokenPriceWithDexscreener({ chainId, tokens: parsedDexscreenerTokens });
70922
- const tokenResults = yield getTokenPricesV2FromPriceGetter(filterTokensToCall, chainId, false);
70923
- const lpTokenResults = yield getTokenPricesV2FromPriceGetter(filterLpTokensToCall, chainId, true);
68980
+ const tokenResults = yield getTokenPricesV3FromPriceGetter(filterTokensToCall, chainId);
70924
68981
  const parsedTokenResults = arrayFilterTokens.map((token, i) => {
70925
- var _a, _b, _c, _d;
70926
- const price = token.symbol.toLowerCase() === 'veabond'
70927
- ? getBalanceNumber((_a = tokenResults === null || tokenResults === void 0 ? void 0 : tokenResults[abondIndex]) === null || _a === void 0 ? void 0 : _a.toString(), 18)
70928
- : getBalanceNumber((_b = tokenResults === null || tokenResults === void 0 ? void 0 : tokenResults[i]) === null || _b === void 0 ? void 0 : _b.toString(), 18);
68982
+ var _a, _b, _c;
68983
+ const price = getBalanceNumber((_a = tokenResults === null || tokenResults === void 0 ? void 0 : tokenResults[i]) === null || _a === void 0 ? void 0 : _a.toString(), 18);
70929
68984
  return {
70930
68985
  symbol: token.symbol,
70931
68986
  address: token.address[chainId],
70932
68987
  price: price !== null && price !== void 0 ? price : undefined,
70933
- decimals: (_d = (_c = token.decimals) === null || _c === void 0 ? void 0 : _c[chainId]) !== null && _d !== void 0 ? _d : undefined,
70934
- chainId,
70935
- };
70936
- });
70937
- const parsedLpTokenResults = Object.values(filterLpTokensToCall).map((token, i) => {
70938
- var _a, _b;
70939
- return {
70940
- symbol: token.symbol,
70941
- address: token.address[chainId],
70942
- price: getBalanceNumber(lpTokenResults[i].toString(), 18),
70943
- decimals: (_b = (_a = token.decimals) === null || _a === void 0 ? void 0 : _a[chainId]) !== null && _b !== void 0 ? _b : undefined,
68988
+ decimals: (_c = (_b = token.decimals) === null || _b === void 0 ? void 0 : _b[chainId]) !== null && _c !== void 0 ? _c : undefined,
70944
68989
  chainId,
70945
68990
  };
70946
68991
  });
70947
- return [...parsedTokenResults, ...parsedLpTokenResults, ...dexScreenerResults];
68992
+ return [...parsedTokenResults, ...dexScreenerResults];
70948
68993
  });
70949
68994
  const getBatchTokenPriceWithDexscreener = (params) => __awaiter$9(void 0, void 0, void 0, function* () {
70950
68995
  const { chainId, tokens } = params;
@@ -71043,7 +69088,7 @@ const getBatchTokenPriceWithDexscreener = (params) => __awaiter$9(void 0, void 0
71043
69088
  .sort((a, b) => { var _a, _b; return ((_a = b === null || b === void 0 ? void 0 : b.liquidity) === null || _a === void 0 ? void 0 : _a.usd) - ((_b = a === null || a === void 0 ? void 0 : a.liquidity) === null || _b === void 0 ? void 0 : _b.usd); })[0]) === null || _a === void 0 ? void 0 : _a.priceUsd;
71044
69089
  }
71045
69090
  }
71046
- catch (_b) {
69091
+ catch (error) {
71047
69092
  price = undefined;
71048
69093
  }
71049
69094
  let originalAddress = token.address;
@@ -71060,7 +69105,7 @@ const getBatchTokenPriceWithDexscreener = (params) => __awaiter$9(void 0, void 0
71060
69105
  return Object.assign(Object.assign({}, tokensCopy === null || tokensCopy === void 0 ? void 0 : tokensCopy[index]), { address: originalAddress, chainId, price: parseFloat(price !== null && price !== void 0 ? price : '0') });
71061
69106
  });
71062
69107
  }
71063
- catch (_a) {
69108
+ catch (error) {
71064
69109
  console.log(`Failed to get price from dexscreener for chain ${chainId}.`);
71065
69110
  return tokensCopy.map((token) => {
71066
69111
  return Object.assign(Object.assign({}, token), { chainId, price: undefined });
@@ -71081,102 +69126,42 @@ const getDexScreenerChainName = (chainId) => {
71081
69126
  //@ts-ignore
71082
69127
  return chainsName[chainId];
71083
69128
  };
71084
- function getTokenPricesV2FromPriceGetter(tokensToCall_1, chain_1) {
71085
- return __awaiter$9(this, arguments, void 0, function* (tokensToCall, chain, lpTokens = false) {
71086
- const tokenCalls = getPriceGetterCallData(tokensToCall, chain, lpTokens);
71087
- const calls = tokenCalls.map((t) => ({
71088
- address: PRICE_GETTER_ADDRESSES[chain],
71089
- name: lpTokens ? 'getLPPriceFromFactory' : 'getPriceFromFactory',
71090
- params: t,
71091
- }));
71092
- const tokenResults = yield multicall(+chain, [types.ChainId.LINEA, types.ChainId.LIGHTLINK, types.ChainId.IOTA, types.ChainId.BASE, types.ChainId.ARBITRUM].includes(chain)
71093
- ? PRICE_GETTER_ABI_LINEA
71094
- : PRICE_GETTER_ABI, calls);
71095
- return tokenResults;
71096
- });
71097
- }
71098
- function getPriceGetterCallData(tokensToCall, // replace 'any' with the actual type
71099
- supportedChainId, lpTokens) {
71100
- return Object.values(tokensToCall).map((token) => {
71101
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
71102
- const liquidityDex = (_a = token.liquidityDex) === null || _a === void 0 ? void 0 : _a[supportedChainId];
71103
- let dexFactory;
71104
- let protocol = 2;
71105
- let factoryV2 = (_c = (_b = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[supportedChainId]) === null || _b === void 0 ? void 0 : _b[2]) !== null && _c !== void 0 ? _c : ZERO_ADDRESS;
71106
- let factoryV3 = (_e = (_d = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[supportedChainId]) === null || _d === void 0 ? void 0 : _d[3]) !== null && _e !== void 0 ? _e : ZERO_ADDRESS;
71107
- let factoryAlgebra = (_g = (_f = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[supportedChainId]) === null || _f === void 0 ? void 0 : _f[4]) !== null && _g !== void 0 ? _g : ZERO_ADDRESS;
71108
- let factorySolidly = (_j = (_h = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[supportedChainId]) === null || _h === void 0 ? void 0 : _h[7]) !== null && _j !== void 0 ? _j : ZERO_ADDRESS;
71109
- let factoryXFAI = (_l = (_k = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[supportedChainId]) === null || _k === void 0 ? void 0 : _k[8]) !== null && _l !== void 0 ? _l : ZERO_ADDRESS;
71110
- let factoryCurve = (_o = (_m = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[supportedChainId]) === null || _m === void 0 ? void 0 : _m[9]) !== null && _o !== void 0 ? _o : ZERO_ADDRESS;
71111
- if (liquidityDex) {
71112
- dexFactory = (_p = types.dexFactories[supportedChainId]) === null || _p === void 0 ? void 0 : _p[liquidityDex];
71113
- protocol = (_q = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.protocol) !== null && _q !== void 0 ? _q : types.Protocols.V2;
71114
- switch (protocol) {
71115
- case types.Protocols.V2:
71116
- factoryV2 = (_r = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _r !== void 0 ? _r : factoryV2;
71117
- break;
71118
- case types.Protocols.V3:
71119
- factoryV3 = (_s = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _s !== void 0 ? _s : factoryV3;
71120
- break;
71121
- case types.Protocols.Algebra:
71122
- factoryAlgebra = (_t = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _t !== void 0 ? _t : factoryAlgebra;
71123
- break;
71124
- case types.Protocols.Solidly:
71125
- factorySolidly = (_u = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _u !== void 0 ? _u : factorySolidly;
71126
- break;
71127
- case types.Protocols.XFAI:
71128
- factoryXFAI = (_v = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _v !== void 0 ? _v : factoryXFAI;
71129
- break;
71130
- case types.Protocols.Curve:
71131
- factoryCurve = (_w = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _w !== void 0 ? _w : factoryCurve;
71132
- break;
69129
+ function getTokenPricesV3FromPriceGetter(tokensToCall, chain) {
69130
+ return __awaiter$9(this, void 0, void 0, function* () {
69131
+ const calls = [];
69132
+ Object.values(tokensToCall).map((token) => {
69133
+ const call = getPriceGetterV3Call(chain, token);
69134
+ if (call) {
69135
+ calls.push(call);
71133
69136
  }
71134
- }
71135
- const errMsg = `No default dex factory found for retrieving price. For Protocol: ${protocol}.`;
71136
- switch (protocol) {
71137
- case types.Protocols.Both:
71138
- if (factoryV2 === ZERO_ADDRESS || factoryV3 === ZERO_ADDRESS) {
71139
- throw new Error(errMsg);
71140
- }
71141
- break;
71142
- case types.Protocols.V2:
71143
- if (factoryV2 === ZERO_ADDRESS) {
71144
- throw new Error(errMsg);
71145
- }
71146
- break;
71147
- case types.Protocols.V3:
71148
- if (factoryV3 === ZERO_ADDRESS) {
71149
- throw new Error(errMsg);
71150
- }
71151
- break;
71152
- }
71153
- // TODO: Not sure if this is the best way to handle this. It requires all tokens to be either LP or not
71154
- if (lpTokens && protocol == types.Protocols.Algebra) {
71155
- protocol = types.Protocols.Gamma;
71156
- }
71157
- if (lpTokens && protocol == types.Protocols.V3) {
71158
- protocol = types.Protocols.Steer;
71159
- }
71160
- // This is a temporary fix for Curve. We should move to new Price getter interface. This is the way backwards compatibility is handled for now for Curve.
71161
- if (protocol == types.Protocols.Curve) {
71162
- factoryV2 = factoryCurve;
71163
- }
71164
- if ([types.ChainId.LINEA, types.ChainId.LIGHTLINK, types.ChainId.IOTA, types.ChainId.BASE, types.ChainId.ARBITRUM].includes(supportedChainId) &&
71165
- !token.lpToken) {
71166
- return [
71167
- token.address[supportedChainId],
71168
- protocol,
71169
- factoryV2,
71170
- factoryV3,
71171
- factoryAlgebra,
71172
- factorySolidly,
71173
- factoryXFAI,
71174
- ];
71175
- }
71176
- else
71177
- return [token.address[supportedChainId], protocol, factoryV2, factoryV3, factoryAlgebra, factorySolidly];
69137
+ });
69138
+ return yield multicall(+chain, PRICE_GETTER_V3_ABI, calls);
71178
69139
  });
71179
69140
  }
69141
+ const getPriceGetterV3Call = (chain, token) => {
69142
+ var _a, _b, _c, _d, _e;
69143
+ const address = token.address[chain];
69144
+ const liquidityDex = (_a = token.liquidityDex) === null || _a === void 0 ? void 0 : _a[chain];
69145
+ const dexFactory = (_b = types.dexFactories[chain]) === null || _b === void 0 ? void 0 : _b[liquidityDex];
69146
+ const protocol = (_c = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.protocol) !== null && _c !== void 0 ? _c : types.Protocols.V2;
69147
+ const factory = (_d = dexFactory === null || dexFactory === void 0 ? void 0 : dexFactory.factory) !== null && _d !== void 0 ? _d : (_e = types.defaultDexFactories === null || types.defaultDexFactories === void 0 ? void 0 : types.defaultDexFactories[chain]) === null || _e === void 0 ? void 0 : _e[protocol];
69148
+ const priceGetterAddress = PRICE_GETTER_ADDRESSES[chain];
69149
+ const wrapper = token.liquidityWrapper;
69150
+ if (!factory) {
69151
+ console.log(`No default dex factory found for retrieving price for protocol ${protocol}. Please contact support.`);
69152
+ return;
69153
+ }
69154
+ const params = [address, protocol, factory];
69155
+ const methodName = token.lpToken ? (!!wrapper ? 'getWrappedLPPrice' : 'getLPPrice') : 'getTokenPrice';
69156
+ if (wrapper && token.lpToken) {
69157
+ params.push(wrapper);
69158
+ }
69159
+ return {
69160
+ address: priceGetterAddress,
69161
+ name: methodName,
69162
+ params,
69163
+ };
69164
+ };
71180
69165
 
71181
69166
  function useCurrencyPrice(currency, chainId) {
71182
69167
  const { data: tokenPrices } = useTokenPrices();
@@ -71525,7 +69510,7 @@ const fetchUserOwnedBillsDataAsync = (chainId, account, bondData, tokenPrices) =
71525
69510
  });
71526
69511
  /* MODIFIED FUNCTION FROM FRONTEND SPECIFICALLY FOR THE SDK */
71527
69512
  const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices) => __awaiter$9(void 0, void 0, void 0, function* () {
71528
- var _a, _b, _c, _d, _e, _f, _g;
69513
+ var _a, _b, _c, _d, _e, _f;
71529
69514
  // Maps all the bills in the list repo to make a call to each of them to get Bills Id, meaning purchased bill ids
71530
69515
  const billIdCalls = bonds.map((b) => {
71531
69516
  var _a;
@@ -71536,10 +69521,8 @@ const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices) => __awaiter$
71536
69521
  });
71537
69522
  });
71538
69523
  const billIds = yield multicall(chainId, BOND_ABI, billIdCalls, true, 15);
71539
- const billsPendingRewardCall = [];
71540
69524
  const billDataCalls = [];
71541
69525
  const billVersions = [];
71542
- const billNFTCalls = [];
71543
69526
  billIds.forEach((idArray, index) => idArray[0].forEach((id) => id.gt(0) &&
71544
69527
  (billDataCalls.push({
71545
69528
  address: bonds[index].contractAddress[bonds[index].chainId],
@@ -71547,13 +69530,7 @@ const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices) => __awaiter$
71547
69530
  params: [id],
71548
69531
  bond: bonds[index],
71549
69532
  }),
71550
- billDataCalls.push({ address: bonds[index].contractAddress[bonds[index].chainId], name: 'billNft' }),
71551
- billNFTCalls.push({
71552
- address: bonds[index].billNnftAddress[bonds[index].chainId],
71553
- name: 'vestedPayout',
71554
- params: [id],
71555
- }),
71556
- billsPendingRewardCall.push({
69533
+ billDataCalls.push({
71557
69534
  address: bonds[index].contractAddress[bonds[index].chainId],
71558
69535
  name: bonds[index].billVersion !== types.BillVersion.V1 ? 'claimablePayout' : 'pendingPayoutFor',
71559
69536
  params: [id],
@@ -71561,43 +69538,44 @@ const fetchUserOwnedBills = (chainId, account, bonds, tokenPrices) => __awaiter$
71561
69538
  }),
71562
69539
  billVersions.push(bonds[index].billVersion))));
71563
69540
  const billData = yield multicall(chainId, BOND_ABI, billDataCalls, true, 150);
71564
- const pendingRewardsCall = yield multicall(chainId, BOND_ABI, billsPendingRewardCall);
71565
69541
  const result = [];
71566
- for (let i = 0; i < billsPendingRewardCall.length; i++) {
71567
- const billDataPos = i === 0 ? 0 : i * 2;
71568
- let bond = billsPendingRewardCall[i].bond;
71569
- bond = Object.assign(Object.assign({}, bond), { payoutTokenPrice: (_a = tokenPrices.find((tokenPrice) => {
71570
- var _a, _b, _c, _d;
71571
- return ((_a = tokenPrice.address) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_d = (_c = (_b = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _b === void 0 ? void 0 : _b.address) === null || _c === void 0 ? void 0 : _c[bond.chainId]) === null || _d === void 0 ? void 0 : _d.toLowerCase()) &&
71572
- tokenPrice.chainId === bond.chainId;
71573
- })) === null || _a === void 0 ? void 0 : _a.price, principalTokenPrice: (_b = tokenPrices.find((tokenPrice) => {
71574
- var _a, _b, _c, _d;
71575
- return ((_a = tokenPrice.address) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_d = (_c = (_b = bond === null || bond === void 0 ? void 0 : bond.lpToken) === null || _b === void 0 ? void 0 : _b.address) === null || _c === void 0 ? void 0 : _c[bond.chainId]) === null || _d === void 0 ? void 0 : _d.toLowerCase()) &&
71576
- tokenPrice.chainId === bond.chainId;
71577
- })) === null || _b === void 0 ? void 0 : _b.price });
69542
+ for (let i = 0; i < billVersions.length; i++) {
69543
+ const billPos = i === 0 ? 0 : i * 2;
69544
+ let bond = billDataCalls[billPos].bond;
69545
+ // const principalTokenPrice = tokenPrices.find(
69546
+ // (tokenPrice) =>
69547
+ // tokenPrice.address?.toLowerCase() === bond?.lpToken?.address?.[bond.chainId]?.toLowerCase() &&
69548
+ // tokenPrice.chainId === bond.chainId,
69549
+ // )?.price
69550
+ const payoutTokenPrice = (_a = tokenPrices.find((tokenPrice) => {
69551
+ var _a, _b, _c, _d;
69552
+ return ((_a = tokenPrice.address) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_d = (_c = (_b = bond === null || bond === void 0 ? void 0 : bond.earnToken) === null || _b === void 0 ? void 0 : _b.address) === null || _c === void 0 ? void 0 : _c[bond.chainId]) === null || _d === void 0 ? void 0 : _d.toLowerCase()) &&
69553
+ tokenPrice.chainId === bond.chainId;
69554
+ })) === null || _a === void 0 ? void 0 : _a.price;
69555
+ bond = Object.assign(Object.assign({}, bond), { payoutTokenPrice: payoutTokenPrice });
71578
69556
  const data = billVersions[i] !== types.BillVersion.V1
71579
69557
  ? {
71580
- address: billsPendingRewardCall[i].address,
71581
- id: billsPendingRewardCall[i].params[0].toString(),
71582
- payout: new BigNumber$1((_c = billData[billDataPos][0]) === null || _c === void 0 ? void 0 : _c.payout.toString())
71583
- .minus((_d = billData[billDataPos][0]) === null || _d === void 0 ? void 0 : _d.payoutClaimed.toString())
69558
+ address: billDataCalls[billPos].address,
69559
+ id: billDataCalls[billPos].params[0].toString(),
69560
+ payout: new BigNumber$1((_b = billData[billPos][0]) === null || _b === void 0 ? void 0 : _b.payout.toString())
69561
+ .minus((_c = billData[billPos][0]) === null || _c === void 0 ? void 0 : _c.payoutClaimed.toString())
71584
69562
  .toString(),
71585
- billNftAddress: billData[billDataPos + 1][0].toString(),
71586
- vesting: (_e = billData[billDataPos][0]) === null || _e === void 0 ? void 0 : _e.vesting.toString(),
71587
- lastBlockTimestamp: (_f = billData[billDataPos][0]) === null || _f === void 0 ? void 0 : _f.lastClaimTimestamp.toString(),
71588
- truePricePaid: (_g = billData[billDataPos][0]) === null || _g === void 0 ? void 0 : _g.truePricePaid.toString(),
71589
- pendingRewards: pendingRewardsCall[i][0].toString(),
69563
+ billNftAddress: bond.billNnftAddress[bond.chainId],
69564
+ vesting: (_d = billData[billPos][0]) === null || _d === void 0 ? void 0 : _d.vesting.toString(),
69565
+ lastBlockTimestamp: (_e = billData[billPos][0]) === null || _e === void 0 ? void 0 : _e.lastClaimTimestamp.toString(),
69566
+ truePricePaid: (_f = billData[billPos][0]) === null || _f === void 0 ? void 0 : _f.truePricePaid.toString(),
69567
+ pendingRewards: billData[billPos + 1][0].toString(),
71590
69568
  bond,
71591
69569
  }
71592
69570
  : {
71593
- address: billsPendingRewardCall[i].address,
71594
- id: billsPendingRewardCall[i].params[0].toString(),
71595
- payout: billData[billDataPos][0].toString(),
71596
- billNftAddress: billData[billDataPos + 1][0].toString(),
71597
- vesting: billData[billDataPos][1].toString(),
71598
- lastBlockTimestamp: billData[billDataPos][2].toString(),
71599
- truePricePaid: billData[billDataPos][3].toString(),
71600
- pendingRewards: pendingRewardsCall[i][0].toString(),
69571
+ address: billDataCalls[billPos].address,
69572
+ id: billDataCalls[billPos].params[0].toString(),
69573
+ payout: billData[billPos][0].toString(),
69574
+ billNftAddress: bond.billNnftAddress[bond.chainId],
69575
+ vesting: billData[billPos][1].toString(),
69576
+ lastBlockTimestamp: billData[billPos][2].toString(),
69577
+ truePricePaid: billData[billPos][3].toString(),
69578
+ pendingRewards: billData[billPos + 1][0].toString(),
71601
69579
  bond,
71602
69580
  };
71603
69581
  result.push(data);