@across-protocol/contracts 5.0.28 → 5.1.0
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/evm/artifacts/AcrossConfigStore.sol/AcrossConfigStore.json +1 -1
- package/dist/evm/artifacts/AcrossEventEmitter.sol/AcrossEventEmitter.json +1 -1
- package/dist/evm/artifacts/AcrossMerkleDistributor.sol/AcrossMerkleDistributor.json +1 -1
- package/dist/evm/artifacts/AcrossMessageHandlerMock.sol/AcrossMessageHandlerMock.json +1 -1
- package/dist/evm/artifacts/AdapterStore.sol/AdapterStore.json +1 -1
- package/dist/evm/artifacts/AdapterStore.sol/MessengerTypes.json +1 -1
- package/dist/evm/artifacts/Address.sol/Address.json +1 -1
- package/dist/evm/artifacts/AddressConverters.sol/Bytes32ToAddress.json +1 -1
- package/dist/evm/artifacts/AdminRelayTokensAdapter.sol/AdminRelayTokensAdapter.json +1 -1
- package/dist/evm/artifacts/AdminWithdrawManager.sol/AdminWithdrawManager.json +1 -1
- package/dist/evm/artifacts/ArbitrumMocks.sol/ArbitrumMockErc20GatewayRouter.json +1 -1
- package/dist/evm/artifacts/ArbitrumMocks.sol/Inbox.json +1 -1
- package/dist/evm/artifacts/ArbitrumMocks.sol/L2GatewayRouter.json +1 -1
- package/dist/evm/artifacts/Arbitrum_Adapter.sol/Arbitrum_Adapter.json +1 -1
- package/dist/evm/artifacts/Arbitrum_CustomGasToken_Adapter.sol/Arbitrum_CustomGasToken_Adapter.json +1 -1
- package/dist/evm/artifacts/Arbitrum_Forwarder.sol/Arbitrum_Forwarder.json +1 -1
- package/dist/evm/artifacts/Arbitrum_RescueAdapter.sol/Arbitrum_RescueAdapter.json +1 -1
- package/dist/evm/artifacts/Arbitrum_SendTokensAdapter.sol/Arbitrum_SendTokensAdapter.json +1 -1
- package/dist/evm/artifacts/Arbitrum_SpokePool.sol/Arbitrum_SpokePool.json +1 -1
- package/dist/evm/artifacts/Arbitrum_WithdrawalHelper.sol/Arbitrum_WithdrawalHelper.json +1 -1
- package/dist/evm/artifacts/Base_Adapter.sol/Base_Adapter.json +1 -1
- package/dist/evm/artifacts/BeaconProxy.sol/BeaconProxy.json +1 -1
- package/dist/evm/artifacts/BondToken.sol/BondToken.json +1 -1
- package/dist/evm/artifacts/BytesLib.sol/BytesLib.json +1 -1
- package/dist/evm/artifacts/Cher_SpokePool.sol/Cher_SpokePool.json +1 -1
- package/dist/evm/artifacts/CircleCCTPAdapter.sol/CircleDomainIds.json +1 -1
- package/dist/evm/artifacts/Constants.sol/Constants.json +1 -1
- package/dist/evm/artifacts/Constants.sol/OptimisticOracleConstraints.json +1 -1
- package/dist/evm/artifacts/Constants.sol/OracleInterfaces.json +1 -1
- package/dist/evm/artifacts/CoreExecution.sol/CoreExecution.json +1 -1
- package/dist/evm/artifacts/CoreSimulatorLib.sol/HypeSystemContract.json +1 -1
- package/dist/evm/artifacts/CoreState.sol/CoreState.json +1 -1
- package/dist/evm/artifacts/CoreView.sol/CoreView.json +1 -1
- package/dist/evm/artifacts/CoreWriterLib.sol/CoreWriterLib.json +1 -1
- package/dist/evm/artifacts/CoreWriterSim.sol/CoreWriterSim.json +1 -1
- package/dist/evm/artifacts/CounterfactualBeacon.sol/CounterfactualBeacon.json +1 -1
- package/dist/evm/artifacts/CounterfactualBeaconBootstrap.sol/CounterfactualBeaconBootstrap.json +1 -1
- package/dist/evm/artifacts/CounterfactualDeposit.sol/CounterfactualDeposit.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositCCTP.sol/CounterfactualDepositCCTP.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositFactory.sol/CounterfactualDepositFactory.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositFactoryTron.sol/CounterfactualDepositFactoryTron.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositOFT.sol/CounterfactualDepositOFT.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositSpokePool.sol/CounterfactualDepositSpokePool.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositSpokePoolTr.sol/CounterfactualDepositSpokePoolTr.json +1 -1
- package/dist/evm/artifacts/CounterfactualDepositVanillaCCTP.sol/CounterfactualDepositVanillaCCTP.json +1 -1
- package/dist/evm/artifacts/Create2.sol/Create2.json +1 -1
- package/dist/evm/artifacts/CrossDomainEnabled.sol/CrossDomainEnabled.json +1 -1
- package/dist/evm/artifacts/DeployedAddresses.sol/DeployedAddresses.json +1 -1
- package/dist/evm/artifacts/DeploymentUtils.sol/DeploymentUtils.json +1 -1
- package/dist/evm/artifacts/DoctorWho_Adapter.sol/DoctorWho_Adapter.json +1 -1
- package/dist/evm/artifacts/DonationBox.sol/DonationBox.json +1 -1
- package/dist/evm/artifacts/DstOFTHandler.sol/DstOFTHandler.json +1 -1
- package/dist/evm/artifacts/ECDSA.sol/ECDSA.json +1 -1
- package/dist/evm/artifacts/ERC1155.sol/ERC1155.json +1 -1
- package/dist/evm/artifacts/ERC1967Proxy.sol/ERC1967Proxy.json +1 -1
- package/dist/evm/artifacts/ERC1967Utils.sol/ERC1967Utils.json +1 -1
- package/dist/evm/artifacts/ERC20.sol/ERC20.json +1 -1
- package/dist/evm/artifacts/Errors.sol/Errors.json +1 -1
- package/dist/evm/artifacts/Ethereum_Adapter.sol/Ethereum_Adapter.json +1 -1
- package/dist/evm/artifacts/Ethereum_RescueAdapter.sol/Ethereum_RescueAdapter.json +1 -1
- package/dist/evm/artifacts/Ethereum_SpokePool.sol/Ethereum_SpokePool.json +1 -1
- package/dist/evm/artifacts/ExpandedERC20.sol/ExpandedERC20.json +1 -1
- package/dist/evm/artifacts/ExpandedERC20WithBlacklist.sol/ExpandedERC20WithBlacklist.json +1 -1
- package/dist/evm/artifacts/HLConstants.sol/HLConstants.json +1 -1
- package/dist/evm/artifacts/HLConversions.sol/HLConversions.json +1 -1
- package/dist/evm/artifacts/HubPool.sol/HubPool.json +1 -1
- package/dist/evm/artifacts/HubPoolStore.sol/HubPoolStore.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockAddressWhitelist.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockFinder.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockIdentifierWhitelist.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockLpTokenFactory.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockOptimisticOracle.json +1 -1
- package/dist/evm/artifacts/HubPoolTestBase.sol/MockStore.json +1 -1
- package/dist/evm/artifacts/HyperCore.sol/HyperCore.json +1 -1
- package/dist/evm/artifacts/HyperCoreFlowExecutor.sol/HyperCoreFlowExecutor.json +1 -1
- package/dist/evm/artifacts/HyperCoreLib.sol/HyperCoreLib.json +1 -1
- package/dist/evm/artifacts/HyperliquidDepositHandler.sol/HyperliquidDepositHandler.json +1 -1
- package/dist/evm/artifacts/Lens_SpokePool.sol/Lens_SpokePool.json +1 -1
- package/dist/evm/artifacts/LibVariable.sol/LibVariable.json +1 -1
- package/dist/evm/artifacts/LineaMocks.sol/MockL2MessageService.json +1 -1
- package/dist/evm/artifacts/LineaMocks.sol/MockL2TokenBridge.json +1 -1
- package/dist/evm/artifacts/Linea_Adapter.sol/Linea_Adapter.json +1 -1
- package/dist/evm/artifacts/Linea_SpokePool.sol/Linea_SpokePool.json +1 -1
- package/dist/evm/artifacts/Lisk_Adapter.sol/Lisk_Adapter.json +1 -1
- package/dist/evm/artifacts/Lisk_SpokePool.sol/Lisk_SpokePool.json +1 -1
- package/dist/evm/artifacts/Lockable.sol/Lockable.json +1 -1
- package/dist/evm/artifacts/LpTokenFactory.sol/LpTokenFactory.json +1 -1
- package/dist/evm/artifacts/Merkle.sol/Merkle.json +1 -1
- package/dist/evm/artifacts/MerkleDistributor.sol/MerkleDistributor.json +1 -1
- package/dist/evm/artifacts/MerkleLibTest.sol/MerkleLibTest.json +1 -1
- package/dist/evm/artifacts/MerkleProof.sol/MerkleProof.json +1 -1
- package/dist/evm/artifacts/MinimalLZOptions.sol/MinimalLZOptions.json +1 -1
- package/dist/evm/artifacts/MintableERC1155.sol/MintableERC1155.json +1 -1
- package/dist/evm/artifacts/MockBedrockStandardBridge.sol/MockBedrockCrossDomainMessenger.json +1 -1
- package/dist/evm/artifacts/MockBedrockStandardBridge.sol/MockBedrockL1StandardBridge.json +1 -1
- package/dist/evm/artifacts/MockBedrockStandardBridge.sol/MockBedrockL2StandardBridge.json +1 -1
- package/dist/evm/artifacts/MockCCTP.sol/MockCCTPMessageTransmitter.json +1 -1
- package/dist/evm/artifacts/MockCCTP.sol/MockCCTPMessageTransmitterV2.json +1 -1
- package/dist/evm/artifacts/MockCCTP.sol/MockCCTPMessenger.json +1 -1
- package/dist/evm/artifacts/MockCCTP.sol/MockCCTPMessengerV2.json +1 -1
- package/dist/evm/artifacts/MockCCTP.sol/MockCCTPMinter.json +1 -1
- package/dist/evm/artifacts/MockCaller.sol/MockCaller.json +1 -1
- package/dist/evm/artifacts/MockERC1271.sol/MockERC1271.json +1 -1
- package/dist/evm/artifacts/MockERC20.sol/MintableERC20.json +1 -1
- package/dist/evm/artifacts/MockERC20.sol/MockERC20.json +1 -1
- package/dist/evm/artifacts/MockEndpoint.sol/MockEndpoint.json +1 -1
- package/dist/evm/artifacts/MockGateway.sol/MockGateway.json +1 -1
- package/dist/evm/artifacts/MockHubPool.sol/MockHubPool.json +1 -1
- package/dist/evm/artifacts/MockOFTMessenger.sol/MockOFTMessenger.json +1 -1
- package/dist/evm/artifacts/MockPermit2.sol/MockPermit2.json +1 -1
- package/dist/evm/artifacts/MockPermit2.sol/Permit2EIP712.json +1 -1
- package/dist/evm/artifacts/MockPermit2.sol/SignatureVerification.json +1 -1
- package/dist/evm/artifacts/MockSpokePool.sol/MockSpokePool.json +1 -1
- package/dist/evm/artifacts/MockSpokePoolV2.sol/MockSpokePoolV2.json +1 -1
- package/dist/evm/artifacts/MockTronUSDT.sol/MockTronUSDT.json +1 -1
- package/dist/evm/artifacts/MockZkStackBridgeHub.sol/MockBridgeHub.json +1 -1
- package/dist/evm/artifacts/Mock_Adapter.sol/Mock_Adapter.json +1 -1
- package/dist/evm/artifacts/Mock_Adapter.sol/Mock_Bridge.json +1 -1
- package/dist/evm/artifacts/Mode_Adapter.sol/Mode_Adapter.json +1 -1
- package/dist/evm/artifacts/MultiCaller.sol/MultiCaller.json +1 -1
- package/dist/evm/artifacts/MultiCallerUpgradeable.sol/MultiCallerUpgradeable.json +1 -1
- package/dist/evm/artifacts/Multicall3.sol/Multicall3.json +1 -1
- package/dist/evm/artifacts/MulticallHandler.sol/MulticallHandler.json +1 -1
- package/dist/evm/artifacts/OFTTransportAdapter.sol/OFTTransportAdapter.json +1 -1
- package/dist/evm/artifacts/OFTTransportAdapterWithStore.sol/OFTTransportAdapterWithStore.json +1 -1
- package/dist/evm/artifacts/OP_Adapter.sol/OP_Adapter.json +1 -1
- package/dist/evm/artifacts/OP_SpokePool.sol/OP_SpokePool.json +1 -1
- package/dist/evm/artifacts/Ovm_Forwarder.sol/Ovm_Forwarder.json +1 -1
- package/dist/evm/artifacts/Ovm_SpokePool.sol/Ovm_SpokePool.json +1 -1
- package/dist/evm/artifacts/Ovm_WithdrawalHelper.sol/Ovm_WithdrawalHelper.json +1 -1
- package/dist/evm/artifacts/PeripherySigningLib.sol/PeripherySigningLib.json +1 -1
- package/dist/evm/artifacts/PermissionedMulticallHandler.sol/PermissionedMulticallHandler.json +1 -1
- package/dist/evm/artifacts/PolygonERC20Test.sol/PolygonERC20Test.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/DepositManagerMock.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/FxStateSenderMock.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/PolygonERC20Mock.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/PolygonERC20PredicateMock.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/PolygonRegistryMock.json +1 -1
- package/dist/evm/artifacts/PolygonMocks.sol/RootChainManagerMock.json +1 -1
- package/dist/evm/artifacts/PolygonTokenBridger.sol/PolygonTokenBridger.json +1 -1
- package/dist/evm/artifacts/Polygon_Adapter.sol/Polygon_Adapter.json +1 -1
- package/dist/evm/artifacts/Polygon_SpokePool.sol/Polygon_SpokePool.json +1 -1
- package/dist/evm/artifacts/PrecompileLib.sol/PrecompileLib.json +1 -1
- package/dist/evm/artifacts/PrecompileSim.sol/PrecompileSim.json +1 -1
- package/dist/evm/artifacts/ProxyAdmin.sol/ProxyAdmin.json +1 -1
- package/dist/evm/artifacts/Router_Adapter.sol/Router_Adapter.json +1 -1
- package/dist/evm/artifacts/SP1AutoVerifier.sol/SP1AutoVerifier.json +1 -1
- package/dist/evm/artifacts/SP1Helios.sol/SP1Helios.json +1 -1
- package/dist/evm/artifacts/SP1MockVerifier.sol/SP1MockVerifier.json +1 -1
- package/dist/evm/artifacts/SafeCast.sol/SafeCast.json +1 -1
- package/dist/evm/artifacts/SafeERC20.sol/SafeERC20.json +1 -1
- package/dist/evm/artifacts/ShortStrings.sol/ShortStrings.json +1 -1
- package/dist/evm/artifacts/Solana_Adapter.sol/Solana_Adapter.json +1 -1
- package/dist/evm/artifacts/SpokePoolPeriphery.sol/SpokePoolPeriphery.json +1 -1
- package/dist/evm/artifacts/SpokePoolPeriphery.sol/SwapProxy.json +1 -1
- package/dist/evm/artifacts/SpokePoolVerifier.sol/SpokePoolVerifier.json +1 -1
- package/dist/evm/artifacts/SponsoredCCTPDstPeriphery.sol/SponsoredCCTPDstPeriphery.json +1 -1
- package/dist/evm/artifacts/SponsoredCCTPSrcPeriphery.sol/SponsoredCCTPSrcPeriphery.json +1 -1
- package/dist/evm/artifacts/SponsoredOFTSrcPeriphery.sol/SponsoredOFTSrcPeriphery.json +1 -1
- package/dist/evm/artifacts/StdConfig.sol/StdConfig.json +1 -1
- package/dist/evm/artifacts/Strings.sol/Strings.json +1 -1
- package/dist/evm/artifacts/SwapHandler.sol/SwapHandler.json +1 -1
- package/dist/evm/artifacts/Timer.sol/Timer.json +1 -1
- package/dist/evm/artifacts/TransferProxy.sol/TransferProxy.json +1 -1
- package/dist/evm/artifacts/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +1 -1
- package/dist/evm/artifacts/TronMulticallHandler.sol/TronMulticallHandler.json +1 -1
- package/dist/evm/artifacts/TronTransferLib.sol/TronTransferLib.json +1 -1
- package/dist/evm/artifacts/Tron_SpokePool.sol/Tron_SpokePool.json +1 -1
- package/dist/evm/artifacts/Tron_SpokePoolPeriphery.sol/Tron_SpokePoolPeriphery.json +1 -1
- package/dist/evm/artifacts/Tron_SpokePoolPeriphery.sol/Tron_SwapProxy.json +1 -1
- package/dist/evm/artifacts/Universal_Adapter.sol/Universal_Adapter.json +1 -1
- package/dist/evm/artifacts/Universal_SpokePool.sol/Universal_SpokePool.json +1 -1
- package/dist/evm/artifacts/UpgradeableBeacon.sol/UpgradeableBeacon.json +1 -1
- package/dist/evm/artifacts/WETH9.sol/WETH9.json +1 -1
- package/dist/evm/artifacts/WithdrawImplementation.sol/WithdrawImplementation.json +1 -1
- package/dist/evm/artifacts/WithdrawImplementationTron.sol/WithdrawImplementationTron.json +1 -1
- package/dist/evm/artifacts/ZkStack_Adapter.sol/ZkStack_Adapter.json +1 -1
- package/dist/evm/artifacts/ZkStack_CustomGasToken_Adapter.sol/ZkStack_CustomGasToken_Adapter.json +1 -1
- package/dist/evm/artifacts/ZkSyncMocks.sol/MockL2Eth.json +1 -1
- package/dist/evm/artifacts/ZkSyncMocks.sol/MockZkBridge.json +1 -1
- package/dist/evm/artifacts/ZkSync_SpokePool.sol/ZkSync_SpokePool.json +1 -1
- package/dist/evm/artifacts/Zora_Adapter.sol/Zora_Adapter.json +1 -1
- package/dist/evm/artifacts/eraVM_EIP7702.sol/SimpleContract.json +1 -1
- package/dist/evm/artifacts/eraVM_EIP7702.sol/SpokePoolEIP7702Test.json +1 -1
- package/dist/evm/artifacts/eraVM_EIP7702.sol/TestableMockSpokePool.json +1 -1
- package/dist/src/DeploymentUtils.d.ts +1 -1
- package/dist/src/svm/assets/idl/sponsored_cctp_src_periphery.json +6 -46
- package/dist/src/svm/assets/sponsored_cctp_src_periphery.d.ts +6 -46
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/errors/sponsoredCctpSrcPeriphery.d.ts +7 -23
- package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/errors/sponsoredCctpSrcPeriphery.js +10 -34
- package/dist/src/svm/web3-v1/cctpHelpers.d.ts +1 -1
- package/dist/src/svm/web3-v1/cctpHelpers.js +2 -0
- package/dist/src/svm/web3-v1/cctpV2Helpers.d.ts +6 -6
- package/dist/src/svm/web3-v1/cctpV2Helpers.js +4 -6
- package/dist/src/svm/web3-v1/constants.d.ts +1 -1
- package/dist/src/svm/web3-v1/constants.js +2 -5
- package/dist/src/svm/web3-v1/conversionUtils.d.ts +7 -4
- package/dist/src/svm/web3-v1/conversionUtils.js +37 -16
- package/dist/src/svm/web3-v1/helpers.d.ts +1 -2
- package/dist/src/svm/web3-v1/helpers.js +4 -6
- package/dist/src/svm/web3-v1/relayHashUtils.d.ts +5 -4
- package/dist/src/svm/web3-v1/relayHashUtils.js +38 -25
- package/dist/src/svm/web3-v1/solanaProgramUtils.js +2 -3
- package/dist/src/svm/web3-v1/transactionUtils.js +2 -2
- package/dist/src/svm/web3-v2/solanaProgramUtils.js +3 -3
- package/dist/src/types/svm.d.ts +6 -7
- package/dist/utils/MerkleTree.js +3 -4
- package/package.json +46 -37
- package/dist/src/consts.d.ts +0 -51
- package/dist/src/consts.js +0 -342
- package/dist/utils/utils.d.ts +0 -28
- package/dist/utils/utils.js +0 -136
|
@@ -29,6 +29,6 @@ export declare function getDeployedBlockNumber(contractName: string, networkId:
|
|
|
29
29
|
* Returns the chainId and contract name for a given contract address.
|
|
30
30
|
*/
|
|
31
31
|
export declare function getContractInfoFromAddress(contractAddress: string): {
|
|
32
|
-
chainId:
|
|
32
|
+
chainId: number;
|
|
33
33
|
contractName: string;
|
|
34
34
|
};
|
|
@@ -1395,58 +1395,18 @@
|
|
|
1395
1395
|
"errors": [
|
|
1396
1396
|
{
|
|
1397
1397
|
"code": 6000,
|
|
1398
|
-
"name": "
|
|
1399
|
-
"msg": "
|
|
1398
|
+
"name": "InvalidSignature",
|
|
1399
|
+
"msg": "Invalid quote signature"
|
|
1400
1400
|
},
|
|
1401
1401
|
{
|
|
1402
1402
|
"code": 6001,
|
|
1403
|
-
"name": "
|
|
1404
|
-
"msg": "Invalid
|
|
1403
|
+
"name": "InvalidDeadline",
|
|
1404
|
+
"msg": "Invalid quote deadline"
|
|
1405
1405
|
},
|
|
1406
1406
|
{
|
|
1407
1407
|
"code": 6002,
|
|
1408
|
-
"name": "
|
|
1409
|
-
"msg": "
|
|
1410
|
-
},
|
|
1411
|
-
{
|
|
1412
|
-
"code": 6003,
|
|
1413
|
-
"name": "InvalidBurnToken",
|
|
1414
|
-
"msg": "Invalid burn_token key"
|
|
1415
|
-
},
|
|
1416
|
-
{
|
|
1417
|
-
"code": 6004,
|
|
1418
|
-
"name": "AmountNotPositive",
|
|
1419
|
-
"msg": "Amount must be greater than 0"
|
|
1420
|
-
},
|
|
1421
|
-
{
|
|
1422
|
-
"code": 6005,
|
|
1423
|
-
"name": "QuoteDeadlineNotPassed",
|
|
1424
|
-
"msg": "The quote deadline has not passed!"
|
|
1425
|
-
},
|
|
1426
|
-
{
|
|
1427
|
-
"code": 6006,
|
|
1428
|
-
"name": "SignerUnchanged",
|
|
1429
|
-
"msg": "New signer unchanged"
|
|
1430
|
-
},
|
|
1431
|
-
{
|
|
1432
|
-
"code": 6007,
|
|
1433
|
-
"name": "DepositAmountBelowMinimum",
|
|
1434
|
-
"msg": "Deposit amount below minimum"
|
|
1435
|
-
},
|
|
1436
|
-
{
|
|
1437
|
-
"code": 6008,
|
|
1438
|
-
"name": "MissingRentClaimAccount",
|
|
1439
|
-
"msg": "Missing rent claim account"
|
|
1440
|
-
},
|
|
1441
|
-
{
|
|
1442
|
-
"code": 6009,
|
|
1443
|
-
"name": "RentClaimOverflow",
|
|
1444
|
-
"msg": "Rent claim amount overflow"
|
|
1445
|
-
},
|
|
1446
|
-
{
|
|
1447
|
-
"code": 6010,
|
|
1448
|
-
"name": "InvalidRecipientKey",
|
|
1449
|
-
"msg": "Invalid recipient key"
|
|
1408
|
+
"name": "InvalidSourceDomain",
|
|
1409
|
+
"msg": "Invalid source domain"
|
|
1450
1410
|
}
|
|
1451
1411
|
],
|
|
1452
1412
|
"types": [
|
|
@@ -1401,58 +1401,18 @@ export type SponsoredCctpSrcPeriphery = {
|
|
|
1401
1401
|
"errors": [
|
|
1402
1402
|
{
|
|
1403
1403
|
"code": 6000;
|
|
1404
|
-
"name": "
|
|
1405
|
-
"msg": "
|
|
1404
|
+
"name": "invalidSignature";
|
|
1405
|
+
"msg": "Invalid quote signature";
|
|
1406
1406
|
},
|
|
1407
1407
|
{
|
|
1408
1408
|
"code": 6001;
|
|
1409
|
-
"name": "
|
|
1410
|
-
"msg": "Invalid
|
|
1409
|
+
"name": "invalidDeadline";
|
|
1410
|
+
"msg": "Invalid quote deadline";
|
|
1411
1411
|
},
|
|
1412
1412
|
{
|
|
1413
1413
|
"code": 6002;
|
|
1414
|
-
"name": "
|
|
1415
|
-
"msg": "
|
|
1416
|
-
},
|
|
1417
|
-
{
|
|
1418
|
-
"code": 6003;
|
|
1419
|
-
"name": "invalidBurnToken";
|
|
1420
|
-
"msg": "Invalid burn_token key";
|
|
1421
|
-
},
|
|
1422
|
-
{
|
|
1423
|
-
"code": 6004;
|
|
1424
|
-
"name": "amountNotPositive";
|
|
1425
|
-
"msg": "Amount must be greater than 0";
|
|
1426
|
-
},
|
|
1427
|
-
{
|
|
1428
|
-
"code": 6005;
|
|
1429
|
-
"name": "quoteDeadlineNotPassed";
|
|
1430
|
-
"msg": "The quote deadline has not passed!";
|
|
1431
|
-
},
|
|
1432
|
-
{
|
|
1433
|
-
"code": 6006;
|
|
1434
|
-
"name": "signerUnchanged";
|
|
1435
|
-
"msg": "New signer unchanged";
|
|
1436
|
-
},
|
|
1437
|
-
{
|
|
1438
|
-
"code": 6007;
|
|
1439
|
-
"name": "depositAmountBelowMinimum";
|
|
1440
|
-
"msg": "Deposit amount below minimum";
|
|
1441
|
-
},
|
|
1442
|
-
{
|
|
1443
|
-
"code": 6008;
|
|
1444
|
-
"name": "missingRentClaimAccount";
|
|
1445
|
-
"msg": "Missing rent claim account";
|
|
1446
|
-
},
|
|
1447
|
-
{
|
|
1448
|
-
"code": 6009;
|
|
1449
|
-
"name": "rentClaimOverflow";
|
|
1450
|
-
"msg": "Rent claim amount overflow";
|
|
1451
|
-
},
|
|
1452
|
-
{
|
|
1453
|
-
"code": 6010;
|
|
1454
|
-
"name": "invalidRecipientKey";
|
|
1455
|
-
"msg": "Invalid recipient key";
|
|
1414
|
+
"name": "invalidSourceDomain";
|
|
1415
|
+
"msg": "Invalid source domain";
|
|
1456
1416
|
}
|
|
1457
1417
|
];
|
|
1458
1418
|
"types": [
|
package/dist/src/svm/clients/SponsoredCctpSrcPeriphery/errors/sponsoredCctpSrcPeriphery.d.ts
CHANGED
|
@@ -6,29 +6,13 @@
|
|
|
6
6
|
* @see https://github.com/codama-idl/codama
|
|
7
7
|
*/
|
|
8
8
|
import { type Address, type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from '@solana/kit';
|
|
9
|
-
/**
|
|
10
|
-
export declare const
|
|
11
|
-
/**
|
|
12
|
-
export declare const
|
|
13
|
-
/**
|
|
14
|
-
export declare const
|
|
15
|
-
|
|
16
|
-
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_BURN_TOKEN = 6003;
|
|
17
|
-
/** AmountNotPositive: Amount must be greater than 0 */
|
|
18
|
-
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__AMOUNT_NOT_POSITIVE = 6004;
|
|
19
|
-
/** QuoteDeadlineNotPassed: The quote deadline has not passed! */
|
|
20
|
-
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__QUOTE_DEADLINE_NOT_PASSED = 6005;
|
|
21
|
-
/** SignerUnchanged: New signer unchanged */
|
|
22
|
-
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__SIGNER_UNCHANGED = 6006;
|
|
23
|
-
/** DepositAmountBelowMinimum: Deposit amount below minimum */
|
|
24
|
-
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__DEPOSIT_AMOUNT_BELOW_MINIMUM = 6007;
|
|
25
|
-
/** MissingRentClaimAccount: Missing rent claim account */
|
|
26
|
-
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__MISSING_RENT_CLAIM_ACCOUNT = 6008;
|
|
27
|
-
/** RentClaimOverflow: Rent claim amount overflow */
|
|
28
|
-
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__RENT_CLAIM_OVERFLOW = 6009;
|
|
29
|
-
/** InvalidRecipientKey: Invalid recipient key */
|
|
30
|
-
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_RECIPIENT_KEY = 6010;
|
|
31
|
-
export type SponsoredCctpSrcPeripheryError = typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__AMOUNT_NOT_POSITIVE | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__CANNOT_SET_CURRENT_TIME | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__DEPOSIT_AMOUNT_BELOW_MINIMUM | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_BURN_TOKEN | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_PROGRAM_DATA | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_RECIPIENT_KEY | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__MISSING_RENT_CLAIM_ACCOUNT | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__NOT_UPGRADE_AUTHORITY | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__QUOTE_DEADLINE_NOT_PASSED | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__RENT_CLAIM_OVERFLOW | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__SIGNER_UNCHANGED;
|
|
9
|
+
/** InvalidSignature: Invalid quote signature */
|
|
10
|
+
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_SIGNATURE = 6000;
|
|
11
|
+
/** InvalidDeadline: Invalid quote deadline */
|
|
12
|
+
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_DEADLINE = 6001;
|
|
13
|
+
/** InvalidSourceDomain: Invalid source domain */
|
|
14
|
+
export declare const SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_SOURCE_DOMAIN = 6002;
|
|
15
|
+
export type SponsoredCctpSrcPeripheryError = typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_DEADLINE | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_SIGNATURE | typeof SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_SOURCE_DOMAIN;
|
|
32
16
|
export declare function getSponsoredCctpSrcPeripheryErrorMessage(code: SponsoredCctpSrcPeripheryError): string;
|
|
33
17
|
export declare function isSponsoredCctpSrcPeripheryError<TProgramErrorCode extends SponsoredCctpSrcPeripheryError>(error: unknown, transactionMessage: {
|
|
34
18
|
instructions: Record<number, {
|
|
@@ -7,47 +7,23 @@
|
|
|
7
7
|
* @see https://github.com/codama-idl/codama
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_SOURCE_DOMAIN = exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_DEADLINE = exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_SIGNATURE = void 0;
|
|
11
11
|
exports.getSponsoredCctpSrcPeripheryErrorMessage = getSponsoredCctpSrcPeripheryErrorMessage;
|
|
12
12
|
exports.isSponsoredCctpSrcPeripheryError = isSponsoredCctpSrcPeripheryError;
|
|
13
13
|
const kit_1 = require("@solana/kit");
|
|
14
14
|
const programs_1 = require("../programs");
|
|
15
|
-
/**
|
|
16
|
-
exports.
|
|
17
|
-
/**
|
|
18
|
-
exports.
|
|
19
|
-
/**
|
|
20
|
-
exports.
|
|
21
|
-
/** InvalidBurnToken: Invalid burn_token key */
|
|
22
|
-
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_BURN_TOKEN = 0x1773; // 6003
|
|
23
|
-
/** AmountNotPositive: Amount must be greater than 0 */
|
|
24
|
-
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__AMOUNT_NOT_POSITIVE = 0x1774; // 6004
|
|
25
|
-
/** QuoteDeadlineNotPassed: The quote deadline has not passed! */
|
|
26
|
-
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__QUOTE_DEADLINE_NOT_PASSED = 0x1775; // 6005
|
|
27
|
-
/** SignerUnchanged: New signer unchanged */
|
|
28
|
-
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__SIGNER_UNCHANGED = 0x1776; // 6006
|
|
29
|
-
/** DepositAmountBelowMinimum: Deposit amount below minimum */
|
|
30
|
-
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__DEPOSIT_AMOUNT_BELOW_MINIMUM = 0x1777; // 6007
|
|
31
|
-
/** MissingRentClaimAccount: Missing rent claim account */
|
|
32
|
-
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__MISSING_RENT_CLAIM_ACCOUNT = 0x1778; // 6008
|
|
33
|
-
/** RentClaimOverflow: Rent claim amount overflow */
|
|
34
|
-
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__RENT_CLAIM_OVERFLOW = 0x1779; // 6009
|
|
35
|
-
/** InvalidRecipientKey: Invalid recipient key */
|
|
36
|
-
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_RECIPIENT_KEY = 0x177a; // 6010
|
|
15
|
+
/** InvalidSignature: Invalid quote signature */
|
|
16
|
+
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_SIGNATURE = 0x1770; // 6000
|
|
17
|
+
/** InvalidDeadline: Invalid quote deadline */
|
|
18
|
+
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_DEADLINE = 0x1771; // 6001
|
|
19
|
+
/** InvalidSourceDomain: Invalid source domain */
|
|
20
|
+
exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_SOURCE_DOMAIN = 0x1772; // 6002
|
|
37
21
|
let sponsoredCctpSrcPeripheryErrorMessages;
|
|
38
22
|
if (process.env.NODE_ENV !== 'production') {
|
|
39
23
|
sponsoredCctpSrcPeripheryErrorMessages = {
|
|
40
|
-
[exports.
|
|
41
|
-
[exports.
|
|
42
|
-
[exports.
|
|
43
|
-
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_BURN_TOKEN]: `Invalid burn_token key`,
|
|
44
|
-
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_PROGRAM_DATA]: `Invalid program data account`,
|
|
45
|
-
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_RECIPIENT_KEY]: `Invalid recipient key`,
|
|
46
|
-
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__MISSING_RENT_CLAIM_ACCOUNT]: `Missing rent claim account`,
|
|
47
|
-
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__NOT_UPGRADE_AUTHORITY]: `Only the upgrade authority can call this instruction`,
|
|
48
|
-
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__QUOTE_DEADLINE_NOT_PASSED]: `The quote deadline has not passed!`,
|
|
49
|
-
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__RENT_CLAIM_OVERFLOW]: `Rent claim amount overflow`,
|
|
50
|
-
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__SIGNER_UNCHANGED]: `New signer unchanged`,
|
|
24
|
+
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_DEADLINE]: `Invalid quote deadline`,
|
|
25
|
+
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_SIGNATURE]: `Invalid quote signature`,
|
|
26
|
+
[exports.SPONSORED_CCTP_SRC_PERIPHERY_ERROR__INVALID_SOURCE_DOMAIN]: `Invalid source domain`,
|
|
51
27
|
};
|
|
52
28
|
}
|
|
53
29
|
function getSponsoredCctpSrcPeripheryErrorMessage(code) {
|
|
@@ -121,6 +121,7 @@ const AttestationResponseStruct = (0, superstruct_1.object)({
|
|
|
121
121
|
* Fetches attestation from attestation service given the txHash.
|
|
122
122
|
*/
|
|
123
123
|
const getMessages = async (txHash, srcDomain, irisApiUrl) => {
|
|
124
|
+
// eslint-disable-next-line no-console
|
|
124
125
|
console.log("Fetching attestations and messages for tx...", txHash);
|
|
125
126
|
let attestationResponse = {};
|
|
126
127
|
while (attestationResponse.error ||
|
|
@@ -140,6 +141,7 @@ const getMessages = async (txHash, srcDomain, irisApiUrl) => {
|
|
|
140
141
|
AttestationResponseStruct.assert(attestationResponse);
|
|
141
142
|
}
|
|
142
143
|
catch (error) {
|
|
144
|
+
// eslint-disable-next-line no-console
|
|
143
145
|
console.error("Invalid attestation response structure:", error);
|
|
144
146
|
throw new Error("Invalid attestation response structure");
|
|
145
147
|
}
|
|
@@ -8,11 +8,11 @@ export type TokenMessengerV2MessageBody = {
|
|
|
8
8
|
version: number;
|
|
9
9
|
burnToken: anchor.web3.PublicKey;
|
|
10
10
|
mintRecipient: anchor.web3.PublicKey;
|
|
11
|
-
amount:
|
|
11
|
+
amount: bigint;
|
|
12
12
|
messageSender: anchor.web3.PublicKey;
|
|
13
|
-
maxFee:
|
|
14
|
-
feeExecuted:
|
|
15
|
-
expirationBlock:
|
|
13
|
+
maxFee: bigint;
|
|
14
|
+
feeExecuted: bigint;
|
|
15
|
+
expirationBlock: bigint;
|
|
16
16
|
hookData: Buffer;
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
@@ -22,7 +22,7 @@ export type MessageHeaderV2 = {
|
|
|
22
22
|
version: number;
|
|
23
23
|
sourceDomain: number;
|
|
24
24
|
destinationDomain: number;
|
|
25
|
-
nonce:
|
|
25
|
+
nonce: bigint;
|
|
26
26
|
sender: anchor.web3.PublicKey;
|
|
27
27
|
recipient: anchor.web3.PublicKey;
|
|
28
28
|
destinationCaller: anchor.web3.PublicKey;
|
|
@@ -38,7 +38,7 @@ export declare const decodeMessageSentDataV2: (message: Buffer) => {
|
|
|
38
38
|
version: number;
|
|
39
39
|
sourceDomain: number;
|
|
40
40
|
destinationDomain: number;
|
|
41
|
-
nonce:
|
|
41
|
+
nonce: bigint;
|
|
42
42
|
sender: anchor.web3.PublicKey;
|
|
43
43
|
recipient: anchor.web3.PublicKey;
|
|
44
44
|
destinationCaller: anchor.web3.PublicKey;
|
|
@@ -27,8 +27,6 @@ exports.AttestationResponse = exports.AttestationMessage = exports.DecodedMessag
|
|
|
27
27
|
exports.getV2BurnAttestation = getV2BurnAttestation;
|
|
28
28
|
const anchor = __importStar(require("@coral-xyz/anchor"));
|
|
29
29
|
const superstruct_1 = require("superstruct");
|
|
30
|
-
const ethers_1 = require("ethers");
|
|
31
|
-
const superstruct_2 = require("superstruct");
|
|
32
30
|
const relayHashUtils_1 = require("./relayHashUtils");
|
|
33
31
|
const conversionUtils_1 = require("./conversionUtils");
|
|
34
32
|
// Index positions to decode Message Header from
|
|
@@ -161,7 +159,7 @@ async function getV2BurnAttestation(txSignature, sourceMessageData, irisApiUrl)
|
|
|
161
159
|
const attestationResponse = await (await fetch(`${irisApiUrl}/v2/messages/${sourceMessage.sourceDomain}/?transactionHash=${txSignature}`)).json();
|
|
162
160
|
if (attestationResponse.error)
|
|
163
161
|
return null;
|
|
164
|
-
(0,
|
|
162
|
+
(0, superstruct_1.assert)(attestationResponse, exports.AttestationResponse);
|
|
165
163
|
// Return the first attested message that matches the source message.
|
|
166
164
|
for (const message of attestationResponse.messages) {
|
|
167
165
|
if (message.message !== "0x" &&
|
|
@@ -169,8 +167,8 @@ async function getV2BurnAttestation(txSignature, sourceMessageData, irisApiUrl)
|
|
|
169
167
|
!!message.decodedMessage &&
|
|
170
168
|
isMatchingV2BurnMessage(sourceMessage, message.decodedMessage)) {
|
|
171
169
|
return {
|
|
172
|
-
destinationMessage: Buffer.from(
|
|
173
|
-
attestation: Buffer.from(
|
|
170
|
+
destinationMessage: Buffer.from((0, conversionUtils_1.hexToBytesStrict)(message.message)),
|
|
171
|
+
attestation: Buffer.from((0, conversionUtils_1.hexToBytesStrict)(message.attestation)),
|
|
174
172
|
};
|
|
175
173
|
}
|
|
176
174
|
}
|
|
@@ -199,5 +197,5 @@ function isMatchingV2BurnMessage(sourceMessage, destinationMessage) {
|
|
|
199
197
|
sourceMessage.messageBody.maxFee.toString() === destinationMessage.decodedMessageBody.maxFee &&
|
|
200
198
|
// feeExecuted is only set on destination
|
|
201
199
|
// expirationBlock is only set on destination
|
|
202
|
-
sourceMessage.messageBody.hookData.equals(Buffer.from(
|
|
200
|
+
sourceMessage.messageBody.hookData.equals(Buffer.from((0, conversionUtils_1.hexToBytesStrict)(destinationMessage.decodedMessageBody.hookData || "0x"))));
|
|
203
201
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import BN from "
|
|
1
|
+
import { BN } from "@coral-xyz/anchor";
|
|
2
2
|
export declare const CIRCLE_IRIS_API_URL_DEVNET = "https://iris-api-sandbox.circle.com";
|
|
3
3
|
export declare const CIRCLE_IRIS_API_URL_MAINNET = "https://iris-api.circle.com";
|
|
4
4
|
export declare const SOLANA_USDC_MAINNET = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.SOLANA_SPOKE_STATE_SEED = exports.MAINNET_CCTP_MESSAGE_TRANSMITTER_ADDRESS = exports.SEPOLIA_CCTP_MESSAGE_TRANSMITTER_ADDRESS = exports.SOLANA_USDC_DEVNET = exports.SOLANA_USDC_MAINNET = exports.CIRCLE_IRIS_API_URL_MAINNET = exports.CIRCLE_IRIS_API_URL_DEVNET = void 0;
|
|
7
|
-
const
|
|
4
|
+
const anchor_1 = require("@coral-xyz/anchor");
|
|
8
5
|
exports.CIRCLE_IRIS_API_URL_DEVNET = "https://iris-api-sandbox.circle.com";
|
|
9
6
|
exports.CIRCLE_IRIS_API_URL_MAINNET = "https://iris-api.circle.com";
|
|
10
7
|
exports.SOLANA_USDC_MAINNET = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v";
|
|
11
8
|
exports.SOLANA_USDC_DEVNET = "4zMMC9srt5Ri5X14GAgXhaHii3GnPAEERYPJgZJDncDU";
|
|
12
9
|
exports.SEPOLIA_CCTP_MESSAGE_TRANSMITTER_ADDRESS = "0x7865fAfC2db2093669d92c0F33AeEF291086BEFD";
|
|
13
10
|
exports.MAINNET_CCTP_MESSAGE_TRANSMITTER_ADDRESS = "0x0a992d191deec32afe36203ad87d7d289a738f81";
|
|
14
|
-
exports.SOLANA_SPOKE_STATE_SEED = new
|
|
11
|
+
exports.SOLANA_SPOKE_STATE_SEED = new anchor_1.BN(0);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { BN } from "@coral-xyz/anchor";
|
|
2
2
|
import { PublicKey } from "@solana/web3.js";
|
|
3
|
-
import { BigNumber } from "ethers";
|
|
4
3
|
/**
|
|
5
4
|
* Converts an integer to a 32-byte Uint8Array.
|
|
6
5
|
*/
|
|
@@ -10,15 +9,19 @@ export declare function intToU8Array32(num: number | BN): number[];
|
|
|
10
9
|
*/
|
|
11
10
|
export declare function u8Array32ToInt(u8Array: Uint8Array | number[]): bigint;
|
|
12
11
|
/**
|
|
13
|
-
* Converts a
|
|
12
|
+
* Converts a 0x-prefixed, even-length hex string to bytes, of exactly `length` bytes when given. Throws on malformed input.
|
|
14
13
|
*/
|
|
15
|
-
export declare function
|
|
14
|
+
export declare function hexToBytesStrict(hex: string, length?: number): Uint8Array;
|
|
15
|
+
/**
|
|
16
|
+
* Returns true for a 0x-prefixed 20-byte hex address. Mixed-case input must carry a valid EIP-55 checksum.
|
|
17
|
+
*/
|
|
18
|
+
export declare function isEvmAddress(address: string): boolean;
|
|
16
19
|
/**
|
|
17
20
|
* Converts a string to a PublicKey.
|
|
18
21
|
*/
|
|
19
22
|
export declare function strPublicKey(publicKey: PublicKey): string;
|
|
20
23
|
/**
|
|
21
|
-
* Converts an EVM address to a Solana PublicKey.
|
|
24
|
+
* Converts an EVM address or a bytes32 value, with or without 0x, to a Solana PublicKey.
|
|
22
25
|
*/
|
|
23
26
|
export declare const evmAddressToPublicKey: (address: string) => PublicKey;
|
|
24
27
|
/**
|
|
@@ -3,11 +3,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.addressOrBase58ToBytes32 = exports.fromBytes32ToAddress = exports.fromBase58ToBytes32 = exports.publicKeyToEvmAddress = exports.evmAddressToPublicKey = void 0;
|
|
4
4
|
exports.intToU8Array32 = intToU8Array32;
|
|
5
5
|
exports.u8Array32ToInt = u8Array32ToInt;
|
|
6
|
-
exports.
|
|
6
|
+
exports.hexToBytesStrict = hexToBytesStrict;
|
|
7
|
+
exports.isEvmAddress = isEvmAddress;
|
|
7
8
|
exports.strPublicKey = strPublicKey;
|
|
8
9
|
const anchor_1 = require("@coral-xyz/anchor");
|
|
9
10
|
const web3_js_1 = require("@solana/web3.js");
|
|
10
|
-
const
|
|
11
|
+
const sha3_js_1 = require("@noble/hashes/sha3.js");
|
|
12
|
+
const utils_js_1 = require("@noble/hashes/utils.js");
|
|
11
13
|
/**
|
|
12
14
|
* Converts an integer to a 32-byte Uint8Array.
|
|
13
15
|
*/
|
|
@@ -30,15 +32,30 @@ function u8Array32ToInt(u8Array) {
|
|
|
30
32
|
throw new Error("Input must be a Uint8Array or an array of 32 numbers.");
|
|
31
33
|
}
|
|
32
34
|
/**
|
|
33
|
-
*
|
|
35
|
+
* Returns true for a 0x-prefixed, even-length hex string, of exactly `length` bytes when given.
|
|
34
36
|
*/
|
|
35
|
-
function
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
function isStrictHex(hex, length) {
|
|
38
|
+
return /^0x([0-9a-fA-F]{2})*$/.test(hex) && (length === undefined || hex.length === 2 + 2 * length);
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Converts a 0x-prefixed, even-length hex string to bytes, of exactly `length` bytes when given. Throws on malformed input.
|
|
42
|
+
*/
|
|
43
|
+
function hexToBytesStrict(hex, length) {
|
|
44
|
+
if (!isStrictHex(hex, length))
|
|
45
|
+
throw new Error(`Invalid hex string: ${hex}`);
|
|
46
|
+
return Buffer.from(hex.slice(2), "hex");
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Returns true for a 0x-prefixed 20-byte hex address. Mixed-case input must carry a valid EIP-55 checksum.
|
|
50
|
+
*/
|
|
51
|
+
function isEvmAddress(address) {
|
|
52
|
+
if (!isStrictHex(address, 20))
|
|
53
|
+
return false;
|
|
54
|
+
const hex = address.slice(2);
|
|
55
|
+
if (hex === hex.toLowerCase() || hex === hex.toUpperCase())
|
|
56
|
+
return true;
|
|
57
|
+
const hash = (0, utils_js_1.bytesToHex)((0, sha3_js_1.keccak_256)((0, utils_js_1.utf8ToBytes)(hex.toLowerCase())));
|
|
58
|
+
return [...hex].every((c, i) => c === (parseInt(hash[i], 16) >= 8 ? c.toUpperCase() : c.toLowerCase()));
|
|
42
59
|
}
|
|
43
60
|
/**
|
|
44
61
|
* Converts a string to a PublicKey.
|
|
@@ -47,11 +64,13 @@ function strPublicKey(publicKey) {
|
|
|
47
64
|
return new web3_js_1.PublicKey(publicKey).toString();
|
|
48
65
|
}
|
|
49
66
|
/**
|
|
50
|
-
* Converts an EVM address to a Solana PublicKey.
|
|
67
|
+
* Converts an EVM address or a bytes32 value, with or without 0x, to a Solana PublicKey.
|
|
51
68
|
*/
|
|
52
69
|
const evmAddressToPublicKey = (address) => {
|
|
53
|
-
const
|
|
54
|
-
|
|
70
|
+
const hex = address.replace(/^0x/, "");
|
|
71
|
+
if (hex.length !== 40 && hex.length !== 64)
|
|
72
|
+
throw new Error(`Invalid EVM address or bytes32: ${address}`);
|
|
73
|
+
return new web3_js_1.PublicKey(hexToBytesStrict(`0x${hex.padStart(64, "0")}`));
|
|
55
74
|
};
|
|
56
75
|
exports.evmAddressToPublicKey = evmAddressToPublicKey;
|
|
57
76
|
/**
|
|
@@ -71,6 +90,8 @@ exports.publicKeyToEvmAddress = publicKeyToEvmAddress;
|
|
|
71
90
|
*/
|
|
72
91
|
const fromBase58ToBytes32 = (input) => {
|
|
73
92
|
const decodedBytes = anchor_1.utils.bytes.bs58.decode(input);
|
|
93
|
+
if (decodedBytes.length !== 32)
|
|
94
|
+
throw new Error(`Invalid base58 bytes32: ${input}`);
|
|
74
95
|
return "0x" + Buffer.from(decodedBytes).toString("hex");
|
|
75
96
|
};
|
|
76
97
|
exports.fromBase58ToBytes32 = fromBase58ToBytes32;
|
|
@@ -90,10 +111,10 @@ exports.fromBytes32ToAddress = fromBytes32ToAddress;
|
|
|
90
111
|
* Converts EVM or SVM address to a bytes32 string.
|
|
91
112
|
*/
|
|
92
113
|
const addressOrBase58ToBytes32 = (input) => {
|
|
93
|
-
if (
|
|
94
|
-
return
|
|
114
|
+
if (isEvmAddress(input)) {
|
|
115
|
+
return "0x" + input.slice(2).padStart(64, "0");
|
|
95
116
|
}
|
|
96
|
-
else if (
|
|
117
|
+
else if (isStrictHex(input, 32)) {
|
|
97
118
|
return input;
|
|
98
119
|
}
|
|
99
120
|
else {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { AnchorProvider, BN } from "@coral-xyz/anchor";
|
|
2
|
-
import { BigNumber } from "@ethersproject/bignumber";
|
|
3
2
|
import { PublicKey } from "@solana/web3.js";
|
|
4
3
|
/**
|
|
5
4
|
* Returns the chainId for a given solana cluster.
|
|
6
5
|
*/
|
|
7
|
-
export declare const getSolanaChainId: (cluster: "devnet" | "mainnet") =>
|
|
6
|
+
export declare const getSolanaChainId: (cluster: "devnet" | "mainnet") => bigint;
|
|
8
7
|
/**
|
|
9
8
|
* Returns true if the provider is on the devnet cluster.
|
|
10
9
|
*/
|
|
@@ -7,16 +7,15 @@ exports.getDepositNowSeedHash = getDepositNowSeedHash;
|
|
|
7
7
|
exports.getDepositNowPda = getDepositNowPda;
|
|
8
8
|
exports.getFillRelayDelegateSeedHash = getFillRelayDelegateSeedHash;
|
|
9
9
|
exports.getFillRelayDelegatePda = getFillRelayDelegatePda;
|
|
10
|
-
const bignumber_1 = require("@ethersproject/bignumber");
|
|
11
|
-
const ethers_1 = require("ethers");
|
|
12
10
|
const web3_js_1 = require("@solana/web3.js");
|
|
13
11
|
const borsh_1 = require("borsh");
|
|
14
|
-
const
|
|
12
|
+
const sha3_js_1 = require("@noble/hashes/sha3.js");
|
|
13
|
+
const utils_js_1 = require("@noble/hashes/utils.js");
|
|
15
14
|
/**
|
|
16
15
|
* Returns the chainId for a given solana cluster.
|
|
17
16
|
*/
|
|
18
17
|
const getSolanaChainId = (cluster) => {
|
|
19
|
-
return
|
|
18
|
+
return BigInt("0x" + (0, utils_js_1.bytesToHex)((0, sha3_js_1.keccak_256)((0, utils_js_1.utf8ToBytes)(`solana-${cluster}`)))) & BigInt("0xFFFFFFFFFFFF");
|
|
20
19
|
};
|
|
21
20
|
exports.getSolanaChainId = getSolanaChainId;
|
|
22
21
|
/**
|
|
@@ -37,8 +36,7 @@ exports.isSolanaDevnet = isSolanaDevnet;
|
|
|
37
36
|
*/
|
|
38
37
|
function deriveSeedHash(schema, seedObj) {
|
|
39
38
|
const serialized = (0, borsh_1.serialize)(schema, seedObj);
|
|
40
|
-
|
|
41
|
-
return Buffer.from(hashHex.slice(2), "hex");
|
|
39
|
+
return Buffer.from((0, sha3_js_1.keccak_256)(serialized));
|
|
42
40
|
}
|
|
43
41
|
/**
|
|
44
42
|
* “Absolute‐deadline” deposit data
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { BN } from "@coral-xyz/anchor";
|
|
2
|
-
import {
|
|
2
|
+
import { RelayerRefundLeafSolana, RelayerRefundLeafType, SlowFillLeaf } from "../../types/svm";
|
|
3
3
|
/**
|
|
4
4
|
* Calculates the relay hash from relay data and chain ID.
|
|
5
5
|
*/
|
|
@@ -11,7 +11,7 @@ export declare function calculateRelayEventHashUint8Array(relayEventData: any, c
|
|
|
11
11
|
/**
|
|
12
12
|
* Reads a 256-bit unsigned integer from a buffer.
|
|
13
13
|
*/
|
|
14
|
-
export declare const readUInt256BE: (buffer: Buffer) =>
|
|
14
|
+
export declare const readUInt256BE: (buffer: Buffer) => bigint;
|
|
15
15
|
/**
|
|
16
16
|
* Hashes a non-empty message using Keccak256.
|
|
17
17
|
*/
|
|
@@ -21,9 +21,10 @@ export declare function hashNonEmptyMessage(message: Buffer): Uint8Array;
|
|
|
21
21
|
*/
|
|
22
22
|
export declare function calculateRelayerRefundLeafHashUint8Array(relayData: RelayerRefundLeafSolana): string;
|
|
23
23
|
/**
|
|
24
|
-
* Hash function for relayer refund leaves.
|
|
24
|
+
* Hash function for relayer refund leaves. EVM leaves are ABI-encoded as a single
|
|
25
|
+
* tuple(uint256 amountToReturn, uint256 chainId, uint256[] refundAmounts, uint256 leafId, address l2TokenAddress, address[] refundAddresses).
|
|
25
26
|
*/
|
|
26
|
-
export declare const relayerRefundHashFn: (input:
|
|
27
|
+
export declare const relayerRefundHashFn: (input: RelayerRefundLeafType) => string;
|
|
27
28
|
/**
|
|
28
29
|
* Hash function for slow fill leaves.
|
|
29
30
|
*/
|