@pendle/sdk-boros 0.1.34 → 0.1.36
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +568 -1
- package/dist/contracts/viemAbis.d.ts +604 -0
- package/dist/contracts/viemAbis.js +343 -1
- package/dist/contracts/viemAbis.js.map +1 -1
- package/dist/entities/exchange/exchange.d.ts +2754 -281
- package/dist/entities/exchange/exchange.js +20 -17
- package/dist/entities/exchange/exchange.js.map +1 -1
- package/dist/entities/exchange/index.d.ts +2 -0
- package/dist/entities/exchange/index.js +2 -0
- package/dist/entities/exchange/index.js.map +1 -1
- package/dist/entities/exchange/tickIndexPowMath.d.ts +4 -0
- package/dist/entities/exchange/tickIndexPowMath.js +28 -0
- package/dist/entities/exchange/tickIndexPowMath.js.map +1 -0
- package/dist/entities/exchange/utils.d.ts +1591 -115
- package/dist/entities/exchange/utils.js +48 -15
- package/dist/entities/exchange/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.iFIndexOracleAbi = exports.iAuthModuleAbi = exports.iTradeModuleAbi = exports.iMarkRateOracleAbi = exports.iExplorerAbi = exports.iMulticall3Abi = exports.iMarketOffViewOnlyAbi = exports.iMarketEntryAbi = exports.iMarketSettingAbi = exports.iMarketAllTypesAbi = exports.iMarketOrderAndOtcAbi = exports.iMarketOffAbi = exports.iMarketAbi = exports.iMarketAllEventsAndTypesAbi = exports.iRouterAbi = exports.iMarketFactoryAbi = exports.iMarketHubStorageOnlyAbi = exports.iMarketHubAllEventsAbi = exports.iMarketHubOnlyAbi = exports.iMarginManagerOnlyAbi = exports.iMarketHubAbi = void 0;
|
|
3
|
+
exports.iBOROS20Abi = exports.iAMMAbi = exports.iFIndexOracleAbi = exports.iAuthModuleAbi = exports.iTradeModuleAbi = exports.iMarkRateOracleAbi = exports.iExplorerAbi = exports.iMulticall3Abi = exports.iMarketOffViewOnlyAbi = exports.iMarketEntryAbi = exports.iMarketSettingAbi = exports.iMarketAllTypesAbi = exports.iMarketOrderAndOtcAbi = exports.iMarketOffAbi = exports.iMarketAbi = exports.iMarketAllEventsAndTypesAbi = exports.iRouterAbi = exports.iMarketFactoryAbi = exports.iMarketHubStorageOnlyAbi = exports.iMarketHubAllEventsAbi = exports.iMarketHubOnlyAbi = exports.iMarginManagerOnlyAbi = exports.iMarketHubAbi = void 0;
|
|
4
4
|
exports.iMarketHubAbi = [
|
|
5
5
|
{
|
|
6
6
|
anonymous: false,
|
|
@@ -5253,4 +5253,346 @@ exports.iFIndexOracleAbi = [
|
|
|
5253
5253
|
type: 'function',
|
|
5254
5254
|
},
|
|
5255
5255
|
];
|
|
5256
|
+
exports.iAMMAbi = [
|
|
5257
|
+
{
|
|
5258
|
+
inputs: [
|
|
5259
|
+
{ internalType: 'MarketAcc', name: 'account', type: 'bytes26' },
|
|
5260
|
+
{ internalType: 'uint256', name: 'balance', type: 'uint256' },
|
|
5261
|
+
{ internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
5262
|
+
],
|
|
5263
|
+
name: 'BOROS20NotEnoughBalance',
|
|
5264
|
+
type: 'error',
|
|
5265
|
+
},
|
|
5266
|
+
{
|
|
5267
|
+
anonymous: false,
|
|
5268
|
+
inputs: [
|
|
5269
|
+
{ indexed: false, internalType: 'uint128', name: 'minAbsRate', type: 'uint128' },
|
|
5270
|
+
{ indexed: false, internalType: 'uint128', name: 'maxAbsRate', type: 'uint128' },
|
|
5271
|
+
{ indexed: false, internalType: 'uint32', name: 'cutOffTimestamp', type: 'uint32' },
|
|
5272
|
+
],
|
|
5273
|
+
name: 'AMMConfigUpdated',
|
|
5274
|
+
type: 'event',
|
|
5275
|
+
},
|
|
5276
|
+
{
|
|
5277
|
+
anonymous: false,
|
|
5278
|
+
inputs: [
|
|
5279
|
+
{ indexed: false, internalType: 'MarketAcc', name: 'from', type: 'bytes26' },
|
|
5280
|
+
{ indexed: false, internalType: 'MarketAcc', name: 'to', type: 'bytes26' },
|
|
5281
|
+
{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
5282
|
+
],
|
|
5283
|
+
name: 'BOROS20Transfer',
|
|
5284
|
+
type: 'event',
|
|
5285
|
+
},
|
|
5286
|
+
{
|
|
5287
|
+
anonymous: false,
|
|
5288
|
+
inputs: [
|
|
5289
|
+
{ indexed: true, internalType: 'MarketAcc', name: 'payer', type: 'bytes26' },
|
|
5290
|
+
{ indexed: false, internalType: 'uint256', name: 'netLpBurned', type: 'uint256' },
|
|
5291
|
+
{ indexed: false, internalType: 'int256', name: 'netCashOut', type: 'int256' },
|
|
5292
|
+
{ indexed: false, internalType: 'int256', name: 'netSizeOut', type: 'int256' },
|
|
5293
|
+
],
|
|
5294
|
+
name: 'Burn',
|
|
5295
|
+
type: 'event',
|
|
5296
|
+
},
|
|
5297
|
+
{
|
|
5298
|
+
anonymous: false,
|
|
5299
|
+
inputs: [{ indexed: false, internalType: 'uint256', name: 'newFeeRate', type: 'uint256' }],
|
|
5300
|
+
name: 'FeeRateUpdated',
|
|
5301
|
+
type: 'event',
|
|
5302
|
+
},
|
|
5303
|
+
{
|
|
5304
|
+
anonymous: false,
|
|
5305
|
+
inputs: [{ indexed: false, internalType: 'uint32', name: 'newWindow', type: 'uint32' }],
|
|
5306
|
+
name: 'ImpliedRateObservationWindowUpdated',
|
|
5307
|
+
type: 'event',
|
|
5308
|
+
},
|
|
5309
|
+
{
|
|
5310
|
+
anonymous: false,
|
|
5311
|
+
inputs: [
|
|
5312
|
+
{ indexed: true, internalType: 'MarketAcc', name: 'receiver', type: 'bytes26' },
|
|
5313
|
+
{ indexed: false, internalType: 'uint256', name: 'netLpMinted', type: 'uint256' },
|
|
5314
|
+
{ indexed: false, internalType: 'int256', name: 'netCashIn', type: 'int256' },
|
|
5315
|
+
{ indexed: false, internalType: 'int256', name: 'netSizeIn', type: 'int256' },
|
|
5316
|
+
],
|
|
5317
|
+
name: 'Mint',
|
|
5318
|
+
type: 'event',
|
|
5319
|
+
},
|
|
5320
|
+
{
|
|
5321
|
+
anonymous: false,
|
|
5322
|
+
inputs: [
|
|
5323
|
+
{ indexed: false, internalType: 'int256', name: 'sizeOut', type: 'int256' },
|
|
5324
|
+
{ indexed: false, internalType: 'int256', name: 'costOut', type: 'int256' },
|
|
5325
|
+
],
|
|
5326
|
+
name: 'Swap',
|
|
5327
|
+
type: 'event',
|
|
5328
|
+
},
|
|
5329
|
+
{
|
|
5330
|
+
inputs: [],
|
|
5331
|
+
name: 'MARKET',
|
|
5332
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
5333
|
+
stateMutability: 'view',
|
|
5334
|
+
type: 'function',
|
|
5335
|
+
},
|
|
5336
|
+
{
|
|
5337
|
+
inputs: [],
|
|
5338
|
+
name: 'MATURITY',
|
|
5339
|
+
outputs: [{ internalType: 'uint32', name: '', type: 'uint32' }],
|
|
5340
|
+
stateMutability: 'view',
|
|
5341
|
+
type: 'function',
|
|
5342
|
+
},
|
|
5343
|
+
{
|
|
5344
|
+
inputs: [],
|
|
5345
|
+
name: 'ROUTER',
|
|
5346
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
5347
|
+
stateMutability: 'view',
|
|
5348
|
+
type: 'function',
|
|
5349
|
+
},
|
|
5350
|
+
{
|
|
5351
|
+
inputs: [],
|
|
5352
|
+
name: 'SEED_TIME',
|
|
5353
|
+
outputs: [{ internalType: 'uint32', name: '', type: 'uint32' }],
|
|
5354
|
+
stateMutability: 'view',
|
|
5355
|
+
type: 'function',
|
|
5356
|
+
},
|
|
5357
|
+
{
|
|
5358
|
+
inputs: [],
|
|
5359
|
+
name: 'SELF_ACC',
|
|
5360
|
+
outputs: [{ internalType: 'MarketAcc', name: '', type: 'bytes26' }],
|
|
5361
|
+
stateMutability: 'view',
|
|
5362
|
+
type: 'function',
|
|
5363
|
+
},
|
|
5364
|
+
{
|
|
5365
|
+
inputs: [],
|
|
5366
|
+
name: '_storage',
|
|
5367
|
+
outputs: [
|
|
5368
|
+
{ internalType: 'uint128', name: 'minAbsRate', type: 'uint128' },
|
|
5369
|
+
{ internalType: 'uint128', name: 'maxAbsRate', type: 'uint128' },
|
|
5370
|
+
{ internalType: 'uint32', name: 'cutOffTimestamp', type: 'uint32' },
|
|
5371
|
+
{ internalType: 'uint64', name: 'feeRate', type: 'uint64' },
|
|
5372
|
+
{ internalType: 'uint32', name: 'oracleImpliedRateWindow', type: 'uint32' },
|
|
5373
|
+
{ internalType: 'uint128', name: 'totalFloatAmount', type: 'uint128' },
|
|
5374
|
+
{ internalType: 'uint128', name: 'normFixedAmount', type: 'uint128' },
|
|
5375
|
+
{ internalType: 'uint32', name: 'lastTradedTime', type: 'uint32' },
|
|
5376
|
+
{ internalType: 'int128', name: 'prevOracleImpliedRate', type: 'int128' },
|
|
5377
|
+
],
|
|
5378
|
+
stateMutability: 'view',
|
|
5379
|
+
type: 'function',
|
|
5380
|
+
},
|
|
5381
|
+
{
|
|
5382
|
+
inputs: [{ internalType: 'MarketAcc', name: 'account', type: 'bytes26' }],
|
|
5383
|
+
name: 'balanceOf',
|
|
5384
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
5385
|
+
stateMutability: 'view',
|
|
5386
|
+
type: 'function',
|
|
5387
|
+
},
|
|
5388
|
+
{
|
|
5389
|
+
inputs: [
|
|
5390
|
+
{ internalType: 'MarketAcc', name: 'payer', type: 'bytes26' },
|
|
5391
|
+
{ internalType: 'int256', name: 'totalCash', type: 'int256' },
|
|
5392
|
+
{ internalType: 'int256', name: 'totalSize', type: 'int256' },
|
|
5393
|
+
{ internalType: 'uint256', name: 'lpToBurn', type: 'uint256' },
|
|
5394
|
+
],
|
|
5395
|
+
name: 'burnByBorosRouter',
|
|
5396
|
+
outputs: [
|
|
5397
|
+
{ internalType: 'int256', name: 'netCashOut', type: 'int256' },
|
|
5398
|
+
{ internalType: 'int256', name: 'netSizeOut', type: 'int256' },
|
|
5399
|
+
],
|
|
5400
|
+
stateMutability: 'nonpayable',
|
|
5401
|
+
type: 'function',
|
|
5402
|
+
},
|
|
5403
|
+
{
|
|
5404
|
+
inputs: [{ internalType: 'int256', name: 'targetRate', type: 'int256' }],
|
|
5405
|
+
name: 'calcSwapSize',
|
|
5406
|
+
outputs: [{ internalType: 'int256', name: '', type: 'int256' }],
|
|
5407
|
+
stateMutability: 'view',
|
|
5408
|
+
type: 'function',
|
|
5409
|
+
},
|
|
5410
|
+
{
|
|
5411
|
+
inputs: [],
|
|
5412
|
+
name: 'decimals',
|
|
5413
|
+
outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }],
|
|
5414
|
+
stateMutability: 'view',
|
|
5415
|
+
type: 'function',
|
|
5416
|
+
},
|
|
5417
|
+
{
|
|
5418
|
+
inputs: [],
|
|
5419
|
+
name: 'feeRate',
|
|
5420
|
+
outputs: [{ internalType: 'uint64', name: '', type: 'uint64' }],
|
|
5421
|
+
stateMutability: 'view',
|
|
5422
|
+
type: 'function',
|
|
5423
|
+
},
|
|
5424
|
+
{
|
|
5425
|
+
inputs: [],
|
|
5426
|
+
name: 'impliedRate',
|
|
5427
|
+
outputs: [{ internalType: 'int256', name: '', type: 'int256' }],
|
|
5428
|
+
stateMutability: 'view',
|
|
5429
|
+
type: 'function',
|
|
5430
|
+
},
|
|
5431
|
+
{
|
|
5432
|
+
inputs: [
|
|
5433
|
+
{ internalType: 'MarketAcc', name: 'receiver', type: 'bytes26' },
|
|
5434
|
+
{ internalType: 'int256', name: 'totalCash', type: 'int256' },
|
|
5435
|
+
{ internalType: 'int256', name: 'totalSize', type: 'int256' },
|
|
5436
|
+
{ internalType: 'int256', name: 'desiredCashIn', type: 'int256' },
|
|
5437
|
+
{ internalType: 'int256', name: 'exactSizeIn', type: 'int256' },
|
|
5438
|
+
],
|
|
5439
|
+
name: 'mintByBorosRouter',
|
|
5440
|
+
outputs: [
|
|
5441
|
+
{ internalType: 'int256', name: 'netCashIn', type: 'int256' },
|
|
5442
|
+
{ internalType: 'uint256', name: 'netLpOut', type: 'uint256' },
|
|
5443
|
+
],
|
|
5444
|
+
stateMutability: 'nonpayable',
|
|
5445
|
+
type: 'function',
|
|
5446
|
+
},
|
|
5447
|
+
{
|
|
5448
|
+
inputs: [],
|
|
5449
|
+
name: 'name',
|
|
5450
|
+
outputs: [{ internalType: 'string', name: '', type: 'string' }],
|
|
5451
|
+
stateMutability: 'view',
|
|
5452
|
+
type: 'function',
|
|
5453
|
+
},
|
|
5454
|
+
{
|
|
5455
|
+
inputs: [],
|
|
5456
|
+
name: 'oracleImpliedRate',
|
|
5457
|
+
outputs: [
|
|
5458
|
+
{ internalType: 'int128', name: 'oracleImpliedRate', type: 'int128' },
|
|
5459
|
+
{ internalType: 'uint32', name: 'observationWindow', type: 'uint32' },
|
|
5460
|
+
],
|
|
5461
|
+
stateMutability: 'view',
|
|
5462
|
+
type: 'function',
|
|
5463
|
+
},
|
|
5464
|
+
{
|
|
5465
|
+
inputs: [],
|
|
5466
|
+
name: 'readState',
|
|
5467
|
+
outputs: [
|
|
5468
|
+
{
|
|
5469
|
+
components: [
|
|
5470
|
+
{ internalType: 'uint256', name: 'totalFloatAmount', type: 'uint256' },
|
|
5471
|
+
{ internalType: 'uint256', name: 'normFixedAmount', type: 'uint256' },
|
|
5472
|
+
{ internalType: 'uint256', name: 'totalLp', type: 'uint256' },
|
|
5473
|
+
{ internalType: 'uint256', name: 'latestFTime', type: 'uint256' },
|
|
5474
|
+
{ internalType: 'uint256', name: 'maturity', type: 'uint256' },
|
|
5475
|
+
{ internalType: 'uint256', name: 'seedTime', type: 'uint256' },
|
|
5476
|
+
{ internalType: 'uint256', name: 'minAbsRate', type: 'uint256' },
|
|
5477
|
+
{ internalType: 'uint256', name: 'maxAbsRate', type: 'uint256' },
|
|
5478
|
+
{ internalType: 'uint256', name: 'cutOffTimestamp', type: 'uint256' },
|
|
5479
|
+
],
|
|
5480
|
+
internalType: 'struct AMMState',
|
|
5481
|
+
name: '',
|
|
5482
|
+
type: 'tuple',
|
|
5483
|
+
},
|
|
5484
|
+
],
|
|
5485
|
+
stateMutability: 'view',
|
|
5486
|
+
type: 'function',
|
|
5487
|
+
},
|
|
5488
|
+
{
|
|
5489
|
+
inputs: [
|
|
5490
|
+
{ internalType: 'uint128', name: 'minAbsRate', type: 'uint128' },
|
|
5491
|
+
{ internalType: 'uint128', name: 'maxAbsRate', type: 'uint128' },
|
|
5492
|
+
{ internalType: 'uint32', name: 'cutOffTimestamp', type: 'uint32' },
|
|
5493
|
+
],
|
|
5494
|
+
name: 'setAMMConfig',
|
|
5495
|
+
outputs: [],
|
|
5496
|
+
stateMutability: 'nonpayable',
|
|
5497
|
+
type: 'function',
|
|
5498
|
+
},
|
|
5499
|
+
{
|
|
5500
|
+
inputs: [{ internalType: 'uint64', name: 'newFeeRate', type: 'uint64' }],
|
|
5501
|
+
name: 'setFeeRate',
|
|
5502
|
+
outputs: [],
|
|
5503
|
+
stateMutability: 'nonpayable',
|
|
5504
|
+
type: 'function',
|
|
5505
|
+
},
|
|
5506
|
+
{
|
|
5507
|
+
inputs: [{ internalType: 'uint32', name: 'newWindow', type: 'uint32' }],
|
|
5508
|
+
name: 'setImpliedRateObservationWindow',
|
|
5509
|
+
outputs: [],
|
|
5510
|
+
stateMutability: 'nonpayable',
|
|
5511
|
+
type: 'function',
|
|
5512
|
+
},
|
|
5513
|
+
{
|
|
5514
|
+
inputs: [{ internalType: 'int256', name: 'sizeOut', type: 'int256' }],
|
|
5515
|
+
name: 'swapByBorosRouter',
|
|
5516
|
+
outputs: [{ internalType: 'int256', name: 'costOut', type: 'int256' }],
|
|
5517
|
+
stateMutability: 'nonpayable',
|
|
5518
|
+
type: 'function',
|
|
5519
|
+
},
|
|
5520
|
+
{
|
|
5521
|
+
inputs: [{ internalType: 'int256', name: 'sizeOut', type: 'int256' }],
|
|
5522
|
+
name: 'swapView',
|
|
5523
|
+
outputs: [{ internalType: 'int256', name: 'costOut', type: 'int256' }],
|
|
5524
|
+
stateMutability: 'view',
|
|
5525
|
+
type: 'function',
|
|
5526
|
+
},
|
|
5527
|
+
{
|
|
5528
|
+
inputs: [],
|
|
5529
|
+
name: 'symbol',
|
|
5530
|
+
outputs: [{ internalType: 'string', name: '', type: 'string' }],
|
|
5531
|
+
stateMutability: 'view',
|
|
5532
|
+
type: 'function',
|
|
5533
|
+
},
|
|
5534
|
+
{
|
|
5535
|
+
inputs: [],
|
|
5536
|
+
name: 'totalSupply',
|
|
5537
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
5538
|
+
stateMutability: 'view',
|
|
5539
|
+
type: 'function',
|
|
5540
|
+
},
|
|
5541
|
+
];
|
|
5542
|
+
exports.iBOROS20Abi = [
|
|
5543
|
+
{
|
|
5544
|
+
inputs: [
|
|
5545
|
+
{ internalType: 'MarketAcc', name: 'account', type: 'bytes26' },
|
|
5546
|
+
{ internalType: 'uint256', name: 'balance', type: 'uint256' },
|
|
5547
|
+
{ internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
5548
|
+
],
|
|
5549
|
+
name: 'BOROS20NotEnoughBalance',
|
|
5550
|
+
type: 'error',
|
|
5551
|
+
},
|
|
5552
|
+
{
|
|
5553
|
+
anonymous: false,
|
|
5554
|
+
inputs: [
|
|
5555
|
+
{ indexed: false, internalType: 'MarketAcc', name: 'from', type: 'bytes26' },
|
|
5556
|
+
{ indexed: false, internalType: 'MarketAcc', name: 'to', type: 'bytes26' },
|
|
5557
|
+
{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
5558
|
+
],
|
|
5559
|
+
name: 'BOROS20Transfer',
|
|
5560
|
+
type: 'event',
|
|
5561
|
+
},
|
|
5562
|
+
{
|
|
5563
|
+
inputs: [{ internalType: 'MarketAcc', name: 'account', type: 'bytes26' }],
|
|
5564
|
+
name: 'balanceOf',
|
|
5565
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
5566
|
+
stateMutability: 'view',
|
|
5567
|
+
type: 'function',
|
|
5568
|
+
},
|
|
5569
|
+
{
|
|
5570
|
+
inputs: [],
|
|
5571
|
+
name: 'decimals',
|
|
5572
|
+
outputs: [{ internalType: 'uint8', name: '', type: 'uint8' }],
|
|
5573
|
+
stateMutability: 'view',
|
|
5574
|
+
type: 'function',
|
|
5575
|
+
},
|
|
5576
|
+
{
|
|
5577
|
+
inputs: [],
|
|
5578
|
+
name: 'name',
|
|
5579
|
+
outputs: [{ internalType: 'string', name: '', type: 'string' }],
|
|
5580
|
+
stateMutability: 'view',
|
|
5581
|
+
type: 'function',
|
|
5582
|
+
},
|
|
5583
|
+
{
|
|
5584
|
+
inputs: [],
|
|
5585
|
+
name: 'symbol',
|
|
5586
|
+
outputs: [{ internalType: 'string', name: '', type: 'string' }],
|
|
5587
|
+
stateMutability: 'view',
|
|
5588
|
+
type: 'function',
|
|
5589
|
+
},
|
|
5590
|
+
{
|
|
5591
|
+
inputs: [],
|
|
5592
|
+
name: 'totalSupply',
|
|
5593
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
5594
|
+
stateMutability: 'view',
|
|
5595
|
+
type: 'function',
|
|
5596
|
+
},
|
|
5597
|
+
];
|
|
5256
5598
|
//# sourceMappingURL=viemAbis.js.map
|