@pyxisjs/chains 0.2.3 → 0.2.5

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