@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.cjs
CHANGED
|
@@ -2722,7 +2722,7 @@ var chainConfigs = {
|
|
|
2722
2722
|
},
|
|
2723
2723
|
addresses: {
|
|
2724
2724
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
2725
|
-
SolverAccount: "
|
|
2725
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
2726
2726
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
2727
2727
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
2728
2728
|
UniswapRouter02: "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D",
|
|
@@ -2789,7 +2789,7 @@ var chainConfigs = {
|
|
|
2789
2789
|
},
|
|
2790
2790
|
addresses: {
|
|
2791
2791
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
2792
|
-
SolverAccount: "
|
|
2792
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
2793
2793
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
2794
2794
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
2795
2795
|
UniswapRouter02: "0x10ED43C718714eb63d5aA57B78B54704E256024E",
|
|
@@ -2850,7 +2850,7 @@ var chainConfigs = {
|
|
|
2850
2850
|
},
|
|
2851
2851
|
addresses: {
|
|
2852
2852
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
2853
|
-
SolverAccount: "
|
|
2853
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
2854
2854
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
2855
2855
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
2856
2856
|
UniswapRouter02: "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24",
|
|
@@ -2924,7 +2924,7 @@ var chainConfigs = {
|
|
|
2924
2924
|
},
|
|
2925
2925
|
addresses: {
|
|
2926
2926
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
2927
|
-
SolverAccount: "
|
|
2927
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
2928
2928
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
2929
2929
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
2930
2930
|
UniswapRouter02: "0x4752ba5DBc23f44D87826276BF6Fd6b1C372aD24",
|
|
@@ -2999,7 +2999,7 @@ var chainConfigs = {
|
|
|
2999
2999
|
},
|
|
3000
3000
|
addresses: {
|
|
3001
3001
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
3002
|
-
SolverAccount: "
|
|
3002
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
3003
3003
|
TokenGateway: "0x8b536105b6Fae2aE9199f5146D3C57Dfe53b614E",
|
|
3004
3004
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
3005
3005
|
UniswapRouter02: "0xd2f9496824951D5237cC71245D659E48d0d5f9E8",
|
|
@@ -3115,7 +3115,7 @@ var chainConfigs = {
|
|
|
3115
3115
|
},
|
|
3116
3116
|
addresses: {
|
|
3117
3117
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
3118
|
-
SolverAccount: "
|
|
3118
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
3119
3119
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
3120
3120
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
3121
3121
|
UniswapRouter02: "0x4A7b5Da61326A6379179b40d00F57E5bbDC962c2",
|
|
@@ -3150,7 +3150,7 @@ var chainConfigs = {
|
|
|
3150
3150
|
},
|
|
3151
3151
|
addresses: {
|
|
3152
3152
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
3153
|
-
SolverAccount: "
|
|
3153
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
3154
3154
|
TokenGateway: "0xFd413e3AFe560182C4471F4d143A96d3e259B6dE",
|
|
3155
3155
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
3156
3156
|
UniswapRouter02: "0xB2e26652e4BAd1e56055A051f922E06760cA0BFE",
|
|
@@ -3306,7 +3306,7 @@ var chainConfigs = {
|
|
|
3306
3306
|
},
|
|
3307
3307
|
addresses: {
|
|
3308
3308
|
IntentGateway: "0xAe041F7B0CB581876832830baeB6a2Aa2a3C9716",
|
|
3309
|
-
SolverAccount: "
|
|
3309
|
+
SolverAccount: "0x7cb55539d1144F62422099c3FA3405092022c88C",
|
|
3310
3310
|
Host: "0x620128E2B19193d6Bd244a3AC8D3bBa0541B19c3",
|
|
3311
3311
|
Calldispatcher: "0xE2C7e576E26E0bE7aC97c6fE925bcDAbD87c4bEd"
|
|
3312
3312
|
},
|
|
@@ -3353,7 +3353,7 @@ var ABI3 = [
|
|
|
3353
3353
|
type: "constructor",
|
|
3354
3354
|
inputs: [
|
|
3355
3355
|
{
|
|
3356
|
-
name: "
|
|
3356
|
+
name: "owner",
|
|
3357
3357
|
type: "address",
|
|
3358
3358
|
internalType: "address"
|
|
3359
3359
|
}
|
|
@@ -3428,25 +3428,6 @@ var ABI3 = [
|
|
|
3428
3428
|
],
|
|
3429
3429
|
stateMutability: "view"
|
|
3430
3430
|
},
|
|
3431
|
-
{
|
|
3432
|
-
type: "function",
|
|
3433
|
-
name: "_instances",
|
|
3434
|
-
inputs: [
|
|
3435
|
-
{
|
|
3436
|
-
name: "",
|
|
3437
|
-
type: "bytes32",
|
|
3438
|
-
internalType: "bytes32"
|
|
3439
|
-
}
|
|
3440
|
-
],
|
|
3441
|
-
outputs: [
|
|
3442
|
-
{
|
|
3443
|
-
name: "",
|
|
3444
|
-
type: "address",
|
|
3445
|
-
internalType: "address"
|
|
3446
|
-
}
|
|
3447
|
-
],
|
|
3448
|
-
stateMutability: "view"
|
|
3449
|
-
},
|
|
3450
3431
|
{
|
|
3451
3432
|
type: "function",
|
|
3452
3433
|
name: "_nonce",
|
|
@@ -3484,6 +3465,19 @@ var ABI3 = [
|
|
|
3484
3465
|
],
|
|
3485
3466
|
stateMutability: "view"
|
|
3486
3467
|
},
|
|
3468
|
+
{
|
|
3469
|
+
type: "function",
|
|
3470
|
+
name: "_owner",
|
|
3471
|
+
inputs: [],
|
|
3472
|
+
outputs: [
|
|
3473
|
+
{
|
|
3474
|
+
name: "",
|
|
3475
|
+
type: "address",
|
|
3476
|
+
internalType: "address"
|
|
3477
|
+
}
|
|
3478
|
+
],
|
|
3479
|
+
stateMutability: "view"
|
|
3480
|
+
},
|
|
3487
3481
|
{
|
|
3488
3482
|
type: "function",
|
|
3489
3483
|
name: "_partialFills",
|
|
@@ -3899,6 +3893,61 @@ var ABI3 = [
|
|
|
3899
3893
|
],
|
|
3900
3894
|
stateMutability: "view"
|
|
3901
3895
|
},
|
|
3896
|
+
{
|
|
3897
|
+
type: "function",
|
|
3898
|
+
name: "initialize",
|
|
3899
|
+
inputs: [
|
|
3900
|
+
{
|
|
3901
|
+
name: "p",
|
|
3902
|
+
type: "tuple",
|
|
3903
|
+
internalType: "struct Params",
|
|
3904
|
+
components: [
|
|
3905
|
+
{
|
|
3906
|
+
name: "host",
|
|
3907
|
+
type: "address",
|
|
3908
|
+
internalType: "address"
|
|
3909
|
+
},
|
|
3910
|
+
{
|
|
3911
|
+
name: "dispatcher",
|
|
3912
|
+
type: "address",
|
|
3913
|
+
internalType: "address"
|
|
3914
|
+
},
|
|
3915
|
+
{
|
|
3916
|
+
name: "solverSelection",
|
|
3917
|
+
type: "bool",
|
|
3918
|
+
internalType: "bool"
|
|
3919
|
+
},
|
|
3920
|
+
{
|
|
3921
|
+
name: "surplusShareBps",
|
|
3922
|
+
type: "uint256",
|
|
3923
|
+
internalType: "uint256"
|
|
3924
|
+
},
|
|
3925
|
+
{
|
|
3926
|
+
name: "protocolFeeBps",
|
|
3927
|
+
type: "uint256",
|
|
3928
|
+
internalType: "uint256"
|
|
3929
|
+
},
|
|
3930
|
+
{
|
|
3931
|
+
name: "priceOracle",
|
|
3932
|
+
type: "address",
|
|
3933
|
+
internalType: "address"
|
|
3934
|
+
}
|
|
3935
|
+
]
|
|
3936
|
+
},
|
|
3937
|
+
{
|
|
3938
|
+
name: "peerChains",
|
|
3939
|
+
type: "bytes[]",
|
|
3940
|
+
internalType: "bytes[]"
|
|
3941
|
+
},
|
|
3942
|
+
{
|
|
3943
|
+
name: "relayer",
|
|
3944
|
+
type: "address",
|
|
3945
|
+
internalType: "address"
|
|
3946
|
+
}
|
|
3947
|
+
],
|
|
3948
|
+
outputs: [],
|
|
3949
|
+
stateMutability: "nonpayable"
|
|
3950
|
+
},
|
|
3902
3951
|
{
|
|
3903
3952
|
type: "function",
|
|
3904
3953
|
name: "instance",
|
|
@@ -3918,6 +3967,19 @@ var ABI3 = [
|
|
|
3918
3967
|
],
|
|
3919
3968
|
stateMutability: "view"
|
|
3920
3969
|
},
|
|
3970
|
+
{
|
|
3971
|
+
type: "function",
|
|
3972
|
+
name: "migrate",
|
|
3973
|
+
inputs: [
|
|
3974
|
+
{
|
|
3975
|
+
name: "relayer",
|
|
3976
|
+
type: "address",
|
|
3977
|
+
internalType: "address"
|
|
3978
|
+
}
|
|
3979
|
+
],
|
|
3980
|
+
outputs: [],
|
|
3981
|
+
stateMutability: "nonpayable"
|
|
3982
|
+
},
|
|
3921
3983
|
{
|
|
3922
3984
|
type: "function",
|
|
3923
3985
|
name: "onAccept",
|
|
@@ -4429,7 +4491,7 @@ var ABI3 = [
|
|
|
4429
4491
|
internalType: "uint256"
|
|
4430
4492
|
}
|
|
4431
4493
|
],
|
|
4432
|
-
stateMutability: "
|
|
4494
|
+
stateMutability: "nonpayable"
|
|
4433
4495
|
},
|
|
4434
4496
|
{
|
|
4435
4497
|
type: "function",
|
|
@@ -4485,6 +4547,19 @@ var ABI3 = [
|
|
|
4485
4547
|
internalType: "uint256"
|
|
4486
4548
|
}
|
|
4487
4549
|
],
|
|
4550
|
+
stateMutability: "nonpayable"
|
|
4551
|
+
},
|
|
4552
|
+
{
|
|
4553
|
+
type: "function",
|
|
4554
|
+
name: "relayer",
|
|
4555
|
+
inputs: [],
|
|
4556
|
+
outputs: [
|
|
4557
|
+
{
|
|
4558
|
+
name: "",
|
|
4559
|
+
type: "address",
|
|
4560
|
+
internalType: "address"
|
|
4561
|
+
}
|
|
4562
|
+
],
|
|
4488
4563
|
stateMutability: "view"
|
|
4489
4564
|
},
|
|
4490
4565
|
{
|
|
@@ -4525,66 +4600,67 @@ var ABI3 = [
|
|
|
4525
4600
|
},
|
|
4526
4601
|
{
|
|
4527
4602
|
type: "function",
|
|
4528
|
-
name: "
|
|
4603
|
+
name: "setRelayer",
|
|
4529
4604
|
inputs: [
|
|
4530
4605
|
{
|
|
4531
|
-
name: "
|
|
4532
|
-
type: "
|
|
4533
|
-
internalType: "
|
|
4534
|
-
|
|
4535
|
-
|
|
4536
|
-
|
|
4537
|
-
|
|
4538
|
-
|
|
4539
|
-
|
|
4540
|
-
|
|
4541
|
-
|
|
4542
|
-
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4546
|
-
|
|
4547
|
-
type: "bool",
|
|
4548
|
-
internalType: "bool"
|
|
4549
|
-
},
|
|
4550
|
-
{
|
|
4551
|
-
name: "surplusShareBps",
|
|
4552
|
-
type: "uint256",
|
|
4553
|
-
internalType: "uint256"
|
|
4554
|
-
},
|
|
4555
|
-
{
|
|
4556
|
-
name: "protocolFeeBps",
|
|
4557
|
-
type: "uint256",
|
|
4558
|
-
internalType: "uint256"
|
|
4559
|
-
},
|
|
4560
|
-
{
|
|
4561
|
-
name: "priceOracle",
|
|
4562
|
-
type: "address",
|
|
4563
|
-
internalType: "address"
|
|
4564
|
-
}
|
|
4565
|
-
]
|
|
4606
|
+
name: "relayer",
|
|
4607
|
+
type: "address",
|
|
4608
|
+
internalType: "address"
|
|
4609
|
+
}
|
|
4610
|
+
],
|
|
4611
|
+
outputs: [],
|
|
4612
|
+
stateMutability: "nonpayable"
|
|
4613
|
+
},
|
|
4614
|
+
{
|
|
4615
|
+
type: "function",
|
|
4616
|
+
name: "upgradeToAndCall",
|
|
4617
|
+
inputs: [
|
|
4618
|
+
{
|
|
4619
|
+
name: "newImplementation",
|
|
4620
|
+
type: "address",
|
|
4621
|
+
internalType: "address"
|
|
4566
4622
|
},
|
|
4567
4623
|
{
|
|
4568
|
-
name: "
|
|
4569
|
-
type: "
|
|
4570
|
-
internalType: "
|
|
4571
|
-
components: [
|
|
4572
|
-
{
|
|
4573
|
-
name: "chain",
|
|
4574
|
-
type: "bytes",
|
|
4575
|
-
internalType: "bytes"
|
|
4576
|
-
},
|
|
4577
|
-
{
|
|
4578
|
-
name: "gateway",
|
|
4579
|
-
type: "address",
|
|
4580
|
-
internalType: "address"
|
|
4581
|
-
}
|
|
4582
|
-
]
|
|
4624
|
+
name: "data",
|
|
4625
|
+
type: "bytes",
|
|
4626
|
+
internalType: "bytes"
|
|
4583
4627
|
}
|
|
4584
4628
|
],
|
|
4585
4629
|
outputs: [],
|
|
4586
4630
|
stateMutability: "nonpayable"
|
|
4587
4631
|
},
|
|
4632
|
+
{
|
|
4633
|
+
type: "function",
|
|
4634
|
+
name: "version",
|
|
4635
|
+
inputs: [],
|
|
4636
|
+
outputs: [
|
|
4637
|
+
{
|
|
4638
|
+
name: "",
|
|
4639
|
+
type: "uint64",
|
|
4640
|
+
internalType: "uint64"
|
|
4641
|
+
}
|
|
4642
|
+
],
|
|
4643
|
+
stateMutability: "view"
|
|
4644
|
+
},
|
|
4645
|
+
{
|
|
4646
|
+
type: "event",
|
|
4647
|
+
name: "DeploymentAdded",
|
|
4648
|
+
inputs: [
|
|
4649
|
+
{
|
|
4650
|
+
name: "chain",
|
|
4651
|
+
type: "string",
|
|
4652
|
+
indexed: false,
|
|
4653
|
+
internalType: "string"
|
|
4654
|
+
},
|
|
4655
|
+
{
|
|
4656
|
+
name: "gateway",
|
|
4657
|
+
type: "address",
|
|
4658
|
+
indexed: false,
|
|
4659
|
+
internalType: "address"
|
|
4660
|
+
}
|
|
4661
|
+
],
|
|
4662
|
+
anonymous: false
|
|
4663
|
+
},
|
|
4588
4664
|
{
|
|
4589
4665
|
type: "event",
|
|
4590
4666
|
name: "DestinationProtocolFeeUpdated",
|
|
@@ -4718,16 +4794,29 @@ var ABI3 = [
|
|
|
4718
4794
|
},
|
|
4719
4795
|
{
|
|
4720
4796
|
type: "event",
|
|
4721
|
-
name: "
|
|
4797
|
+
name: "Initialized",
|
|
4722
4798
|
inputs: [
|
|
4723
4799
|
{
|
|
4724
|
-
name: "
|
|
4725
|
-
type: "
|
|
4800
|
+
name: "version",
|
|
4801
|
+
type: "uint64",
|
|
4726
4802
|
indexed: false,
|
|
4727
|
-
internalType: "
|
|
4803
|
+
internalType: "uint64"
|
|
4804
|
+
}
|
|
4805
|
+
],
|
|
4806
|
+
anonymous: false
|
|
4807
|
+
},
|
|
4808
|
+
{
|
|
4809
|
+
type: "event",
|
|
4810
|
+
name: "OrderCancelled",
|
|
4811
|
+
inputs: [
|
|
4812
|
+
{
|
|
4813
|
+
name: "commitment",
|
|
4814
|
+
type: "bytes32",
|
|
4815
|
+
indexed: true,
|
|
4816
|
+
internalType: "bytes32"
|
|
4728
4817
|
},
|
|
4729
4818
|
{
|
|
4730
|
-
name: "
|
|
4819
|
+
name: "canceller",
|
|
4731
4820
|
type: "address",
|
|
4732
4821
|
indexed: false,
|
|
4733
4822
|
internalType: "address"
|
|
@@ -5055,14 +5144,52 @@ var ABI3 = [
|
|
|
5055
5144
|
],
|
|
5056
5145
|
anonymous: false
|
|
5057
5146
|
},
|
|
5147
|
+
{
|
|
5148
|
+
type: "event",
|
|
5149
|
+
name: "RelayerUpdated",
|
|
5150
|
+
inputs: [
|
|
5151
|
+
{
|
|
5152
|
+
name: "previous",
|
|
5153
|
+
type: "address",
|
|
5154
|
+
indexed: false,
|
|
5155
|
+
internalType: "address"
|
|
5156
|
+
},
|
|
5157
|
+
{
|
|
5158
|
+
name: "current",
|
|
5159
|
+
type: "address",
|
|
5160
|
+
indexed: false,
|
|
5161
|
+
internalType: "address"
|
|
5162
|
+
}
|
|
5163
|
+
],
|
|
5164
|
+
anonymous: false
|
|
5165
|
+
},
|
|
5166
|
+
{
|
|
5167
|
+
type: "event",
|
|
5168
|
+
name: "Upgraded",
|
|
5169
|
+
inputs: [
|
|
5170
|
+
{
|
|
5171
|
+
name: "implementation",
|
|
5172
|
+
type: "address",
|
|
5173
|
+
indexed: true,
|
|
5174
|
+
internalType: "address"
|
|
5175
|
+
}
|
|
5176
|
+
],
|
|
5177
|
+
anonymous: false
|
|
5178
|
+
},
|
|
5058
5179
|
{
|
|
5059
5180
|
type: "error",
|
|
5060
|
-
name: "
|
|
5061
|
-
inputs: [
|
|
5181
|
+
name: "AddressEmptyCode",
|
|
5182
|
+
inputs: [
|
|
5183
|
+
{
|
|
5184
|
+
name: "target",
|
|
5185
|
+
type: "address",
|
|
5186
|
+
internalType: "address"
|
|
5187
|
+
}
|
|
5188
|
+
]
|
|
5062
5189
|
},
|
|
5063
5190
|
{
|
|
5064
5191
|
type: "error",
|
|
5065
|
-
name: "
|
|
5192
|
+
name: "Cancelled",
|
|
5066
5193
|
inputs: []
|
|
5067
5194
|
},
|
|
5068
5195
|
{
|
|
@@ -5092,11 +5219,37 @@ var ABI3 = [
|
|
|
5092
5219
|
}
|
|
5093
5220
|
]
|
|
5094
5221
|
},
|
|
5222
|
+
{
|
|
5223
|
+
type: "error",
|
|
5224
|
+
name: "ERC1967InvalidImplementation",
|
|
5225
|
+
inputs: [
|
|
5226
|
+
{
|
|
5227
|
+
name: "implementation",
|
|
5228
|
+
type: "address",
|
|
5229
|
+
internalType: "address"
|
|
5230
|
+
}
|
|
5231
|
+
]
|
|
5232
|
+
},
|
|
5233
|
+
{
|
|
5234
|
+
type: "error",
|
|
5235
|
+
name: "ERC1967NonPayable",
|
|
5236
|
+
inputs: []
|
|
5237
|
+
},
|
|
5095
5238
|
{
|
|
5096
5239
|
type: "error",
|
|
5097
5240
|
name: "Expired",
|
|
5098
5241
|
inputs: []
|
|
5099
5242
|
},
|
|
5243
|
+
{
|
|
5244
|
+
type: "error",
|
|
5245
|
+
name: "FailedCall",
|
|
5246
|
+
inputs: []
|
|
5247
|
+
},
|
|
5248
|
+
{
|
|
5249
|
+
type: "error",
|
|
5250
|
+
name: "FillExpired",
|
|
5251
|
+
inputs: []
|
|
5252
|
+
},
|
|
5100
5253
|
{
|
|
5101
5254
|
type: "error",
|
|
5102
5255
|
name: "Filled",
|
|
@@ -5107,6 +5260,11 @@ var ABI3 = [
|
|
|
5107
5260
|
name: "InsufficientNativeToken",
|
|
5108
5261
|
inputs: []
|
|
5109
5262
|
},
|
|
5263
|
+
{
|
|
5264
|
+
type: "error",
|
|
5265
|
+
name: "InvalidInitialization",
|
|
5266
|
+
inputs: []
|
|
5267
|
+
},
|
|
5110
5268
|
{
|
|
5111
5269
|
type: "error",
|
|
5112
5270
|
name: "InvalidInput",
|
|
@@ -5122,6 +5280,21 @@ var ABI3 = [
|
|
|
5122
5280
|
name: "NotExpired",
|
|
5123
5281
|
inputs: []
|
|
5124
5282
|
},
|
|
5283
|
+
{
|
|
5284
|
+
type: "error",
|
|
5285
|
+
name: "NotInitializing",
|
|
5286
|
+
inputs: []
|
|
5287
|
+
},
|
|
5288
|
+
{
|
|
5289
|
+
type: "error",
|
|
5290
|
+
name: "PartialFillNotAllowed",
|
|
5291
|
+
inputs: []
|
|
5292
|
+
},
|
|
5293
|
+
{
|
|
5294
|
+
type: "error",
|
|
5295
|
+
name: "ReentrancyGuardReentrantCall",
|
|
5296
|
+
inputs: []
|
|
5297
|
+
},
|
|
5125
5298
|
{
|
|
5126
5299
|
type: "error",
|
|
5127
5300
|
name: "SafeERC20FailedOperation",
|
|
@@ -5159,6 +5332,11 @@ var ABI3 = [
|
|
|
5159
5332
|
name: "UnexpectedCall",
|
|
5160
5333
|
inputs: []
|
|
5161
5334
|
},
|
|
5335
|
+
{
|
|
5336
|
+
type: "error",
|
|
5337
|
+
name: "UnknownInstance",
|
|
5338
|
+
inputs: []
|
|
5339
|
+
},
|
|
5162
5340
|
{
|
|
5163
5341
|
type: "error",
|
|
5164
5342
|
name: "UnknownOrder",
|
|
@@ -20379,8 +20557,52 @@ var IntentGateway = class _IntentGateway {
|
|
|
20379
20557
|
}
|
|
20380
20558
|
}
|
|
20381
20559
|
};
|
|
20382
|
-
|
|
20383
|
-
|
|
20560
|
+
function rpcFetch() {
|
|
20561
|
+
const f = globalThis.fetch;
|
|
20562
|
+
if (typeof f !== "function") {
|
|
20563
|
+
throw new Error("No fetch available; call setAggregationFetch() before using the aggregation helpers");
|
|
20564
|
+
}
|
|
20565
|
+
return f;
|
|
20566
|
+
}
|
|
20567
|
+
var PhantomRpcError = class extends Error {
|
|
20568
|
+
constructor(message, cause) {
|
|
20569
|
+
super(message);
|
|
20570
|
+
this.cause = cause;
|
|
20571
|
+
this.name = "PhantomRpcError";
|
|
20572
|
+
}
|
|
20573
|
+
cause;
|
|
20574
|
+
};
|
|
20575
|
+
async function rpcCall(url, payload) {
|
|
20576
|
+
let lastErr;
|
|
20577
|
+
for (let attempt = 0; attempt < 4; attempt++) {
|
|
20578
|
+
if (attempt > 0) await new Promise((resolve) => setTimeout(resolve, 150 * attempt));
|
|
20579
|
+
let timer;
|
|
20580
|
+
try {
|
|
20581
|
+
const timeout = new Promise((_, reject) => {
|
|
20582
|
+
timer = setTimeout(() => reject(new Error(`rpc timeout: ${url}`)), 12e3);
|
|
20583
|
+
});
|
|
20584
|
+
const response = await Promise.race([
|
|
20585
|
+
rpcFetch()(url, {
|
|
20586
|
+
method: "POST",
|
|
20587
|
+
headers: { accept: "application/json", "content-type": "application/json" },
|
|
20588
|
+
body: JSON.stringify(payload)
|
|
20589
|
+
}),
|
|
20590
|
+
timeout
|
|
20591
|
+
]);
|
|
20592
|
+
const body = await response.json();
|
|
20593
|
+
if (body?.error) {
|
|
20594
|
+
lastErr = new Error(`rpc error: ${JSON.stringify(body.error).slice(0, 200)}`);
|
|
20595
|
+
continue;
|
|
20596
|
+
}
|
|
20597
|
+
return body;
|
|
20598
|
+
} catch (err) {
|
|
20599
|
+
lastErr = err;
|
|
20600
|
+
} finally {
|
|
20601
|
+
if (timer) clearTimeout(timer);
|
|
20602
|
+
}
|
|
20603
|
+
}
|
|
20604
|
+
throw new PhantomRpcError(`RPC call failed after 4 attempts: ${url}`, lastErr);
|
|
20605
|
+
}
|
|
20384
20606
|
var FILL_ORDER_ABI = IntentGatewayV2_default.ABI;
|
|
20385
20607
|
var DECLARATION_V1 = 1;
|
|
20386
20608
|
var DECLARATION_V2 = 2;
|
|
@@ -20469,15 +20691,35 @@ function decodeAcceptedSourceChains(paymasterAndData) {
|
|
|
20469
20691
|
return decodePhantomBidDeclaration(paymasterAndData).acceptedSources;
|
|
20470
20692
|
}
|
|
20471
20693
|
var UNISWAP_QUOTE_HAIRCUT_BPS = 10n;
|
|
20472
|
-
var PHANTOM_QUOTE_HAIRCUT_BPS = 5n;
|
|
20473
20694
|
function haircut(amount, bps) {
|
|
20474
20695
|
return amount * (10000n - bps) / 10000n;
|
|
20475
20696
|
}
|
|
20476
20697
|
function applyUniswapQuoteHaircut(amount) {
|
|
20477
20698
|
return haircut(amount, UNISWAP_QUOTE_HAIRCUT_BPS);
|
|
20478
20699
|
}
|
|
20479
|
-
|
|
20480
|
-
|
|
20700
|
+
var SELECTOR_GATEWAY_PARAMS = "0xcff0ab96";
|
|
20701
|
+
var GATEWAY_PARAMS_WORDS = 6;
|
|
20702
|
+
var GATEWAY_PARAMS_FEE_WORD = 4;
|
|
20703
|
+
async function readProtocolFeeHaircutBps(evmRpcUrl, gatewayAddress) {
|
|
20704
|
+
const result = await rpcCall(evmRpcUrl, {
|
|
20705
|
+
id: 1,
|
|
20706
|
+
jsonrpc: "2.0",
|
|
20707
|
+
method: "eth_call",
|
|
20708
|
+
params: [{ to: gatewayAddress, data: SELECTOR_GATEWAY_PARAMS }, "latest"]
|
|
20709
|
+
});
|
|
20710
|
+
const hex = result.result;
|
|
20711
|
+
if (typeof hex !== "string" || hex.length < 2 + 64 * GATEWAY_PARAMS_WORDS) {
|
|
20712
|
+
throw new PhantomRpcError(`IntentGateway.params() returned no usable result from ${gatewayAddress} on ${evmRpcUrl}`);
|
|
20713
|
+
}
|
|
20714
|
+
const start = 2 + 64 * GATEWAY_PARAMS_FEE_WORD;
|
|
20715
|
+
const protocolFeeBps = BigInt(`0x${hex.slice(start, start + 64)}`);
|
|
20716
|
+
if (protocolFeeBps >= 10000n) {
|
|
20717
|
+
throw new PhantomRpcError(`IntentGateway ${gatewayAddress} reports an implausible protocol fee: ${protocolFeeBps} bps`);
|
|
20718
|
+
}
|
|
20719
|
+
return protocolFeeBps;
|
|
20720
|
+
}
|
|
20721
|
+
function applyProtocolFeeHaircut(amount, protocolFeeBps) {
|
|
20722
|
+
return haircut(amount, protocolFeeBps);
|
|
20481
20723
|
}
|
|
20482
20724
|
FILL_ORDER_ABI.find(
|
|
20483
20725
|
(item) => item?.type === "function" && item?.name === "fillOrder"
|
|
@@ -24987,7 +25229,6 @@ exports.ORDER_V2_PARAM_TYPE = ORDER_V2_PARAM_TYPE;
|
|
|
24987
25229
|
exports.OrderStatus = OrderStatus;
|
|
24988
25230
|
exports.OrderStatusChecker = OrderStatusChecker;
|
|
24989
25231
|
exports.PACKED_USEROP_TYPEHASH = PACKED_USEROP_TYPEHASH;
|
|
24990
|
-
exports.PHANTOM_QUOTE_HAIRCUT_BPS = PHANTOM_QUOTE_HAIRCUT_BPS;
|
|
24991
25232
|
exports.PLACE_ORDER_SELECTOR = PLACE_ORDER_SELECTOR;
|
|
24992
25233
|
exports.PhantomSnapshotUnavailableError = PhantomSnapshotUnavailableError;
|
|
24993
25234
|
exports.PharosChain = PharosChain;
|
|
@@ -25016,7 +25257,7 @@ exports.UnsupportedLiquidityChainError = UnsupportedLiquidityChainError;
|
|
|
25016
25257
|
exports.WrappedHyperFungibleTokenABI = WrappedHyperFungibleTokenABI;
|
|
25017
25258
|
exports.__test = __test;
|
|
25018
25259
|
exports.adjustDecimals = adjustDecimals;
|
|
25019
|
-
exports.
|
|
25260
|
+
exports.applyProtocolFeeHaircut = applyProtocolFeeHaircut;
|
|
25020
25261
|
exports.applyUniswapQuoteHaircut = applyUniswapQuoteHaircut;
|
|
25021
25262
|
exports.bytes20ToBytes32 = bytes20ToBytes32;
|
|
25022
25263
|
exports.bytes32ToBytes20 = bytes32ToBytes20;
|
|
@@ -25087,6 +25328,7 @@ exports.queryAssetTeleported = queryAssetTeleported;
|
|
|
25087
25328
|
exports.queryGetRequest = queryGetRequest;
|
|
25088
25329
|
exports.queryPostRequest = queryPostRequest;
|
|
25089
25330
|
exports.quoteUniswap = quoteUniswap;
|
|
25331
|
+
exports.readProtocolFeeHaircutBps = readProtocolFeeHaircutBps;
|
|
25090
25332
|
exports.requestCommitmentKey = requestCommitmentKey;
|
|
25091
25333
|
exports.resetFillOptionsVersionCache = resetFillOptionsVersionCache;
|
|
25092
25334
|
exports.responseCommitmentKey = responseCommitmentKey;
|