@pyxisjs/chains 0.2.2 → 0.2.4

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.mjs CHANGED
@@ -2726,18 +2726,185 @@ var Vault_default = {
2726
2726
  ]
2727
2727
  };
2728
2728
 
2729
+ // src/aptos/abis/MultiChainLayerZeroTeller.json
2730
+ var MultiChainLayerZeroTeller_default = {
2731
+ address: "0xfa6387d040ba849299b684f853ab302e83fe9e51121047a3b312f89bf4efda5f",
2732
+ name: "multi_chain_lz_teller",
2733
+ friends: [
2734
+ "0xfa6387d040ba849299b684f853ab302e83fe9e51121047a3b312f89bf4efda5f::oapp_receive"
2735
+ ],
2736
+ exposed_functions: [
2737
+ {
2738
+ name: "initialize",
2739
+ visibility: "public",
2740
+ is_entry: false,
2741
+ is_view: false,
2742
+ generic_type_params: [],
2743
+ params: ["&signer"],
2744
+ return: []
2745
+ },
2746
+ {
2747
+ name: "bridge",
2748
+ visibility: "public",
2749
+ is_entry: true,
2750
+ is_view: false,
2751
+ generic_type_params: [],
2752
+ params: [
2753
+ "&signer",
2754
+ "address",
2755
+ "u32",
2756
+ "vector<u8>",
2757
+ "u64",
2758
+ "u64",
2759
+ "u64",
2760
+ "vector<u8>"
2761
+ ],
2762
+ return: []
2763
+ },
2764
+ {
2765
+ name: "deposit_and_bridge",
2766
+ visibility: "public",
2767
+ is_entry: true,
2768
+ is_view: false,
2769
+ generic_type_params: [],
2770
+ params: [
2771
+ "&signer",
2772
+ "address",
2773
+ "address",
2774
+ "u64",
2775
+ "u64",
2776
+ "u32",
2777
+ "vector<u8>",
2778
+ "u64",
2779
+ "u64",
2780
+ "vector<u8>"
2781
+ ],
2782
+ return: []
2783
+ },
2784
+ {
2785
+ name: "lz_receive",
2786
+ visibility: "friend",
2787
+ is_entry: false,
2788
+ is_view: false,
2789
+ generic_type_params: [],
2790
+ params: [
2791
+ "u32",
2792
+ "vector<u8>",
2793
+ "u64",
2794
+ "0xe60045e20fc2c99e869c1c34a65b9291c020cd12a0d37a00a53ac1348af4f43c::endpoint::WrappedGuid",
2795
+ "vector<u8>",
2796
+ "vector<u8>",
2797
+ "0x1::option::Option<0x1::fungible_asset::FungibleAsset>"
2798
+ ],
2799
+ return: []
2800
+ },
2801
+ {
2802
+ name: "quote_bridge",
2803
+ visibility: "public",
2804
+ is_entry: false,
2805
+ is_view: true,
2806
+ generic_type_params: [],
2807
+ params: ["address", "u32", "u64", "vector<u8>", "vector<u8>", "bool"],
2808
+ return: ["u64", "u64"]
2809
+ }
2810
+ ],
2811
+ structs: [
2812
+ {
2813
+ name: "TellerCapabilities",
2814
+ is_native: false,
2815
+ is_event: false,
2816
+ is_enum: true,
2817
+ abilities: ["key"],
2818
+ generic_type_params: [],
2819
+ fields: []
2820
+ },
2821
+ {
2822
+ name: "MessageReceived",
2823
+ is_native: false,
2824
+ is_event: true,
2825
+ is_enum: false,
2826
+ abilities: ["drop", "store"],
2827
+ generic_type_params: [],
2828
+ fields: [
2829
+ {
2830
+ name: "message_id",
2831
+ type: "vector<u8>"
2832
+ },
2833
+ {
2834
+ name: "share_amount_ld",
2835
+ type: "u64"
2836
+ },
2837
+ {
2838
+ name: "recipient",
2839
+ type: "address"
2840
+ }
2841
+ ]
2842
+ },
2843
+ {
2844
+ name: "MessageSent",
2845
+ is_native: false,
2846
+ is_event: true,
2847
+ is_enum: false,
2848
+ abilities: ["drop", "store"],
2849
+ generic_type_params: [],
2850
+ fields: [
2851
+ {
2852
+ name: "message_id",
2853
+ type: "vector<u8>"
2854
+ },
2855
+ {
2856
+ name: "share_amount_ld",
2857
+ type: "u64"
2858
+ },
2859
+ {
2860
+ name: "recipient_raw",
2861
+ type: "vector<u8>"
2862
+ }
2863
+ ]
2864
+ }
2865
+ ]
2866
+ };
2867
+
2868
+ // src/aptos/abis/index.ts
2869
+ var AccountantAptosABI = Accountant_default;
2870
+ var AtomicQueueAptosABI = AtomicQueue_default;
2871
+ var TellerAptosABI = Teller_default;
2872
+ var VaultAptosABI = Vault_default;
2873
+ var MultiChainLayerZeroTellerAptosABI = MultiChainLayerZeroTeller_default;
2874
+
2729
2875
  // src/aptos/adapter.ts
2730
2876
  import {
2731
2877
  Aptos,
2732
2878
  AptosConfig,
2879
+ APTOS_COIN,
2880
+ Hex,
2733
2881
  Network
2734
2882
  } from "@aptos-labs/ts-sdk";
2735
2883
  import {
2736
2884
  BaseChainAdapter,
2737
2885
  NetworkType,
2738
2886
  getChainConfig,
2739
- PyxisUtils
2887
+ PyxisUtils,
2888
+ getLayerZeroEndpointId,
2889
+ getEstimatedBridgeTime,
2890
+ getLayerZeroGasLimit
2740
2891
  } from "@pyxisjs/core";
2892
+ import { Options } from "@layerzerolabs/lz-v2-utilities";
2893
+
2894
+ // ../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js
2895
+ var isProduction = process.env.NODE_ENV === "production";
2896
+ var prefix = "Invariant failed";
2897
+ function invariant(condition, message) {
2898
+ if (condition) {
2899
+ return;
2900
+ }
2901
+ if (isProduction) {
2902
+ throw new Error(prefix);
2903
+ }
2904
+ var provided = typeof message === "function" ? message() : message;
2905
+ var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
2906
+ throw new Error(value);
2907
+ }
2741
2908
 
2742
2909
  // src/common/contracts.ts
2743
2910
  import { ChainType } from "@pyxisjs/core";
@@ -6673,88 +6840,1403 @@ var Teller_default2 = [
6673
6840
  }
6674
6841
  ];
6675
6842
 
6676
- // src/common/contracts.ts
6677
- var CONTRACTS = {
6678
- accountant: {
6679
- name: "Accountant",
6680
- abi: {
6681
- [ChainType.MoveVM]: Accountant_default,
6682
- [ChainType.EVM]: Accountant_default2
6683
- },
6684
- functionSignatures: {
6685
- [ChainType.MoveVM]: {
6686
- calculate_shares_from_assets_safe: "{address}::accountant::calculate_shares_from_assets_safe",
6687
- calculate_assets_from_shares_safe: "{address}::accountant::calculate_assets_from_shares_safe",
6688
- get_withdraw_rate_in_quote_safe: "{address}::accountant::get_withdraw_rate_in_quote_safe",
6689
- get_deposit_rate_in_quote_safe: "{address}::accountant::get_deposit_rate_in_quote_safe"
6690
- },
6691
- [ChainType.EVM]: {
6692
- calculate_shares_from_assets_safe: "calculateSharesFromAssetsSafe",
6693
- calculate_assets_from_shares_safe: "calculateAssetsFromSharesSafe",
6694
- // EVM contract doesn't have safe functions
6695
- get_withdraw_rate_in_quote_safe: "getWithdrawRateInQuote",
6696
- get_deposit_rate_in_quote_safe: "getDepositRateInQuote"
6843
+ // src/evm/abis/MultiChainLayerZeroTeller.json
6844
+ var MultiChainLayerZeroTeller_default2 = [
6845
+ {
6846
+ type: "constructor",
6847
+ inputs: [
6848
+ { name: "_owner", type: "address", internalType: "address" },
6849
+ { name: "_vault", type: "address", internalType: "address" },
6850
+ { name: "_accountant", type: "address", internalType: "address" },
6851
+ { name: "_endpoint", type: "address", internalType: "address" }
6852
+ ],
6853
+ stateMutability: "nonpayable"
6854
+ },
6855
+ {
6856
+ type: "function",
6857
+ name: "accountant",
6858
+ inputs: [],
6859
+ outputs: [
6860
+ {
6861
+ name: "",
6862
+ type: "address",
6863
+ internalType: "contract AccountantWithRateProviders"
6697
6864
  }
6698
- }
6865
+ ],
6866
+ stateMutability: "view"
6699
6867
  },
6700
- teller: {
6701
- name: "Teller",
6702
- abi: {
6703
- [ChainType.MoveVM]: Teller_default,
6704
- [ChainType.EVM]: Teller_default2
6705
- },
6706
- functionSignatures: {
6707
- [ChainType.MoveVM]: {
6708
- deposit: "{address}::teller::deposit",
6709
- deposit_with_referral: "{address}::teller::deposit_with_referral",
6710
- deposit_for: "{address}::teller::deposit_for",
6711
- mint_shares: "{address}::teller::mint_shares",
6712
- create_withdrawal_request: "{address}::teller::create_withdrawal_request"
6868
+ {
6869
+ type: "function",
6870
+ name: "addAsset",
6871
+ inputs: [
6872
+ { name: "asset", type: "address", internalType: "contract ERC20" }
6873
+ ],
6874
+ outputs: [],
6875
+ stateMutability: "nonpayable"
6876
+ },
6877
+ {
6878
+ type: "function",
6879
+ name: "addChain",
6880
+ inputs: [
6881
+ { name: "chainSelector", type: "uint32", internalType: "uint32" },
6882
+ { name: "allowMessagesFrom", type: "bool", internalType: "bool" },
6883
+ { name: "allowMessagesTo", type: "bool", internalType: "bool" },
6884
+ {
6885
+ name: "targetTeller",
6886
+ type: "address",
6887
+ internalType: "address"
6713
6888
  },
6714
- [ChainType.EVM]: {
6715
- deposit: "deposit",
6716
- deposit_with_referral: "depositWithReferral",
6717
- deposit_for: "depositFor",
6718
- mint_shares: "mintShares",
6719
- create_withdrawal_request: "createWithdrawalRequest"
6889
+ {
6890
+ name: "messageGasLimit",
6891
+ type: "uint64",
6892
+ internalType: "uint64"
6893
+ },
6894
+ { name: "messageGasMin", type: "uint64", internalType: "uint64" }
6895
+ ],
6896
+ outputs: [],
6897
+ stateMutability: "nonpayable"
6898
+ },
6899
+ {
6900
+ type: "function",
6901
+ name: "allowInitializePath",
6902
+ inputs: [
6903
+ {
6904
+ name: "origin",
6905
+ type: "tuple",
6906
+ internalType: "struct Origin",
6907
+ components: [
6908
+ { name: "srcEid", type: "uint32", internalType: "uint32" },
6909
+ { name: "sender", type: "bytes32", internalType: "bytes32" },
6910
+ { name: "nonce", type: "uint64", internalType: "uint64" }
6911
+ ]
6720
6912
  }
6721
- }
6913
+ ],
6914
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
6915
+ stateMutability: "view"
6722
6916
  },
6723
- atomicQueue: {
6724
- name: "AtomicQueue",
6725
- abi: {
6726
- [ChainType.MoveVM]: AtomicQueue_default,
6727
- [ChainType.EVM]: AtomicQueue_default2
6728
- },
6729
- functionSignatures: {
6730
- [ChainType.MoveVM]: {
6731
- get_minimum_request_age: "{address}::atomic_queue::get_minimum_request_age",
6732
- get_all_atomic_requests: "{address}::atomic_queue::get_all_atomic_requests",
6733
- get_request_update_cooldown: "{address}::atomic_queue::get_request_update_cooldown",
6734
- get_request_updated_at: "{address}::atomic_queue::get_request_updated_at",
6735
- get_user_atomic_request: "{address}::atomic_queue::get_user_atomic_request",
6736
- get_user_atomic_requests: "{address}::atomic_queue::get_user_atomic_requests",
6737
- is_atomic_request_valid: "{address}::atomic_queue::is_atomic_request_valid",
6738
- is_paused: "{address}::atomic_queue::is_paused",
6739
- update_atomic_request: "{address}::atomic_queue::update_atomic_request",
6740
- cancel_atomic_request: "{address}::atomic_queue::cancel_atomic_request",
6741
- cancel_withdrawal_request: "{address}::atomic_queue::cancel_atomic_request"
6917
+ {
6918
+ type: "function",
6919
+ name: "allowMessagesFromChain",
6920
+ inputs: [
6921
+ { name: "chainSelector", type: "uint32", internalType: "uint32" },
6922
+ { name: "targetTeller", type: "address", internalType: "address" }
6923
+ ],
6924
+ outputs: [],
6925
+ stateMutability: "nonpayable"
6926
+ },
6927
+ {
6928
+ type: "function",
6929
+ name: "allowMessagesToChain",
6930
+ inputs: [
6931
+ { name: "chainSelector", type: "uint32", internalType: "uint32" },
6932
+ {
6933
+ name: "targetTeller",
6934
+ type: "address",
6935
+ internalType: "address"
6742
6936
  },
6743
- [ChainType.EVM]: {
6744
- get_minimum_request_age: "getMinimumRequestAge",
6745
- cancel_withdrawal_request: "cancelWithdrawalRequest",
6746
- reclaim_withdrawal_request: "reclaimWithdrawalRequest",
6747
- update_atomic_request: "updateAtomicRequest",
6748
- get_request_updated_at: "getRequestUpdatedAt",
6749
- get_user_atomic_requests: "getUserAtomicRequests"
6937
+ {
6938
+ name: "messageGasLimit",
6939
+ type: "uint64",
6940
+ internalType: "uint64"
6750
6941
  }
6751
- }
6942
+ ],
6943
+ outputs: [],
6944
+ stateMutability: "nonpayable"
6752
6945
  },
6753
- vault: {
6754
- name: "Vault",
6946
+ {
6947
+ type: "function",
6948
+ name: "authority",
6949
+ inputs: [],
6950
+ outputs: [
6951
+ { name: "", type: "address", internalType: "contract Authority" }
6952
+ ],
6953
+ stateMutability: "view"
6954
+ },
6955
+ {
6956
+ type: "function",
6957
+ name: "beforeTransfer",
6958
+ inputs: [
6959
+ { name: "from", type: "address", internalType: "address" },
6960
+ { name: "amount", type: "uint256", internalType: "uint256" }
6961
+ ],
6962
+ outputs: [],
6963
+ stateMutability: "view"
6964
+ },
6965
+ {
6966
+ type: "function",
6967
+ name: "bridge",
6968
+ inputs: [
6969
+ { name: "shareAmount", type: "uint256", internalType: "uint256" },
6970
+ {
6971
+ name: "data",
6972
+ type: "tuple",
6973
+ internalType: "struct BridgeData",
6974
+ components: [
6975
+ {
6976
+ name: "chainSelector",
6977
+ type: "uint32",
6978
+ internalType: "uint32"
6979
+ },
6980
+ {
6981
+ name: "messageGas",
6982
+ type: "uint64",
6983
+ internalType: "uint64"
6984
+ },
6985
+ {
6986
+ name: "destinationChainReceiver",
6987
+ type: "bytes32",
6988
+ internalType: "bytes32"
6989
+ },
6990
+ {
6991
+ name: "bridgeFeeToken",
6992
+ type: "address",
6993
+ internalType: "contract ERC20"
6994
+ },
6995
+ { name: "data", type: "bytes", internalType: "bytes" }
6996
+ ]
6997
+ }
6998
+ ],
6999
+ outputs: [
7000
+ { name: "messageId", type: "bytes32", internalType: "bytes32" }
7001
+ ],
7002
+ stateMutability: "payable"
7003
+ },
7004
+ {
7005
+ type: "function",
7006
+ name: "bulkDeposit",
7007
+ inputs: [
7008
+ {
7009
+ name: "depositAsset",
7010
+ type: "address",
7011
+ internalType: "contract ERC20"
7012
+ },
7013
+ {
7014
+ name: "depositAmount",
7015
+ type: "uint256",
7016
+ internalType: "uint256"
7017
+ },
7018
+ { name: "minimumMint", type: "uint256", internalType: "uint256" },
7019
+ { name: "to", type: "address", internalType: "address" }
7020
+ ],
7021
+ outputs: [
7022
+ { name: "shares", type: "uint256", internalType: "uint256" }
7023
+ ],
7024
+ stateMutability: "nonpayable"
7025
+ },
7026
+ {
7027
+ type: "function",
7028
+ name: "bulkWithdraw",
7029
+ inputs: [
7030
+ {
7031
+ name: "withdrawAsset",
7032
+ type: "address",
7033
+ internalType: "contract ERC20"
7034
+ },
7035
+ { name: "shareAmount", type: "uint256", internalType: "uint256" },
7036
+ {
7037
+ name: "minimumAssets",
7038
+ type: "uint256",
7039
+ internalType: "uint256"
7040
+ },
7041
+ { name: "to", type: "address", internalType: "address" }
7042
+ ],
7043
+ outputs: [
7044
+ { name: "assetsOut", type: "uint256", internalType: "uint256" }
7045
+ ],
7046
+ stateMutability: "nonpayable"
7047
+ },
7048
+ {
7049
+ type: "function",
7050
+ name: "deposit",
7051
+ inputs: [
7052
+ {
7053
+ name: "depositAsset",
7054
+ type: "address",
7055
+ internalType: "contract ERC20"
7056
+ },
7057
+ {
7058
+ name: "depositAmount",
7059
+ type: "uint256",
7060
+ internalType: "uint256"
7061
+ },
7062
+ { name: "minimumMint", type: "uint256", internalType: "uint256" }
7063
+ ],
7064
+ outputs: [
7065
+ { name: "shares", type: "uint256", internalType: "uint256" }
7066
+ ],
7067
+ stateMutability: "nonpayable"
7068
+ },
7069
+ {
7070
+ type: "function",
7071
+ name: "depositAndBridge",
7072
+ inputs: [
7073
+ {
7074
+ name: "depositAsset",
7075
+ type: "address",
7076
+ internalType: "contract ERC20"
7077
+ },
7078
+ {
7079
+ name: "depositAmount",
7080
+ type: "uint256",
7081
+ internalType: "uint256"
7082
+ },
7083
+ { name: "minimumMint", type: "uint256", internalType: "uint256" },
7084
+ {
7085
+ name: "data",
7086
+ type: "tuple",
7087
+ internalType: "struct BridgeData",
7088
+ components: [
7089
+ {
7090
+ name: "chainSelector",
7091
+ type: "uint32",
7092
+ internalType: "uint32"
7093
+ },
7094
+ {
7095
+ name: "messageGas",
7096
+ type: "uint64",
7097
+ internalType: "uint64"
7098
+ },
7099
+ {
7100
+ name: "destinationChainReceiver",
7101
+ type: "bytes32",
7102
+ internalType: "bytes32"
7103
+ },
7104
+ {
7105
+ name: "bridgeFeeToken",
7106
+ type: "address",
7107
+ internalType: "contract ERC20"
7108
+ },
7109
+ { name: "data", type: "bytes", internalType: "bytes" }
7110
+ ]
7111
+ }
7112
+ ],
7113
+ outputs: [],
7114
+ stateMutability: "payable"
7115
+ },
7116
+ {
7117
+ type: "function",
7118
+ name: "depositNonce",
7119
+ inputs: [],
7120
+ outputs: [{ name: "", type: "uint96", internalType: "uint96" }],
7121
+ stateMutability: "view"
7122
+ },
7123
+ {
7124
+ type: "function",
7125
+ name: "depositWithPermit",
7126
+ inputs: [
7127
+ {
7128
+ name: "depositAsset",
7129
+ type: "address",
7130
+ internalType: "contract ERC20"
7131
+ },
7132
+ {
7133
+ name: "depositAmount",
7134
+ type: "uint256",
7135
+ internalType: "uint256"
7136
+ },
7137
+ { name: "minimumMint", type: "uint256", internalType: "uint256" },
7138
+ { name: "deadline", type: "uint256", internalType: "uint256" },
7139
+ { name: "v", type: "uint8", internalType: "uint8" },
7140
+ { name: "r", type: "bytes32", internalType: "bytes32" },
7141
+ { name: "s", type: "bytes32", internalType: "bytes32" }
7142
+ ],
7143
+ outputs: [
7144
+ { name: "shares", type: "uint256", internalType: "uint256" }
7145
+ ],
7146
+ stateMutability: "nonpayable"
7147
+ },
7148
+ {
7149
+ type: "function",
7150
+ name: "endpoint",
7151
+ inputs: [],
7152
+ outputs: [
7153
+ {
7154
+ name: "",
7155
+ type: "address",
7156
+ internalType: "contract ILayerZeroEndpointV2"
7157
+ }
7158
+ ],
7159
+ stateMutability: "view"
7160
+ },
7161
+ {
7162
+ type: "function",
7163
+ name: "isComposeMsgSender",
7164
+ inputs: [
7165
+ {
7166
+ name: "",
7167
+ type: "tuple",
7168
+ internalType: "struct Origin",
7169
+ components: [
7170
+ { name: "srcEid", type: "uint32", internalType: "uint32" },
7171
+ { name: "sender", type: "bytes32", internalType: "bytes32" },
7172
+ { name: "nonce", type: "uint64", internalType: "uint64" }
7173
+ ]
7174
+ },
7175
+ { name: "", type: "bytes", internalType: "bytes" },
7176
+ { name: "_sender", type: "address", internalType: "address" }
7177
+ ],
7178
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
7179
+ stateMutability: "view"
7180
+ },
7181
+ {
7182
+ type: "function",
7183
+ name: "isPaused",
7184
+ inputs: [],
7185
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
7186
+ stateMutability: "view"
7187
+ },
7188
+ {
7189
+ type: "function",
7190
+ name: "isSupported",
7191
+ inputs: [
7192
+ { name: "", type: "address", internalType: "contract ERC20" }
7193
+ ],
7194
+ outputs: [{ name: "", type: "bool", internalType: "bool" }],
7195
+ stateMutability: "view"
7196
+ },
7197
+ {
7198
+ type: "function",
7199
+ name: "lzReceive",
7200
+ inputs: [
7201
+ {
7202
+ name: "_origin",
7203
+ type: "tuple",
7204
+ internalType: "struct Origin",
7205
+ components: [
7206
+ { name: "srcEid", type: "uint32", internalType: "uint32" },
7207
+ { name: "sender", type: "bytes32", internalType: "bytes32" },
7208
+ { name: "nonce", type: "uint64", internalType: "uint64" }
7209
+ ]
7210
+ },
7211
+ { name: "_guid", type: "bytes32", internalType: "bytes32" },
7212
+ { name: "_message", type: "bytes", internalType: "bytes" },
7213
+ { name: "_executor", type: "address", internalType: "address" },
7214
+ { name: "_extraData", type: "bytes", internalType: "bytes" }
7215
+ ],
7216
+ outputs: [],
7217
+ stateMutability: "payable"
7218
+ },
7219
+ {
7220
+ type: "function",
7221
+ name: "minDepositAmount",
7222
+ inputs: [
7223
+ { name: "", type: "address", internalType: "contract ERC20" }
7224
+ ],
7225
+ outputs: [{ name: "", type: "uint256", internalType: "uint256" }],
7226
+ stateMutability: "view"
7227
+ },
7228
+ {
7229
+ type: "function",
7230
+ name: "nextNonce",
7231
+ inputs: [
7232
+ { name: "", type: "uint32", internalType: "uint32" },
7233
+ { name: "", type: "bytes32", internalType: "bytes32" }
7234
+ ],
7235
+ outputs: [
7236
+ { name: "nonce", type: "uint64", internalType: "uint64" }
7237
+ ],
7238
+ stateMutability: "view"
7239
+ },
7240
+ {
7241
+ type: "function",
7242
+ name: "oAppVersion",
7243
+ inputs: [],
7244
+ outputs: [
7245
+ { name: "senderVersion", type: "uint64", internalType: "uint64" },
7246
+ {
7247
+ name: "receiverVersion",
7248
+ type: "uint64",
7249
+ internalType: "uint64"
7250
+ }
7251
+ ],
7252
+ stateMutability: "pure"
7253
+ },
7254
+ {
7255
+ type: "function",
7256
+ name: "owner",
7257
+ inputs: [],
7258
+ outputs: [{ name: "", type: "address", internalType: "address" }],
7259
+ stateMutability: "view"
7260
+ },
7261
+ {
7262
+ type: "function",
7263
+ name: "pause",
7264
+ inputs: [],
7265
+ outputs: [],
7266
+ stateMutability: "nonpayable"
7267
+ },
7268
+ {
7269
+ type: "function",
7270
+ name: "peers",
7271
+ inputs: [{ name: "eid", type: "uint32", internalType: "uint32" }],
7272
+ outputs: [
7273
+ { name: "peer", type: "bytes32", internalType: "bytes32" }
7274
+ ],
7275
+ stateMutability: "view"
7276
+ },
7277
+ {
7278
+ type: "function",
7279
+ name: "previewFee",
7280
+ inputs: [
7281
+ { name: "shareAmount", type: "uint256", internalType: "uint256" },
7282
+ {
7283
+ name: "data",
7284
+ type: "tuple",
7285
+ internalType: "struct BridgeData",
7286
+ components: [
7287
+ {
7288
+ name: "chainSelector",
7289
+ type: "uint32",
7290
+ internalType: "uint32"
7291
+ },
7292
+ {
7293
+ name: "messageGas",
7294
+ type: "uint64",
7295
+ internalType: "uint64"
7296
+ },
7297
+ {
7298
+ name: "destinationChainReceiver",
7299
+ type: "bytes32",
7300
+ internalType: "bytes32"
7301
+ },
7302
+ {
7303
+ name: "bridgeFeeToken",
7304
+ type: "address",
7305
+ internalType: "contract ERC20"
7306
+ },
7307
+ { name: "data", type: "bytes", internalType: "bytes" }
7308
+ ]
7309
+ }
7310
+ ],
7311
+ outputs: [
7312
+ { name: "fee", type: "uint256", internalType: "uint256" }
7313
+ ],
7314
+ stateMutability: "view"
7315
+ },
7316
+ {
7317
+ type: "function",
7318
+ name: "publicDepositHistory",
7319
+ inputs: [{ name: "", type: "uint256", internalType: "uint256" }],
7320
+ outputs: [{ name: "", type: "bytes32", internalType: "bytes32" }],
7321
+ stateMutability: "view"
7322
+ },
7323
+ {
7324
+ type: "function",
7325
+ name: "refundDeposit",
7326
+ inputs: [
7327
+ { name: "nonce", type: "uint256", internalType: "uint256" },
7328
+ { name: "receiver", type: "address", internalType: "address" },
7329
+ {
7330
+ name: "depositAsset",
7331
+ type: "address",
7332
+ internalType: "address"
7333
+ },
7334
+ {
7335
+ name: "depositAmount",
7336
+ type: "uint256",
7337
+ internalType: "uint256"
7338
+ },
7339
+ { name: "shareAmount", type: "uint256", internalType: "uint256" },
7340
+ {
7341
+ name: "depositTimestamp",
7342
+ type: "uint256",
7343
+ internalType: "uint256"
7344
+ },
7345
+ {
7346
+ name: "shareLockUpPeriodAtTimeOfDeposit",
7347
+ type: "uint256",
7348
+ internalType: "uint256"
7349
+ }
7350
+ ],
7351
+ outputs: [],
7352
+ stateMutability: "nonpayable"
7353
+ },
7354
+ {
7355
+ type: "function",
7356
+ name: "removeAsset",
7357
+ inputs: [
7358
+ { name: "asset", type: "address", internalType: "contract ERC20" }
7359
+ ],
7360
+ outputs: [],
7361
+ stateMutability: "nonpayable"
7362
+ },
7363
+ {
7364
+ type: "function",
7365
+ name: "removeChain",
7366
+ inputs: [
7367
+ { name: "chainSelector", type: "uint32", internalType: "uint32" }
7368
+ ],
7369
+ outputs: [],
7370
+ stateMutability: "nonpayable"
7371
+ },
7372
+ {
7373
+ type: "function",
7374
+ name: "selectorToChains",
7375
+ inputs: [{ name: "", type: "uint32", internalType: "uint32" }],
7376
+ outputs: [
7377
+ { name: "allowMessagesFrom", type: "bool", internalType: "bool" },
7378
+ { name: "allowMessagesTo", type: "bool", internalType: "bool" },
7379
+ {
7380
+ name: "targetTeller",
7381
+ type: "address",
7382
+ internalType: "address"
7383
+ },
7384
+ {
7385
+ name: "messageGasLimit",
7386
+ type: "uint64",
7387
+ internalType: "uint64"
7388
+ },
7389
+ {
7390
+ name: "minimumMessageGas",
7391
+ type: "uint64",
7392
+ internalType: "uint64"
7393
+ }
7394
+ ],
7395
+ stateMutability: "view"
7396
+ },
7397
+ {
7398
+ type: "function",
7399
+ name: "setAuthority",
7400
+ inputs: [
7401
+ {
7402
+ name: "newAuthority",
7403
+ type: "address",
7404
+ internalType: "contract Authority"
7405
+ }
7406
+ ],
7407
+ outputs: [],
7408
+ stateMutability: "nonpayable"
7409
+ },
7410
+ {
7411
+ type: "function",
7412
+ name: "setChainGasLimit",
7413
+ inputs: [
7414
+ { name: "chainSelector", type: "uint32", internalType: "uint32" },
7415
+ {
7416
+ name: "messageGasLimit",
7417
+ type: "uint64",
7418
+ internalType: "uint64"
7419
+ }
7420
+ ],
7421
+ outputs: [],
7422
+ stateMutability: "nonpayable"
7423
+ },
7424
+ {
7425
+ type: "function",
7426
+ name: "setDelegate",
7427
+ inputs: [
7428
+ { name: "_delegate", type: "address", internalType: "address" }
7429
+ ],
7430
+ outputs: [],
7431
+ stateMutability: "nonpayable"
7432
+ },
7433
+ {
7434
+ type: "function",
7435
+ name: "setMinDepositAmount",
7436
+ inputs: [
7437
+ {
7438
+ name: "asset",
7439
+ type: "address",
7440
+ internalType: "contract ERC20"
7441
+ },
7442
+ { name: "minAmount", type: "uint256", internalType: "uint256" }
7443
+ ],
7444
+ outputs: [],
7445
+ stateMutability: "nonpayable"
7446
+ },
7447
+ {
7448
+ type: "function",
7449
+ name: "setPeer",
7450
+ inputs: [
7451
+ { name: "_eid", type: "uint32", internalType: "uint32" },
7452
+ { name: "_peer", type: "bytes32", internalType: "bytes32" }
7453
+ ],
7454
+ outputs: [],
7455
+ stateMutability: "nonpayable"
7456
+ },
7457
+ {
7458
+ type: "function",
7459
+ name: "setShareLockPeriod",
7460
+ inputs: [
7461
+ {
7462
+ name: "_shareLockPeriod",
7463
+ type: "uint64",
7464
+ internalType: "uint64"
7465
+ }
7466
+ ],
7467
+ outputs: [],
7468
+ stateMutability: "nonpayable"
7469
+ },
7470
+ {
7471
+ type: "function",
7472
+ name: "shareLockPeriod",
7473
+ inputs: [],
7474
+ outputs: [{ name: "", type: "uint64", internalType: "uint64" }],
7475
+ stateMutability: "view"
7476
+ },
7477
+ {
7478
+ type: "function",
7479
+ name: "shareLockers",
7480
+ inputs: [
7481
+ { name: "", type: "address", internalType: "address" },
7482
+ { name: "", type: "uint256", internalType: "uint256" }
7483
+ ],
7484
+ outputs: [
7485
+ { name: "amount", type: "uint256", internalType: "uint256" },
7486
+ { name: "unlockTime", type: "uint64", internalType: "uint64" }
7487
+ ],
7488
+ stateMutability: "view"
7489
+ },
7490
+ {
7491
+ type: "function",
7492
+ name: "stopMessagesFromChain",
7493
+ inputs: [
7494
+ { name: "chainSelector", type: "uint32", internalType: "uint32" }
7495
+ ],
7496
+ outputs: [],
7497
+ stateMutability: "nonpayable"
7498
+ },
7499
+ {
7500
+ type: "function",
7501
+ name: "stopMessagesToChain",
7502
+ inputs: [
7503
+ { name: "chainSelector", type: "uint32", internalType: "uint32" }
7504
+ ],
7505
+ outputs: [],
7506
+ stateMutability: "nonpayable"
7507
+ },
7508
+ {
7509
+ type: "function",
7510
+ name: "transferOwnership",
7511
+ inputs: [
7512
+ { name: "newOwner", type: "address", internalType: "address" }
7513
+ ],
7514
+ outputs: [],
7515
+ stateMutability: "nonpayable"
7516
+ },
7517
+ {
7518
+ type: "function",
7519
+ name: "unpause",
7520
+ inputs: [],
7521
+ outputs: [],
7522
+ stateMutability: "nonpayable"
7523
+ },
7524
+ {
7525
+ type: "function",
7526
+ name: "vault",
7527
+ inputs: [],
7528
+ outputs: [
7529
+ {
7530
+ name: "",
7531
+ type: "address",
7532
+ internalType: "contract BoringVault"
7533
+ }
7534
+ ],
7535
+ stateMutability: "view"
7536
+ },
7537
+ {
7538
+ type: "event",
7539
+ name: "AssetAdded",
7540
+ inputs: [
7541
+ {
7542
+ name: "asset",
7543
+ type: "address",
7544
+ indexed: true,
7545
+ internalType: "address"
7546
+ }
7547
+ ],
7548
+ anonymous: false
7549
+ },
7550
+ {
7551
+ type: "event",
7552
+ name: "AssetRemoved",
7553
+ inputs: [
7554
+ {
7555
+ name: "asset",
7556
+ type: "address",
7557
+ indexed: true,
7558
+ internalType: "address"
7559
+ }
7560
+ ],
7561
+ anonymous: false
7562
+ },
7563
+ {
7564
+ type: "event",
7565
+ name: "AuthorityUpdated",
7566
+ inputs: [
7567
+ {
7568
+ name: "user",
7569
+ type: "address",
7570
+ indexed: true,
7571
+ internalType: "address"
7572
+ },
7573
+ {
7574
+ name: "newAuthority",
7575
+ type: "address",
7576
+ indexed: true,
7577
+ internalType: "contract Authority"
7578
+ }
7579
+ ],
7580
+ anonymous: false
7581
+ },
7582
+ {
7583
+ type: "event",
7584
+ name: "BulkDeposit",
7585
+ inputs: [
7586
+ {
7587
+ name: "asset",
7588
+ type: "address",
7589
+ indexed: true,
7590
+ internalType: "address"
7591
+ },
7592
+ {
7593
+ name: "depositAmount",
7594
+ type: "uint256",
7595
+ indexed: true,
7596
+ internalType: "uint256"
7597
+ }
7598
+ ],
7599
+ anonymous: false
7600
+ },
7601
+ {
7602
+ type: "event",
7603
+ name: "BulkWithdraw",
7604
+ inputs: [
7605
+ {
7606
+ name: "asset",
7607
+ type: "address",
7608
+ indexed: true,
7609
+ internalType: "address"
7610
+ },
7611
+ {
7612
+ name: "shareAmount",
7613
+ type: "uint256",
7614
+ indexed: true,
7615
+ internalType: "uint256"
7616
+ }
7617
+ ],
7618
+ anonymous: false
7619
+ },
7620
+ {
7621
+ type: "event",
7622
+ name: "ChainAdded",
7623
+ inputs: [
7624
+ {
7625
+ name: "chainSelector",
7626
+ type: "uint256",
7627
+ indexed: true,
7628
+ internalType: "uint256"
7629
+ },
7630
+ {
7631
+ name: "allowMessagesFrom",
7632
+ type: "bool",
7633
+ indexed: false,
7634
+ internalType: "bool"
7635
+ },
7636
+ {
7637
+ name: "allowMessagesTo",
7638
+ type: "bool",
7639
+ indexed: false,
7640
+ internalType: "bool"
7641
+ },
7642
+ {
7643
+ name: "targetTeller",
7644
+ type: "address",
7645
+ indexed: true,
7646
+ internalType: "address"
7647
+ },
7648
+ {
7649
+ name: "messageGasLimit",
7650
+ type: "uint64",
7651
+ indexed: true,
7652
+ internalType: "uint64"
7653
+ },
7654
+ {
7655
+ name: "messageGasMin",
7656
+ type: "uint64",
7657
+ indexed: false,
7658
+ internalType: "uint64"
7659
+ }
7660
+ ],
7661
+ anonymous: false
7662
+ },
7663
+ {
7664
+ type: "event",
7665
+ name: "ChainAllowMessagesFrom",
7666
+ inputs: [
7667
+ {
7668
+ name: "chainSelector",
7669
+ type: "uint256",
7670
+ indexed: true,
7671
+ internalType: "uint256"
7672
+ },
7673
+ {
7674
+ name: "targetTeller",
7675
+ type: "address",
7676
+ indexed: true,
7677
+ internalType: "address"
7678
+ }
7679
+ ],
7680
+ anonymous: false
7681
+ },
7682
+ {
7683
+ type: "event",
7684
+ name: "ChainAllowMessagesTo",
7685
+ inputs: [
7686
+ {
7687
+ name: "chainSelector",
7688
+ type: "uint256",
7689
+ indexed: true,
7690
+ internalType: "uint256"
7691
+ },
7692
+ {
7693
+ name: "targetTeller",
7694
+ type: "address",
7695
+ indexed: true,
7696
+ internalType: "address"
7697
+ }
7698
+ ],
7699
+ anonymous: false
7700
+ },
7701
+ {
7702
+ type: "event",
7703
+ name: "ChainRemoved",
7704
+ inputs: [
7705
+ {
7706
+ name: "chainSelector",
7707
+ type: "uint256",
7708
+ indexed: true,
7709
+ internalType: "uint256"
7710
+ }
7711
+ ],
7712
+ anonymous: false
7713
+ },
7714
+ {
7715
+ type: "event",
7716
+ name: "ChainSetGasLimit",
7717
+ inputs: [
7718
+ {
7719
+ name: "chainSelector",
7720
+ type: "uint256",
7721
+ indexed: true,
7722
+ internalType: "uint256"
7723
+ },
7724
+ {
7725
+ name: "messageGasLimit",
7726
+ type: "uint64",
7727
+ indexed: true,
7728
+ internalType: "uint64"
7729
+ }
7730
+ ],
7731
+ anonymous: false
7732
+ },
7733
+ {
7734
+ type: "event",
7735
+ name: "ChainStopMessagesFrom",
7736
+ inputs: [
7737
+ {
7738
+ name: "chainSelector",
7739
+ type: "uint256",
7740
+ indexed: true,
7741
+ internalType: "uint256"
7742
+ }
7743
+ ],
7744
+ anonymous: false
7745
+ },
7746
+ {
7747
+ type: "event",
7748
+ name: "ChainStopMessagesTo",
7749
+ inputs: [
7750
+ {
7751
+ name: "chainSelector",
7752
+ type: "uint256",
7753
+ indexed: true,
7754
+ internalType: "uint256"
7755
+ }
7756
+ ],
7757
+ anonymous: false
7758
+ },
7759
+ {
7760
+ type: "event",
7761
+ name: "Deposit",
7762
+ inputs: [
7763
+ {
7764
+ name: "nonce",
7765
+ type: "uint256",
7766
+ indexed: true,
7767
+ internalType: "uint256"
7768
+ },
7769
+ {
7770
+ name: "receiver",
7771
+ type: "address",
7772
+ indexed: true,
7773
+ internalType: "address"
7774
+ },
7775
+ {
7776
+ name: "depositAsset",
7777
+ type: "address",
7778
+ indexed: true,
7779
+ internalType: "address"
7780
+ },
7781
+ {
7782
+ name: "depositAmount",
7783
+ type: "uint256",
7784
+ indexed: false,
7785
+ internalType: "uint256"
7786
+ },
7787
+ {
7788
+ name: "shareAmount",
7789
+ type: "uint256",
7790
+ indexed: false,
7791
+ internalType: "uint256"
7792
+ },
7793
+ {
7794
+ name: "depositTimestamp",
7795
+ type: "uint256",
7796
+ indexed: false,
7797
+ internalType: "uint256"
7798
+ },
7799
+ {
7800
+ name: "shareLockPeriodAtTimeOfDeposit",
7801
+ type: "uint256",
7802
+ indexed: false,
7803
+ internalType: "uint256"
7804
+ }
7805
+ ],
7806
+ anonymous: false
7807
+ },
7808
+ {
7809
+ type: "event",
7810
+ name: "DepositRefunded",
7811
+ inputs: [
7812
+ {
7813
+ name: "nonce",
7814
+ type: "uint256",
7815
+ indexed: true,
7816
+ internalType: "uint256"
7817
+ },
7818
+ {
7819
+ name: "depositHash",
7820
+ type: "bytes32",
7821
+ indexed: false,
7822
+ internalType: "bytes32"
7823
+ },
7824
+ {
7825
+ name: "user",
7826
+ type: "address",
7827
+ indexed: true,
7828
+ internalType: "address"
7829
+ }
7830
+ ],
7831
+ anonymous: false
7832
+ },
7833
+ {
7834
+ type: "event",
7835
+ name: "MessageReceived",
7836
+ inputs: [
7837
+ {
7838
+ name: "messageId",
7839
+ type: "bytes32",
7840
+ indexed: false,
7841
+ internalType: "bytes32"
7842
+ },
7843
+ {
7844
+ name: "shareAmount",
7845
+ type: "uint256",
7846
+ indexed: true,
7847
+ internalType: "uint256"
7848
+ },
7849
+ {
7850
+ name: "to",
7851
+ type: "bytes32",
7852
+ indexed: true,
7853
+ internalType: "bytes32"
7854
+ }
7855
+ ],
7856
+ anonymous: false
7857
+ },
7858
+ {
7859
+ type: "event",
7860
+ name: "MessageSent",
7861
+ inputs: [
7862
+ {
7863
+ name: "messageId",
7864
+ type: "bytes32",
7865
+ indexed: false,
7866
+ internalType: "bytes32"
7867
+ },
7868
+ {
7869
+ name: "shareAmount",
7870
+ type: "uint256",
7871
+ indexed: true,
7872
+ internalType: "uint256"
7873
+ },
7874
+ {
7875
+ name: "to",
7876
+ type: "bytes32",
7877
+ indexed: true,
7878
+ internalType: "bytes32"
7879
+ }
7880
+ ],
7881
+ anonymous: false
7882
+ },
7883
+ {
7884
+ type: "event",
7885
+ name: "MinDepositAmountSet",
7886
+ inputs: [
7887
+ {
7888
+ name: "asset",
7889
+ type: "address",
7890
+ indexed: true,
7891
+ internalType: "address"
7892
+ },
7893
+ {
7894
+ name: "minAmount",
7895
+ type: "uint256",
7896
+ indexed: false,
7897
+ internalType: "uint256"
7898
+ }
7899
+ ],
7900
+ anonymous: false
7901
+ },
7902
+ {
7903
+ type: "event",
7904
+ name: "OwnershipTransferred",
7905
+ inputs: [
7906
+ {
7907
+ name: "user",
7908
+ type: "address",
7909
+ indexed: true,
7910
+ internalType: "address"
7911
+ },
7912
+ {
7913
+ name: "newOwner",
7914
+ type: "address",
7915
+ indexed: true,
7916
+ internalType: "address"
7917
+ }
7918
+ ],
7919
+ anonymous: false
7920
+ },
7921
+ { type: "event", name: "Paused", inputs: [], anonymous: false },
7922
+ {
7923
+ type: "event",
7924
+ name: "PeerSet",
7925
+ inputs: [
7926
+ {
7927
+ name: "eid",
7928
+ type: "uint32",
7929
+ indexed: false,
7930
+ internalType: "uint32"
7931
+ },
7932
+ {
7933
+ name: "peer",
7934
+ type: "bytes32",
7935
+ indexed: false,
7936
+ internalType: "bytes32"
7937
+ }
7938
+ ],
7939
+ anonymous: false
7940
+ },
7941
+ { type: "event", name: "Unpaused", inputs: [], anonymous: false },
7942
+ {
7943
+ type: "error",
7944
+ name: "AmountNotDivisible",
7945
+ inputs: [
7946
+ { name: "amount", type: "uint256", internalType: "uint256" }
7947
+ ]
7948
+ },
7949
+ {
7950
+ type: "error",
7951
+ name: "CrossChainTellerBase__AmountTooSmallToBridge",
7952
+ inputs: [
7953
+ { name: "shareAmount", type: "uint256", internalType: "uint256" }
7954
+ ]
7955
+ },
7956
+ { type: "error", name: "InvalidDelegate", inputs: [] },
7957
+ { type: "error", name: "InvalidEndpointCall", inputs: [] },
7958
+ {
7959
+ type: "error",
7960
+ name: "InvalidOptionType",
7961
+ inputs: [
7962
+ { name: "optionType", type: "uint16", internalType: "uint16" }
7963
+ ]
7964
+ },
7965
+ {
7966
+ type: "error",
7967
+ name: "LocalDecimalsTooLow",
7968
+ inputs: [
7969
+ {
7970
+ name: "localDecimals",
7971
+ type: "uint256",
7972
+ internalType: "uint256"
7973
+ }
7974
+ ]
7975
+ },
7976
+ { type: "error", name: "LzTokenUnavailable", inputs: [] },
7977
+ {
7978
+ type: "error",
7979
+ name: "MultiChainLayerZeroTellerWithMultiAssetSupport_InvalidAptosAddressForEVM",
7980
+ inputs: [
7981
+ { name: "receiver", type: "bytes32", internalType: "bytes32" }
7982
+ ]
7983
+ },
7984
+ {
7985
+ type: "error",
7986
+ name: "MultiChainLayerZeroTellerWithMultiAssetSupport_InvalidToken",
7987
+ inputs: []
7988
+ },
7989
+ {
7990
+ type: "error",
7991
+ name: "MultiChainTellerBase_DestinationChainReceiverIsZeroBytes32",
7992
+ inputs: []
7993
+ },
7994
+ {
7995
+ type: "error",
7996
+ name: "MultiChainTellerBase_GasLimitExceeded",
7997
+ inputs: []
7998
+ },
7999
+ { type: "error", name: "MultiChainTellerBase_GasTooLow", inputs: [] },
8000
+ {
8001
+ type: "error",
8002
+ name: "MultiChainTellerBase_MessagesNotAllowedFrom",
8003
+ inputs: [
8004
+ { name: "chainSelector", type: "uint32", internalType: "uint32" }
8005
+ ]
8006
+ },
8007
+ {
8008
+ type: "error",
8009
+ name: "MultiChainTellerBase_MessagesNotAllowedTo",
8010
+ inputs: [
8011
+ {
8012
+ name: "chainSelector",
8013
+ type: "uint256",
8014
+ internalType: "uint256"
8015
+ }
8016
+ ]
8017
+ },
8018
+ {
8019
+ type: "error",
8020
+ name: "MultiChainTellerBase_TargetTellerIsZeroAddress",
8021
+ inputs: []
8022
+ },
8023
+ {
8024
+ type: "error",
8025
+ name: "MultiChainTellerBase_ZeroMessageGasLimit",
8026
+ inputs: []
8027
+ },
8028
+ {
8029
+ type: "error",
8030
+ name: "NoPeer",
8031
+ inputs: [{ name: "eid", type: "uint32", internalType: "uint32" }]
8032
+ },
8033
+ {
8034
+ type: "error",
8035
+ name: "NotEnoughNative",
8036
+ inputs: [
8037
+ { name: "msgValue", type: "uint256", internalType: "uint256" }
8038
+ ]
8039
+ },
8040
+ {
8041
+ type: "error",
8042
+ name: "OnlyEndpoint",
8043
+ inputs: [{ name: "addr", type: "address", internalType: "address" }]
8044
+ },
8045
+ {
8046
+ type: "error",
8047
+ name: "OnlyPeer",
8048
+ inputs: [
8049
+ { name: "eid", type: "uint32", internalType: "uint32" },
8050
+ { name: "sender", type: "bytes32", internalType: "bytes32" }
8051
+ ]
8052
+ },
8053
+ {
8054
+ type: "error",
8055
+ name: "SafeCastOverflowedUintDowncast",
8056
+ inputs: [
8057
+ { name: "bits", type: "uint8", internalType: "uint8" },
8058
+ { name: "value", type: "uint256", internalType: "uint256" }
8059
+ ]
8060
+ },
8061
+ {
8062
+ type: "error",
8063
+ name: "SafeERC20FailedOperation",
8064
+ inputs: [
8065
+ { name: "token", type: "address", internalType: "address" }
8066
+ ]
8067
+ },
8068
+ {
8069
+ type: "error",
8070
+ name: "TellerWithMultiAssetSupport__AssetAlreadySupported",
8071
+ inputs: []
8072
+ },
8073
+ {
8074
+ type: "error",
8075
+ name: "TellerWithMultiAssetSupport__AssetNotSupported",
8076
+ inputs: []
8077
+ },
8078
+ {
8079
+ type: "error",
8080
+ name: "TellerWithMultiAssetSupport__BadDepositHash",
8081
+ inputs: []
8082
+ },
8083
+ {
8084
+ type: "error",
8085
+ name: "TellerWithMultiAssetSupport__DepositBelowMinimum",
8086
+ inputs: []
8087
+ },
8088
+ {
8089
+ type: "error",
8090
+ name: "TellerWithMultiAssetSupport__DepositNotFound",
8091
+ inputs: []
8092
+ },
8093
+ {
8094
+ type: "error",
8095
+ name: "TellerWithMultiAssetSupport__InsufficientUnlockedShares",
8096
+ inputs: [
8097
+ { name: "user", type: "address", internalType: "address" },
8098
+ { name: "requested", type: "uint256", internalType: "uint256" }
8099
+ ]
8100
+ },
8101
+ {
8102
+ type: "error",
8103
+ name: "TellerWithMultiAssetSupport__MinimumAssetsNotMet",
8104
+ inputs: []
8105
+ },
8106
+ {
8107
+ type: "error",
8108
+ name: "TellerWithMultiAssetSupport__MinimumMintNotMet",
8109
+ inputs: []
8110
+ },
8111
+ {
8112
+ type: "error",
8113
+ name: "TellerWithMultiAssetSupport__Paused",
8114
+ inputs: []
8115
+ },
8116
+ {
8117
+ type: "error",
8118
+ name: "TellerWithMultiAssetSupport__PermitFailedAndAllowanceTooLow",
8119
+ inputs: []
8120
+ },
8121
+ {
8122
+ type: "error",
8123
+ name: "TellerWithMultiAssetSupport__ShareLockPeriodTooLong",
8124
+ inputs: []
8125
+ },
8126
+ {
8127
+ type: "error",
8128
+ name: "TellerWithMultiAssetSupport__SharesAreLocked",
8129
+ inputs: []
8130
+ },
8131
+ {
8132
+ type: "error",
8133
+ name: "TellerWithMultiAssetSupport__SharesAreUnLocked",
8134
+ inputs: []
8135
+ },
8136
+ {
8137
+ type: "error",
8138
+ name: "TellerWithMultiAssetSupport__ZeroAssets",
8139
+ inputs: []
8140
+ },
8141
+ {
8142
+ type: "error",
8143
+ name: "TellerWithMultiAssetSupport__ZeroShares",
8144
+ inputs: []
8145
+ },
8146
+ { type: "error", name: "Unauthorized", inputs: [] }
8147
+ ];
8148
+
8149
+ // src/evm/abis/index.ts
8150
+ var AccountantABI = Accountant_default2;
8151
+ var AtomicQueueABI = AtomicQueue_default2;
8152
+ var BoringVaultABI = Vault_default2;
8153
+ var TellerWithMultiAssetSupportABI = Teller_default2;
8154
+ var MultiChainLayerZeroTellerEVMABI = MultiChainLayerZeroTeller_default2;
8155
+
8156
+ // src/common/contracts.ts
8157
+ var CONTRACTS = {
8158
+ accountant: {
8159
+ name: "Accountant",
8160
+ abi: {
8161
+ [ChainType.MoveVM]: AccountantAptosABI,
8162
+ [ChainType.EVM]: AccountantABI
8163
+ },
8164
+ functionSignatures: {
8165
+ [ChainType.MoveVM]: {
8166
+ calculate_shares_from_assets_safe: "{address}::accountant::calculate_shares_from_assets_safe",
8167
+ calculate_assets_from_shares_safe: "{address}::accountant::calculate_assets_from_shares_safe",
8168
+ get_withdraw_rate_in_quote_safe: "{address}::accountant::get_withdraw_rate_in_quote_safe",
8169
+ get_deposit_rate_in_quote_safe: "{address}::accountant::get_deposit_rate_in_quote_safe"
8170
+ },
8171
+ [ChainType.EVM]: {
8172
+ calculate_shares_from_assets_safe: "calculateSharesFromAssetsSafe",
8173
+ calculate_assets_from_shares_safe: "calculateAssetsFromSharesSafe",
8174
+ // EVM contract doesn't have safe functions
8175
+ get_withdraw_rate_in_quote_safe: "getWithdrawRateInQuote",
8176
+ get_deposit_rate_in_quote_safe: "getDepositRateInQuote"
8177
+ }
8178
+ }
8179
+ },
8180
+ teller: {
8181
+ name: "Teller",
8182
+ abi: {
8183
+ [ChainType.MoveVM]: TellerAptosABI,
8184
+ [ChainType.EVM]: TellerWithMultiAssetSupportABI
8185
+ },
8186
+ functionSignatures: {
8187
+ [ChainType.MoveVM]: {
8188
+ deposit: "{address}::teller::deposit",
8189
+ deposit_with_referral: "{address}::teller::deposit_with_referral",
8190
+ deposit_for: "{address}::teller::deposit_for",
8191
+ mint_shares: "{address}::teller::mint_shares",
8192
+ create_withdrawal_request: "{address}::teller::create_withdrawal_request"
8193
+ },
8194
+ [ChainType.EVM]: {
8195
+ deposit: "deposit",
8196
+ deposit_with_referral: "depositWithReferral",
8197
+ deposit_for: "depositFor",
8198
+ mint_shares: "mintShares",
8199
+ create_withdrawal_request: "createWithdrawalRequest"
8200
+ }
8201
+ }
8202
+ },
8203
+ atomicQueue: {
8204
+ name: "AtomicQueue",
8205
+ abi: {
8206
+ [ChainType.MoveVM]: AtomicQueueAptosABI,
8207
+ [ChainType.EVM]: AtomicQueueABI
8208
+ },
8209
+ functionSignatures: {
8210
+ [ChainType.MoveVM]: {
8211
+ get_minimum_request_age: "{address}::atomic_queue::get_minimum_request_age",
8212
+ get_all_atomic_requests: "{address}::atomic_queue::get_all_atomic_requests",
8213
+ get_request_update_cooldown: "{address}::atomic_queue::get_request_update_cooldown",
8214
+ get_request_updated_at: "{address}::atomic_queue::get_request_updated_at",
8215
+ get_user_atomic_request: "{address}::atomic_queue::get_user_atomic_request",
8216
+ get_user_atomic_requests: "{address}::atomic_queue::get_user_atomic_requests",
8217
+ is_atomic_request_valid: "{address}::atomic_queue::is_atomic_request_valid",
8218
+ is_paused: "{address}::atomic_queue::is_paused",
8219
+ update_atomic_request: "{address}::atomic_queue::update_atomic_request",
8220
+ cancel_atomic_request: "{address}::atomic_queue::cancel_atomic_request",
8221
+ cancel_withdrawal_request: "{address}::atomic_queue::cancel_atomic_request"
8222
+ },
8223
+ [ChainType.EVM]: {
8224
+ get_minimum_request_age: "minimumRequestAge",
8225
+ cancel_atomic_request: "cancelAtomicRequest",
8226
+ update_atomic_request: "updateAtomicRequest",
8227
+ get_request_updated_at: "getRequestUpdatedAt",
8228
+ get_user_atomic_requests: "getUserAtomicRequests",
8229
+ get_all_atomic_requests: "getAtomicRequests",
8230
+ // Private functions
8231
+ view_solve_metadata: "viewSolveMetaData"
8232
+ }
8233
+ }
8234
+ },
8235
+ vault: {
8236
+ name: "Vault",
6755
8237
  abi: {
6756
- [ChainType.MoveVM]: Vault_default,
6757
- [ChainType.EVM]: Vault_default2
8238
+ [ChainType.MoveVM]: VaultAptosABI,
8239
+ [ChainType.EVM]: BoringVaultABI
6758
8240
  },
6759
8241
  functionSignatures: {
6760
8242
  [ChainType.MoveVM]: {
@@ -6768,6 +8250,23 @@ var CONTRACTS = {
6768
8250
  get_total_shares: "totalShares"
6769
8251
  }
6770
8252
  }
8253
+ },
8254
+ multiChainLzTeller: {
8255
+ name: "MultiChainLayerZeroTeller",
8256
+ abi: {
8257
+ [ChainType.MoveVM]: MultiChainLayerZeroTellerAptosABI,
8258
+ [ChainType.EVM]: MultiChainLayerZeroTellerEVMABI
8259
+ },
8260
+ functionSignatures: {
8261
+ [ChainType.MoveVM]: {
8262
+ quote_bridge: "{address}::multi_chain_lz_teller::quote_bridge",
8263
+ bridge: "{address}::multi_chain_lz_teller::bridge"
8264
+ },
8265
+ [ChainType.EVM]: {
8266
+ preview_fee: "previewFee",
8267
+ bridge: "bridge"
8268
+ }
8269
+ }
6771
8270
  }
6772
8271
  };
6773
8272
  function getFunctionSignature(type, contractName, functionName, contractAddress) {
@@ -6799,6 +8298,22 @@ function getContractABI(type, contractName) {
6799
8298
  console.warn(`ABI for ${contractName} on ${type} is missing`);
6800
8299
  return [];
6801
8300
  }
8301
+ if (type === ChainType.MoveVM) {
8302
+ const aptosAbi = abi;
8303
+ const signatures = contract.functionSignatures[ChainType.MoveVM] || {};
8304
+ const usedFunctionNames = new Set(
8305
+ Object.values(signatures).map((sig) => sig?.split("::").pop())
8306
+ );
8307
+ return {
8308
+ ...aptosAbi,
8309
+ exposed_functions: aptosAbi.exposed_functions.filter(
8310
+ (fn) => usedFunctionNames.has(fn.name)
8311
+ ),
8312
+ // For now, keep all structs as they might be needed for type decoding
8313
+ // but we could also filter them based on usage in functions
8314
+ structs: aptosAbi.structs
8315
+ };
8316
+ }
6802
8317
  return abi;
6803
8318
  }
6804
8319
 
@@ -6857,7 +8372,7 @@ var AptosChainAdapter = class extends BaseChainAdapter {
6857
8372
  typeArguments: params.typeArguments || [],
6858
8373
  functionArguments: params.arguments || []
6859
8374
  };
6860
- const [result] = await this.getClient().view({
8375
+ const result = await this.getClient().view({
6861
8376
  payload
6862
8377
  });
6863
8378
  return result;
@@ -6960,7 +8475,7 @@ var AptosChainAdapter = class extends BaseChainAdapter {
6960
8475
  "accountant",
6961
8476
  "get_withdraw_rate_in_quote_safe"
6962
8477
  );
6963
- const result = await this.viewContract({
8478
+ const [result] = await this.viewContract({
6964
8479
  address: this.getContractAddress("accountant"),
6965
8480
  function: functionSignature,
6966
8481
  arguments: [args.vault, args.quoteAsset],
@@ -6973,7 +8488,7 @@ var AptosChainAdapter = class extends BaseChainAdapter {
6973
8488
  "accountant",
6974
8489
  "get_deposit_rate_in_quote_safe"
6975
8490
  );
6976
- const result = await this.viewContract({
8491
+ const [result] = await this.viewContract({
6977
8492
  address: this.getContractAddress("accountant"),
6978
8493
  function: functionSignature,
6979
8494
  arguments: [args.vault, args.quoteAsset],
@@ -6990,7 +8505,7 @@ var AptosChainAdapter = class extends BaseChainAdapter {
6990
8505
  "accountant",
6991
8506
  "calculate_shares_from_assets_safe"
6992
8507
  );
6993
- const result = await this.viewContract({
8508
+ const [result] = await this.viewContract({
6994
8509
  address: this.getContractAddress("accountant"),
6995
8510
  function: functionSignature,
6996
8511
  arguments: [vault, asset, amount],
@@ -7007,7 +8522,7 @@ var AptosChainAdapter = class extends BaseChainAdapter {
7007
8522
  "accountant",
7008
8523
  "calculate_assets_from_shares_safe"
7009
8524
  );
7010
- const result = await this.viewContract({
8525
+ const [result] = await this.viewContract({
7011
8526
  address: this.getContractAddress("accountant"),
7012
8527
  function: functionSignature,
7013
8528
  arguments: [vault, wantAsset, amount],
@@ -7015,6 +8530,110 @@ var AptosChainAdapter = class extends BaseChainAdapter {
7015
8530
  });
7016
8531
  return result;
7017
8532
  }
8533
+ async quoteBridge({
8534
+ vault,
8535
+ amount,
8536
+ destinationChain,
8537
+ recipient
8538
+ }) {
8539
+ invariant(vault, "vault address is required for bridging");
8540
+ const contractAddresses = this.getContractAddresses();
8541
+ const lzTellerAddress = contractAddresses.multiChainLzTeller;
8542
+ if (!lzTellerAddress) {
8543
+ throw new Error(
8544
+ "Vault does not support bridging. multiChainLzTeller contract address not configured."
8545
+ );
8546
+ }
8547
+ const config = getChainConfig(this.chain.id);
8548
+ const functionSignature = getFunctionSignature(
8549
+ config.type,
8550
+ "multiChainLzTeller",
8551
+ "quote_bridge",
8552
+ lzTellerAddress
8553
+ );
8554
+ const gasLimit = getLayerZeroGasLimit(this.chain.id, destinationChain);
8555
+ const options = Options.newOptions().addExecutorLzReceiveOption(gasLimit);
8556
+ const extraOptions = options.toBytes();
8557
+ const payInZro = false;
8558
+ const dstEid = getLayerZeroEndpointId(destinationChain);
8559
+ const recipientBytes = this.addressToBytes(recipient);
8560
+ const [nativeFee] = await this.viewContract({
8561
+ address: lzTellerAddress,
8562
+ function: functionSignature,
8563
+ arguments: [
8564
+ vault,
8565
+ dstEid,
8566
+ amount,
8567
+ recipientBytes,
8568
+ extraOptions,
8569
+ payInZro
8570
+ ],
8571
+ abi: getContractABI(config.type, "multiChainLzTeller")
8572
+ });
8573
+ return {
8574
+ fee: nativeFee,
8575
+ feeTokenAddress: APTOS_COIN,
8576
+ method: "LayerZero",
8577
+ estimatedTime: getEstimatedBridgeTime(this.chain.id, destinationChain),
8578
+ extraOptions,
8579
+ // Pay only with native (payInZro = false)
8580
+ zroFee: "0"
8581
+ };
8582
+ }
8583
+ async buildBridgeTx(args) {
8584
+ invariant(args.vault, "vault address is required for bridging");
8585
+ const contractAddresses = this.getContractAddresses();
8586
+ const lzTellerAddress = contractAddresses.multiChainLzTeller;
8587
+ invariant(
8588
+ lzTellerAddress,
8589
+ "Vault does not support bridging. multiChainLzTeller contract address not configured."
8590
+ );
8591
+ const config = getChainConfig(this.chain.id);
8592
+ const functionSignature = getFunctionSignature(
8593
+ config.type,
8594
+ "multiChainLzTeller",
8595
+ "bridge",
8596
+ lzTellerAddress
8597
+ );
8598
+ const dstEid = getLayerZeroEndpointId(args.destinationChain);
8599
+ const recipientBytes = this.addressToBytes(args.recipient.toLowerCase());
8600
+ const extraOptions = args.extraOptions;
8601
+ const zroFee = BigInt(args.zroFee);
8602
+ return await this.buildPayload({
8603
+ to: lzTellerAddress,
8604
+ function: functionSignature,
8605
+ arguments: [
8606
+ args.vault,
8607
+ dstEid,
8608
+ recipientBytes,
8609
+ args.amount,
8610
+ args.fee,
8611
+ zroFee,
8612
+ extraOptions
8613
+ ],
8614
+ abi: getContractABI(config.type, "multiChainLzTeller")
8615
+ });
8616
+ }
8617
+ /**
8618
+ * Convert address to 32-byte format for LayerZero
8619
+ * - EVM addresses (20 bytes): pad with 12 leading zero bytes
8620
+ * - Aptos addresses (32 or 66 hex chars): use as-is
8621
+ */
8622
+ addressToBytes(address) {
8623
+ const cleanAddress = address.replace("0x", "").toLowerCase();
8624
+ if (cleanAddress.length === 40) {
8625
+ const padded = "0".repeat(24) + cleanAddress;
8626
+ return this.hexToBytes(padded);
8627
+ }
8628
+ if (cleanAddress.length === 64) {
8629
+ return this.hexToBytes(cleanAddress);
8630
+ }
8631
+ throw new Error(`Invalid address format: ${address}`);
8632
+ }
8633
+ /** Convert hex string to Uint8Array */
8634
+ hexToBytes(hex) {
8635
+ return Hex.fromHexString(hex).toUint8Array();
8636
+ }
7018
8637
  async buildDepositTx(args) {
7019
8638
  const functionSignature = this.getFunctionSignature("teller", "deposit");
7020
8639
  return await this.buildPayload({
@@ -7134,21 +8753,6 @@ import {
7134
8753
  PyxisUtils as PyxisUtils2
7135
8754
  } from "@pyxisjs/core";
7136
8755
 
7137
- // ../../node_modules/.pnpm/tiny-invariant@1.3.3/node_modules/tiny-invariant/dist/esm/tiny-invariant.js
7138
- var isProduction = process.env.NODE_ENV === "production";
7139
- var prefix = "Invariant failed";
7140
- function invariant(condition, message) {
7141
- if (condition) {
7142
- return;
7143
- }
7144
- if (isProduction) {
7145
- throw new Error(prefix);
7146
- }
7147
- var provided = typeof message === "function" ? message() : message;
7148
- var value = provided ? "".concat(prefix, ": ").concat(provided) : prefix;
7149
- throw new Error(value);
7150
- }
7151
-
7152
8756
  // src/aptos/analytics-utils.ts
7153
8757
  var apyWindowDaysMap = {
7154
8758
  "7d": 7,
@@ -7430,15 +9034,24 @@ var AptosAnalyticsClient = class {
7430
9034
  };
7431
9035
 
7432
9036
  // src/evm/adapter.ts
9037
+ var import_dayjs2 = __toESM(require_dayjs_min());
9038
+ import { Options as Options2 } from "@layerzerolabs/lz-v2-utilities";
7433
9039
  import {
7434
9040
  BaseChainAdapter as BaseChainAdapter3,
9041
+ BridgeMethod,
7435
9042
  ChainId,
7436
- getChainConfig as getChainConfig3
9043
+ PyxisUtils as PyxisUtils3,
9044
+ getChainConfig as getChainConfig3,
9045
+ getEstimatedBridgeTime as getEstimatedBridgeTime2,
9046
+ getLayerZeroEndpointId as getLayerZeroEndpointId2,
9047
+ getLayerZeroGasLimit as getLayerZeroGasLimit2
7437
9048
  } from "@pyxisjs/core";
7438
9049
  import {
7439
9050
  createPublicClient,
7440
9051
  erc20Abi,
7441
- http
9052
+ ethAddress,
9053
+ http,
9054
+ zeroAddress
7442
9055
  } from "viem";
7443
9056
  import { arbitrum, mainnet, sepolia } from "viem/chains";
7444
9057
  var viemChainMap = {
@@ -7671,6 +9284,85 @@ var EthereumChainAdapter = class extends BaseChainAdapter3 {
7671
9284
  });
7672
9285
  return result.toString();
7673
9286
  }
9287
+ async quoteBridge({
9288
+ vault,
9289
+ amount,
9290
+ destinationChain,
9291
+ recipient
9292
+ }) {
9293
+ invariant(vault, "vault address is required for bridging");
9294
+ const contractAddresses = this.getContractAddresses();
9295
+ const lzTellerAddress = contractAddresses.multiChainLzTeller;
9296
+ invariant(
9297
+ lzTellerAddress,
9298
+ "multiChainLzTeller contract address not configured."
9299
+ );
9300
+ const dstEid = getLayerZeroEndpointId2(destinationChain);
9301
+ const config = getChainConfig3(this.chain.id);
9302
+ const functionSignature = getFunctionSignature(
9303
+ config.type,
9304
+ "multiChainLzTeller",
9305
+ "preview_fee",
9306
+ lzTellerAddress
9307
+ );
9308
+ const bridgeData = {
9309
+ chainSelector: dstEid,
9310
+ destinationChainReceiver: recipient,
9311
+ messageGas: getLayerZeroGasLimit2(this.chain.id, destinationChain),
9312
+ bridgeFeeToken: ethAddress,
9313
+ data: "0x"
9314
+ // Empty extra data
9315
+ };
9316
+ const result = await this.viewContract({
9317
+ address: lzTellerAddress,
9318
+ function: functionSignature,
9319
+ arguments: [amount, bridgeData],
9320
+ abi: getContractABI(config.type, "multiChainLzTeller")
9321
+ });
9322
+ return {
9323
+ fee: result.toString(),
9324
+ feeTokenAddress: zeroAddress,
9325
+ method: BridgeMethod.LayerZero,
9326
+ estimatedTime: getEstimatedBridgeTime2(this.chain.id, destinationChain),
9327
+ extraOptions: Options2.newOptions().addExecutorLzReceiveOption(
9328
+ getLayerZeroGasLimit2(this.chain.id, destinationChain)
9329
+ ).toBytes(),
9330
+ zroFee: "0"
9331
+ };
9332
+ }
9333
+ async buildBridgeTx(args) {
9334
+ invariant(args.vault, "vault address is required for bridging");
9335
+ const contractAddresses = this.getContractAddresses();
9336
+ const lzTellerAddress = contractAddresses.multiChainLzTeller;
9337
+ invariant(
9338
+ lzTellerAddress,
9339
+ "Vault does not support bridging. multiChainLzTeller contract address not configured."
9340
+ );
9341
+ const config = getChainConfig3(this.chain.id);
9342
+ const functionSignature = getFunctionSignature(
9343
+ config.type,
9344
+ "multiChainLzTeller",
9345
+ "bridge",
9346
+ lzTellerAddress
9347
+ );
9348
+ const dstEid = getLayerZeroEndpointId2(args.destinationChain);
9349
+ const extraOptionsHex = "0x" + Buffer.from(args.extraOptions).toString("hex");
9350
+ const bridgeData = {
9351
+ chainSelector: dstEid,
9352
+ messageGas: getLayerZeroGasLimit2(this.chain.id, args.destinationChain),
9353
+ destinationChainReceiver: args.recipient,
9354
+ bridgeFeeToken: ethAddress,
9355
+ data: extraOptionsHex
9356
+ };
9357
+ const payload = await this.buildPayload({
9358
+ to: lzTellerAddress,
9359
+ function: functionSignature,
9360
+ arguments: [args.amount, bridgeData],
9361
+ abi: getContractABI(config.type, "multiChainLzTeller"),
9362
+ value: args.fee
9363
+ });
9364
+ return payload;
9365
+ }
7674
9366
  async buildDepositTx(args) {
7675
9367
  const functionSignature = this.getFunctionSignature("teller", "deposit");
7676
9368
  const tellerAddress = this.getContractAddress("teller");
@@ -7707,11 +9399,18 @@ var EthereumChainAdapter = class extends BaseChainAdapter3 {
7707
9399
  to: this.getContractAddress("atomicQueue"),
7708
9400
  function: functionSignature,
7709
9401
  arguments: [
7710
- args.offerAsset,
7711
- args.wantAsset,
7712
- args.offerAmount,
7713
- args.price,
7714
- args.deadline
9402
+ [
9403
+ args.user,
9404
+ args.offerAsset,
9405
+ args.wantAsset,
9406
+ Number(args.deadline),
9407
+ Number(args.price),
9408
+ Number(args.offerAmount),
9409
+ false,
9410
+ // inSolve: Default false
9411
+ (0, import_dayjs2.default)().unix()
9412
+ // UpdatedAt: current unix timestamp
9413
+ ]
7715
9414
  ],
7716
9415
  abi
7717
9416
  });
@@ -7719,7 +9418,7 @@ var EthereumChainAdapter = class extends BaseChainAdapter3 {
7719
9418
  async buildReclaimWithdrawalRequestTx(args) {
7720
9419
  const functionSignature = this.getFunctionSignature(
7721
9420
  "atomicQueue",
7722
- "reclaim_withdrawal_request"
9421
+ "cancel_atomic_request"
7723
9422
  );
7724
9423
  const abi = this.getContractABI("atomicQueue");
7725
9424
  return await this.buildPayload({
@@ -7732,7 +9431,7 @@ var EthereumChainAdapter = class extends BaseChainAdapter3 {
7732
9431
  async buildCancelWithdrawalRequestTx(args) {
7733
9432
  const functionSignature = this.getFunctionSignature(
7734
9433
  "atomicQueue",
7735
- "cancel_withdrawal_request"
9434
+ "cancel_atomic_request"
7736
9435
  );
7737
9436
  const abi = this.getContractABI("atomicQueue");
7738
9437
  return await this.buildPayload({
@@ -7742,7 +9441,7 @@ var EthereumChainAdapter = class extends BaseChainAdapter3 {
7742
9441
  abi
7743
9442
  });
7744
9443
  }
7745
- async getMinimumRequestAge(args) {
9444
+ async getMinimumRequestAge(_args) {
7746
9445
  const functionSignature = this.getFunctionSignature(
7747
9446
  "atomicQueue",
7748
9447
  "get_minimum_request_age"
@@ -7750,28 +9449,87 @@ var EthereumChainAdapter = class extends BaseChainAdapter3 {
7750
9449
  const result = await this.viewContract({
7751
9450
  address: this.getContractAddress("atomicQueue"),
7752
9451
  function: functionSignature,
7753
- arguments: [args.vault],
9452
+ arguments: [],
7754
9453
  abi: this.getContractABI("atomicQueue")
7755
9454
  });
7756
9455
  return Number(result);
7757
9456
  }
7758
- async getUserWithdrawalRequests(_args) {
7759
- return [];
9457
+ async getUserWithdrawalRequests({
9458
+ userAddress,
9459
+ flag,
9460
+ matchAll
9461
+ }) {
9462
+ const requestFlag = PyxisUtils3.buildRequestFlags(flag);
9463
+ const getAllWithdrawalRequestFn = this.getFunctionSignature(
9464
+ "atomicQueue",
9465
+ "get_all_atomic_requests"
9466
+ );
9467
+ const withdrawalRequests = await this.viewContract({
9468
+ address: this.getContractAddress("atomicQueue"),
9469
+ function: getAllWithdrawalRequestFn,
9470
+ arguments: [0, Number.MAX_SAFE_INTEGER, requestFlag, matchAll],
9471
+ abi: this.getContractABI("atomicQueue")
9472
+ });
9473
+ const userRequests = withdrawalRequests.filter(
9474
+ (request) => request.user === userAddress
9475
+ );
9476
+ return Promise.all(
9477
+ userRequests.map((request) => this.mapEVMWithdrawalRequest(request))
9478
+ );
9479
+ }
9480
+ async mapEVMWithdrawalRequest(request) {
9481
+ const solveData = await this.viewSolveData({
9482
+ offerAsset: request.offerToken,
9483
+ wantAsset: request.wantToken,
9484
+ user: request.user
9485
+ });
9486
+ return {
9487
+ atomicPrice: request.atomicPrice,
9488
+ deadline: request.deadline,
9489
+ flags: PyxisUtils3.parseRequestFlags(solveData.flags),
9490
+ offerAmount: request.offerAmount,
9491
+ offerToken: request.offerToken,
9492
+ userAddress: request.user,
9493
+ wantToken: request.wantToken,
9494
+ wantAmount: String(solveData.assetsForWant),
9495
+ updatedAt: request.updatedAt
9496
+ };
9497
+ }
9498
+ async viewSolveData({
9499
+ offerAsset,
9500
+ wantAsset,
9501
+ user
9502
+ }) {
9503
+ const functionSignature = this.getFunctionSignature(
9504
+ "atomicQueue",
9505
+ "view_solve_metadata"
9506
+ );
9507
+ const [requestMetadata] = await this.viewContract({
9508
+ address: this.getContractAddress("atomicQueue"),
9509
+ function: functionSignature,
9510
+ arguments: [offerAsset, wantAsset, [user]],
9511
+ abi: this.getContractABI("atomicQueue")
9512
+ });
9513
+ if (!requestMetadata[0]) {
9514
+ throw new Error("Solve metadata not found");
9515
+ }
9516
+ return requestMetadata[0];
7760
9517
  }
7761
9518
  };
7762
9519
  export {
7763
- Accountant_default2 as AccountantABI,
7764
- Accountant_default as AccountantAptosABI,
9520
+ AccountantABI,
9521
+ AccountantAptosABI,
7765
9522
  AptosAnalyticsClient,
7766
9523
  AptosChainAdapter,
7767
- AtomicQueue_default2 as AtomicQueueABI,
7768
- AtomicQueue_default as AtomicQueueAptosABI,
7769
- Vault_default2 as BoringVaultABI,
9524
+ AtomicQueueABI,
9525
+ AtomicQueueAptosABI,
9526
+ BoringVaultABI,
7770
9527
  CONTRACTS,
7771
9528
  EthereumChainAdapter,
7772
- Teller_default as TellerAptosABI,
7773
- Teller_default2 as TellerWithMultiAssetSupportABI,
7774
- Vault_default as VaultAptosABI,
9529
+ MultiChainLayerZeroTellerAptosABI,
9530
+ TellerAptosABI,
9531
+ TellerWithMultiAssetSupportABI,
9532
+ VaultAptosABI,
7775
9533
  getContractABI,
7776
9534
  getFunctionSignature,
7777
9535
  mapIndexerToVaultActivity