@spicenet-io/spiceflow-core 0.3.13 → 0.3.15

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/index.cjs CHANGED
@@ -23,6 +23,7 @@ __export(index_exports, {
23
23
  ChainBatchHashAbi: () => ChainBatchHashAbi,
24
24
  DELEGATE_ABI: () => DELEGATE_ABI,
25
25
  ERC20_ABI: () => ERC20_ABI,
26
+ ESCROW_ADDRESS: () => ESCROW_ADDRESS,
26
27
  HttpError: () => HttpError,
27
28
  IntentHashAbi: () => IntentHashAbi,
28
29
  NATIVE_TOKEN_ADDRESS: () => NATIVE_TOKEN_ADDRESS,
@@ -48,8 +49,6 @@ __export(index_exports, {
48
49
  getDeployment: () => getDeployment,
49
50
  getEquivalenceGroup: () => getEquivalenceGroup,
50
51
  getEquivalentAddresses: () => getEquivalentAddresses,
51
- getEscrowContract: () => getEscrowContract,
52
- getEscrowContractAddress: () => getEscrowContractAddress,
53
52
  getIntentHash: () => getIntentHash,
54
53
  getIntentStepStatus: () => getIntentStepStatus,
55
54
  getMainnetChains: () => getMainnetChains,
@@ -71,9 +70,6 @@ __export(index_exports, {
71
70
  requireTokenBySymbol: () => requireTokenBySymbol,
72
71
  requireViemChain: () => requireViemChain,
73
72
  resolveTokenRef: () => resolveTokenRef,
74
- spicenetAbi: () => spicenetAbi,
75
- spicenetEscrowAbi: () => spicenetEscrowAbi,
76
- spicenetWalletManagerAbi: () => spicenetEscrowAbi,
77
73
  submitTransaction: () => submitTransaction,
78
74
  truncateAddress: () => truncateAddress,
79
75
  uniV3QuoterV2Abi: () => uniV3QuoterV2Abi,
@@ -121,7 +117,7 @@ function getIntentHash(signatureType, nbf, exp, chainBatches) {
121
117
  );
122
118
  }
123
119
  async function getAccountNonce(address, publicClient) {
124
- return await publicClient.getTransactionCount({ address });
120
+ return await publicClient.getTransactionCount({ address, blockTag: "pending" });
125
121
  }
126
122
  async function getRecentBlock(publicClient) {
127
123
  return await publicClient.getBlockNumber();
@@ -757,7 +753,6 @@ var CHAINS = {
757
753
  network: "mainnet",
758
754
  nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
759
755
  delegateContract: "0x5884Bff4876C979271E65D2feA8D0CF3bF6E6CcC",
760
- escrowContract: "0xd3F8f177BB3d7dfD883d7c232f3093EdD61C3De9",
761
756
  blockExplorer: "https://basescan.org",
762
757
  rpcUrl: "https://mainnet.base.org",
763
758
  logo: logo_base,
@@ -770,7 +765,6 @@ var CHAINS = {
770
765
  network: "mainnet",
771
766
  nativeCurrency: { name: "Ether", symbol: "ETH", decimals: 18 },
772
767
  delegateContract: "0x262E1A689555dA5209113A056d0d164EF8355395",
773
- escrowContract: "0x47d6DB10d99b1E0A074B1467407C7A53B68e1147",
774
768
  blockExplorer: "https://arbiscan.io",
775
769
  rpcUrl: "https://arb1.arbitrum.io/rpc",
776
770
  logo: logo_arb,
@@ -783,7 +777,6 @@ var CHAINS = {
783
777
  network: "mainnet",
784
778
  nativeCurrency: { name: "Citrea Bitcoin", symbol: "cBTC", decimals: 18 },
785
779
  delegateContract: "0x5884Bff4876C979271E65D2feA8D0CF3bF6E6CcC",
786
- escrowContract: "0x3677113f10d82acFEeDd22dF5c7cFD58736111ee",
787
780
  blockExplorer: "https://explorer.mainnet.citrea.xyz",
788
781
  rpcUrl: "https://rpc.mainnet.citrea.xyz",
789
782
  logo: logo_citrea,
@@ -831,7 +824,6 @@ var CHAINS = {
831
824
  network: "testnet",
832
825
  nativeCurrency: { name: "cBTC", symbol: "cBTC", decimals: 18 },
833
826
  delegateContract: "0x347056dd1CB95ae850192e3fC6FA995537A3A091",
834
- escrowContract: "0xDf5616Fe65f103972c25EF596C6386904E5CbC8f",
835
827
  blockExplorer: "https://explorer.testnet.citrea.xyz",
836
828
  rpcUrl: "https://rpc.testnet.citrea.xyz",
837
829
  logo: logo_citrea,
@@ -964,9 +956,6 @@ function getAllChainsByNetwork(network) {
964
956
  function getDelegateContract(chainId) {
965
957
  return CHAINS[chainId]?.delegateContract;
966
958
  }
967
- function getEscrowContract(chainId) {
968
- return CHAINS[chainId]?.escrowContract;
969
- }
970
959
  function toViemChain(meta) {
971
960
  if (meta.chainType === "starknet") return void 0;
972
961
  return (0, import_viem2.defineChain)({
@@ -1010,13 +999,7 @@ var STARKNET_MAINNET_CHAIN_ID = 23448594291968336;
1010
999
  // src/utils.ts
1011
1000
  var NATIVE_TOKEN_ADDRESS = "0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE";
1012
1001
  var ZERO_ADDRESS = "0x0000000000000000000000000000000000000000";
1013
- function getEscrowContractAddress(chainId) {
1014
- const escrow = getEscrowContract(chainId);
1015
- if (!escrow) {
1016
- throw new Error(`Escrow contract not configured for chain ${chainId}`);
1017
- }
1018
- return escrow;
1019
- }
1002
+ var ESCROW_ADDRESS = "0xeee2b52e7CFe6e2168341a34cEB783b68FEdf1A2";
1020
1003
  function isNativeToken(address) {
1021
1004
  const lower = address.toLowerCase();
1022
1005
  return lower === "0x0" || lower === "0x0000000000000000000000000000000000000000" || lower === "0xeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee";
@@ -1427,1159 +1410,6 @@ var uniV3SwapRouterAbi = [
1427
1410
  }
1428
1411
  ];
1429
1412
 
1430
- // src/abis/spicenet.ts
1431
- var spicenetAbi = [
1432
- {
1433
- type: "function",
1434
- name: "closeRebalancingRequest",
1435
- inputs: [
1436
- {
1437
- name: "args",
1438
- type: "tuple",
1439
- internalType: "struct Spicenet.CloseRebalancingRequestArgs",
1440
- components: [
1441
- {
1442
- name: "idempotenceKey",
1443
- type: "bytes32",
1444
- internalType: "bytes32"
1445
- },
1446
- {
1447
- name: "repaymentChainTokenAmount",
1448
- type: "uint256",
1449
- internalType: "uint256"
1450
- }
1451
- ]
1452
- }
1453
- ],
1454
- outputs: [],
1455
- stateMutability: "nonpayable"
1456
- },
1457
- {
1458
- type: "function",
1459
- name: "createWithdrawalRequest",
1460
- inputs: [
1461
- {
1462
- name: "request",
1463
- type: "tuple",
1464
- internalType: "struct Spicenet.CreateWithdrawalRequestArgs",
1465
- components: [
1466
- {
1467
- name: "chainId",
1468
- type: "string",
1469
- internalType: "string"
1470
- },
1471
- {
1472
- name: "idempotenceKey",
1473
- type: "bytes32",
1474
- internalType: "bytes32"
1475
- },
1476
- {
1477
- name: "nbf",
1478
- type: "uint256",
1479
- internalType: "uint256"
1480
- },
1481
- {
1482
- name: "exp",
1483
- type: "uint256",
1484
- internalType: "uint256"
1485
- },
1486
- {
1487
- name: "metadata",
1488
- type: "string",
1489
- internalType: "string"
1490
- },
1491
- {
1492
- name: "transfers",
1493
- type: "tuple[]",
1494
- internalType: "struct Spicenet.CreateTokenTransfer[]",
1495
- components: [
1496
- {
1497
- name: "token",
1498
- type: "string",
1499
- internalType: "string"
1500
- },
1501
- {
1502
- name: "to",
1503
- type: "string",
1504
- internalType: "string"
1505
- },
1506
- {
1507
- name: "amount",
1508
- type: "uint256",
1509
- internalType: "uint256"
1510
- }
1511
- ]
1512
- }
1513
- ]
1514
- }
1515
- ],
1516
- outputs: [],
1517
- stateMutability: "nonpayable"
1518
- },
1519
- {
1520
- type: "function",
1521
- name: "createRebalancingRequest",
1522
- inputs: [
1523
- {
1524
- name: "request",
1525
- type: "tuple",
1526
- internalType: "struct Spicenet.CreateRebalancingRequestArgs",
1527
- components: [
1528
- {
1529
- name: "idempotenceKey",
1530
- type: "bytes32",
1531
- internalType: "bytes32"
1532
- },
1533
- {
1534
- name: "nbf",
1535
- type: "uint256",
1536
- internalType: "uint256"
1537
- },
1538
- {
1539
- name: "exp",
1540
- type: "uint256",
1541
- internalType: "uint256"
1542
- },
1543
- {
1544
- name: "metadata",
1545
- type: "string",
1546
- internalType: "string"
1547
- },
1548
- {
1549
- name: "recipient",
1550
- type: "string",
1551
- internalType: "string"
1552
- },
1553
- {
1554
- name: "fromChainToken",
1555
- type: "string",
1556
- internalType: "string"
1557
- },
1558
- {
1559
- name: "fromChainTokenAmount",
1560
- type: "uint256",
1561
- internalType: "uint256"
1562
- },
1563
- {
1564
- name: "toChainToken",
1565
- type: "string",
1566
- internalType: "string"
1567
- },
1568
- {
1569
- name: "toChainTokenAmountMin",
1570
- type: "uint256",
1571
- internalType: "uint256"
1572
- }
1573
- ]
1574
- }
1575
- ],
1576
- outputs: [],
1577
- stateMutability: "nonpayable"
1578
- }
1579
- ];
1580
-
1581
- // src/abis/spicenetEscrow.ts
1582
- var spicenetEscrowAbi = [
1583
- {
1584
- type: "constructor",
1585
- inputs: [],
1586
- stateMutability: "nonpayable"
1587
- },
1588
- {
1589
- type: "receive",
1590
- stateMutability: "payable"
1591
- },
1592
- {
1593
- type: "function",
1594
- name: "DEFAULT_ADMIN_ROLE",
1595
- inputs: [],
1596
- outputs: [
1597
- {
1598
- name: "",
1599
- type: "bytes32",
1600
- internalType: "bytes32"
1601
- }
1602
- ],
1603
- stateMutability: "view"
1604
- },
1605
- {
1606
- type: "function",
1607
- name: "PAUSER_ROLE",
1608
- inputs: [],
1609
- outputs: [
1610
- {
1611
- name: "",
1612
- type: "bytes32",
1613
- internalType: "bytes32"
1614
- }
1615
- ],
1616
- stateMutability: "view"
1617
- },
1618
- {
1619
- type: "function",
1620
- name: "RELAYER_ROLE",
1621
- inputs: [],
1622
- outputs: [
1623
- {
1624
- name: "",
1625
- type: "bytes32",
1626
- internalType: "bytes32"
1627
- }
1628
- ],
1629
- stateMutability: "view"
1630
- },
1631
- {
1632
- type: "function",
1633
- name: "UNPAUSER_ROLE",
1634
- inputs: [],
1635
- outputs: [
1636
- {
1637
- name: "",
1638
- type: "bytes32",
1639
- internalType: "bytes32"
1640
- }
1641
- ],
1642
- stateMutability: "view"
1643
- },
1644
- {
1645
- type: "function",
1646
- name: "UPGRADER_ROLE",
1647
- inputs: [],
1648
- outputs: [
1649
- {
1650
- name: "",
1651
- type: "bytes32",
1652
- internalType: "bytes32"
1653
- }
1654
- ],
1655
- stateMutability: "view"
1656
- },
1657
- {
1658
- type: "function",
1659
- name: "UPGRADE_INTERFACE_VERSION",
1660
- inputs: [],
1661
- outputs: [
1662
- {
1663
- name: "",
1664
- type: "string",
1665
- internalType: "string"
1666
- }
1667
- ],
1668
- stateMutability: "view"
1669
- },
1670
- {
1671
- type: "function",
1672
- name: "adminProcessWithdrawalRequestEvents",
1673
- inputs: [
1674
- {
1675
- name: "requests",
1676
- type: "tuple[]",
1677
- internalType: "struct ISpicenetEscrow.WithdrawalRequest[]",
1678
- components: [
1679
- {
1680
- name: "idempotenceKey",
1681
- type: "bytes32",
1682
- internalType: "bytes32"
1683
- },
1684
- {
1685
- name: "forUser",
1686
- type: "string",
1687
- internalType: "string"
1688
- },
1689
- {
1690
- name: "nbf",
1691
- type: "uint256",
1692
- internalType: "uint256"
1693
- },
1694
- {
1695
- name: "exp",
1696
- type: "uint256",
1697
- internalType: "uint256"
1698
- },
1699
- {
1700
- name: "metadata",
1701
- type: "string",
1702
- internalType: "string"
1703
- },
1704
- {
1705
- name: "transfers",
1706
- type: "tuple[]",
1707
- internalType: "struct ISpicenetEscrow.TokenTransfer[]",
1708
- components: [
1709
- {
1710
- name: "token",
1711
- type: "address",
1712
- internalType: "address"
1713
- },
1714
- {
1715
- name: "to",
1716
- type: "address",
1717
- internalType: "address"
1718
- },
1719
- {
1720
- name: "amount",
1721
- type: "uint256",
1722
- internalType: "uint256"
1723
- }
1724
- ]
1725
- }
1726
- ]
1727
- }
1728
- ],
1729
- outputs: [],
1730
- stateMutability: "nonpayable"
1731
- },
1732
- {
1733
- type: "function",
1734
- name: "adminSetWithdrawalInfos",
1735
- inputs: [
1736
- {
1737
- name: "idempotenceKeys",
1738
- type: "bytes32[]",
1739
- internalType: "bytes32[]"
1740
- },
1741
- {
1742
- name: "withdrawalInfos",
1743
- type: "tuple[]",
1744
- internalType: "struct ISpicenetEscrow.WithdrawalInfo[]",
1745
- components: [
1746
- {
1747
- name: "forUser",
1748
- type: "string",
1749
- internalType: "string"
1750
- },
1751
- {
1752
- name: "blockNumber",
1753
- type: "uint256",
1754
- internalType: "uint256"
1755
- },
1756
- {
1757
- name: "nbf",
1758
- type: "uint256",
1759
- internalType: "uint256"
1760
- },
1761
- {
1762
- name: "exp",
1763
- type: "uint256",
1764
- internalType: "uint256"
1765
- },
1766
- {
1767
- name: "metadata",
1768
- type: "string",
1769
- internalType: "string"
1770
- }
1771
- ]
1772
- }
1773
- ],
1774
- outputs: [],
1775
- stateMutability: "nonpayable"
1776
- },
1777
- {
1778
- type: "function",
1779
- name: "adminWithdraw",
1780
- inputs: [
1781
- {
1782
- name: "transfers",
1783
- type: "tuple[]",
1784
- internalType: "struct ISpicenetEscrow.TokenTransfer[]",
1785
- components: [
1786
- {
1787
- name: "token",
1788
- type: "address",
1789
- internalType: "address"
1790
- },
1791
- {
1792
- name: "to",
1793
- type: "address",
1794
- internalType: "address"
1795
- },
1796
- {
1797
- name: "amount",
1798
- type: "uint256",
1799
- internalType: "uint256"
1800
- }
1801
- ]
1802
- }
1803
- ],
1804
- outputs: [],
1805
- stateMutability: "nonpayable"
1806
- },
1807
- {
1808
- type: "function",
1809
- name: "getRoleAdmin",
1810
- inputs: [
1811
- {
1812
- name: "role",
1813
- type: "bytes32",
1814
- internalType: "bytes32"
1815
- }
1816
- ],
1817
- outputs: [
1818
- {
1819
- name: "",
1820
- type: "bytes32",
1821
- internalType: "bytes32"
1822
- }
1823
- ],
1824
- stateMutability: "view"
1825
- },
1826
- {
1827
- type: "function",
1828
- name: "getRoleMember",
1829
- inputs: [
1830
- {
1831
- name: "role",
1832
- type: "bytes32",
1833
- internalType: "bytes32"
1834
- },
1835
- {
1836
- name: "index",
1837
- type: "uint256",
1838
- internalType: "uint256"
1839
- }
1840
- ],
1841
- outputs: [
1842
- {
1843
- name: "",
1844
- type: "address",
1845
- internalType: "address"
1846
- }
1847
- ],
1848
- stateMutability: "view"
1849
- },
1850
- {
1851
- type: "function",
1852
- name: "getRoleMemberCount",
1853
- inputs: [
1854
- {
1855
- name: "role",
1856
- type: "bytes32",
1857
- internalType: "bytes32"
1858
- }
1859
- ],
1860
- outputs: [
1861
- {
1862
- name: "",
1863
- type: "uint256",
1864
- internalType: "uint256"
1865
- }
1866
- ],
1867
- stateMutability: "view"
1868
- },
1869
- {
1870
- type: "function",
1871
- name: "getRoleMembers",
1872
- inputs: [
1873
- {
1874
- name: "role",
1875
- type: "bytes32",
1876
- internalType: "bytes32"
1877
- }
1878
- ],
1879
- outputs: [
1880
- {
1881
- name: "",
1882
- type: "address[]",
1883
- internalType: "address[]"
1884
- }
1885
- ],
1886
- stateMutability: "view"
1887
- },
1888
- {
1889
- type: "function",
1890
- name: "getWithdrawalInfo",
1891
- inputs: [
1892
- {
1893
- name: "idempotenceKey",
1894
- type: "bytes32",
1895
- internalType: "bytes32"
1896
- }
1897
- ],
1898
- outputs: [
1899
- {
1900
- name: "",
1901
- type: "tuple",
1902
- internalType: "struct ISpicenetEscrow.WithdrawalInfo",
1903
- components: [
1904
- {
1905
- name: "forUser",
1906
- type: "string",
1907
- internalType: "string"
1908
- },
1909
- {
1910
- name: "blockNumber",
1911
- type: "uint256",
1912
- internalType: "uint256"
1913
- },
1914
- {
1915
- name: "nbf",
1916
- type: "uint256",
1917
- internalType: "uint256"
1918
- },
1919
- {
1920
- name: "exp",
1921
- type: "uint256",
1922
- internalType: "uint256"
1923
- },
1924
- {
1925
- name: "metadata",
1926
- type: "string",
1927
- internalType: "string"
1928
- }
1929
- ]
1930
- }
1931
- ],
1932
- stateMutability: "view"
1933
- },
1934
- {
1935
- type: "function",
1936
- name: "grantRole",
1937
- inputs: [
1938
- {
1939
- name: "role",
1940
- type: "bytes32",
1941
- internalType: "bytes32"
1942
- },
1943
- {
1944
- name: "account",
1945
- type: "address",
1946
- internalType: "address"
1947
- }
1948
- ],
1949
- outputs: [],
1950
- stateMutability: "nonpayable"
1951
- },
1952
- {
1953
- type: "function",
1954
- name: "hasRole",
1955
- inputs: [
1956
- {
1957
- name: "role",
1958
- type: "bytes32",
1959
- internalType: "bytes32"
1960
- },
1961
- {
1962
- name: "account",
1963
- type: "address",
1964
- internalType: "address"
1965
- }
1966
- ],
1967
- outputs: [
1968
- {
1969
- name: "",
1970
- type: "bool",
1971
- internalType: "bool"
1972
- }
1973
- ],
1974
- stateMutability: "view"
1975
- },
1976
- {
1977
- type: "function",
1978
- name: "initialize",
1979
- inputs: [
1980
- {
1981
- name: "defaultAdmin",
1982
- type: "address",
1983
- internalType: "address"
1984
- }
1985
- ],
1986
- outputs: [],
1987
- stateMutability: "nonpayable"
1988
- },
1989
- {
1990
- type: "function",
1991
- name: "pause",
1992
- inputs: [],
1993
- outputs: [],
1994
- stateMutability: "nonpayable"
1995
- },
1996
- {
1997
- type: "function",
1998
- name: "paused",
1999
- inputs: [],
2000
- outputs: [
2001
- {
2002
- name: "",
2003
- type: "bool",
2004
- internalType: "bool"
2005
- }
2006
- ],
2007
- stateMutability: "view"
2008
- },
2009
- {
2010
- type: "function",
2011
- name: "processWithdrawal",
2012
- inputs: [
2013
- {
2014
- name: "request",
2015
- type: "tuple",
2016
- internalType: "struct ISpicenetEscrow.WithdrawalRequest",
2017
- components: [
2018
- {
2019
- name: "idempotenceKey",
2020
- type: "bytes32",
2021
- internalType: "bytes32"
2022
- },
2023
- {
2024
- name: "forUser",
2025
- type: "string",
2026
- internalType: "string"
2027
- },
2028
- {
2029
- name: "nbf",
2030
- type: "uint256",
2031
- internalType: "uint256"
2032
- },
2033
- {
2034
- name: "exp",
2035
- type: "uint256",
2036
- internalType: "uint256"
2037
- },
2038
- {
2039
- name: "metadata",
2040
- type: "string",
2041
- internalType: "string"
2042
- },
2043
- {
2044
- name: "transfers",
2045
- type: "tuple[]",
2046
- internalType: "struct ISpicenetEscrow.TokenTransfer[]",
2047
- components: [
2048
- {
2049
- name: "token",
2050
- type: "address",
2051
- internalType: "address"
2052
- },
2053
- {
2054
- name: "to",
2055
- type: "address",
2056
- internalType: "address"
2057
- },
2058
- {
2059
- name: "amount",
2060
- type: "uint256",
2061
- internalType: "uint256"
2062
- }
2063
- ]
2064
- }
2065
- ]
2066
- }
2067
- ],
2068
- outputs: [],
2069
- stateMutability: "nonpayable"
2070
- },
2071
- {
2072
- type: "function",
2073
- name: "proxiableUUID",
2074
- inputs: [],
2075
- outputs: [
2076
- {
2077
- name: "",
2078
- type: "bytes32",
2079
- internalType: "bytes32"
2080
- }
2081
- ],
2082
- stateMutability: "view"
2083
- },
2084
- {
2085
- type: "function",
2086
- name: "renounceRole",
2087
- inputs: [
2088
- {
2089
- name: "role",
2090
- type: "bytes32",
2091
- internalType: "bytes32"
2092
- },
2093
- {
2094
- name: "callerConfirmation",
2095
- type: "address",
2096
- internalType: "address"
2097
- }
2098
- ],
2099
- outputs: [],
2100
- stateMutability: "nonpayable"
2101
- },
2102
- {
2103
- type: "function",
2104
- name: "revokeRole",
2105
- inputs: [
2106
- {
2107
- name: "role",
2108
- type: "bytes32",
2109
- internalType: "bytes32"
2110
- },
2111
- {
2112
- name: "account",
2113
- type: "address",
2114
- internalType: "address"
2115
- }
2116
- ],
2117
- outputs: [],
2118
- stateMutability: "nonpayable"
2119
- },
2120
- {
2121
- type: "function",
2122
- name: "supportsInterface",
2123
- inputs: [
2124
- {
2125
- name: "interfaceId",
2126
- type: "bytes4",
2127
- internalType: "bytes4"
2128
- }
2129
- ],
2130
- outputs: [
2131
- {
2132
- name: "",
2133
- type: "bool",
2134
- internalType: "bool"
2135
- }
2136
- ],
2137
- stateMutability: "view"
2138
- },
2139
- {
2140
- type: "function",
2141
- name: "unpause",
2142
- inputs: [],
2143
- outputs: [],
2144
- stateMutability: "nonpayable"
2145
- },
2146
- {
2147
- type: "function",
2148
- name: "upgradeToAndCall",
2149
- inputs: [
2150
- {
2151
- name: "newImplementation",
2152
- type: "address",
2153
- internalType: "address"
2154
- },
2155
- {
2156
- name: "data",
2157
- type: "bytes",
2158
- internalType: "bytes"
2159
- }
2160
- ],
2161
- outputs: [],
2162
- stateMutability: "payable"
2163
- },
2164
- {
2165
- type: "event",
2166
- name: "Initialized",
2167
- inputs: [
2168
- {
2169
- name: "version",
2170
- type: "uint64",
2171
- indexed: false,
2172
- internalType: "uint64"
2173
- }
2174
- ],
2175
- anonymous: false
2176
- },
2177
- {
2178
- type: "event",
2179
- name: "NativeTransfer",
2180
- inputs: [
2181
- {
2182
- name: "from",
2183
- type: "address",
2184
- indexed: true,
2185
- internalType: "address"
2186
- },
2187
- {
2188
- name: "to",
2189
- type: "address",
2190
- indexed: true,
2191
- internalType: "address"
2192
- },
2193
- {
2194
- name: "value",
2195
- type: "uint256",
2196
- indexed: false,
2197
- internalType: "uint256"
2198
- }
2199
- ],
2200
- anonymous: false
2201
- },
2202
- {
2203
- type: "event",
2204
- name: "Paused",
2205
- inputs: [
2206
- {
2207
- name: "account",
2208
- type: "address",
2209
- indexed: false,
2210
- internalType: "address"
2211
- }
2212
- ],
2213
- anonymous: false
2214
- },
2215
- {
2216
- type: "event",
2217
- name: "RoleAdminChanged",
2218
- inputs: [
2219
- {
2220
- name: "role",
2221
- type: "bytes32",
2222
- indexed: true,
2223
- internalType: "bytes32"
2224
- },
2225
- {
2226
- name: "previousAdminRole",
2227
- type: "bytes32",
2228
- indexed: true,
2229
- internalType: "bytes32"
2230
- },
2231
- {
2232
- name: "newAdminRole",
2233
- type: "bytes32",
2234
- indexed: true,
2235
- internalType: "bytes32"
2236
- }
2237
- ],
2238
- anonymous: false
2239
- },
2240
- {
2241
- type: "event",
2242
- name: "RoleGranted",
2243
- inputs: [
2244
- {
2245
- name: "role",
2246
- type: "bytes32",
2247
- indexed: true,
2248
- internalType: "bytes32"
2249
- },
2250
- {
2251
- name: "account",
2252
- type: "address",
2253
- indexed: true,
2254
- internalType: "address"
2255
- },
2256
- {
2257
- name: "sender",
2258
- type: "address",
2259
- indexed: true,
2260
- internalType: "address"
2261
- }
2262
- ],
2263
- anonymous: false
2264
- },
2265
- {
2266
- type: "event",
2267
- name: "RoleRevoked",
2268
- inputs: [
2269
- {
2270
- name: "role",
2271
- type: "bytes32",
2272
- indexed: true,
2273
- internalType: "bytes32"
2274
- },
2275
- {
2276
- name: "account",
2277
- type: "address",
2278
- indexed: true,
2279
- internalType: "address"
2280
- },
2281
- {
2282
- name: "sender",
2283
- type: "address",
2284
- indexed: true,
2285
- internalType: "address"
2286
- }
2287
- ],
2288
- anonymous: false
2289
- },
2290
- {
2291
- type: "event",
2292
- name: "Unpaused",
2293
- inputs: [
2294
- {
2295
- name: "account",
2296
- type: "address",
2297
- indexed: false,
2298
- internalType: "address"
2299
- }
2300
- ],
2301
- anonymous: false
2302
- },
2303
- {
2304
- type: "event",
2305
- name: "Upgraded",
2306
- inputs: [
2307
- {
2308
- name: "implementation",
2309
- type: "address",
2310
- indexed: true,
2311
- internalType: "address"
2312
- }
2313
- ],
2314
- anonymous: false
2315
- },
2316
- {
2317
- type: "event",
2318
- name: "WithdrawalProcessed",
2319
- inputs: [
2320
- {
2321
- name: "idempotenceKey",
2322
- type: "bytes32",
2323
- indexed: true,
2324
- internalType: "bytes32"
2325
- },
2326
- {
2327
- name: "forUser",
2328
- type: "string",
2329
- indexed: true,
2330
- internalType: "string"
2331
- },
2332
- {
2333
- name: "request",
2334
- type: "tuple",
2335
- indexed: false,
2336
- internalType: "struct ISpicenetEscrow.WithdrawalRequest",
2337
- components: [
2338
- {
2339
- name: "idempotenceKey",
2340
- type: "bytes32",
2341
- internalType: "bytes32"
2342
- },
2343
- {
2344
- name: "forUser",
2345
- type: "string",
2346
- internalType: "string"
2347
- },
2348
- {
2349
- name: "nbf",
2350
- type: "uint256",
2351
- internalType: "uint256"
2352
- },
2353
- {
2354
- name: "exp",
2355
- type: "uint256",
2356
- internalType: "uint256"
2357
- },
2358
- {
2359
- name: "metadata",
2360
- type: "string",
2361
- internalType: "string"
2362
- },
2363
- {
2364
- name: "transfers",
2365
- type: "tuple[]",
2366
- internalType: "struct ISpicenetEscrow.TokenTransfer[]",
2367
- components: [
2368
- {
2369
- name: "token",
2370
- type: "address",
2371
- internalType: "address"
2372
- },
2373
- {
2374
- name: "to",
2375
- type: "address",
2376
- internalType: "address"
2377
- },
2378
- {
2379
- name: "amount",
2380
- type: "uint256",
2381
- internalType: "uint256"
2382
- }
2383
- ]
2384
- }
2385
- ]
2386
- }
2387
- ],
2388
- anonymous: false
2389
- },
2390
- {
2391
- type: "error",
2392
- name: "AccessControlBadConfirmation",
2393
- inputs: []
2394
- },
2395
- {
2396
- type: "error",
2397
- name: "AccessControlUnauthorizedAccount",
2398
- inputs: [
2399
- {
2400
- name: "account",
2401
- type: "address",
2402
- internalType: "address"
2403
- },
2404
- {
2405
- name: "neededRole",
2406
- type: "bytes32",
2407
- internalType: "bytes32"
2408
- }
2409
- ]
2410
- },
2411
- {
2412
- type: "error",
2413
- name: "AddressEmptyCode",
2414
- inputs: [
2415
- {
2416
- name: "target",
2417
- type: "address",
2418
- internalType: "address"
2419
- }
2420
- ]
2421
- },
2422
- {
2423
- type: "error",
2424
- name: "ERC1967InvalidImplementation",
2425
- inputs: [
2426
- {
2427
- name: "implementation",
2428
- type: "address",
2429
- internalType: "address"
2430
- }
2431
- ]
2432
- },
2433
- {
2434
- type: "error",
2435
- name: "ERC1967NonPayable",
2436
- inputs: []
2437
- },
2438
- {
2439
- type: "error",
2440
- name: "EnforcedPause",
2441
- inputs: []
2442
- },
2443
- {
2444
- type: "error",
2445
- name: "ExpectedPause",
2446
- inputs: []
2447
- },
2448
- {
2449
- type: "error",
2450
- name: "FailedCall",
2451
- inputs: []
2452
- },
2453
- {
2454
- type: "error",
2455
- name: "InsufficientBalance",
2456
- inputs: [
2457
- {
2458
- name: "balance",
2459
- type: "uint256",
2460
- internalType: "uint256"
2461
- },
2462
- {
2463
- name: "needed",
2464
- type: "uint256",
2465
- internalType: "uint256"
2466
- }
2467
- ]
2468
- },
2469
- {
2470
- type: "error",
2471
- name: "InvalidInitialization",
2472
- inputs: []
2473
- },
2474
- {
2475
- type: "error",
2476
- name: "NotInitializing",
2477
- inputs: []
2478
- },
2479
- {
2480
- type: "error",
2481
- name: "SafeERC20FailedOperation",
2482
- inputs: [
2483
- {
2484
- name: "token",
2485
- type: "address",
2486
- internalType: "address"
2487
- }
2488
- ]
2489
- },
2490
- {
2491
- type: "error",
2492
- name: "UUPSUnauthorizedCallContext",
2493
- inputs: []
2494
- },
2495
- {
2496
- type: "error",
2497
- name: "UUPSUnsupportedProxiableUUID",
2498
- inputs: [
2499
- {
2500
- name: "slot",
2501
- type: "bytes32",
2502
- internalType: "bytes32"
2503
- }
2504
- ]
2505
- },
2506
- {
2507
- type: "error",
2508
- name: "WithdrawalAlreadyProcessed",
2509
- inputs: [
2510
- {
2511
- name: "idempotenceKey",
2512
- type: "bytes32",
2513
- internalType: "bytes32"
2514
- },
2515
- {
2516
- name: "withdrawalInfo",
2517
- type: "tuple",
2518
- internalType: "struct ISpicenetEscrow.WithdrawalInfo",
2519
- components: [
2520
- {
2521
- name: "forUser",
2522
- type: "string",
2523
- internalType: "string"
2524
- },
2525
- {
2526
- name: "blockNumber",
2527
- type: "uint256",
2528
- internalType: "uint256"
2529
- },
2530
- {
2531
- name: "nbf",
2532
- type: "uint256",
2533
- internalType: "uint256"
2534
- },
2535
- {
2536
- name: "exp",
2537
- type: "uint256",
2538
- internalType: "uint256"
2539
- },
2540
- {
2541
- name: "metadata",
2542
- type: "string",
2543
- internalType: "string"
2544
- }
2545
- ]
2546
- }
2547
- ]
2548
- },
2549
- {
2550
- type: "error",
2551
- name: "WithdrawalRequestExpired",
2552
- inputs: [
2553
- {
2554
- name: "currentTime",
2555
- type: "uint256",
2556
- internalType: "uint256"
2557
- },
2558
- {
2559
- name: "exp",
2560
- type: "uint256",
2561
- internalType: "uint256"
2562
- }
2563
- ]
2564
- },
2565
- {
2566
- type: "error",
2567
- name: "WithdrawalRequestTooEarly",
2568
- inputs: [
2569
- {
2570
- name: "currentTime",
2571
- type: "uint256",
2572
- internalType: "uint256"
2573
- },
2574
- {
2575
- name: "nbf",
2576
- type: "uint256",
2577
- internalType: "uint256"
2578
- }
2579
- ]
2580
- }
2581
- ];
2582
-
2583
1413
  // src/swap.ts
2584
1414
  var import_viem3 = require("viem");
2585
1415
  function applySlippage(amount, slippage = 0.03) {
@@ -2633,6 +1463,7 @@ function buildUniV3SwapCalls(params) {
2633
1463
  ChainBatchHashAbi,
2634
1464
  DELEGATE_ABI,
2635
1465
  ERC20_ABI,
1466
+ ESCROW_ADDRESS,
2636
1467
  HttpError,
2637
1468
  IntentHashAbi,
2638
1469
  NATIVE_TOKEN_ADDRESS,
@@ -2658,8 +1489,6 @@ function buildUniV3SwapCalls(params) {
2658
1489
  getDeployment,
2659
1490
  getEquivalenceGroup,
2660
1491
  getEquivalentAddresses,
2661
- getEscrowContract,
2662
- getEscrowContractAddress,
2663
1492
  getIntentHash,
2664
1493
  getIntentStepStatus,
2665
1494
  getMainnetChains,
@@ -2681,9 +1510,6 @@ function buildUniV3SwapCalls(params) {
2681
1510
  requireTokenBySymbol,
2682
1511
  requireViemChain,
2683
1512
  resolveTokenRef,
2684
- spicenetAbi,
2685
- spicenetEscrowAbi,
2686
- spicenetWalletManagerAbi,
2687
1513
  submitTransaction,
2688
1514
  truncateAddress,
2689
1515
  uniV3QuoterV2Abi,