@hyperbridge/sdk 2.8.10 → 2.8.12
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/browser/index.d.ts +220 -83
- package/dist/browser/index.js +336 -94
- package/dist/browser/index.js.map +1 -1
- package/dist/node/index.cjs +337 -95
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +336 -94
- package/dist/node/index.js.map +1 -1
- package/dist/node/{intents-helpers-BKj42imQ.d.cts → intents-helpers-C9PJp8rx.d.cts} +639 -220
- package/dist/node/{intents-helpers-BKj42imQ.d.ts → intents-helpers-C9PJp8rx.d.ts} +639 -220
- package/dist/node/intents-helpers.cjs +301 -97
- package/dist/node/intents-helpers.cjs.map +1 -1
- package/dist/node/intents-helpers.d.cts +1 -1
- package/dist/node/intents-helpers.d.ts +1 -1
- package/dist/node/intents-helpers.js +300 -96
- package/dist/node/intents-helpers.js.map +1 -1
- package/package.json +1 -1
package/dist/node/index.js
CHANGED
|
@@ -2711,7 +2711,7 @@ var chainConfigs = {
|
|
|
2711
2711
|
},
|
|
2712
2712
|
addresses: {
|
|
2713
2713
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
2714
|
-
SolverAccount: "
|
|
2714
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
2715
2715
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
2716
2716
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
2717
2717
|
UniswapRouter02: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
|
|
@@ -2778,7 +2778,7 @@ var chainConfigs = {
|
|
|
2778
2778
|
},
|
|
2779
2779
|
addresses: {
|
|
2780
2780
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
2781
|
-
SolverAccount: "
|
|
2781
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
2782
2782
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
2783
2783
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
2784
2784
|
UniswapRouter02: "0x10ED43C718714eb63d5aA57B78B54704E256024E",
|
|
@@ -2839,7 +2839,7 @@ var chainConfigs = {
|
|
|
2839
2839
|
},
|
|
2840
2840
|
addresses: {
|
|
2841
2841
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
2842
|
-
SolverAccount: "
|
|
2842
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
2843
2843
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
2844
2844
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
2845
2845
|
UniswapRouter02: "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24",
|
|
@@ -2913,7 +2913,7 @@ var chainConfigs = {
|
|
|
2913
2913
|
},
|
|
2914
2914
|
addresses: {
|
|
2915
2915
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
2916
|
-
SolverAccount: "
|
|
2916
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
2917
2917
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
2918
2918
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
2919
2919
|
UniswapRouter02: "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24",
|
|
@@ -2988,7 +2988,7 @@ var chainConfigs = {
|
|
|
2988
2988
|
},
|
|
2989
2989
|
addresses: {
|
|
2990
2990
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
2991
|
-
SolverAccount: "
|
|
2991
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
2992
2992
|
TokenGateway: "0x8b536105b6Fae2aE9199f5146D3C57Dfe53b614E",
|
|
2993
2993
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
2994
2994
|
UniswapRouter02: "0xd2f9496824951D5237cC71245D659E48d0d5f9E8",
|
|
@@ -3104,7 +3104,7 @@ var chainConfigs = {
|
|
|
3104
3104
|
},
|
|
3105
3105
|
addresses: {
|
|
3106
3106
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
3107
|
-
SolverAccount: "
|
|
3107
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
3108
3108
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
3109
3109
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
3110
3110
|
UniswapRouter02: "0x4A7b5Da61326A6379179b40d00F57E5bbDC962c2",
|
|
@@ -3139,7 +3139,7 @@ var chainConfigs = {
|
|
|
3139
3139
|
},
|
|
3140
3140
|
addresses: {
|
|
3141
3141
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
3142
|
-
SolverAccount: "
|
|
3142
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
3143
3143
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
3144
3144
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
3145
3145
|
UniswapRouter02: "0xB2e26652e4BAd1e56055A051f922E06760cA0BFE",
|
|
@@ -3295,7 +3295,7 @@ var chainConfigs = {
|
|
|
3295
3295
|
},
|
|
3296
3296
|
addresses: {
|
|
3297
3297
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
3298
|
-
SolverAccount: "
|
|
3298
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
3299
3299
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
3300
3300
|
Calldispatcher: "0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd"
|
|
3301
3301
|
},
|
|
@@ -3342,7 +3342,7 @@ var ABI3 = [
|
|
|
3342
3342
|
type: "constructor",
|
|
3343
3343
|
inputs: [
|
|
3344
3344
|
{
|
|
3345
|
-
name: "
|
|
3345
|
+
name: "owner",
|
|
3346
3346
|
type: "address",
|
|
3347
3347
|
internalType: "address"
|
|
3348
3348
|
}
|
|
@@ -3417,25 +3417,6 @@ var ABI3 = [
|
|
|
3417
3417
|
],
|
|
3418
3418
|
stateMutability: "view"
|
|
3419
3419
|
},
|
|
3420
|
-
{
|
|
3421
|
-
type: "function",
|
|
3422
|
-
name: "_instances",
|
|
3423
|
-
inputs: [
|
|
3424
|
-
{
|
|
3425
|
-
name: "",
|
|
3426
|
-
type: "bytes32",
|
|
3427
|
-
internalType: "bytes32"
|
|
3428
|
-
}
|
|
3429
|
-
],
|
|
3430
|
-
outputs: [
|
|
3431
|
-
{
|
|
3432
|
-
name: "",
|
|
3433
|
-
type: "address",
|
|
3434
|
-
internalType: "address"
|
|
3435
|
-
}
|
|
3436
|
-
],
|
|
3437
|
-
stateMutability: "view"
|
|
3438
|
-
},
|
|
3439
3420
|
{
|
|
3440
3421
|
type: "function",
|
|
3441
3422
|
name: "_nonce",
|
|
@@ -3473,6 +3454,19 @@ var ABI3 = [
|
|
|
3473
3454
|
],
|
|
3474
3455
|
stateMutability: "view"
|
|
3475
3456
|
},
|
|
3457
|
+
{
|
|
3458
|
+
type: "function",
|
|
3459
|
+
name: "_owner",
|
|
3460
|
+
inputs: [],
|
|
3461
|
+
outputs: [
|
|
3462
|
+
{
|
|
3463
|
+
name: "",
|
|
3464
|
+
type: "address",
|
|
3465
|
+
internalType: "address"
|
|
3466
|
+
}
|
|
3467
|
+
],
|
|
3468
|
+
stateMutability: "view"
|
|
3469
|
+
},
|
|
3476
3470
|
{
|
|
3477
3471
|
type: "function",
|
|
3478
3472
|
name: "_partialFills",
|
|
@@ -3888,6 +3882,61 @@ var ABI3 = [
|
|
|
3888
3882
|
],
|
|
3889
3883
|
stateMutability: "view"
|
|
3890
3884
|
},
|
|
3885
|
+
{
|
|
3886
|
+
type: "function",
|
|
3887
|
+
name: "initialize",
|
|
3888
|
+
inputs: [
|
|
3889
|
+
{
|
|
3890
|
+
name: "p",
|
|
3891
|
+
type: "tuple",
|
|
3892
|
+
internalType: "struct Params",
|
|
3893
|
+
components: [
|
|
3894
|
+
{
|
|
3895
|
+
name: "host",
|
|
3896
|
+
type: "address",
|
|
3897
|
+
internalType: "address"
|
|
3898
|
+
},
|
|
3899
|
+
{
|
|
3900
|
+
name: "dispatcher",
|
|
3901
|
+
type: "address",
|
|
3902
|
+
internalType: "address"
|
|
3903
|
+
},
|
|
3904
|
+
{
|
|
3905
|
+
name: "solverSelection",
|
|
3906
|
+
type: "bool",
|
|
3907
|
+
internalType: "bool"
|
|
3908
|
+
},
|
|
3909
|
+
{
|
|
3910
|
+
name: "surplusShareBps",
|
|
3911
|
+
type: "uint256",
|
|
3912
|
+
internalType: "uint256"
|
|
3913
|
+
},
|
|
3914
|
+
{
|
|
3915
|
+
name: "protocolFeeBps",
|
|
3916
|
+
type: "uint256",
|
|
3917
|
+
internalType: "uint256"
|
|
3918
|
+
},
|
|
3919
|
+
{
|
|
3920
|
+
name: "priceOracle",
|
|
3921
|
+
type: "address",
|
|
3922
|
+
internalType: "address"
|
|
3923
|
+
}
|
|
3924
|
+
]
|
|
3925
|
+
},
|
|
3926
|
+
{
|
|
3927
|
+
name: "peerChains",
|
|
3928
|
+
type: "bytes[]",
|
|
3929
|
+
internalType: "bytes[]"
|
|
3930
|
+
},
|
|
3931
|
+
{
|
|
3932
|
+
name: "relayer",
|
|
3933
|
+
type: "address",
|
|
3934
|
+
internalType: "address"
|
|
3935
|
+
}
|
|
3936
|
+
],
|
|
3937
|
+
outputs: [],
|
|
3938
|
+
stateMutability: "nonpayable"
|
|
3939
|
+
},
|
|
3891
3940
|
{
|
|
3892
3941
|
type: "function",
|
|
3893
3942
|
name: "instance",
|
|
@@ -3907,6 +3956,19 @@ var ABI3 = [
|
|
|
3907
3956
|
],
|
|
3908
3957
|
stateMutability: "view"
|
|
3909
3958
|
},
|
|
3959
|
+
{
|
|
3960
|
+
type: "function",
|
|
3961
|
+
name: "migrate",
|
|
3962
|
+
inputs: [
|
|
3963
|
+
{
|
|
3964
|
+
name: "relayer",
|
|
3965
|
+
type: "address",
|
|
3966
|
+
internalType: "address"
|
|
3967
|
+
}
|
|
3968
|
+
],
|
|
3969
|
+
outputs: [],
|
|
3970
|
+
stateMutability: "nonpayable"
|
|
3971
|
+
},
|
|
3910
3972
|
{
|
|
3911
3973
|
type: "function",
|
|
3912
3974
|
name: "onAccept",
|
|
@@ -4418,7 +4480,7 @@ var ABI3 = [
|
|
|
4418
4480
|
internalType: "uint256"
|
|
4419
4481
|
}
|
|
4420
4482
|
],
|
|
4421
|
-
stateMutability: "
|
|
4483
|
+
stateMutability: "nonpayable"
|
|
4422
4484
|
},
|
|
4423
4485
|
{
|
|
4424
4486
|
type: "function",
|
|
@@ -4474,6 +4536,19 @@ var ABI3 = [
|
|
|
4474
4536
|
internalType: "uint256"
|
|
4475
4537
|
}
|
|
4476
4538
|
],
|
|
4539
|
+
stateMutability: "nonpayable"
|
|
4540
|
+
},
|
|
4541
|
+
{
|
|
4542
|
+
type: "function",
|
|
4543
|
+
name: "relayer",
|
|
4544
|
+
inputs: [],
|
|
4545
|
+
outputs: [
|
|
4546
|
+
{
|
|
4547
|
+
name: "",
|
|
4548
|
+
type: "address",
|
|
4549
|
+
internalType: "address"
|
|
4550
|
+
}
|
|
4551
|
+
],
|
|
4477
4552
|
stateMutability: "view"
|
|
4478
4553
|
},
|
|
4479
4554
|
{
|
|
@@ -4514,66 +4589,67 @@ var ABI3 = [
|
|
|
4514
4589
|
},
|
|
4515
4590
|
{
|
|
4516
4591
|
type: "function",
|
|
4517
|
-
name: "
|
|
4592
|
+
name: "setRelayer",
|
|
4518
4593
|
inputs: [
|
|
4519
4594
|
{
|
|
4520
|
-
name: "
|
|
4521
|
-
type: "
|
|
4522
|
-
internalType: "
|
|
4523
|
-
|
|
4524
|
-
|
|
4525
|
-
|
|
4526
|
-
|
|
4527
|
-
|
|
4528
|
-
|
|
4529
|
-
|
|
4530
|
-
|
|
4531
|
-
|
|
4532
|
-
|
|
4533
|
-
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
type: "bool",
|
|
4537
|
-
internalType: "bool"
|
|
4538
|
-
},
|
|
4539
|
-
{
|
|
4540
|
-
name: "surplusShareBps",
|
|
4541
|
-
type: "uint256",
|
|
4542
|
-
internalType: "uint256"
|
|
4543
|
-
},
|
|
4544
|
-
{
|
|
4545
|
-
name: "protocolFeeBps",
|
|
4546
|
-
type: "uint256",
|
|
4547
|
-
internalType: "uint256"
|
|
4548
|
-
},
|
|
4549
|
-
{
|
|
4550
|
-
name: "priceOracle",
|
|
4551
|
-
type: "address",
|
|
4552
|
-
internalType: "address"
|
|
4553
|
-
}
|
|
4554
|
-
]
|
|
4595
|
+
name: "relayer",
|
|
4596
|
+
type: "address",
|
|
4597
|
+
internalType: "address"
|
|
4598
|
+
}
|
|
4599
|
+
],
|
|
4600
|
+
outputs: [],
|
|
4601
|
+
stateMutability: "nonpayable"
|
|
4602
|
+
},
|
|
4603
|
+
{
|
|
4604
|
+
type: "function",
|
|
4605
|
+
name: "upgradeToAndCall",
|
|
4606
|
+
inputs: [
|
|
4607
|
+
{
|
|
4608
|
+
name: "newImplementation",
|
|
4609
|
+
type: "address",
|
|
4610
|
+
internalType: "address"
|
|
4555
4611
|
},
|
|
4556
4612
|
{
|
|
4557
|
-
name: "
|
|
4558
|
-
type: "
|
|
4559
|
-
internalType: "
|
|
4560
|
-
components: [
|
|
4561
|
-
{
|
|
4562
|
-
name: "chain",
|
|
4563
|
-
type: "bytes",
|
|
4564
|
-
internalType: "bytes"
|
|
4565
|
-
},
|
|
4566
|
-
{
|
|
4567
|
-
name: "gateway",
|
|
4568
|
-
type: "address",
|
|
4569
|
-
internalType: "address"
|
|
4570
|
-
}
|
|
4571
|
-
]
|
|
4613
|
+
name: "data",
|
|
4614
|
+
type: "bytes",
|
|
4615
|
+
internalType: "bytes"
|
|
4572
4616
|
}
|
|
4573
4617
|
],
|
|
4574
4618
|
outputs: [],
|
|
4575
4619
|
stateMutability: "nonpayable"
|
|
4576
4620
|
},
|
|
4621
|
+
{
|
|
4622
|
+
type: "function",
|
|
4623
|
+
name: "version",
|
|
4624
|
+
inputs: [],
|
|
4625
|
+
outputs: [
|
|
4626
|
+
{
|
|
4627
|
+
name: "",
|
|
4628
|
+
type: "uint64",
|
|
4629
|
+
internalType: "uint64"
|
|
4630
|
+
}
|
|
4631
|
+
],
|
|
4632
|
+
stateMutability: "view"
|
|
4633
|
+
},
|
|
4634
|
+
{
|
|
4635
|
+
type: "event",
|
|
4636
|
+
name: "DeploymentAdded",
|
|
4637
|
+
inputs: [
|
|
4638
|
+
{
|
|
4639
|
+
name: "chain",
|
|
4640
|
+
type: "string",
|
|
4641
|
+
indexed: false,
|
|
4642
|
+
internalType: "string"
|
|
4643
|
+
},
|
|
4644
|
+
{
|
|
4645
|
+
name: "gateway",
|
|
4646
|
+
type: "address",
|
|
4647
|
+
indexed: false,
|
|
4648
|
+
internalType: "address"
|
|
4649
|
+
}
|
|
4650
|
+
],
|
|
4651
|
+
anonymous: false
|
|
4652
|
+
},
|
|
4577
4653
|
{
|
|
4578
4654
|
type: "event",
|
|
4579
4655
|
name: "DestinationProtocolFeeUpdated",
|
|
@@ -4707,16 +4783,29 @@ var ABI3 = [
|
|
|
4707
4783
|
},
|
|
4708
4784
|
{
|
|
4709
4785
|
type: "event",
|
|
4710
|
-
name: "
|
|
4786
|
+
name: "Initialized",
|
|
4711
4787
|
inputs: [
|
|
4712
4788
|
{
|
|
4713
|
-
name: "
|
|
4714
|
-
type: "
|
|
4789
|
+
name: "version",
|
|
4790
|
+
type: "uint64",
|
|
4715
4791
|
indexed: false,
|
|
4716
|
-
internalType: "
|
|
4792
|
+
internalType: "uint64"
|
|
4793
|
+
}
|
|
4794
|
+
],
|
|
4795
|
+
anonymous: false
|
|
4796
|
+
},
|
|
4797
|
+
{
|
|
4798
|
+
type: "event",
|
|
4799
|
+
name: "OrderCancelled",
|
|
4800
|
+
inputs: [
|
|
4801
|
+
{
|
|
4802
|
+
name: "commitment",
|
|
4803
|
+
type: "bytes32",
|
|
4804
|
+
indexed: true,
|
|
4805
|
+
internalType: "bytes32"
|
|
4717
4806
|
},
|
|
4718
4807
|
{
|
|
4719
|
-
name: "
|
|
4808
|
+
name: "canceller",
|
|
4720
4809
|
type: "address",
|
|
4721
4810
|
indexed: false,
|
|
4722
4811
|
internalType: "address"
|
|
@@ -5044,14 +5133,52 @@ var ABI3 = [
|
|
|
5044
5133
|
],
|
|
5045
5134
|
anonymous: false
|
|
5046
5135
|
},
|
|
5136
|
+
{
|
|
5137
|
+
type: "event",
|
|
5138
|
+
name: "RelayerUpdated",
|
|
5139
|
+
inputs: [
|
|
5140
|
+
{
|
|
5141
|
+
name: "previous",
|
|
5142
|
+
type: "address",
|
|
5143
|
+
indexed: false,
|
|
5144
|
+
internalType: "address"
|
|
5145
|
+
},
|
|
5146
|
+
{
|
|
5147
|
+
name: "current",
|
|
5148
|
+
type: "address",
|
|
5149
|
+
indexed: false,
|
|
5150
|
+
internalType: "address"
|
|
5151
|
+
}
|
|
5152
|
+
],
|
|
5153
|
+
anonymous: false
|
|
5154
|
+
},
|
|
5155
|
+
{
|
|
5156
|
+
type: "event",
|
|
5157
|
+
name: "Upgraded",
|
|
5158
|
+
inputs: [
|
|
5159
|
+
{
|
|
5160
|
+
name: "implementation",
|
|
5161
|
+
type: "address",
|
|
5162
|
+
indexed: true,
|
|
5163
|
+
internalType: "address"
|
|
5164
|
+
}
|
|
5165
|
+
],
|
|
5166
|
+
anonymous: false
|
|
5167
|
+
},
|
|
5047
5168
|
{
|
|
5048
5169
|
type: "error",
|
|
5049
|
-
name: "
|
|
5050
|
-
inputs: [
|
|
5170
|
+
name: "AddressEmptyCode",
|
|
5171
|
+
inputs: [
|
|
5172
|
+
{
|
|
5173
|
+
name: "target",
|
|
5174
|
+
type: "address",
|
|
5175
|
+
internalType: "address"
|
|
5176
|
+
}
|
|
5177
|
+
]
|
|
5051
5178
|
},
|
|
5052
5179
|
{
|
|
5053
5180
|
type: "error",
|
|
5054
|
-
name: "
|
|
5181
|
+
name: "Cancelled",
|
|
5055
5182
|
inputs: []
|
|
5056
5183
|
},
|
|
5057
5184
|
{
|
|
@@ -5081,11 +5208,37 @@ var ABI3 = [
|
|
|
5081
5208
|
}
|
|
5082
5209
|
]
|
|
5083
5210
|
},
|
|
5211
|
+
{
|
|
5212
|
+
type: "error",
|
|
5213
|
+
name: "ERC1967InvalidImplementation",
|
|
5214
|
+
inputs: [
|
|
5215
|
+
{
|
|
5216
|
+
name: "implementation",
|
|
5217
|
+
type: "address",
|
|
5218
|
+
internalType: "address"
|
|
5219
|
+
}
|
|
5220
|
+
]
|
|
5221
|
+
},
|
|
5222
|
+
{
|
|
5223
|
+
type: "error",
|
|
5224
|
+
name: "ERC1967NonPayable",
|
|
5225
|
+
inputs: []
|
|
5226
|
+
},
|
|
5084
5227
|
{
|
|
5085
5228
|
type: "error",
|
|
5086
5229
|
name: "Expired",
|
|
5087
5230
|
inputs: []
|
|
5088
5231
|
},
|
|
5232
|
+
{
|
|
5233
|
+
type: "error",
|
|
5234
|
+
name: "FailedCall",
|
|
5235
|
+
inputs: []
|
|
5236
|
+
},
|
|
5237
|
+
{
|
|
5238
|
+
type: "error",
|
|
5239
|
+
name: "FillExpired",
|
|
5240
|
+
inputs: []
|
|
5241
|
+
},
|
|
5089
5242
|
{
|
|
5090
5243
|
type: "error",
|
|
5091
5244
|
name: "Filled",
|
|
@@ -5096,6 +5249,11 @@ var ABI3 = [
|
|
|
5096
5249
|
name: "InsufficientNativeToken",
|
|
5097
5250
|
inputs: []
|
|
5098
5251
|
},
|
|
5252
|
+
{
|
|
5253
|
+
type: "error",
|
|
5254
|
+
name: "InvalidInitialization",
|
|
5255
|
+
inputs: []
|
|
5256
|
+
},
|
|
5099
5257
|
{
|
|
5100
5258
|
type: "error",
|
|
5101
5259
|
name: "InvalidInput",
|
|
@@ -5111,6 +5269,21 @@ var ABI3 = [
|
|
|
5111
5269
|
name: "NotExpired",
|
|
5112
5270
|
inputs: []
|
|
5113
5271
|
},
|
|
5272
|
+
{
|
|
5273
|
+
type: "error",
|
|
5274
|
+
name: "NotInitializing",
|
|
5275
|
+
inputs: []
|
|
5276
|
+
},
|
|
5277
|
+
{
|
|
5278
|
+
type: "error",
|
|
5279
|
+
name: "PartialFillNotAllowed",
|
|
5280
|
+
inputs: []
|
|
5281
|
+
},
|
|
5282
|
+
{
|
|
5283
|
+
type: "error",
|
|
5284
|
+
name: "ReentrancyGuardReentrantCall",
|
|
5285
|
+
inputs: []
|
|
5286
|
+
},
|
|
5114
5287
|
{
|
|
5115
5288
|
type: "error",
|
|
5116
5289
|
name: "SafeERC20FailedOperation",
|
|
@@ -5148,6 +5321,11 @@ var ABI3 = [
|
|
|
5148
5321
|
name: "UnexpectedCall",
|
|
5149
5322
|
inputs: []
|
|
5150
5323
|
},
|
|
5324
|
+
{
|
|
5325
|
+
type: "error",
|
|
5326
|
+
name: "UnknownInstance",
|
|
5327
|
+
inputs: []
|
|
5328
|
+
},
|
|
5151
5329
|
{
|
|
5152
5330
|
type: "error",
|
|
5153
5331
|
name: "UnknownOrder",
|
|
@@ -20368,8 +20546,52 @@ var IntentGateway = class _IntentGateway {
|
|
|
20368
20546
|
}
|
|
20369
20547
|
}
|
|
20370
20548
|
};
|
|
20371
|
-
|
|
20372
|
-
|
|
20549
|
+
function rpcFetch() {
|
|
20550
|
+
const f = globalThis.fetch;
|
|
20551
|
+
if (typeof f !== "function") {
|
|
20552
|
+
throw new Error("No fetch available; call setAggregationFetch() before using the aggregation helpers");
|
|
20553
|
+
}
|
|
20554
|
+
return f;
|
|
20555
|
+
}
|
|
20556
|
+
var PhantomRpcError = class extends Error {
|
|
20557
|
+
constructor(message, cause) {
|
|
20558
|
+
super(message);
|
|
20559
|
+
this.cause = cause;
|
|
20560
|
+
this.name = "PhantomRpcError";
|
|
20561
|
+
}
|
|
20562
|
+
cause;
|
|
20563
|
+
};
|
|
20564
|
+
async function rpcCall(url, payload) {
|
|
20565
|
+
let lastErr;
|
|
20566
|
+
for (let attempt = 0; attempt < 4; attempt++) {
|
|
20567
|
+
if (attempt > 0) await new Promise((resolve) => setTimeout(resolve, 150 * attempt));
|
|
20568
|
+
let timer;
|
|
20569
|
+
try {
|
|
20570
|
+
const timeout = new Promise((_, reject) => {
|
|
20571
|
+
timer = setTimeout(() => reject(new Error(`rpc timeout: ${url}`)), 12e3);
|
|
20572
|
+
});
|
|
20573
|
+
const response = await Promise.race([
|
|
20574
|
+
rpcFetch()(url, {
|
|
20575
|
+
method: "POST",
|
|
20576
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
20577
|
+
body: JSON.stringify(payload)
|
|
20578
|
+
}),
|
|
20579
|
+
timeout
|
|
20580
|
+
]);
|
|
20581
|
+
const body = await response.json();
|
|
20582
|
+
if (body?.error) {
|
|
20583
|
+
lastErr = new Error(`rpc error: ${JSON.stringify(body.error).slice(0, 200)}`);
|
|
20584
|
+
continue;
|
|
20585
|
+
}
|
|
20586
|
+
return body;
|
|
20587
|
+
} catch (err) {
|
|
20588
|
+
lastErr = err;
|
|
20589
|
+
} finally {
|
|
20590
|
+
if (timer) clearTimeout(timer);
|
|
20591
|
+
}
|
|
20592
|
+
}
|
|
20593
|
+
throw new PhantomRpcError(`RPC call failed after 4 attempts: ${url}`, lastErr);
|
|
20594
|
+
}
|
|
20373
20595
|
var FILL_ORDER_ABI = IntentGatewayV2_default.ABI;
|
|
20374
20596
|
var DECLARATION_V1 = 1;
|
|
20375
20597
|
var DECLARATION_V2 = 2;
|
|
@@ -20458,15 +20680,35 @@ function decodeAcceptedSourceChains(paymasterAndData) {
|
|
|
20458
20680
|
return decodePhantomBidDeclaration(paymasterAndData).acceptedSources;
|
|
20459
20681
|
}
|
|
20460
20682
|
var UNISWAP_QUOTE_HAIRCUT_BPS = 10n;
|
|
20461
|
-
var PHANTOM_QUOTE_HAIRCUT_BPS = 5n;
|
|
20462
20683
|
function haircut(amount, bps) {
|
|
20463
20684
|
return amount * (10000n - bps) / 10000n;
|
|
20464
20685
|
}
|
|
20465
20686
|
function applyUniswapQuoteHaircut(amount) {
|
|
20466
20687
|
return haircut(amount, UNISWAP_QUOTE_HAIRCUT_BPS);
|
|
20467
20688
|
}
|
|
20468
|
-
|
|
20469
|
-
|
|
20689
|
+
var SELECTOR_GATEWAY_PARAMS = "0xcff0ab96";
|
|
20690
|
+
var GATEWAY_PARAMS_WORDS = 6;
|
|
20691
|
+
var GATEWAY_PARAMS_FEE_WORD = 4;
|
|
20692
|
+
async function readProtocolFeeHaircutBps(evmRpcUrl, gatewayAddress) {
|
|
20693
|
+
const result = await rpcCall(evmRpcUrl, {
|
|
20694
|
+
id: 1,
|
|
20695
|
+
jsonrpc: "2.0",
|
|
20696
|
+
method: "eth_call",
|
|
20697
|
+
params: [{ to: gatewayAddress, data: SELECTOR_GATEWAY_PARAMS }, "latest"]
|
|
20698
|
+
});
|
|
20699
|
+
const hex = result.result;
|
|
20700
|
+
if (typeof hex !== "string" || hex.length < 2 + 64 * GATEWAY_PARAMS_WORDS) {
|
|
20701
|
+
throw new PhantomRpcError(`IntentGateway.params() returned no usable result from ${gatewayAddress} on ${evmRpcUrl}`);
|
|
20702
|
+
}
|
|
20703
|
+
const start = 2 + 64 * GATEWAY_PARAMS_FEE_WORD;
|
|
20704
|
+
const protocolFeeBps = BigInt(`0x${hex.slice(start, start + 64)}`);
|
|
20705
|
+
if (protocolFeeBps >= 10000n) {
|
|
20706
|
+
throw new PhantomRpcError(`IntentGateway ${gatewayAddress} reports an implausible protocol fee: ${protocolFeeBps} bps`);
|
|
20707
|
+
}
|
|
20708
|
+
return protocolFeeBps;
|
|
20709
|
+
}
|
|
20710
|
+
function applyProtocolFeeHaircut(amount, protocolFeeBps) {
|
|
20711
|
+
return haircut(amount, protocolFeeBps);
|
|
20470
20712
|
}
|
|
20471
20713
|
FILL_ORDER_ABI.find(
|
|
20472
20714
|
(item) => item?.type === "function" && item?.name === "fillOrder"
|
|
@@ -24941,6 +25183,6 @@ async function teleportDot(param_) {
|
|
|
24941
25183
|
return stream;
|
|
24942
25184
|
}
|
|
24943
25185
|
|
|
24944
|
-
export { ADDRESS_ZERO2 as ADDRESS_ZERO, BundlerMethod, CHAINS_WITHOUT_VALID_UNTIL, ChainConfigService, Chains, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, ERC20Method, ERC7821_BATCH_MODE, EvmChain, ABI as EvmHostABI, EvmLanguage, FILL_ORDER_V1_ABI, HyperClientStatus, HyperFungibleToken, HyperFungibleTokenABI, INCLUSION_TIMEOUT_MS, IndexedRateUnavailableError, IntentGateway, ABI3 as IntentGatewayABI, IntentOrderStatus, IntentsCoprocessor, InvalidIndexedRateError, InvalidLiquidityIndexerResponseError, InvalidPhantomSnapshotError, IsmpClient, LEGACY_FILL_OPTIONS_IMPLEMENTATIONS, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, OrderStatus, OrderStatusChecker, PACKED_USEROP_TYPEHASH,
|
|
25186
|
+
export { ADDRESS_ZERO2 as ADDRESS_ZERO, BundlerMethod, CHAINS_WITHOUT_VALID_UNTIL, ChainConfigService, Chains, CryptoUtils, DEFAULT_ADDRESS, DEFAULT_GRAFFITI, DOMAIN_TYPEHASH, DUMMY_PRIVATE_KEY, ERC20Method, ERC7821_BATCH_MODE, EvmChain, ABI as EvmHostABI, EvmLanguage, FILL_ORDER_V1_ABI, HyperClientStatus, HyperFungibleToken, HyperFungibleTokenABI, INCLUSION_TIMEOUT_MS, IndexedRateUnavailableError, IntentGateway, ABI3 as IntentGatewayABI, IntentOrderStatus, IntentsCoprocessor, InvalidIndexedRateError, InvalidLiquidityIndexerResponseError, InvalidPhantomSnapshotError, IsmpClient, LEGACY_FILL_OPTIONS_IMPLEMENTATIONS, MOCK_ADDRESS, ORDER_V2_PARAM_TYPE, OrderStatus, OrderStatusChecker, PACKED_USEROP_TYPEHASH, PLACE_ORDER_SELECTOR, PhantomSnapshotUnavailableError, PharosChain, PolkadotHubChain, REQUEST_COMMITMENTS_SLOT, REQUEST_RECEIPTS_SLOT, RESPONSE_COMMITMENTS_SLOT, RESPONSE_RECEIPTS_SLOT, RequestKind, RequestStatus, SELECT_SOLVER_TYPEHASH, STATE_COMMITMENTS_SLOT, SubstrateChain, Swap, TESTNET_CHAINS, TeleportStatus, TimeoutStatus, TokenGateway, TronChain, UNISWAP_QUOTE_HAIRCUT_BPS, USE_ETHERSCAN_CHAINS, UnsupportedIntentQuotePairError, UnsupportedIntentQuoteStrategyError, UnsupportedLiquidityAssetError, UnsupportedLiquidityChainError, WrappedHyperFungibleTokenABI, __test, adjustDecimals, applyProtocolFeeHaircut, applyUniswapQuoteHaircut, bytes20ToBytes32, bytes32ToBytes20, calculateAllowanceMappingLocation, calculateBalanceMappingLocation, chainConfigs, constructRedeemEscrowRequestBody, constructRefundEscrowRequestBody, convertCodecToIGetRequest, convertCodecToIProof, convertIGetRequestToCodec, convertIProofToCodec, convertStateIdToStateMachineId, convertStateMachineEnumToString, convertStateMachineIdToEnum, createEvmChain, createQueryClient, decodeAcceptedSourceChains, decodeERC7821ExecuteBatch, decodeFillOrder, decodePhantomBidDeclaration, decodeUserOpScale, deriveHttpUrl, encodeAcceptedSourceChains, encodeERC7821ExecuteBatch, encodeFillOrder, encodeISMPMessage, encodePhantomBidDeclaration, encodeStateMachineId, encodeUserOpScale, encodeWithdrawalRequest, estimateGasForPost, fetchPrice, fetchSourceProof, generateRootWithProof, getChainId, getConfigByStateMachineId, getContractCallInput, getContractCallInputs, getFillOptionsVersion, getGasPriceFromEtherscan, getOrFetchStorageSlot, getOrderPlacedFromTx, getPostRequestEventFromTx, getPostResponseEventFromTx, getRequestCommitment, getStateCommitmentFieldSlot, getStateCommitmentSlot, getStorageSlot, getViemChain, hexToString, hyperbridgeAddress, maxBigInt, normalizeAddressForEvmBytes32, normalizeAddressForStateMachine, normalizeEvmAddress, normalizeEvmChainId, normalizeStateMachineId, orderCommitment, parseStateMachineId, pharosAtlantic, pharosMainnet, polkadotAssetHubPaseo, polkadotHubMainnet, poolSlug, postRequestCommitment, queryAssetTeleported, queryGetRequest, queryPostRequest, quoteUniswap, readProtocolFeeHaircutBps, requestCommitmentKey, resetFillOptionsVersionCache, responseCommitmentKey, retryPromise, sortPoolSymbols, teleport, teleportDot, transformOrderForContract, tronChainIds, tronNile };
|
|
24945
25187
|
//# sourceMappingURL=index.js.map
|
|
24946
25188
|
//# sourceMappingURL=index.js.map
|