@haechi-labs/face-types
Advanced tools
Comparing version 1.12.5 to 1.12.12
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("ethers");var r;exports.Network=void 0,(r=exports.Network||(exports.Network={})).ETHEREUM="ethereum",r.ROPSTEN="ropsten",r.SEPOLIA="sepolia",r.POLYGON="polygon",r.MUMBAI="mumbai",r.TEZOS="tezos",r.GHOSTNET="ghostnet",r.BNB_SMART_CHAIN="bnb_smart_chain",r.BNB_SMART_CHAIN_TESTNET="bnb_smart_chain_testnet",r.KLAYTN="klaytn",r.BAOBAB="baobab",r.SOLANA="solana",r.SOLANA_DEVNET="solana_devnet",r.NEAR="near",r.NEAR_TESTNET="near_testnet",r.BORA="bora",r.BORA_TESTNET="bora_testnet",r.ETH_MAINNET="ethereum",r.ETH_TESTNET="ropsten",r.MATIC_MAINNET="polygon",r.MATIC_TESTNET="mumbai",r.BINANCE_COIN_MAINNET="bnb_smart_chain",r.BINANCE_COIN_TESTNET="bnb_smart_chain_testnet",r.KLAYTN_MAINNET="klaytn",r.KLAYTN_TESTNET="baobab",r.APTOS="aptoslab",r.APTOS_TESTNET="aptoslab_testnet",r.MEVERSE="meverse",r.MEVERSE_TESTNET="meverse_testnet",r.PSM="psm",r.PSM_TESTNET="psm_testnet",r.PSM_TESTNET_TEST="psm_testnet_test",r.PSM_TESTNET_DEV="psm_testnet_dev",r.HOME_VERSE="home_verse",r.HOME_VERSE_TESTNET="home_verse_testnet",r.YOOLDO_VERSE="yooldo_verse",r.SAND_VERSE="sand_verse",r.OASYS="oasys",r.OASYS_TESTNET="oasys_testnet",r.MCH_VERSE="mch_verse",r.MCH_VERSE_TESTNET="mch_verse_testnet",r.HEDERA="hedera",r.HEDERA_TESTNET="hedera_testnet",r.DEFI_VERSE_TESTNET="defi_verse_testnet",r.DEFI_VERSE="defi_verse",r.KROMA="kroma",r.KROMA_SEPOLIA="kroma_sepolia",r.ASM_QA="asm_qa",r.ASM_TEST="asm_test",r.ASM_DEV="asm_dev";const t={[exports.Network.ETHEREUM]:1,[exports.Network.ROPSTEN]:3,[exports.Network.SEPOLIA]:11155111,[exports.Network.POLYGON]:137,[exports.Network.MUMBAI]:80001,[exports.Network.TEZOS]:9999999,[exports.Network.GHOSTNET]:9999998,[exports.Network.BNB_SMART_CHAIN]:56,[exports.Network.BNB_SMART_CHAIN_TESTNET]:97,[exports.Network.KLAYTN]:8217,[exports.Network.BAOBAB]:1001,[exports.Network.SOLANA]:0,[exports.Network.SOLANA_DEVNET]:0,[exports.Network.NEAR]:0,[exports.Network.NEAR_TESTNET]:0,[exports.Network.BORA]:77001,[exports.Network.BORA_TESTNET]:99001,[exports.Network.APTOS]:1,[exports.Network.APTOS_TESTNET]:2,[exports.Network.MEVERSE]:7518,[exports.Network.MEVERSE_TESTNET]:4759,[exports.Network.PSM_TESTNET_DEV]:100,[exports.Network.PSM_TESTNET_TEST]:400,[exports.Network.PSM_TESTNET]:500,[exports.Network.PSM]:91002,[exports.Network.HOME_VERSE]:19011,[exports.Network.HOME_VERSE_TESTNET]:40875,[exports.Network.YOOLDO_VERSE]:411,[exports.Network.SAND_VERSE]:20197,[exports.Network.OASYS]:248,[exports.Network.OASYS_TESTNET]:9372,[exports.Network.MCH_VERSE]:29548,[exports.Network.MCH_VERSE_TESTNET]:420,[exports.Network.HEDERA]:295,[exports.Network.HEDERA_TESTNET]:296,[exports.Network.DEFI_VERSE]:16116,[exports.Network.DEFI_VERSE_TESTNET]:17117,[exports.Network.KROMA]:255,[exports.Network.KROMA_SEPOLIA]:2358,[exports.Network.ASM_QA]:807424,[exports.Network.ASM_TEST]:595581,[exports.Network.ASM_DEV]:955081,1:exports.Network.ETHEREUM,3:exports.Network.ROPSTEN,11155111:exports.Network.SEPOLIA,137:exports.Network.POLYGON,80001:exports.Network.MUMBAI,9999999:exports.Network.TEZOS,9999998:exports.Network.GHOSTNET,56:exports.Network.BNB_SMART_CHAIN,97:exports.Network.BNB_SMART_CHAIN_TESTNET,8217:exports.Network.KLAYTN,1001:exports.Network.BAOBAB,77001:exports.Network.BORA,99001:exports.Network.BORA_TESTNET,7518:exports.Network.MEVERSE,4759:exports.Network.MEVERSE_TESTNET,100:exports.Network.PSM_TESTNET_DEV,400:exports.Network.PSM_TESTNET_TEST,500:exports.Network.PSM_TESTNET,91002:exports.Network.PSM,19011:exports.Network.HOME_VERSE,40875:exports.Network.HOME_VERSE_TESTNET,411:exports.Network.YOOLDO_VERSE,20197:exports.Network.SAND_VERSE,248:exports.Network.OASYS,9372:exports.Network.OASYS_TESTNET,29548:exports.Network.MCH_VERSE,420:exports.Network.MCH_VERSE_TESTNET,295:exports.Network.HEDERA,296:exports.Network.HEDERA_TESTNET,16116:exports.Network.DEFI_VERSE,17117:exports.Network.DEFI_VERSE_TESTNET,255:exports.Network.KROMA,2358:exports.Network.KROMA_SEPOLIA,807424:exports.Network.ASM_QA,595581:exports.Network.ASM_TEST,955081:exports.Network.ASM_DEV};var o;exports.Blockchain=void 0,(o=exports.Blockchain||(exports.Blockchain={})).ETHEREUM="ETHEREUM",o.POLYGON="POLYGON",o.BNB_SMART_CHAIN="BNB_SMART_CHAIN",o.KLAYTN="KLAYTN",o.SOLANA="SOLANA",o.TEZOS="TEZOS",o.NEAR="NEAR",o.BORA="BORA",o.APTOS="APTOS",o.MEVERSE="MEVERSE",o.PSM="PSM",o.PSM_TEST="PSM_TEST",o.PSM_DEV="PSM_DEV",o.HOME_VERSE="HOME_VERSE",o.YOOLDO_VERSE="YOOLDO_VERSE",o.OASYS="OASYS",o.MCH_VERSE="MCH_VERSE",o.HEDERA="HEDERA",o.DEFI_VERSE="DEFI_VERSE",o.KROMA="KROMA",o.ASM_TEST="ASM_TEST",o.ASM_QA="ASM_QA",o.ASM_DEV="ASM_DEV";const s=[exports.Blockchain.ETHEREUM,exports.Blockchain.POLYGON,exports.Blockchain.BNB_SMART_CHAIN,exports.Blockchain.KLAYTN,exports.Blockchain.BORA,exports.Blockchain.MEVERSE,exports.Blockchain.PSM,exports.Blockchain.PSM_DEV,exports.Blockchain.PSM_TEST,exports.Blockchain.HOME_VERSE,exports.Blockchain.YOOLDO_VERSE,exports.Blockchain.OASYS,exports.Blockchain.MCH_VERSE,exports.Blockchain.HEDERA,exports.Blockchain.DEFI_VERSE,exports.Blockchain.KROMA,exports.Blockchain.ASM_QA,exports.Blockchain.ASM_TEST,exports.Blockchain.ASM_DEV];function E(e){switch(e){case exports.Network.ETHEREUM:case exports.Network.ROPSTEN:case exports.Network.SEPOLIA:return exports.Blockchain.ETHEREUM;case exports.Network.POLYGON:case exports.Network.MUMBAI:return exports.Blockchain.POLYGON;case exports.Network.TEZOS:case exports.Network.GHOSTNET:return exports.Blockchain.TEZOS;case exports.Network.BNB_SMART_CHAIN:case exports.Network.BNB_SMART_CHAIN_TESTNET:return exports.Blockchain.BNB_SMART_CHAIN;case exports.Network.KLAYTN:case exports.Network.BAOBAB:return exports.Blockchain.KLAYTN;case exports.Network.SOLANA:case exports.Network.SOLANA_DEVNET:return exports.Blockchain.SOLANA;case exports.Network.BORA:case exports.Network.BORA_TESTNET:return exports.Blockchain.BORA;case exports.Network.NEAR:case exports.Network.NEAR_TESTNET:return exports.Blockchain.NEAR;case exports.Network.APTOS:case exports.Network.APTOS_TESTNET:return exports.Blockchain.APTOS;case exports.Network.MEVERSE:case exports.Network.MEVERSE_TESTNET:return exports.Blockchain.MEVERSE;case exports.Network.PSM:case exports.Network.PSM_TESTNET:return exports.Blockchain.PSM;case exports.Network.PSM_TESTNET_TEST:return exports.Blockchain.PSM_TEST;case exports.Network.PSM_TESTNET_DEV:return exports.Blockchain.PSM_DEV;case exports.Network.HOME_VERSE:case exports.Network.HOME_VERSE_TESTNET:return exports.Blockchain.HOME_VERSE;case exports.Network.YOOLDO_VERSE:case exports.Network.SAND_VERSE:return exports.Blockchain.YOOLDO_VERSE;case exports.Network.OASYS:case exports.Network.OASYS_TESTNET:return exports.Blockchain.OASYS;case exports.Network.MCH_VERSE:case exports.Network.MCH_VERSE_TESTNET:return exports.Blockchain.MCH_VERSE;case exports.Network.HEDERA:case exports.Network.HEDERA_TESTNET:return exports.Blockchain.HEDERA;case exports.Network.DEFI_VERSE:case exports.Network.DEFI_VERSE_TESTNET:return exports.Blockchain.DEFI_VERSE;case exports.Network.KROMA:case exports.Network.KROMA_SEPOLIA:return exports.Blockchain.KROMA;case exports.Network.ASM_QA:return exports.Blockchain.ASM_QA;case exports.Network.ASM_TEST:return exports.Blockchain.ASM_TEST;case exports.Network.ASM_DEV:return exports.Blockchain.ASM_DEV}throw new Error(`Unsupported network: ${e}`)}var a,n,c,_,N,T,S,p,A;exports.BoraPortalConnectStatusEnum=void 0,(a=exports.BoraPortalConnectStatusEnum||(exports.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",a.Unconnected="UNCONNECTED";class i{constructor(e,r){i.ensureHexString(e),i.checkLength(e,r),this.hex=e,this.length=r}static empty(){return new i("",0)}static fromUint8Array(e){return new i(x(e),e.length)}static fromHex(e,r){return new i(e,r)}static ensureHexString(e){try{if(""===e)return;if(null==e)throw new Error(`hex is null ${e}`);if(!e.startsWith("0x"))throw new Error(`hex does not start with 0x ${e}`);if(null==e.match("0x[0-9a-fA-F]+"))throw new Error(`invalid hex data ${e}`)}catch(e){throw e}}static checkLength(e,r){if(0===e.length)return;if(4*(e.length-2)/8>r)throw new Error(`length is less than hex data ${e}, ${r}`)}toString(){return this.hex}toHex(){return this.hex}toBigNumber(){return e.BigNumber.from(this.hex)}toJSON(){return{hex:this.hex,length:this.length}}static fromJSON(e){const{hex:r,length:t}=JSON.parse(e);return new i(r,t)}static fromBigNumber(e,r){return i.fromHex(e.toHexString(),r)}toUInt8Array(){const e=this.hex.substring(2),r=[];for(let t=0;t<e.length;t+=2)r.push(parseInt(e.substring(t,t+2),16));return new Uint8Array(r)}static concat(e,r){try{const t=e.toUInt8Array(),o=r.toUInt8Array(),s=new Uint8Array(t.length+o.length);s.set(t),s.set(o,t.length);const E=x(s);return new i(E,t.length+o.length)}catch(e){return console.debug("concat error",e),i.empty()}}split(e){const r=this.toUInt8Array();return[i.fromUint8Array(r.slice(0,e)),i.fromUint8Array(r.slice(e))]}clone(){return new i(this.hex,this.length)}unsafeSetLength(e){this.length=e}}function x(e){return"0x"+[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function R(e){return function(e){return null===e}(e)||function(e){return void 0===e}(e)}exports.Env=void 0,(n=exports.Env||(exports.Env={})).Local="Local",n.Dev="Dev",n.StageTest="StageTest",n.StageMainnet="StageMainnet",n.ProdTest="ProdTest",n.ProdMainnet="ProdMainnet",exports.DesktopOS=void 0,(c=exports.DesktopOS||(exports.DesktopOS={})).Linux="linux",c.MacOS="mac_os",c.Unix="unix",c.Unknown="unknown",c.Windows="windows",exports.MobileOS=void 0,(_=exports.MobileOS||(exports.MobileOS={})).Android="android",_.iOS="ios",_.Unknown="unknown",_.WindowsPhone="Windows Phone",exports.JsonRpcMethod=void 0,(N=exports.JsonRpcMethod||(exports.JsonRpcMethod={})).face_logInSignUp="face_logInSignUp",N.face_loggedIn="face_loggedIn",N.face_logOut="face_logOut",N.face_open2fa="face_open2fa",N.face_currentUser="face_currentUser",N.face_accounts="face_accounts",N.face_getUserVerificationToken="face_getUserVerificationToken",N.face_openIframe="face_openIframe",N.face_closeIframe="face_closeIframe",N.face_ready="face_ready",N.face_openHome="face_openHome",N.face_openBuy="face_openBuy",N.face_openKit="face_openKit",N.face_connectExternalWallet="face_connectExternalWallet",N.face_openWalletConnect="face_openWalletConnect",N.face_confirmWalletConnectDapp="face_confirmWalletConnectDapp",N.face_switchNetwork="face_switchNetwork",N.face_directSocialLogin="face_directSocialLogin",N.face_getIdToken="face_getIdToken",N.face_loginWithIdToken="face_loginWithIdToken",N.face_loginWithAccessToken="face_loginWithAccessToken",N.face_showToast="face_showToast",N.bora_connect="bora_connect",N.bora_isConnected="bora_isConnected",N.eth_sendTransaction="eth_sendTransaction",N.eth_getBalance="eth_getBalance",N.eth_call="eth_call",N.eth_estimateGas="eth_estimateGas",N.eth_sign="eth_sign",N.eth_signTypedData_v3="eth_signTypedData_v3",N.eth_signTypedData_v4="eth_signTypedData_v4",N.eth_chainId="eth_chainId",N.eth_accounts="eth_accounts",N.personal_sign="personal_sign",N.personal_listAccounts="personal_listAccounts",N.wallet_switchEthereumChain="wallet_switchEthereumChain",N.solana_sendTransaction="solana_sendTransaction",N.near_broadcast_tx_async="near_broadcast_tx_async",N.near_get_balance="near_get_balance",N.aptos_signMultiAgentTransaction="aptos_signMultiAgentTransaction",N.aptos_signMessage="aptos_signMessage",N.aptos_signTransaction="aptos_signTransaction",N.aptos_signAndSubmitTransaction="aptos_signAndSubmitTransaction",N.hedera_associate="hedera_associate",N.tezos_publicKey="tezos_publicKey",N.tezos_transferFA2="tezos_transferFA2",N.tezos_transferCoin="tezos_transferCoin",N.hedera_getAccountId="hedera_getAccountId",N.hedera_getHashConnectPairString="hedera_getHashConnectPairString",N.hedera_initHashConnect="hedera_initHashConnect",N.hedera_pairHashConnect="hedera_pairHashConnect",N.hedera_disconnectHashConnect="hedera_disconnectHashConnect",exports.JsonRpcSource=void 0,(T=exports.JsonRpcSource||(exports.JsonRpcSource={})).FACE_SDK="FACE_SDK",T.FACE_IFRAME="FACE_IFRAME",T.FACE_WALLET_CONNECT="FACE_WALLET_CONNECT",T.FACE_NATIVE_SDK="FACE_NATIVE_SDK",exports.RpcErrorCode=void 0,(S=exports.RpcErrorCode||(exports.RpcErrorCode={}))[S.PARSE_ERROR=-32700]="PARSE_ERROR",S[S.INVALID_REQUEST=-32600]="INVALID_REQUEST",S[S.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",S[S.INVALID_PARAMS=-32602]="INVALID_PARAMS",S[S.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",exports.HttpStatus=void 0,(p=exports.HttpStatus||(exports.HttpStatus={}))[p.SUCCESS=200]="SUCCESS",p[p.CREATED=201]="CREATED",p[p.BAD_REQUEST=400]="BAD_REQUEST",p[p.UNAUTHORIZED=401]="UNAUTHORIZED",p[p.FORBIDDEN=403]="FORBIDDEN",p[p.NOT_FOUND=404]="NOT_FOUND",p[p.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",exports.FaceErrorCode=void 0,(A=exports.FaceErrorCode||(exports.FaceErrorCode={}))[A.INVALID_ARGUMENT=4e3]="INVALID_ARGUMENT",A[A.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",A[A.NOT_IMPLEMENTED=4002]="NOT_IMPLEMENTED",A[A.BAD_REQUEST=4003]="BAD_REQUEST",A[A.SEND_TRANSACTION_FAILED=4004]="SEND_TRANSACTION_FAILED",A[A.SIGN_FAILED=4005]="SIGN_FAILED",A[A.UNAUTHORIZED=4100]="UNAUTHORIZED",A[A.NO_USER_DATA=4101]="NO_USER_DATA",A[A.AUTHENTICATION=4102]="AUTHENTICATION",A[A.UNSUPPORTED_SOCIAL_PROVIDER=4103]="UNSUPPORTED_SOCIAL_PROVIDER",A[A.INVALID_ENVIRONMENT=4200]="INVALID_ENVIRONMENT",A[A.UNSUPPORTED_METHOD=4201]="UNSUPPORTED_METHOD",A[A.UNSUPPORTED_CHAIN=4202]="UNSUPPORTED_CHAIN",A[A.INVALID_WALLET=4300]="INVALID_WALLET",A[A.PROVIDERS_AND_WALLETS_CONFIG_ERROR=4301]="PROVIDERS_AND_WALLETS_CONFIG_ERROR",A[A.NO_COIN_AVAILABLE_TO_BUY=4400]="NO_COIN_AVAILABLE_TO_BUY",A[A.INVALID_SIGNATURE_MESSAGE=4906]="INVALID_SIGNATURE_MESSAGE",A[A.INVALID_BORA_API_AND_SECRET_KEY=4907]="INVALID_BORA_API_AND_SECRET_KEY",A[A.ALREADY_CONNECTED_OTHER_BAPP_USN=4909]="ALREADY_CONNECTED_OTHER_BAPP_USN",A[A.BORA_SERVICE_REGION_IS_WRONG=4910]="BORA_SERVICE_REGION_IS_WRONG",A[A.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET=4911]="BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET",A[A.INTERNAL=5e3]="INTERNAL";class k extends Error{static isFaceError(e){return e.isFaceError}isValidErrorCode(e){return!R(r=e)&&"number"==typeof r&&Object.values(exports.RpcErrorCode).includes(r)||function(e){return!R(e)&&"number"==typeof e&&Object.values(exports.FaceErrorCode).includes(e)}(e);var r}constructor(e){var r;if(super(),this.isFaceError=!0,this.code=this.isValidErrorCode(e.code)?e.code:exports.FaceErrorCode.INTERNAL,this.message=`Face Error: [${this.code}] ${e.message}`,e.origin){const t=e.origin.isFaceError&&e.origin.origin?e.origin.origin:e.origin,{message:o,stack:s,name:E,cause:a}=t;this.origin={message:o,stack:s,name:E,cause:a},t.isAxiosError&&(this.origin.data=null===(r=null==t?void 0:t.response)||void 0===r?void 0:r.data)}e.data&&(this.data=e.data),Object.setPrototypeOf(this,k.prototype),Error.captureStackTrace(this,this.constructor)}}function O(e,r){return l({message:`invalid ${e}`+(r?`: ${r}`:""),code:exports.FaceErrorCode.INVALID_ARGUMENT})}function l(e){return new k(e)}function w(e,r,t){if(!e)throw r(...null!=t?t:[])}const h=["MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsY-w2HRh6VwRfOw5P7pMvQzxf3Hz3dOurwCeV4AHmVWpxh-DfQx8aKL8394dJVy7x2geVeKR62rSl58HsFsr9utgvHb7PzZluV6DlDQJKrsHIjYiOSKVadMUgNHV40NgrzQggxuOY0MhJ599GWeXps_PPzWv7hsLircae1PnVOQIDAQAB","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnh7y9sFxoFWwjP9Xlg7s9kXqfRGMusccEFr-LcvzyfPrFohvaKw0YLdMdb8trgK5M5VCEGWJ8p_sMSwb6i_MkQwv2s711uKxHAasUmDtX6eMy3eNKowdZo5nXraQpQd529c0jtZt5l07ryHHts3k4MF0W83GpaoWgjSLXhMEK8QIDAQAB","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqBmCzkl0ClfF_yuegA44dL5KGOq4BxtQlizFKFjh3VR2zIyHmp8Y6aFXhLmuJjiyRvZXi9K_dA0mEH458U9pf7iffGZOEa8fRELachZmd2-dZuI6mdL7XrNPY8XNPG4EcCtp3GVVefSr3dKEaTaBl6c0BUBWRBcpWLkX0cSe2bQIDAQAB","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCS23ncDS7x8nmTuK1FFN0EfYo0vo6xhTBMBNWVbQsufv60X8hv3-TbAQ3JIyMEhLo-c-31oYrvrQ0G2e9j8yvJYEUnLuE-PaABo0y3V5m9g_qdTB5p9eEfqZlDrcUl1zUr4W7rJwFwkTlAFSKOqVCPnm8ozmcMyyrEHgl2AbehrQIDAQAB"],u=new Set([exports.Blockchain.PSM,exports.Blockchain.PSM_DEV,exports.Blockchain.PSM_TEST]),M=new Set([exports.Blockchain.ASM_QA,exports.Blockchain.ASM_TEST,exports.Blockchain.ASM_DEV]);function d(e){return h.includes(e)}var I;exports.TxType=void 0,(I=exports.TxType||(exports.TxType={})).COIN="COIN",I.ERC20="ERC20",I.ERC721="ERC721",I.ERC1155="ERC1155",I.FT="FT",I.CONVERT="CONVERT",I.Associate="ASSOCIATE",I.FA2_FT="FA2_FT",I.FA2_NFT="FA2_NFT",I.FA2_MFT="FA2_MFT";var B;exports.UserStatus=void 0,(B=exports.UserStatus||(exports.UserStatus={})).isWalletCreated="isWalletCreated",B.isNewUser="isNewUser",B.isRegisteredPinCode="isRegisteredPinCode",B.isAdmin="isAdmin",exports.CryptoBuffer=i,exports.FaceAuthSessionKey="Face-Auth-Session",exports.FaceError=k,exports.FaceOAuthResultKey="Face-OAuth-Result",exports.FaceVersionLocalKey="Face-Version",exports.LoginProvider={Google:"google.com",Apple:"apple.com",Twitter:"twitter.com",Discord:"discord.com",Facebook:"facebook.com",Kakao:"kakao.com"},exports.NetworkChainIdMap=t,exports.WalletPath="m/44'/60'/1'/0/0",exports.alreadyConnectedToOtherBappusn=function(e){return l({message:"already connected to other bappusn",code:exports.FaceErrorCode.ALREADY_CONNECTED_OTHER_BAPP_USN,origin:e})},exports.assert=w,exports.assertArgument=function(e,r,t,o=!0){(o||e)&&w(!!e&&r,O,[t])},exports.bappusnAlreadyConnectedToOtherWallet=function(e){return l({message:"bappusn already connected to other wallet",code:exports.FaceErrorCode.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET,origin:e})},exports.boraServiceRegionIsWrong=function(e){return new k({message:"bora service region is wrong",code:exports.FaceErrorCode.BORA_SERVICE_REGION_IS_WRONG,origin:e})},exports.filterNexonBlockchains=function(e,r){if(d(e))return r;const t=new Set(r);for(const e of u)t.delete(e);for(const e of M)t.delete(e);return t},exports.filterNexonNetworks=function(e,r,t){if(d(e))return r;const o=[];for(const e of r){const r=t(e);u.has(E(r))||M.has(E(r))||o.push(e)}return o},exports.getEthlikeBlockchains=function(){return s},exports.getPlatFormCoinDecimalByBlockchain=e=>{switch(e){case exports.Blockchain.ETHEREUM:case exports.Blockchain.POLYGON:case exports.Blockchain.KLAYTN:case exports.Blockchain.BNB_SMART_CHAIN:case exports.Blockchain.BORA:case exports.Blockchain.MEVERSE:case exports.Blockchain.PSM:case exports.Blockchain.PSM_DEV:case exports.Blockchain.PSM_TEST:case exports.Blockchain.HOME_VERSE:case exports.Blockchain.YOOLDO_VERSE:case exports.Blockchain.OASYS:case exports.Blockchain.MCH_VERSE:case exports.Blockchain.HEDERA:case exports.Blockchain.DEFI_VERSE:case exports.Blockchain.KROMA:case exports.Blockchain.ASM_QA:case exports.Blockchain.ASM_TEST:case exports.Blockchain.ASM_DEV:return 18;case exports.Blockchain.SOLANA:return 9;case exports.Blockchain.NEAR:return 24;case exports.Blockchain.APTOS:return 8;case exports.Blockchain.TEZOS:return 6;default:throw new Error("unsupported blockchain")}},exports.invalidApiKeyError=function(e){return l({message:"invalid api key error",code:exports.FaceErrorCode.UNAUTHORIZED,origin:e})},exports.invalidArgumentError=O,exports.invalidBoraPortalIdAndSecretKey=function(e){return l({message:"Not found bapp. please contact FaceWallet Team to register BoraPortal Client Id/SecretKey.",code:exports.FaceErrorCode.INVALID_BORA_API_AND_SECRET_KEY,origin:e})},exports.invalidEnvironmentError=function(e){return l({message:"invalid environment",code:exports.FaceErrorCode.INVALID_ENVIRONMENT,data:{env:e}})},exports.invalidHostNameError=function(e){return l({message:"invalid host name error",code:exports.FaceErrorCode.UNAUTHORIZED,origin:e})},exports.invalidSignatureError=function(e){return l({message:"Invalid Signature message.",code:exports.FaceErrorCode.INVALID_SIGNATURE_MESSAGE,origin:e})},exports.invalidWallet=function(){return l({message:"invalid wallet error",code:exports.FaceErrorCode.INVALID_WALLET})},exports.isEthlikeBlockchain=function(e){return-1!==s.indexOf(e)},exports.isEthlikeNetwork=e=>{switch(e){case exports.Network.ETHEREUM:case exports.Network.ROPSTEN:case exports.Network.SEPOLIA:case exports.Network.POLYGON:case exports.Network.MUMBAI:case exports.Network.BNB_SMART_CHAIN:case exports.Network.BNB_SMART_CHAIN_TESTNET:case exports.Network.KLAYTN:case exports.Network.BAOBAB:case exports.Network.BORA:case exports.Network.BORA_TESTNET:case exports.Network.MEVERSE:case exports.Network.MEVERSE_TESTNET:case exports.Network.PSM_TESTNET_DEV:case exports.Network.PSM_TESTNET_TEST:case exports.Network.PSM_TESTNET:case exports.Network.PSM:case exports.Network.HOME_VERSE:case exports.Network.HOME_VERSE_TESTNET:case exports.Network.YOOLDO_VERSE:case exports.Network.SAND_VERSE:case exports.Network.OASYS:case exports.Network.OASYS_TESTNET:case exports.Network.MCH_VERSE:case exports.Network.MCH_VERSE_TESTNET:case exports.Network.HEDERA:case exports.Network.HEDERA_TESTNET:case exports.Network.DEFI_VERSE:case exports.Network.DEFI_VERSE_TESTNET:case exports.Network.KROMA:case exports.Network.KROMA_SEPOLIA:case exports.Network.ASM_QA:case exports.Network.ASM_TEST:case exports.Network.ASM_DEV:return!0;default:return!1}},exports.isSupportedNetwork=e=>{switch(e){case exports.Network.ETHEREUM:case exports.Network.SEPOLIA:case exports.Network.POLYGON:case exports.Network.MUMBAI:case exports.Network.TEZOS:case exports.Network.GHOSTNET:case exports.Network.BNB_SMART_CHAIN:case exports.Network.BNB_SMART_CHAIN_TESTNET:case exports.Network.KLAYTN:case exports.Network.BAOBAB:case exports.Network.SOLANA:case exports.Network.SOLANA_DEVNET:case exports.Network.NEAR:case exports.Network.NEAR_TESTNET:case exports.Network.BORA:case exports.Network.BORA_TESTNET:case exports.Network.APTOS:case exports.Network.APTOS_TESTNET:case exports.Network.MEVERSE:case exports.Network.MEVERSE_TESTNET:case exports.Network.PSM_TESTNET:case exports.Network.PSM_TESTNET_DEV:case exports.Network.PSM_TESTNET_TEST:case exports.Network.HOME_VERSE:case exports.Network.HOME_VERSE_TESTNET:case exports.Network.YOOLDO_VERSE:case exports.Network.SAND_VERSE:case exports.Network.OASYS:case exports.Network.OASYS_TESTNET:case exports.Network.MCH_VERSE:case exports.Network.MCH_VERSE_TESTNET:case exports.Network.HEDERA:case exports.Network.HEDERA_TESTNET:case exports.Network.DEFI_VERSE:case exports.Network.DEFI_VERSE_TESTNET:case exports.Network.KROMA:case exports.Network.KROMA_SEPOLIA:case exports.Network.ASM_QA:case exports.Network.ASM_TEST:case exports.Network.ASM_DEV:return!0;default:return!1}},exports.kitProvidersAndWalletsConfigError=function(){return l({message:"Both wallets and providers cannot be empty.",code:exports.FaceErrorCode.PROVIDERS_AND_WALLETS_CONFIG_ERROR})},exports.makeError=l,exports.networkToBlockchain=E,exports.noCoinAvailableToBuy=function(e,r){return l({message:"No coin available to buy.",code:exports.FaceErrorCode.NO_COIN_AVAILABLE_TO_BUY,data:{blockchains:e,contractAddress:r}})},exports.noUserDataError=function(){return l({message:"no user data",code:exports.FaceErrorCode.NO_USER_DATA})},exports.notImplementedError=function(e){return l({message:e,code:exports.FaceErrorCode.NOT_IMPLEMENTED})},exports.oauthError=function(e,r){return l({message:`OAuth 2.0 Error: ${e}`,code:exports.FaceErrorCode.AUTHENTICATION,origin:r})},exports.parseFaceSolanaNearTransactionPayload=function(e){return null==e||"object"!=typeof e||null==e.serializedHex||"string"!=typeof e.serializedHex?null:e},exports.sendTransactionError=function(e){return l({message:e.message,code:exports.FaceErrorCode.SEND_TRANSACTION_FAILED,data:e.data})},exports.signError=function(e){return l({message:e,code:exports.FaceErrorCode.SIGN_FAILED})},exports.unknownError=function(e){return l({message:"unknown error",code:exports.FaceErrorCode.INTERNAL,origin:e})},exports.unsupportedChainError=function(e){return l({message:"unsupported chain error",code:exports.FaceErrorCode.UNSUPPORTED_CHAIN,origin:e})},exports.unsupportedProviderError=function(e){return l({message:`${e} login is not supported.`,code:exports.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},exports.unsupportedTokenProviderError=function(e){return l({message:`${e} is not support get id token`,code:exports.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},exports.userRejectedRequest=function(e){return l({code:exports.FaceErrorCode.USER_REJECTED_REQUEST,message:"user rejected request",data:{path:e}})}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("ethers");var r,t,o,n,s,a,E,_,i,c,A,T;exports.Network=void 0,(r=exports.Network||(exports.Network={})).ETHEREUM="ethereum",r.SEPOLIA="sepolia",r.POLYGON="polygon",r.MUMBAI="mumbai",r.TEZOS="tezos",r.GHOSTNET="ghostnet",r.BNB_SMART_CHAIN="bnb_smart_chain",r.BNB_SMART_CHAIN_TESTNET="bnb_smart_chain_testnet",r.KLAYTN="klaytn",r.BAOBAB="baobab",r.SOLANA="solana",r.SOLANA_DEVNET="solana_devnet",r.NEAR="near",r.NEAR_TESTNET="near_testnet",r.BORA="bora",r.BORA_TESTNET="bora_testnet",r.ETH_MAINNET="ethereum",r.MATIC_MAINNET="polygon",r.MATIC_TESTNET="mumbai",r.BINANCE_COIN_MAINNET="bnb_smart_chain",r.BINANCE_COIN_TESTNET="bnb_smart_chain_testnet",r.KLAYTN_MAINNET="klaytn",r.KLAYTN_TESTNET="baobab",r.APTOS="aptoslab",r.APTOS_TESTNET="aptoslab_testnet",r.MEVERSE="meverse",r.MEVERSE_TESTNET="meverse_testnet",r.PSM="psm",r.PSM_TESTNET="psm_testnet",r.PSM_TESTNET_TEST="psm_testnet_test",r.PSM_TESTNET_DEV="psm_testnet_dev",r.HOME_VERSE="home_verse",r.HOME_VERSE_TESTNET="home_verse_testnet",r.YOOLDO_VERSE="yooldo_verse",r.SAND_VERSE="sand_verse",r.OASYS="oasys",r.OASYS_TESTNET="oasys_testnet",r.MCH_VERSE="mch_verse",r.MCH_VERSE_TESTNET="mch_verse_testnet",r.HEDERA="hedera",r.HEDERA_TESTNET="hedera_testnet",r.DEFI_VERSE_TESTNET="defi_verse_testnet",r.DEFI_VERSE="defi_verse",r.KROMA="kroma",r.KROMA_SEPOLIA="kroma_sepolia",r.ASM_QA="asm_qa",r.ASM_TEST="asm_test",r.ASM_DEV="asm_dev",r.LINEA="linea",r.LINEA_GOERLI="linea_goerli",exports.Blockchain=void 0,(t=exports.Blockchain||(exports.Blockchain={})).ETHEREUM="ETHEREUM",t.POLYGON="POLYGON",t.BNB_SMART_CHAIN="BNB_SMART_CHAIN",t.KLAYTN="KLAYTN",t.SOLANA="SOLANA",t.TEZOS="TEZOS",t.NEAR="NEAR",t.BORA="BORA",t.APTOS="APTOS",t.MEVERSE="MEVERSE",t.PSM="PSM",t.PSM_TEST="PSM_TEST",t.PSM_DEV="PSM_DEV",t.HOME_VERSE="HOME_VERSE",t.YOOLDO_VERSE="YOOLDO_VERSE",t.OASYS="OASYS",t.MCH_VERSE="MCH_VERSE",t.HEDERA="HEDERA",t.DEFI_VERSE="DEFI_VERSE",t.KROMA="KROMA",t.ASM_TEST="ASM_TEST",t.ASM_QA="ASM_QA",t.ASM_DEV="ASM_DEV",t.LINEA="LINEA",exports.BoraPortalConnectStatusEnum=void 0,(o=exports.BoraPortalConnectStatusEnum||(exports.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",o.Unconnected="UNCONNECTED";class N{constructor(e,r){N.ensureHexString(e),N.checkLength(e,r),this.hex=e,this.length=r}static empty(){return new N("",0)}static fromUint8Array(e){return new N(d(e),e.length)}static fromHex(e,r){return new N(e,r)}static ensureHexString(e){try{if(""===e)return;if(null==e)throw new Error(`hex is null ${e}`);if(!e.startsWith("0x"))throw new Error(`hex does not start with 0x ${e}`);if(null==e.match("0x[0-9a-fA-F]+"))throw new Error(`invalid hex data ${e}`)}catch(e){throw e}}static checkLength(e,r){if(0===e.length)return;if(4*(e.length-2)/8>r)throw new Error(`length is less than hex data ${e}, ${r}`)}toString(){return this.hex}toHex(){return this.hex}toBigNumber(){return e.BigNumber.from(this.hex)}toJSON(){return{hex:this.hex,length:this.length}}static fromJSON(e){const{hex:r,length:t}=JSON.parse(e);return new N(r,t)}static fromBigNumber(e,r){return N.fromHex(e.toHexString(),r)}toUInt8Array(){const e=this.hex.substring(2),r=[];for(let t=0;t<e.length;t+=2)r.push(parseInt(e.substring(t,t+2),16));return new Uint8Array(r)}static concat(e,r){try{const t=e.toUInt8Array(),o=r.toUInt8Array(),n=new Uint8Array(t.length+o.length);n.set(t),n.set(o,t.length);const s=d(n);return new N(s,t.length+o.length)}catch(e){return console.debug("concat error",e),N.empty()}}split(e){const r=this.toUInt8Array();return[N.fromUint8Array(r.slice(0,e)),N.fromUint8Array(r.slice(e))]}clone(){return new N(this.hex,this.length)}unsafeSetLength(e){this.length=e}}function d(e){return"0x"+[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function S(e){return function(e){return null===e}(e)||function(e){return void 0===e}(e)}exports.Env=void 0,(n=exports.Env||(exports.Env={})).Local="Local",n.Dev="Dev",n.StageTest="StageTest",n.StageMainnet="StageMainnet",n.ProdTest="ProdTest",n.ProdMainnet="ProdMainnet",exports.DesktopOS=void 0,(s=exports.DesktopOS||(exports.DesktopOS={})).Linux="linux",s.MacOS="mac_os",s.Unix="unix",s.Unknown="unknown",s.Windows="windows",exports.MobileOS=void 0,(a=exports.MobileOS||(exports.MobileOS={})).Android="android",a.iOS="ios",a.Unknown="unknown",a.WindowsPhone="Windows Phone",exports.JsonRpcMethod=void 0,(E=exports.JsonRpcMethod||(exports.JsonRpcMethod={})).face_logInSignUp="face_logInSignUp",E.face_loggedIn="face_loggedIn",E.face_logOut="face_logOut",E.face_open2fa="face_open2fa",E.face_currentUser="face_currentUser",E.face_accounts="face_accounts",E.face_getUserVerificationToken="face_getUserVerificationToken",E.face_openIframe="face_openIframe",E.face_closeIframe="face_closeIframe",E.face_ready="face_ready",E.face_openHome="face_openHome",E.face_openBuy="face_openBuy",E.face_openKit="face_openKit",E.face_connectExternalWallet="face_connectExternalWallet",E.face_openWalletConnect="face_openWalletConnect",E.face_confirmWalletConnectDapp="face_confirmWalletConnectDapp",E.face_switchNetwork="face_switchNetwork",E.face_directSocialLogin="face_directSocialLogin",E.face_getIdToken="face_getIdToken",E.face_loginWithIdToken="face_loginWithIdToken",E.face_loginWithAccessToken="face_loginWithAccessToken",E.face_showToast="face_showToast",E.bora_connect="bora_connect",E.bora_isConnected="bora_isConnected",E.eth_sendTransaction="eth_sendTransaction",E.eth_getBalance="eth_getBalance",E.eth_call="eth_call",E.eth_estimateGas="eth_estimateGas",E.eth_sign="eth_sign",E.eth_signTypedData_v3="eth_signTypedData_v3",E.eth_signTypedData_v4="eth_signTypedData_v4",E.eth_chainId="eth_chainId",E.eth_accounts="eth_accounts",E.personal_sign="personal_sign",E.personal_listAccounts="personal_listAccounts",E.wallet_switchEthereumChain="wallet_switchEthereumChain",E.solana_sendTransaction="solana_sendTransaction",E.near_broadcast_tx_async="near_broadcast_tx_async",E.near_get_balance="near_get_balance",E.aptos_signMultiAgentTransaction="aptos_signMultiAgentTransaction",E.aptos_signMessage="aptos_signMessage",E.aptos_signTransaction="aptos_signTransaction",E.aptos_signAndSubmitTransaction="aptos_signAndSubmitTransaction",E.hedera_associate="hedera_associate",E.tezos_publicKey="tezos_publicKey",E.tezos_transferFA2="tezos_transferFA2",E.tezos_transferCoin="tezos_transferCoin",E.hedera_getAccountId="hedera_getAccountId",E.hedera_getHashConnectPairString="hedera_getHashConnectPairString",E.hedera_initHashConnect="hedera_initHashConnect",E.hedera_pairHashConnect="hedera_pairHashConnect",E.hedera_disconnectHashConnect="hedera_disconnectHashConnect",exports.JsonRpcSource=void 0,(_=exports.JsonRpcSource||(exports.JsonRpcSource={})).FACE_SDK="FACE_SDK",_.FACE_IFRAME="FACE_IFRAME",_.FACE_WALLET_CONNECT="FACE_WALLET_CONNECT",_.FACE_NATIVE_SDK="FACE_NATIVE_SDK",exports.RpcErrorCode=void 0,(i=exports.RpcErrorCode||(exports.RpcErrorCode={}))[i.PARSE_ERROR=-32700]="PARSE_ERROR",i[i.INVALID_REQUEST=-32600]="INVALID_REQUEST",i[i.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",i[i.INVALID_PARAMS=-32602]="INVALID_PARAMS",i[i.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",exports.HttpStatus=void 0,(c=exports.HttpStatus||(exports.HttpStatus={}))[c.SUCCESS=200]="SUCCESS",c[c.CREATED=201]="CREATED",c[c.BAD_REQUEST=400]="BAD_REQUEST",c[c.UNAUTHORIZED=401]="UNAUTHORIZED",c[c.FORBIDDEN=403]="FORBIDDEN",c[c.NOT_FOUND=404]="NOT_FOUND",c[c.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",exports.FaceErrorCode=void 0,(A=exports.FaceErrorCode||(exports.FaceErrorCode={}))[A.INVALID_ARGUMENT=4e3]="INVALID_ARGUMENT",A[A.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",A[A.NOT_IMPLEMENTED=4002]="NOT_IMPLEMENTED",A[A.BAD_REQUEST=4003]="BAD_REQUEST",A[A.SEND_TRANSACTION_FAILED=4004]="SEND_TRANSACTION_FAILED",A[A.SIGN_FAILED=4005]="SIGN_FAILED",A[A.UNAUTHORIZED=4100]="UNAUTHORIZED",A[A.NO_USER_DATA=4101]="NO_USER_DATA",A[A.AUTHENTICATION=4102]="AUTHENTICATION",A[A.UNSUPPORTED_SOCIAL_PROVIDER=4103]="UNSUPPORTED_SOCIAL_PROVIDER",A[A.INVALID_ENVIRONMENT=4200]="INVALID_ENVIRONMENT",A[A.UNSUPPORTED_METHOD=4201]="UNSUPPORTED_METHOD",A[A.UNSUPPORTED_CHAIN=4202]="UNSUPPORTED_CHAIN",A[A.INVALID_WALLET=4300]="INVALID_WALLET",A[A.PROVIDERS_AND_WALLETS_CONFIG_ERROR=4301]="PROVIDERS_AND_WALLETS_CONFIG_ERROR",A[A.NO_COIN_AVAILABLE_TO_BUY=4400]="NO_COIN_AVAILABLE_TO_BUY",A[A.INVALID_SIGNATURE_MESSAGE=4906]="INVALID_SIGNATURE_MESSAGE",A[A.INVALID_BORA_API_AND_SECRET_KEY=4907]="INVALID_BORA_API_AND_SECRET_KEY",A[A.ALREADY_CONNECTED_OTHER_BAPP_USN=4909]="ALREADY_CONNECTED_OTHER_BAPP_USN",A[A.BORA_SERVICE_REGION_IS_WRONG=4910]="BORA_SERVICE_REGION_IS_WRONG",A[A.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET=4911]="BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET",A[A.INTERNAL=5e3]="INTERNAL";class p extends Error{static isFaceError(e){return e.isFaceError}isValidErrorCode(e){return!S(r=e)&&"number"==typeof r&&Object.values(exports.RpcErrorCode).includes(r)||function(e){return!S(e)&&"number"==typeof e&&Object.values(exports.FaceErrorCode).includes(e)}(e);var r}constructor(e){var r;if(super(),this.isFaceError=!0,this.code=this.isValidErrorCode(e.code)?e.code:exports.FaceErrorCode.INTERNAL,this.message=`Face Error: [${this.code}] ${e.message}`,e.origin){const t=e.origin.isFaceError&&e.origin.origin?e.origin.origin:e.origin,{message:o,stack:n,name:s,cause:a}=t;this.origin={message:o,stack:n,name:s,cause:a},t.isAxiosError&&(this.origin.data=null===(r=null==t?void 0:t.response)||void 0===r?void 0:r.data)}e.data&&(this.data=e.data),Object.setPrototypeOf(this,p.prototype),Error.captureStackTrace(this,this.constructor)}}function R(e,r){return u({message:`invalid ${e}`+(r?`: ${r}`:""),code:exports.FaceErrorCode.INVALID_ARGUMENT})}function u(e){return new p(e)}function l(e,r,t){if(!e)throw r(...null!=t?t:[])}exports.TxType=void 0,(T=exports.TxType||(exports.TxType={})).COIN="COIN",T.ERC20="ERC20",T.ERC721="ERC721",T.ERC1155="ERC1155",T.FT="FT",T.CONVERT="CONVERT",T.Associate="ASSOCIATE",T.FA2_FT="FA2_FT",T.FA2_NFT="FA2_NFT",T.FA2_MFT="FA2_MFT";var O;exports.UserStatus=void 0,(O=exports.UserStatus||(exports.UserStatus={})).isWalletCreated="isWalletCreated",O.isNewUser="isNewUser",O.isRegisteredPinCode="isRegisteredPinCode",O.isAdmin="isAdmin",exports.CryptoBuffer=N,exports.FaceAuthSessionKey="Face-Auth-Session",exports.FaceError=p,exports.FaceOAuthResultKey="Face-OAuth-Result",exports.FaceVersionLocalKey="Face-Version",exports.LoginProvider={Google:"google.com",Apple:"apple.com",Twitter:"twitter.com",Discord:"discord.com",Facebook:"facebook.com",Kakao:"kakao.com"},exports.WalletPath="m/44'/60'/1'/0/0",exports.alreadyConnectedToOtherBappusn=function(e){return u({message:"already connected to other bappusn",code:exports.FaceErrorCode.ALREADY_CONNECTED_OTHER_BAPP_USN,origin:e})},exports.assert=l,exports.assertArgument=function(e,r,t,o=!0){(o||e)&&l(!!e&&r,R,[t])},exports.bappusnAlreadyConnectedToOtherWallet=function(e){return u({message:"bappusn already connected to other wallet",code:exports.FaceErrorCode.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET,origin:e})},exports.boraServiceRegionIsWrong=function(e){return new p({message:"bora service region is wrong",code:exports.FaceErrorCode.BORA_SERVICE_REGION_IS_WRONG,origin:e})},exports.invalidApiKeyError=function(e){return u({message:"invalid api key error",code:exports.FaceErrorCode.UNAUTHORIZED,origin:e})},exports.invalidArgumentError=R,exports.invalidBoraPortalIdAndSecretKey=function(e){return u({message:"Not found bapp. please contact FaceWallet Team to register BoraPortal Client Id/SecretKey.",code:exports.FaceErrorCode.INVALID_BORA_API_AND_SECRET_KEY,origin:e})},exports.invalidEnvironmentError=function(e){return u({message:"invalid environment",code:exports.FaceErrorCode.INVALID_ENVIRONMENT,data:{env:e}})},exports.invalidHostNameError=function(e){return u({message:"invalid host name error",code:exports.FaceErrorCode.UNAUTHORIZED,origin:e})},exports.invalidSignatureError=function(e){return u({message:"Invalid Signature message.",code:exports.FaceErrorCode.INVALID_SIGNATURE_MESSAGE,origin:e})},exports.invalidWallet=function(){return u({message:"invalid wallet error",code:exports.FaceErrorCode.INVALID_WALLET})},exports.kitProvidersAndWalletsConfigError=function(){return u({message:"Both wallets and providers cannot be empty.",code:exports.FaceErrorCode.PROVIDERS_AND_WALLETS_CONFIG_ERROR})},exports.makeError=u,exports.noCoinAvailableToBuy=function(e,r){return u({message:"No coin available to buy.",code:exports.FaceErrorCode.NO_COIN_AVAILABLE_TO_BUY,data:{blockchains:e,contractAddress:r}})},exports.noUserDataError=function(){return u({message:"no user data",code:exports.FaceErrorCode.NO_USER_DATA})},exports.notImplementedError=function(e){return u({message:e,code:exports.FaceErrorCode.NOT_IMPLEMENTED})},exports.oauthError=function(e,r){return u({message:`OAuth 2.0 Error: ${e}`,code:exports.FaceErrorCode.AUTHENTICATION,origin:r})},exports.parseFaceSolanaNearTransactionPayload=function(e){return null==e||"object"!=typeof e||null==e.serializedHex||"string"!=typeof e.serializedHex?null:e},exports.sendTransactionError=function(e){return u({message:e.message,code:exports.FaceErrorCode.SEND_TRANSACTION_FAILED,data:e.data})},exports.signError=function(e){return u({message:e,code:exports.FaceErrorCode.SIGN_FAILED})},exports.unknownError=function(e){return u({message:"unknown error",code:exports.FaceErrorCode.INTERNAL,origin:e})},exports.unsupportedChainError=function(e){return u({message:"unsupported chain error",code:exports.FaceErrorCode.UNSUPPORTED_CHAIN,origin:e})},exports.unsupportedProviderError=function(e){return u({message:`${e} login is not supported.`,code:exports.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},exports.unsupportedTokenProviderError=function(e){return u({message:`${e} is not support get id token`,code:exports.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},exports.userRejectedRequest=function(e){return u({code:exports.FaceErrorCode.USER_REJECTED_REQUEST,message:"user rejected request",data:{path:e}})}; | ||
//# sourceMappingURL=index.js.map |
export declare enum Network { | ||
ETHEREUM = "ethereum", | ||
/** @deprecated NETWORK */ | ||
ROPSTEN = "ropsten", | ||
SEPOLIA = "sepolia", | ||
@@ -22,4 +20,2 @@ POLYGON = "polygon", | ||
ETH_MAINNET = "ethereum", | ||
/** @deprecated use ROPSTEN */ | ||
ETH_TESTNET = "ropsten", | ||
/** @deprecated use POLYGON */ | ||
@@ -61,8 +57,6 @@ MATIC_MAINNET = "polygon", | ||
ASM_TEST = "asm_test", | ||
ASM_DEV = "asm_dev" | ||
ASM_DEV = "asm_dev", | ||
LINEA = "linea", | ||
LINEA_GOERLI = "linea_goerli" | ||
} | ||
export declare const isSupportedNetwork: (network?: Network) => boolean; | ||
export declare const NetworkChainIdMap: { | ||
[key in Network | number]: Network | number; | ||
}; | ||
export declare enum Blockchain { | ||
@@ -91,7 +85,5 @@ ETHEREUM = "ETHEREUM", | ||
ASM_QA = "ASM_QA", | ||
ASM_DEV = "ASM_DEV" | ||
ASM_DEV = "ASM_DEV", | ||
LINEA = "LINEA" | ||
} | ||
export declare function networkToBlockchain(network: Network): Blockchain; | ||
export declare function isEthlikeBlockchain(blockchain: Blockchain): boolean; | ||
export declare function getEthlikeBlockchains(): Blockchain[]; | ||
export interface KeyPair { | ||
@@ -101,4 +93,2 @@ privateKey: Uint8Array; | ||
} | ||
export declare const getPlatFormCoinDecimalByBlockchain: (blockchain: Blockchain) => number; | ||
export declare const isEthlikeNetwork: (network: Network) => boolean; | ||
//# sourceMappingURL=blockchain.d.ts.map |
@@ -14,4 +14,4 @@ export * from './aptos'; | ||
export * from './kit'; | ||
export * from './nexon'; | ||
export * from './onRamp'; | ||
export * from './secret'; | ||
export * from './tezos'; | ||
@@ -18,0 +18,0 @@ export * from './transaction'; |
@@ -51,4 +51,2 @@ import { BigNumber, BigNumberish } from 'ethers'; | ||
ETHEREUM = "ethereum", | ||
/** @deprecated NETWORK */ | ||
ROPSTEN = "ropsten", | ||
SEPOLIA = "sepolia", | ||
@@ -71,4 +69,2 @@ POLYGON = "polygon", | ||
ETH_MAINNET = "ethereum", | ||
/** @deprecated use ROPSTEN */ | ||
ETH_TESTNET = "ropsten", | ||
/** @deprecated use POLYGON */ | ||
@@ -110,8 +106,6 @@ MATIC_MAINNET = "polygon", | ||
ASM_TEST = "asm_test", | ||
ASM_DEV = "asm_dev" | ||
ASM_DEV = "asm_dev", | ||
LINEA = "linea", | ||
LINEA_GOERLI = "linea_goerli" | ||
} | ||
declare const isSupportedNetwork: (network?: Network) => boolean; | ||
declare const NetworkChainIdMap: { | ||
[key in Network | number]: Network | number; | ||
}; | ||
declare enum Blockchain { | ||
@@ -140,7 +134,5 @@ ETHEREUM = "ETHEREUM", | ||
ASM_QA = "ASM_QA", | ||
ASM_DEV = "ASM_DEV" | ||
ASM_DEV = "ASM_DEV", | ||
LINEA = "LINEA" | ||
} | ||
declare function networkToBlockchain(network: Network): Blockchain; | ||
declare function isEthlikeBlockchain(blockchain: Blockchain): boolean; | ||
declare function getEthlikeBlockchains(): Blockchain[]; | ||
interface KeyPair { | ||
@@ -150,4 +142,2 @@ privateKey: Uint8Array; | ||
} | ||
declare const getPlatFormCoinDecimalByBlockchain: (blockchain: Blockchain) => number; | ||
declare const isEthlikeNetwork: (network: Network) => boolean; | ||
@@ -505,5 +495,2 @@ declare enum BoraPortalConnectStatusEnum { | ||
declare function filterNexonBlockchains(apiKey: string, previousBlockchains: Set<Blockchain>): Set<Blockchain>; | ||
declare function filterNexonNetworks<T>(apiKey: string, items: ReadonlyArray<T>, networkGetter: (arg: T) => Network): readonly T[]; | ||
type OnRampOptions = { | ||
@@ -515,2 +502,7 @@ blockchains: Blockchain[]; | ||
type AccountSecret = { | ||
privateKey?: string; | ||
pinCode?: string; | ||
}; | ||
interface TezosTransferCoinRequest { | ||
@@ -586,2 +578,2 @@ to: string; | ||
export { AccountsResponse, AptosSignMessagePayload, AptosSignMessageResponse, AptosTxOptions, Blockchain, BoraPortalConnectRequest, BoraPortalConnectStatusEnum, BoraPortalConnectStatusResponse, Coin, ConnectedWallet, ConnectionResult, CryptoBuffer, Currency, DappMetaData, DesktopOS, Env, EthTransactionRequest, FaceAptosTransactionPayload, FaceAuthSession, FaceAuthSessionKey, FaceError, FaceErrorCode, FaceEthereumTransactionPayload, FaceHederaTransactionPayload, FaceIdTokenResponse, FaceLoginResponse, FaceOAuthResult, FaceOAuthResultKey, FacePlatform, FaceSDK, FaceService, FaceSolanaNearTransactionPayload, FaceTezosTransferPayload, FaceTransactionPayload, FaceVersionLocalKey, HexString, HomeOptions, HttpStatus, IconTypes, JsonRpcBatchRequestCallback, JsonRpcError, JsonRpcMethod, JsonRpcRequestCallback, JsonRpcRequestPayload, JsonRpcResponsePayload, JsonRpcSource, KeyPair, LoginProvider, LoginProviderType, LoginWithAccessTokenRequest, LoginWithIdTokenRequest, MobileOS, Network, NetworkChainIdMap, OS, OnRampOptions, PinCode, Platform, ProviderRpcError, Receipt, RpcErrorCode, ScreenSize, Share1LocalForage, TezosTransferCoinRequest, TezosTransferFa2Params, TezosTransferFtRequest, Token, TxType, UserStatus, Wallet, WalletMetaData, WalletPath, alreadyConnectedToOtherBappusn, assert, assertArgument, bappusnAlreadyConnectedToOtherWallet, boraServiceRegionIsWrong, filterNexonBlockchains, filterNexonNetworks, getEthlikeBlockchains, getPlatFormCoinDecimalByBlockchain, invalidApiKeyError, invalidArgumentError, invalidBoraPortalIdAndSecretKey, invalidEnvironmentError, invalidHostNameError, invalidSignatureError, invalidWallet, isEthlikeBlockchain, isEthlikeNetwork, isSupportedNetwork, kitProvidersAndWalletsConfigError, makeError, networkToBlockchain, noCoinAvailableToBuy, noUserDataError, notImplementedError, oauthError, parseFaceSolanaNearTransactionPayload, sendTransactionError, signError, unknownError, unsupportedChainError, unsupportedProviderError, unsupportedTokenProviderError, userRejectedRequest }; | ||
export { AccountSecret, AccountsResponse, AptosSignMessagePayload, AptosSignMessageResponse, AptosTxOptions, Blockchain, BoraPortalConnectRequest, BoraPortalConnectStatusEnum, BoraPortalConnectStatusResponse, Coin, ConnectedWallet, ConnectionResult, CryptoBuffer, Currency, DappMetaData, DesktopOS, Env, EthTransactionRequest, FaceAptosTransactionPayload, FaceAuthSession, FaceAuthSessionKey, FaceError, FaceErrorCode, FaceEthereumTransactionPayload, FaceHederaTransactionPayload, FaceIdTokenResponse, FaceLoginResponse, FaceOAuthResult, FaceOAuthResultKey, FacePlatform, FaceSDK, FaceService, FaceSolanaNearTransactionPayload, FaceTezosTransferPayload, FaceTransactionPayload, FaceVersionLocalKey, HexString, HomeOptions, HttpStatus, IconTypes, JsonRpcBatchRequestCallback, JsonRpcError, JsonRpcMethod, JsonRpcRequestCallback, JsonRpcRequestPayload, JsonRpcResponsePayload, JsonRpcSource, KeyPair, LoginProvider, LoginProviderType, LoginWithAccessTokenRequest, LoginWithIdTokenRequest, MobileOS, Network, OS, OnRampOptions, PinCode, Platform, ProviderRpcError, Receipt, RpcErrorCode, ScreenSize, Share1LocalForage, TezosTransferCoinRequest, TezosTransferFa2Params, TezosTransferFtRequest, Token, TxType, UserStatus, Wallet, WalletMetaData, WalletPath, alreadyConnectedToOtherBappusn, assert, assertArgument, bappusnAlreadyConnectedToOtherWallet, boraServiceRegionIsWrong, invalidApiKeyError, invalidArgumentError, invalidBoraPortalIdAndSecretKey, invalidEnvironmentError, invalidHostNameError, invalidSignatureError, invalidWallet, kitProvidersAndWalletsConfigError, makeError, noCoinAvailableToBuy, noUserDataError, notImplementedError, oauthError, parseFaceSolanaNearTransactionPayload, sendTransactionError, signError, unknownError, unsupportedChainError, unsupportedProviderError, unsupportedTokenProviderError, userRejectedRequest }; |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("ethers");var r;exports.Network=void 0,(r=exports.Network||(exports.Network={})).ETHEREUM="ethereum",r.ROPSTEN="ropsten",r.SEPOLIA="sepolia",r.POLYGON="polygon",r.MUMBAI="mumbai",r.TEZOS="tezos",r.GHOSTNET="ghostnet",r.BNB_SMART_CHAIN="bnb_smart_chain",r.BNB_SMART_CHAIN_TESTNET="bnb_smart_chain_testnet",r.KLAYTN="klaytn",r.BAOBAB="baobab",r.SOLANA="solana",r.SOLANA_DEVNET="solana_devnet",r.NEAR="near",r.NEAR_TESTNET="near_testnet",r.BORA="bora",r.BORA_TESTNET="bora_testnet",r.ETH_MAINNET="ethereum",r.ETH_TESTNET="ropsten",r.MATIC_MAINNET="polygon",r.MATIC_TESTNET="mumbai",r.BINANCE_COIN_MAINNET="bnb_smart_chain",r.BINANCE_COIN_TESTNET="bnb_smart_chain_testnet",r.KLAYTN_MAINNET="klaytn",r.KLAYTN_TESTNET="baobab",r.APTOS="aptoslab",r.APTOS_TESTNET="aptoslab_testnet",r.MEVERSE="meverse",r.MEVERSE_TESTNET="meverse_testnet",r.PSM="psm",r.PSM_TESTNET="psm_testnet",r.PSM_TESTNET_TEST="psm_testnet_test",r.PSM_TESTNET_DEV="psm_testnet_dev",r.HOME_VERSE="home_verse",r.HOME_VERSE_TESTNET="home_verse_testnet",r.YOOLDO_VERSE="yooldo_verse",r.SAND_VERSE="sand_verse",r.OASYS="oasys",r.OASYS_TESTNET="oasys_testnet",r.MCH_VERSE="mch_verse",r.MCH_VERSE_TESTNET="mch_verse_testnet",r.HEDERA="hedera",r.HEDERA_TESTNET="hedera_testnet",r.DEFI_VERSE_TESTNET="defi_verse_testnet",r.DEFI_VERSE="defi_verse",r.KROMA="kroma",r.KROMA_SEPOLIA="kroma_sepolia",r.ASM_QA="asm_qa",r.ASM_TEST="asm_test",r.ASM_DEV="asm_dev";const t={[exports.Network.ETHEREUM]:1,[exports.Network.ROPSTEN]:3,[exports.Network.SEPOLIA]:11155111,[exports.Network.POLYGON]:137,[exports.Network.MUMBAI]:80001,[exports.Network.TEZOS]:9999999,[exports.Network.GHOSTNET]:9999998,[exports.Network.BNB_SMART_CHAIN]:56,[exports.Network.BNB_SMART_CHAIN_TESTNET]:97,[exports.Network.KLAYTN]:8217,[exports.Network.BAOBAB]:1001,[exports.Network.SOLANA]:0,[exports.Network.SOLANA_DEVNET]:0,[exports.Network.NEAR]:0,[exports.Network.NEAR_TESTNET]:0,[exports.Network.BORA]:77001,[exports.Network.BORA_TESTNET]:99001,[exports.Network.APTOS]:1,[exports.Network.APTOS_TESTNET]:2,[exports.Network.MEVERSE]:7518,[exports.Network.MEVERSE_TESTNET]:4759,[exports.Network.PSM_TESTNET_DEV]:100,[exports.Network.PSM_TESTNET_TEST]:400,[exports.Network.PSM_TESTNET]:500,[exports.Network.PSM]:91002,[exports.Network.HOME_VERSE]:19011,[exports.Network.HOME_VERSE_TESTNET]:40875,[exports.Network.YOOLDO_VERSE]:411,[exports.Network.SAND_VERSE]:20197,[exports.Network.OASYS]:248,[exports.Network.OASYS_TESTNET]:9372,[exports.Network.MCH_VERSE]:29548,[exports.Network.MCH_VERSE_TESTNET]:420,[exports.Network.HEDERA]:295,[exports.Network.HEDERA_TESTNET]:296,[exports.Network.DEFI_VERSE]:16116,[exports.Network.DEFI_VERSE_TESTNET]:17117,[exports.Network.KROMA]:255,[exports.Network.KROMA_SEPOLIA]:2358,[exports.Network.ASM_QA]:807424,[exports.Network.ASM_TEST]:595581,[exports.Network.ASM_DEV]:955081,1:exports.Network.ETHEREUM,3:exports.Network.ROPSTEN,11155111:exports.Network.SEPOLIA,137:exports.Network.POLYGON,80001:exports.Network.MUMBAI,9999999:exports.Network.TEZOS,9999998:exports.Network.GHOSTNET,56:exports.Network.BNB_SMART_CHAIN,97:exports.Network.BNB_SMART_CHAIN_TESTNET,8217:exports.Network.KLAYTN,1001:exports.Network.BAOBAB,77001:exports.Network.BORA,99001:exports.Network.BORA_TESTNET,7518:exports.Network.MEVERSE,4759:exports.Network.MEVERSE_TESTNET,100:exports.Network.PSM_TESTNET_DEV,400:exports.Network.PSM_TESTNET_TEST,500:exports.Network.PSM_TESTNET,91002:exports.Network.PSM,19011:exports.Network.HOME_VERSE,40875:exports.Network.HOME_VERSE_TESTNET,411:exports.Network.YOOLDO_VERSE,20197:exports.Network.SAND_VERSE,248:exports.Network.OASYS,9372:exports.Network.OASYS_TESTNET,29548:exports.Network.MCH_VERSE,420:exports.Network.MCH_VERSE_TESTNET,295:exports.Network.HEDERA,296:exports.Network.HEDERA_TESTNET,16116:exports.Network.DEFI_VERSE,17117:exports.Network.DEFI_VERSE_TESTNET,255:exports.Network.KROMA,2358:exports.Network.KROMA_SEPOLIA,807424:exports.Network.ASM_QA,595581:exports.Network.ASM_TEST,955081:exports.Network.ASM_DEV};var o;exports.Blockchain=void 0,(o=exports.Blockchain||(exports.Blockchain={})).ETHEREUM="ETHEREUM",o.POLYGON="POLYGON",o.BNB_SMART_CHAIN="BNB_SMART_CHAIN",o.KLAYTN="KLAYTN",o.SOLANA="SOLANA",o.TEZOS="TEZOS",o.NEAR="NEAR",o.BORA="BORA",o.APTOS="APTOS",o.MEVERSE="MEVERSE",o.PSM="PSM",o.PSM_TEST="PSM_TEST",o.PSM_DEV="PSM_DEV",o.HOME_VERSE="HOME_VERSE",o.YOOLDO_VERSE="YOOLDO_VERSE",o.OASYS="OASYS",o.MCH_VERSE="MCH_VERSE",o.HEDERA="HEDERA",o.DEFI_VERSE="DEFI_VERSE",o.KROMA="KROMA",o.ASM_TEST="ASM_TEST",o.ASM_QA="ASM_QA",o.ASM_DEV="ASM_DEV";const s=[exports.Blockchain.ETHEREUM,exports.Blockchain.POLYGON,exports.Blockchain.BNB_SMART_CHAIN,exports.Blockchain.KLAYTN,exports.Blockchain.BORA,exports.Blockchain.MEVERSE,exports.Blockchain.PSM,exports.Blockchain.PSM_DEV,exports.Blockchain.PSM_TEST,exports.Blockchain.HOME_VERSE,exports.Blockchain.YOOLDO_VERSE,exports.Blockchain.OASYS,exports.Blockchain.MCH_VERSE,exports.Blockchain.HEDERA,exports.Blockchain.DEFI_VERSE,exports.Blockchain.KROMA,exports.Blockchain.ASM_QA,exports.Blockchain.ASM_TEST,exports.Blockchain.ASM_DEV];function E(e){switch(e){case exports.Network.ETHEREUM:case exports.Network.ROPSTEN:case exports.Network.SEPOLIA:return exports.Blockchain.ETHEREUM;case exports.Network.POLYGON:case exports.Network.MUMBAI:return exports.Blockchain.POLYGON;case exports.Network.TEZOS:case exports.Network.GHOSTNET:return exports.Blockchain.TEZOS;case exports.Network.BNB_SMART_CHAIN:case exports.Network.BNB_SMART_CHAIN_TESTNET:return exports.Blockchain.BNB_SMART_CHAIN;case exports.Network.KLAYTN:case exports.Network.BAOBAB:return exports.Blockchain.KLAYTN;case exports.Network.SOLANA:case exports.Network.SOLANA_DEVNET:return exports.Blockchain.SOLANA;case exports.Network.BORA:case exports.Network.BORA_TESTNET:return exports.Blockchain.BORA;case exports.Network.NEAR:case exports.Network.NEAR_TESTNET:return exports.Blockchain.NEAR;case exports.Network.APTOS:case exports.Network.APTOS_TESTNET:return exports.Blockchain.APTOS;case exports.Network.MEVERSE:case exports.Network.MEVERSE_TESTNET:return exports.Blockchain.MEVERSE;case exports.Network.PSM:case exports.Network.PSM_TESTNET:return exports.Blockchain.PSM;case exports.Network.PSM_TESTNET_TEST:return exports.Blockchain.PSM_TEST;case exports.Network.PSM_TESTNET_DEV:return exports.Blockchain.PSM_DEV;case exports.Network.HOME_VERSE:case exports.Network.HOME_VERSE_TESTNET:return exports.Blockchain.HOME_VERSE;case exports.Network.YOOLDO_VERSE:case exports.Network.SAND_VERSE:return exports.Blockchain.YOOLDO_VERSE;case exports.Network.OASYS:case exports.Network.OASYS_TESTNET:return exports.Blockchain.OASYS;case exports.Network.MCH_VERSE:case exports.Network.MCH_VERSE_TESTNET:return exports.Blockchain.MCH_VERSE;case exports.Network.HEDERA:case exports.Network.HEDERA_TESTNET:return exports.Blockchain.HEDERA;case exports.Network.DEFI_VERSE:case exports.Network.DEFI_VERSE_TESTNET:return exports.Blockchain.DEFI_VERSE;case exports.Network.KROMA:case exports.Network.KROMA_SEPOLIA:return exports.Blockchain.KROMA;case exports.Network.ASM_QA:return exports.Blockchain.ASM_QA;case exports.Network.ASM_TEST:return exports.Blockchain.ASM_TEST;case exports.Network.ASM_DEV:return exports.Blockchain.ASM_DEV}throw new Error(`Unsupported network: ${e}`)}var a,n,c,_,N,T,S,p,A;exports.BoraPortalConnectStatusEnum=void 0,(a=exports.BoraPortalConnectStatusEnum||(exports.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",a.Unconnected="UNCONNECTED";class i{constructor(e,r){i.ensureHexString(e),i.checkLength(e,r),this.hex=e,this.length=r}static empty(){return new i("",0)}static fromUint8Array(e){return new i(x(e),e.length)}static fromHex(e,r){return new i(e,r)}static ensureHexString(e){try{if(""===e)return;if(null==e)throw new Error(`hex is null ${e}`);if(!e.startsWith("0x"))throw new Error(`hex does not start with 0x ${e}`);if(null==e.match("0x[0-9a-fA-F]+"))throw new Error(`invalid hex data ${e}`)}catch(e){throw e}}static checkLength(e,r){if(0===e.length)return;if(4*(e.length-2)/8>r)throw new Error(`length is less than hex data ${e}, ${r}`)}toString(){return this.hex}toHex(){return this.hex}toBigNumber(){return e.BigNumber.from(this.hex)}toJSON(){return{hex:this.hex,length:this.length}}static fromJSON(e){const{hex:r,length:t}=JSON.parse(e);return new i(r,t)}static fromBigNumber(e,r){return i.fromHex(e.toHexString(),r)}toUInt8Array(){const e=this.hex.substring(2),r=[];for(let t=0;t<e.length;t+=2)r.push(parseInt(e.substring(t,t+2),16));return new Uint8Array(r)}static concat(e,r){try{const t=e.toUInt8Array(),o=r.toUInt8Array(),s=new Uint8Array(t.length+o.length);s.set(t),s.set(o,t.length);const E=x(s);return new i(E,t.length+o.length)}catch(e){return console.debug("concat error",e),i.empty()}}split(e){const r=this.toUInt8Array();return[i.fromUint8Array(r.slice(0,e)),i.fromUint8Array(r.slice(e))]}clone(){return new i(this.hex,this.length)}unsafeSetLength(e){this.length=e}}function x(e){return"0x"+[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function R(e){return function(e){return null===e}(e)||function(e){return void 0===e}(e)}exports.Env=void 0,(n=exports.Env||(exports.Env={})).Local="Local",n.Dev="Dev",n.StageTest="StageTest",n.StageMainnet="StageMainnet",n.ProdTest="ProdTest",n.ProdMainnet="ProdMainnet",exports.DesktopOS=void 0,(c=exports.DesktopOS||(exports.DesktopOS={})).Linux="linux",c.MacOS="mac_os",c.Unix="unix",c.Unknown="unknown",c.Windows="windows",exports.MobileOS=void 0,(_=exports.MobileOS||(exports.MobileOS={})).Android="android",_.iOS="ios",_.Unknown="unknown",_.WindowsPhone="Windows Phone",exports.JsonRpcMethod=void 0,(N=exports.JsonRpcMethod||(exports.JsonRpcMethod={})).face_logInSignUp="face_logInSignUp",N.face_loggedIn="face_loggedIn",N.face_logOut="face_logOut",N.face_open2fa="face_open2fa",N.face_currentUser="face_currentUser",N.face_accounts="face_accounts",N.face_getUserVerificationToken="face_getUserVerificationToken",N.face_openIframe="face_openIframe",N.face_closeIframe="face_closeIframe",N.face_ready="face_ready",N.face_openHome="face_openHome",N.face_openBuy="face_openBuy",N.face_openKit="face_openKit",N.face_connectExternalWallet="face_connectExternalWallet",N.face_openWalletConnect="face_openWalletConnect",N.face_confirmWalletConnectDapp="face_confirmWalletConnectDapp",N.face_switchNetwork="face_switchNetwork",N.face_directSocialLogin="face_directSocialLogin",N.face_getIdToken="face_getIdToken",N.face_loginWithIdToken="face_loginWithIdToken",N.face_loginWithAccessToken="face_loginWithAccessToken",N.face_showToast="face_showToast",N.bora_connect="bora_connect",N.bora_isConnected="bora_isConnected",N.eth_sendTransaction="eth_sendTransaction",N.eth_getBalance="eth_getBalance",N.eth_call="eth_call",N.eth_estimateGas="eth_estimateGas",N.eth_sign="eth_sign",N.eth_signTypedData_v3="eth_signTypedData_v3",N.eth_signTypedData_v4="eth_signTypedData_v4",N.eth_chainId="eth_chainId",N.eth_accounts="eth_accounts",N.personal_sign="personal_sign",N.personal_listAccounts="personal_listAccounts",N.wallet_switchEthereumChain="wallet_switchEthereumChain",N.solana_sendTransaction="solana_sendTransaction",N.near_broadcast_tx_async="near_broadcast_tx_async",N.near_get_balance="near_get_balance",N.aptos_signMultiAgentTransaction="aptos_signMultiAgentTransaction",N.aptos_signMessage="aptos_signMessage",N.aptos_signTransaction="aptos_signTransaction",N.aptos_signAndSubmitTransaction="aptos_signAndSubmitTransaction",N.hedera_associate="hedera_associate",N.tezos_publicKey="tezos_publicKey",N.tezos_transferFA2="tezos_transferFA2",N.tezos_transferCoin="tezos_transferCoin",N.hedera_getAccountId="hedera_getAccountId",N.hedera_getHashConnectPairString="hedera_getHashConnectPairString",N.hedera_initHashConnect="hedera_initHashConnect",N.hedera_pairHashConnect="hedera_pairHashConnect",N.hedera_disconnectHashConnect="hedera_disconnectHashConnect",exports.JsonRpcSource=void 0,(T=exports.JsonRpcSource||(exports.JsonRpcSource={})).FACE_SDK="FACE_SDK",T.FACE_IFRAME="FACE_IFRAME",T.FACE_WALLET_CONNECT="FACE_WALLET_CONNECT",T.FACE_NATIVE_SDK="FACE_NATIVE_SDK",exports.RpcErrorCode=void 0,(S=exports.RpcErrorCode||(exports.RpcErrorCode={}))[S.PARSE_ERROR=-32700]="PARSE_ERROR",S[S.INVALID_REQUEST=-32600]="INVALID_REQUEST",S[S.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",S[S.INVALID_PARAMS=-32602]="INVALID_PARAMS",S[S.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",exports.HttpStatus=void 0,(p=exports.HttpStatus||(exports.HttpStatus={}))[p.SUCCESS=200]="SUCCESS",p[p.CREATED=201]="CREATED",p[p.BAD_REQUEST=400]="BAD_REQUEST",p[p.UNAUTHORIZED=401]="UNAUTHORIZED",p[p.FORBIDDEN=403]="FORBIDDEN",p[p.NOT_FOUND=404]="NOT_FOUND",p[p.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",exports.FaceErrorCode=void 0,(A=exports.FaceErrorCode||(exports.FaceErrorCode={}))[A.INVALID_ARGUMENT=4e3]="INVALID_ARGUMENT",A[A.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",A[A.NOT_IMPLEMENTED=4002]="NOT_IMPLEMENTED",A[A.BAD_REQUEST=4003]="BAD_REQUEST",A[A.SEND_TRANSACTION_FAILED=4004]="SEND_TRANSACTION_FAILED",A[A.SIGN_FAILED=4005]="SIGN_FAILED",A[A.UNAUTHORIZED=4100]="UNAUTHORIZED",A[A.NO_USER_DATA=4101]="NO_USER_DATA",A[A.AUTHENTICATION=4102]="AUTHENTICATION",A[A.UNSUPPORTED_SOCIAL_PROVIDER=4103]="UNSUPPORTED_SOCIAL_PROVIDER",A[A.INVALID_ENVIRONMENT=4200]="INVALID_ENVIRONMENT",A[A.UNSUPPORTED_METHOD=4201]="UNSUPPORTED_METHOD",A[A.UNSUPPORTED_CHAIN=4202]="UNSUPPORTED_CHAIN",A[A.INVALID_WALLET=4300]="INVALID_WALLET",A[A.PROVIDERS_AND_WALLETS_CONFIG_ERROR=4301]="PROVIDERS_AND_WALLETS_CONFIG_ERROR",A[A.NO_COIN_AVAILABLE_TO_BUY=4400]="NO_COIN_AVAILABLE_TO_BUY",A[A.INVALID_SIGNATURE_MESSAGE=4906]="INVALID_SIGNATURE_MESSAGE",A[A.INVALID_BORA_API_AND_SECRET_KEY=4907]="INVALID_BORA_API_AND_SECRET_KEY",A[A.ALREADY_CONNECTED_OTHER_BAPP_USN=4909]="ALREADY_CONNECTED_OTHER_BAPP_USN",A[A.BORA_SERVICE_REGION_IS_WRONG=4910]="BORA_SERVICE_REGION_IS_WRONG",A[A.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET=4911]="BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET",A[A.INTERNAL=5e3]="INTERNAL";class k extends Error{static isFaceError(e){return e.isFaceError}isValidErrorCode(e){return!R(r=e)&&"number"==typeof r&&Object.values(exports.RpcErrorCode).includes(r)||function(e){return!R(e)&&"number"==typeof e&&Object.values(exports.FaceErrorCode).includes(e)}(e);var r}constructor(e){var r;if(super(),this.isFaceError=!0,this.code=this.isValidErrorCode(e.code)?e.code:exports.FaceErrorCode.INTERNAL,this.message=`Face Error: [${this.code}] ${e.message}`,e.origin){const t=e.origin.isFaceError&&e.origin.origin?e.origin.origin:e.origin,{message:o,stack:s,name:E,cause:a}=t;this.origin={message:o,stack:s,name:E,cause:a},t.isAxiosError&&(this.origin.data=null===(r=null==t?void 0:t.response)||void 0===r?void 0:r.data)}e.data&&(this.data=e.data),Object.setPrototypeOf(this,k.prototype),Error.captureStackTrace(this,this.constructor)}}function O(e,r){return l({message:`invalid ${e}`+(r?`: ${r}`:""),code:exports.FaceErrorCode.INVALID_ARGUMENT})}function l(e){return new k(e)}function w(e,r,t){if(!e)throw r(...null!=t?t:[])}const h=["MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsY-w2HRh6VwRfOw5P7pMvQzxf3Hz3dOurwCeV4AHmVWpxh-DfQx8aKL8394dJVy7x2geVeKR62rSl58HsFsr9utgvHb7PzZluV6DlDQJKrsHIjYiOSKVadMUgNHV40NgrzQggxuOY0MhJ599GWeXps_PPzWv7hsLircae1PnVOQIDAQAB","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnh7y9sFxoFWwjP9Xlg7s9kXqfRGMusccEFr-LcvzyfPrFohvaKw0YLdMdb8trgK5M5VCEGWJ8p_sMSwb6i_MkQwv2s711uKxHAasUmDtX6eMy3eNKowdZo5nXraQpQd529c0jtZt5l07ryHHts3k4MF0W83GpaoWgjSLXhMEK8QIDAQAB","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqBmCzkl0ClfF_yuegA44dL5KGOq4BxtQlizFKFjh3VR2zIyHmp8Y6aFXhLmuJjiyRvZXi9K_dA0mEH458U9pf7iffGZOEa8fRELachZmd2-dZuI6mdL7XrNPY8XNPG4EcCtp3GVVefSr3dKEaTaBl6c0BUBWRBcpWLkX0cSe2bQIDAQAB","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCS23ncDS7x8nmTuK1FFN0EfYo0vo6xhTBMBNWVbQsufv60X8hv3-TbAQ3JIyMEhLo-c-31oYrvrQ0G2e9j8yvJYEUnLuE-PaABo0y3V5m9g_qdTB5p9eEfqZlDrcUl1zUr4W7rJwFwkTlAFSKOqVCPnm8ozmcMyyrEHgl2AbehrQIDAQAB"],u=new Set([exports.Blockchain.PSM,exports.Blockchain.PSM_DEV,exports.Blockchain.PSM_TEST]),M=new Set([exports.Blockchain.ASM_QA,exports.Blockchain.ASM_TEST,exports.Blockchain.ASM_DEV]);function d(e){return h.includes(e)}var I;exports.TxType=void 0,(I=exports.TxType||(exports.TxType={})).COIN="COIN",I.ERC20="ERC20",I.ERC721="ERC721",I.ERC1155="ERC1155",I.FT="FT",I.CONVERT="CONVERT",I.Associate="ASSOCIATE",I.FA2_FT="FA2_FT",I.FA2_NFT="FA2_NFT",I.FA2_MFT="FA2_MFT";var B;exports.UserStatus=void 0,(B=exports.UserStatus||(exports.UserStatus={})).isWalletCreated="isWalletCreated",B.isNewUser="isNewUser",B.isRegisteredPinCode="isRegisteredPinCode",B.isAdmin="isAdmin",exports.CryptoBuffer=i,exports.FaceAuthSessionKey="Face-Auth-Session",exports.FaceError=k,exports.FaceOAuthResultKey="Face-OAuth-Result",exports.FaceVersionLocalKey="Face-Version",exports.LoginProvider={Google:"google.com",Apple:"apple.com",Twitter:"twitter.com",Discord:"discord.com",Facebook:"facebook.com",Kakao:"kakao.com"},exports.NetworkChainIdMap=t,exports.WalletPath="m/44'/60'/1'/0/0",exports.alreadyConnectedToOtherBappusn=function(e){return l({message:"already connected to other bappusn",code:exports.FaceErrorCode.ALREADY_CONNECTED_OTHER_BAPP_USN,origin:e})},exports.assert=w,exports.assertArgument=function(e,r,t,o=!0){(o||e)&&w(!!e&&r,O,[t])},exports.bappusnAlreadyConnectedToOtherWallet=function(e){return l({message:"bappusn already connected to other wallet",code:exports.FaceErrorCode.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET,origin:e})},exports.boraServiceRegionIsWrong=function(e){return new k({message:"bora service region is wrong",code:exports.FaceErrorCode.BORA_SERVICE_REGION_IS_WRONG,origin:e})},exports.filterNexonBlockchains=function(e,r){if(d(e))return r;const t=new Set(r);for(const e of u)t.delete(e);for(const e of M)t.delete(e);return t},exports.filterNexonNetworks=function(e,r,t){if(d(e))return r;const o=[];for(const e of r){const r=t(e);u.has(E(r))||M.has(E(r))||o.push(e)}return o},exports.getEthlikeBlockchains=function(){return s},exports.getPlatFormCoinDecimalByBlockchain=e=>{switch(e){case exports.Blockchain.ETHEREUM:case exports.Blockchain.POLYGON:case exports.Blockchain.KLAYTN:case exports.Blockchain.BNB_SMART_CHAIN:case exports.Blockchain.BORA:case exports.Blockchain.MEVERSE:case exports.Blockchain.PSM:case exports.Blockchain.PSM_DEV:case exports.Blockchain.PSM_TEST:case exports.Blockchain.HOME_VERSE:case exports.Blockchain.YOOLDO_VERSE:case exports.Blockchain.OASYS:case exports.Blockchain.MCH_VERSE:case exports.Blockchain.HEDERA:case exports.Blockchain.DEFI_VERSE:case exports.Blockchain.KROMA:case exports.Blockchain.ASM_QA:case exports.Blockchain.ASM_TEST:case exports.Blockchain.ASM_DEV:return 18;case exports.Blockchain.SOLANA:return 9;case exports.Blockchain.NEAR:return 24;case exports.Blockchain.APTOS:return 8;case exports.Blockchain.TEZOS:return 6;default:throw new Error("unsupported blockchain")}},exports.invalidApiKeyError=function(e){return l({message:"invalid api key error",code:exports.FaceErrorCode.UNAUTHORIZED,origin:e})},exports.invalidArgumentError=O,exports.invalidBoraPortalIdAndSecretKey=function(e){return l({message:"Not found bapp. please contact FaceWallet Team to register BoraPortal Client Id/SecretKey.",code:exports.FaceErrorCode.INVALID_BORA_API_AND_SECRET_KEY,origin:e})},exports.invalidEnvironmentError=function(e){return l({message:"invalid environment",code:exports.FaceErrorCode.INVALID_ENVIRONMENT,data:{env:e}})},exports.invalidHostNameError=function(e){return l({message:"invalid host name error",code:exports.FaceErrorCode.UNAUTHORIZED,origin:e})},exports.invalidSignatureError=function(e){return l({message:"Invalid Signature message.",code:exports.FaceErrorCode.INVALID_SIGNATURE_MESSAGE,origin:e})},exports.invalidWallet=function(){return l({message:"invalid wallet error",code:exports.FaceErrorCode.INVALID_WALLET})},exports.isEthlikeBlockchain=function(e){return-1!==s.indexOf(e)},exports.isEthlikeNetwork=e=>{switch(e){case exports.Network.ETHEREUM:case exports.Network.ROPSTEN:case exports.Network.SEPOLIA:case exports.Network.POLYGON:case exports.Network.MUMBAI:case exports.Network.BNB_SMART_CHAIN:case exports.Network.BNB_SMART_CHAIN_TESTNET:case exports.Network.KLAYTN:case exports.Network.BAOBAB:case exports.Network.BORA:case exports.Network.BORA_TESTNET:case exports.Network.MEVERSE:case exports.Network.MEVERSE_TESTNET:case exports.Network.PSM_TESTNET_DEV:case exports.Network.PSM_TESTNET_TEST:case exports.Network.PSM_TESTNET:case exports.Network.PSM:case exports.Network.HOME_VERSE:case exports.Network.HOME_VERSE_TESTNET:case exports.Network.YOOLDO_VERSE:case exports.Network.SAND_VERSE:case exports.Network.OASYS:case exports.Network.OASYS_TESTNET:case exports.Network.MCH_VERSE:case exports.Network.MCH_VERSE_TESTNET:case exports.Network.HEDERA:case exports.Network.HEDERA_TESTNET:case exports.Network.DEFI_VERSE:case exports.Network.DEFI_VERSE_TESTNET:case exports.Network.KROMA:case exports.Network.KROMA_SEPOLIA:case exports.Network.ASM_QA:case exports.Network.ASM_TEST:case exports.Network.ASM_DEV:return!0;default:return!1}},exports.isSupportedNetwork=e=>{switch(e){case exports.Network.ETHEREUM:case exports.Network.SEPOLIA:case exports.Network.POLYGON:case exports.Network.MUMBAI:case exports.Network.TEZOS:case exports.Network.GHOSTNET:case exports.Network.BNB_SMART_CHAIN:case exports.Network.BNB_SMART_CHAIN_TESTNET:case exports.Network.KLAYTN:case exports.Network.BAOBAB:case exports.Network.SOLANA:case exports.Network.SOLANA_DEVNET:case exports.Network.NEAR:case exports.Network.NEAR_TESTNET:case exports.Network.BORA:case exports.Network.BORA_TESTNET:case exports.Network.APTOS:case exports.Network.APTOS_TESTNET:case exports.Network.MEVERSE:case exports.Network.MEVERSE_TESTNET:case exports.Network.PSM_TESTNET:case exports.Network.PSM_TESTNET_DEV:case exports.Network.PSM_TESTNET_TEST:case exports.Network.HOME_VERSE:case exports.Network.HOME_VERSE_TESTNET:case exports.Network.YOOLDO_VERSE:case exports.Network.SAND_VERSE:case exports.Network.OASYS:case exports.Network.OASYS_TESTNET:case exports.Network.MCH_VERSE:case exports.Network.MCH_VERSE_TESTNET:case exports.Network.HEDERA:case exports.Network.HEDERA_TESTNET:case exports.Network.DEFI_VERSE:case exports.Network.DEFI_VERSE_TESTNET:case exports.Network.KROMA:case exports.Network.KROMA_SEPOLIA:case exports.Network.ASM_QA:case exports.Network.ASM_TEST:case exports.Network.ASM_DEV:return!0;default:return!1}},exports.kitProvidersAndWalletsConfigError=function(){return l({message:"Both wallets and providers cannot be empty.",code:exports.FaceErrorCode.PROVIDERS_AND_WALLETS_CONFIG_ERROR})},exports.makeError=l,exports.networkToBlockchain=E,exports.noCoinAvailableToBuy=function(e,r){return l({message:"No coin available to buy.",code:exports.FaceErrorCode.NO_COIN_AVAILABLE_TO_BUY,data:{blockchains:e,contractAddress:r}})},exports.noUserDataError=function(){return l({message:"no user data",code:exports.FaceErrorCode.NO_USER_DATA})},exports.notImplementedError=function(e){return l({message:e,code:exports.FaceErrorCode.NOT_IMPLEMENTED})},exports.oauthError=function(e,r){return l({message:`OAuth 2.0 Error: ${e}`,code:exports.FaceErrorCode.AUTHENTICATION,origin:r})},exports.parseFaceSolanaNearTransactionPayload=function(e){return null==e||"object"!=typeof e||null==e.serializedHex||"string"!=typeof e.serializedHex?null:e},exports.sendTransactionError=function(e){return l({message:e.message,code:exports.FaceErrorCode.SEND_TRANSACTION_FAILED,data:e.data})},exports.signError=function(e){return l({message:e,code:exports.FaceErrorCode.SIGN_FAILED})},exports.unknownError=function(e){return l({message:"unknown error",code:exports.FaceErrorCode.INTERNAL,origin:e})},exports.unsupportedChainError=function(e){return l({message:"unsupported chain error",code:exports.FaceErrorCode.UNSUPPORTED_CHAIN,origin:e})},exports.unsupportedProviderError=function(e){return l({message:`${e} login is not supported.`,code:exports.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},exports.unsupportedTokenProviderError=function(e){return l({message:`${e} is not support get id token`,code:exports.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},exports.userRejectedRequest=function(e){return l({code:exports.FaceErrorCode.USER_REJECTED_REQUEST,message:"user rejected request",data:{path:e}})}; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("ethers");var r,t,o,n,s,a,E,_,i,c,A,T;exports.Network=void 0,(r=exports.Network||(exports.Network={})).ETHEREUM="ethereum",r.SEPOLIA="sepolia",r.POLYGON="polygon",r.MUMBAI="mumbai",r.TEZOS="tezos",r.GHOSTNET="ghostnet",r.BNB_SMART_CHAIN="bnb_smart_chain",r.BNB_SMART_CHAIN_TESTNET="bnb_smart_chain_testnet",r.KLAYTN="klaytn",r.BAOBAB="baobab",r.SOLANA="solana",r.SOLANA_DEVNET="solana_devnet",r.NEAR="near",r.NEAR_TESTNET="near_testnet",r.BORA="bora",r.BORA_TESTNET="bora_testnet",r.ETH_MAINNET="ethereum",r.MATIC_MAINNET="polygon",r.MATIC_TESTNET="mumbai",r.BINANCE_COIN_MAINNET="bnb_smart_chain",r.BINANCE_COIN_TESTNET="bnb_smart_chain_testnet",r.KLAYTN_MAINNET="klaytn",r.KLAYTN_TESTNET="baobab",r.APTOS="aptoslab",r.APTOS_TESTNET="aptoslab_testnet",r.MEVERSE="meverse",r.MEVERSE_TESTNET="meverse_testnet",r.PSM="psm",r.PSM_TESTNET="psm_testnet",r.PSM_TESTNET_TEST="psm_testnet_test",r.PSM_TESTNET_DEV="psm_testnet_dev",r.HOME_VERSE="home_verse",r.HOME_VERSE_TESTNET="home_verse_testnet",r.YOOLDO_VERSE="yooldo_verse",r.SAND_VERSE="sand_verse",r.OASYS="oasys",r.OASYS_TESTNET="oasys_testnet",r.MCH_VERSE="mch_verse",r.MCH_VERSE_TESTNET="mch_verse_testnet",r.HEDERA="hedera",r.HEDERA_TESTNET="hedera_testnet",r.DEFI_VERSE_TESTNET="defi_verse_testnet",r.DEFI_VERSE="defi_verse",r.KROMA="kroma",r.KROMA_SEPOLIA="kroma_sepolia",r.ASM_QA="asm_qa",r.ASM_TEST="asm_test",r.ASM_DEV="asm_dev",r.LINEA="linea",r.LINEA_GOERLI="linea_goerli",exports.Blockchain=void 0,(t=exports.Blockchain||(exports.Blockchain={})).ETHEREUM="ETHEREUM",t.POLYGON="POLYGON",t.BNB_SMART_CHAIN="BNB_SMART_CHAIN",t.KLAYTN="KLAYTN",t.SOLANA="SOLANA",t.TEZOS="TEZOS",t.NEAR="NEAR",t.BORA="BORA",t.APTOS="APTOS",t.MEVERSE="MEVERSE",t.PSM="PSM",t.PSM_TEST="PSM_TEST",t.PSM_DEV="PSM_DEV",t.HOME_VERSE="HOME_VERSE",t.YOOLDO_VERSE="YOOLDO_VERSE",t.OASYS="OASYS",t.MCH_VERSE="MCH_VERSE",t.HEDERA="HEDERA",t.DEFI_VERSE="DEFI_VERSE",t.KROMA="KROMA",t.ASM_TEST="ASM_TEST",t.ASM_QA="ASM_QA",t.ASM_DEV="ASM_DEV",t.LINEA="LINEA",exports.BoraPortalConnectStatusEnum=void 0,(o=exports.BoraPortalConnectStatusEnum||(exports.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",o.Unconnected="UNCONNECTED";class N{constructor(e,r){N.ensureHexString(e),N.checkLength(e,r),this.hex=e,this.length=r}static empty(){return new N("",0)}static fromUint8Array(e){return new N(d(e),e.length)}static fromHex(e,r){return new N(e,r)}static ensureHexString(e){try{if(""===e)return;if(null==e)throw new Error(`hex is null ${e}`);if(!e.startsWith("0x"))throw new Error(`hex does not start with 0x ${e}`);if(null==e.match("0x[0-9a-fA-F]+"))throw new Error(`invalid hex data ${e}`)}catch(e){throw e}}static checkLength(e,r){if(0===e.length)return;if(4*(e.length-2)/8>r)throw new Error(`length is less than hex data ${e}, ${r}`)}toString(){return this.hex}toHex(){return this.hex}toBigNumber(){return e.BigNumber.from(this.hex)}toJSON(){return{hex:this.hex,length:this.length}}static fromJSON(e){const{hex:r,length:t}=JSON.parse(e);return new N(r,t)}static fromBigNumber(e,r){return N.fromHex(e.toHexString(),r)}toUInt8Array(){const e=this.hex.substring(2),r=[];for(let t=0;t<e.length;t+=2)r.push(parseInt(e.substring(t,t+2),16));return new Uint8Array(r)}static concat(e,r){try{const t=e.toUInt8Array(),o=r.toUInt8Array(),n=new Uint8Array(t.length+o.length);n.set(t),n.set(o,t.length);const s=d(n);return new N(s,t.length+o.length)}catch(e){return console.debug("concat error",e),N.empty()}}split(e){const r=this.toUInt8Array();return[N.fromUint8Array(r.slice(0,e)),N.fromUint8Array(r.slice(e))]}clone(){return new N(this.hex,this.length)}unsafeSetLength(e){this.length=e}}function d(e){return"0x"+[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function S(e){return function(e){return null===e}(e)||function(e){return void 0===e}(e)}exports.Env=void 0,(n=exports.Env||(exports.Env={})).Local="Local",n.Dev="Dev",n.StageTest="StageTest",n.StageMainnet="StageMainnet",n.ProdTest="ProdTest",n.ProdMainnet="ProdMainnet",exports.DesktopOS=void 0,(s=exports.DesktopOS||(exports.DesktopOS={})).Linux="linux",s.MacOS="mac_os",s.Unix="unix",s.Unknown="unknown",s.Windows="windows",exports.MobileOS=void 0,(a=exports.MobileOS||(exports.MobileOS={})).Android="android",a.iOS="ios",a.Unknown="unknown",a.WindowsPhone="Windows Phone",exports.JsonRpcMethod=void 0,(E=exports.JsonRpcMethod||(exports.JsonRpcMethod={})).face_logInSignUp="face_logInSignUp",E.face_loggedIn="face_loggedIn",E.face_logOut="face_logOut",E.face_open2fa="face_open2fa",E.face_currentUser="face_currentUser",E.face_accounts="face_accounts",E.face_getUserVerificationToken="face_getUserVerificationToken",E.face_openIframe="face_openIframe",E.face_closeIframe="face_closeIframe",E.face_ready="face_ready",E.face_openHome="face_openHome",E.face_openBuy="face_openBuy",E.face_openKit="face_openKit",E.face_connectExternalWallet="face_connectExternalWallet",E.face_openWalletConnect="face_openWalletConnect",E.face_confirmWalletConnectDapp="face_confirmWalletConnectDapp",E.face_switchNetwork="face_switchNetwork",E.face_directSocialLogin="face_directSocialLogin",E.face_getIdToken="face_getIdToken",E.face_loginWithIdToken="face_loginWithIdToken",E.face_loginWithAccessToken="face_loginWithAccessToken",E.face_showToast="face_showToast",E.bora_connect="bora_connect",E.bora_isConnected="bora_isConnected",E.eth_sendTransaction="eth_sendTransaction",E.eth_getBalance="eth_getBalance",E.eth_call="eth_call",E.eth_estimateGas="eth_estimateGas",E.eth_sign="eth_sign",E.eth_signTypedData_v3="eth_signTypedData_v3",E.eth_signTypedData_v4="eth_signTypedData_v4",E.eth_chainId="eth_chainId",E.eth_accounts="eth_accounts",E.personal_sign="personal_sign",E.personal_listAccounts="personal_listAccounts",E.wallet_switchEthereumChain="wallet_switchEthereumChain",E.solana_sendTransaction="solana_sendTransaction",E.near_broadcast_tx_async="near_broadcast_tx_async",E.near_get_balance="near_get_balance",E.aptos_signMultiAgentTransaction="aptos_signMultiAgentTransaction",E.aptos_signMessage="aptos_signMessage",E.aptos_signTransaction="aptos_signTransaction",E.aptos_signAndSubmitTransaction="aptos_signAndSubmitTransaction",E.hedera_associate="hedera_associate",E.tezos_publicKey="tezos_publicKey",E.tezos_transferFA2="tezos_transferFA2",E.tezos_transferCoin="tezos_transferCoin",E.hedera_getAccountId="hedera_getAccountId",E.hedera_getHashConnectPairString="hedera_getHashConnectPairString",E.hedera_initHashConnect="hedera_initHashConnect",E.hedera_pairHashConnect="hedera_pairHashConnect",E.hedera_disconnectHashConnect="hedera_disconnectHashConnect",exports.JsonRpcSource=void 0,(_=exports.JsonRpcSource||(exports.JsonRpcSource={})).FACE_SDK="FACE_SDK",_.FACE_IFRAME="FACE_IFRAME",_.FACE_WALLET_CONNECT="FACE_WALLET_CONNECT",_.FACE_NATIVE_SDK="FACE_NATIVE_SDK",exports.RpcErrorCode=void 0,(i=exports.RpcErrorCode||(exports.RpcErrorCode={}))[i.PARSE_ERROR=-32700]="PARSE_ERROR",i[i.INVALID_REQUEST=-32600]="INVALID_REQUEST",i[i.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",i[i.INVALID_PARAMS=-32602]="INVALID_PARAMS",i[i.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",exports.HttpStatus=void 0,(c=exports.HttpStatus||(exports.HttpStatus={}))[c.SUCCESS=200]="SUCCESS",c[c.CREATED=201]="CREATED",c[c.BAD_REQUEST=400]="BAD_REQUEST",c[c.UNAUTHORIZED=401]="UNAUTHORIZED",c[c.FORBIDDEN=403]="FORBIDDEN",c[c.NOT_FOUND=404]="NOT_FOUND",c[c.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",exports.FaceErrorCode=void 0,(A=exports.FaceErrorCode||(exports.FaceErrorCode={}))[A.INVALID_ARGUMENT=4e3]="INVALID_ARGUMENT",A[A.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",A[A.NOT_IMPLEMENTED=4002]="NOT_IMPLEMENTED",A[A.BAD_REQUEST=4003]="BAD_REQUEST",A[A.SEND_TRANSACTION_FAILED=4004]="SEND_TRANSACTION_FAILED",A[A.SIGN_FAILED=4005]="SIGN_FAILED",A[A.UNAUTHORIZED=4100]="UNAUTHORIZED",A[A.NO_USER_DATA=4101]="NO_USER_DATA",A[A.AUTHENTICATION=4102]="AUTHENTICATION",A[A.UNSUPPORTED_SOCIAL_PROVIDER=4103]="UNSUPPORTED_SOCIAL_PROVIDER",A[A.INVALID_ENVIRONMENT=4200]="INVALID_ENVIRONMENT",A[A.UNSUPPORTED_METHOD=4201]="UNSUPPORTED_METHOD",A[A.UNSUPPORTED_CHAIN=4202]="UNSUPPORTED_CHAIN",A[A.INVALID_WALLET=4300]="INVALID_WALLET",A[A.PROVIDERS_AND_WALLETS_CONFIG_ERROR=4301]="PROVIDERS_AND_WALLETS_CONFIG_ERROR",A[A.NO_COIN_AVAILABLE_TO_BUY=4400]="NO_COIN_AVAILABLE_TO_BUY",A[A.INVALID_SIGNATURE_MESSAGE=4906]="INVALID_SIGNATURE_MESSAGE",A[A.INVALID_BORA_API_AND_SECRET_KEY=4907]="INVALID_BORA_API_AND_SECRET_KEY",A[A.ALREADY_CONNECTED_OTHER_BAPP_USN=4909]="ALREADY_CONNECTED_OTHER_BAPP_USN",A[A.BORA_SERVICE_REGION_IS_WRONG=4910]="BORA_SERVICE_REGION_IS_WRONG",A[A.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET=4911]="BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET",A[A.INTERNAL=5e3]="INTERNAL";class p extends Error{static isFaceError(e){return e.isFaceError}isValidErrorCode(e){return!S(r=e)&&"number"==typeof r&&Object.values(exports.RpcErrorCode).includes(r)||function(e){return!S(e)&&"number"==typeof e&&Object.values(exports.FaceErrorCode).includes(e)}(e);var r}constructor(e){var r;if(super(),this.isFaceError=!0,this.code=this.isValidErrorCode(e.code)?e.code:exports.FaceErrorCode.INTERNAL,this.message=`Face Error: [${this.code}] ${e.message}`,e.origin){const t=e.origin.isFaceError&&e.origin.origin?e.origin.origin:e.origin,{message:o,stack:n,name:s,cause:a}=t;this.origin={message:o,stack:n,name:s,cause:a},t.isAxiosError&&(this.origin.data=null===(r=null==t?void 0:t.response)||void 0===r?void 0:r.data)}e.data&&(this.data=e.data),Object.setPrototypeOf(this,p.prototype),Error.captureStackTrace(this,this.constructor)}}function R(e,r){return u({message:`invalid ${e}`+(r?`: ${r}`:""),code:exports.FaceErrorCode.INVALID_ARGUMENT})}function u(e){return new p(e)}function l(e,r,t){if(!e)throw r(...null!=t?t:[])}exports.TxType=void 0,(T=exports.TxType||(exports.TxType={})).COIN="COIN",T.ERC20="ERC20",T.ERC721="ERC721",T.ERC1155="ERC1155",T.FT="FT",T.CONVERT="CONVERT",T.Associate="ASSOCIATE",T.FA2_FT="FA2_FT",T.FA2_NFT="FA2_NFT",T.FA2_MFT="FA2_MFT";var O;exports.UserStatus=void 0,(O=exports.UserStatus||(exports.UserStatus={})).isWalletCreated="isWalletCreated",O.isNewUser="isNewUser",O.isRegisteredPinCode="isRegisteredPinCode",O.isAdmin="isAdmin",exports.CryptoBuffer=N,exports.FaceAuthSessionKey="Face-Auth-Session",exports.FaceError=p,exports.FaceOAuthResultKey="Face-OAuth-Result",exports.FaceVersionLocalKey="Face-Version",exports.LoginProvider={Google:"google.com",Apple:"apple.com",Twitter:"twitter.com",Discord:"discord.com",Facebook:"facebook.com",Kakao:"kakao.com"},exports.WalletPath="m/44'/60'/1'/0/0",exports.alreadyConnectedToOtherBappusn=function(e){return u({message:"already connected to other bappusn",code:exports.FaceErrorCode.ALREADY_CONNECTED_OTHER_BAPP_USN,origin:e})},exports.assert=l,exports.assertArgument=function(e,r,t,o=!0){(o||e)&&l(!!e&&r,R,[t])},exports.bappusnAlreadyConnectedToOtherWallet=function(e){return u({message:"bappusn already connected to other wallet",code:exports.FaceErrorCode.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET,origin:e})},exports.boraServiceRegionIsWrong=function(e){return new p({message:"bora service region is wrong",code:exports.FaceErrorCode.BORA_SERVICE_REGION_IS_WRONG,origin:e})},exports.invalidApiKeyError=function(e){return u({message:"invalid api key error",code:exports.FaceErrorCode.UNAUTHORIZED,origin:e})},exports.invalidArgumentError=R,exports.invalidBoraPortalIdAndSecretKey=function(e){return u({message:"Not found bapp. please contact FaceWallet Team to register BoraPortal Client Id/SecretKey.",code:exports.FaceErrorCode.INVALID_BORA_API_AND_SECRET_KEY,origin:e})},exports.invalidEnvironmentError=function(e){return u({message:"invalid environment",code:exports.FaceErrorCode.INVALID_ENVIRONMENT,data:{env:e}})},exports.invalidHostNameError=function(e){return u({message:"invalid host name error",code:exports.FaceErrorCode.UNAUTHORIZED,origin:e})},exports.invalidSignatureError=function(e){return u({message:"Invalid Signature message.",code:exports.FaceErrorCode.INVALID_SIGNATURE_MESSAGE,origin:e})},exports.invalidWallet=function(){return u({message:"invalid wallet error",code:exports.FaceErrorCode.INVALID_WALLET})},exports.kitProvidersAndWalletsConfigError=function(){return u({message:"Both wallets and providers cannot be empty.",code:exports.FaceErrorCode.PROVIDERS_AND_WALLETS_CONFIG_ERROR})},exports.makeError=u,exports.noCoinAvailableToBuy=function(e,r){return u({message:"No coin available to buy.",code:exports.FaceErrorCode.NO_COIN_AVAILABLE_TO_BUY,data:{blockchains:e,contractAddress:r}})},exports.noUserDataError=function(){return u({message:"no user data",code:exports.FaceErrorCode.NO_USER_DATA})},exports.notImplementedError=function(e){return u({message:e,code:exports.FaceErrorCode.NOT_IMPLEMENTED})},exports.oauthError=function(e,r){return u({message:`OAuth 2.0 Error: ${e}`,code:exports.FaceErrorCode.AUTHENTICATION,origin:r})},exports.parseFaceSolanaNearTransactionPayload=function(e){return null==e||"object"!=typeof e||null==e.serializedHex||"string"!=typeof e.serializedHex?null:e},exports.sendTransactionError=function(e){return u({message:e.message,code:exports.FaceErrorCode.SEND_TRANSACTION_FAILED,data:e.data})},exports.signError=function(e){return u({message:e,code:exports.FaceErrorCode.SIGN_FAILED})},exports.unknownError=function(e){return u({message:"unknown error",code:exports.FaceErrorCode.INTERNAL,origin:e})},exports.unsupportedChainError=function(e){return u({message:"unsupported chain error",code:exports.FaceErrorCode.UNSUPPORTED_CHAIN,origin:e})},exports.unsupportedProviderError=function(e){return u({message:`${e} login is not supported.`,code:exports.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},exports.unsupportedTokenProviderError=function(e){return u({message:`${e} is not support get id token`,code:exports.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},exports.userRejectedRequest=function(e){return u({code:exports.FaceErrorCode.USER_REJECTED_REQUEST,message:"user rejected request",data:{path:e}})}; | ||
//# sourceMappingURL=index.js.map |
export declare enum Network { | ||
ETHEREUM = "ethereum", | ||
/** @deprecated NETWORK */ | ||
ROPSTEN = "ropsten", | ||
SEPOLIA = "sepolia", | ||
@@ -22,4 +20,2 @@ POLYGON = "polygon", | ||
ETH_MAINNET = "ethereum", | ||
/** @deprecated use ROPSTEN */ | ||
ETH_TESTNET = "ropsten", | ||
/** @deprecated use POLYGON */ | ||
@@ -61,8 +57,6 @@ MATIC_MAINNET = "polygon", | ||
ASM_TEST = "asm_test", | ||
ASM_DEV = "asm_dev" | ||
ASM_DEV = "asm_dev", | ||
LINEA = "linea", | ||
LINEA_GOERLI = "linea_goerli" | ||
} | ||
export declare const isSupportedNetwork: (network?: Network) => boolean; | ||
export declare const NetworkChainIdMap: { | ||
[key in Network | number]: Network | number; | ||
}; | ||
export declare enum Blockchain { | ||
@@ -91,7 +85,5 @@ ETHEREUM = "ETHEREUM", | ||
ASM_QA = "ASM_QA", | ||
ASM_DEV = "ASM_DEV" | ||
ASM_DEV = "ASM_DEV", | ||
LINEA = "LINEA" | ||
} | ||
export declare function networkToBlockchain(network: Network): Blockchain; | ||
export declare function isEthlikeBlockchain(blockchain: Blockchain): boolean; | ||
export declare function getEthlikeBlockchains(): Blockchain[]; | ||
export interface KeyPair { | ||
@@ -101,4 +93,2 @@ privateKey: Uint8Array; | ||
} | ||
export declare const getPlatFormCoinDecimalByBlockchain: (blockchain: Blockchain) => number; | ||
export declare const isEthlikeNetwork: (network: Network) => boolean; | ||
//# sourceMappingURL=blockchain.d.ts.map |
@@ -14,4 +14,4 @@ export * from './aptos'; | ||
export * from './kit'; | ||
export * from './nexon'; | ||
export * from './onRamp'; | ||
export * from './secret'; | ||
export * from './tezos'; | ||
@@ -18,0 +18,0 @@ export * from './transaction'; |
@@ -1,2 +0,2 @@ | ||
!function(e,r){"object"==typeof exports&&"undefined"!=typeof module?r(exports,require("ethers")):"function"==typeof define&&define.amd?define(["exports","ethers"],r):r((e="undefined"!=typeof globalThis?globalThis:e||self).FaceTypes={},e.ethers)}(this,(function(e,r){"use strict";var t;e.Network=void 0,(t=e.Network||(e.Network={})).ETHEREUM="ethereum",t.ROPSTEN="ropsten",t.SEPOLIA="sepolia",t.POLYGON="polygon",t.MUMBAI="mumbai",t.TEZOS="tezos",t.GHOSTNET="ghostnet",t.BNB_SMART_CHAIN="bnb_smart_chain",t.BNB_SMART_CHAIN_TESTNET="bnb_smart_chain_testnet",t.KLAYTN="klaytn",t.BAOBAB="baobab",t.SOLANA="solana",t.SOLANA_DEVNET="solana_devnet",t.NEAR="near",t.NEAR_TESTNET="near_testnet",t.BORA="bora",t.BORA_TESTNET="bora_testnet",t.ETH_MAINNET="ethereum",t.ETH_TESTNET="ropsten",t.MATIC_MAINNET="polygon",t.MATIC_TESTNET="mumbai",t.BINANCE_COIN_MAINNET="bnb_smart_chain",t.BINANCE_COIN_TESTNET="bnb_smart_chain_testnet",t.KLAYTN_MAINNET="klaytn",t.KLAYTN_TESTNET="baobab",t.APTOS="aptoslab",t.APTOS_TESTNET="aptoslab_testnet",t.MEVERSE="meverse",t.MEVERSE_TESTNET="meverse_testnet",t.PSM="psm",t.PSM_TESTNET="psm_testnet",t.PSM_TESTNET_TEST="psm_testnet_test",t.PSM_TESTNET_DEV="psm_testnet_dev",t.HOME_VERSE="home_verse",t.HOME_VERSE_TESTNET="home_verse_testnet",t.YOOLDO_VERSE="yooldo_verse",t.SAND_VERSE="sand_verse",t.OASYS="oasys",t.OASYS_TESTNET="oasys_testnet",t.MCH_VERSE="mch_verse",t.MCH_VERSE_TESTNET="mch_verse_testnet",t.HEDERA="hedera",t.HEDERA_TESTNET="hedera_testnet",t.DEFI_VERSE_TESTNET="defi_verse_testnet",t.DEFI_VERSE="defi_verse",t.KROMA="kroma",t.KROMA_SEPOLIA="kroma_sepolia",t.ASM_QA="asm_qa",t.ASM_TEST="asm_test",t.ASM_DEV="asm_dev";const o={[e.Network.ETHEREUM]:1,[e.Network.ROPSTEN]:3,[e.Network.SEPOLIA]:11155111,[e.Network.POLYGON]:137,[e.Network.MUMBAI]:80001,[e.Network.TEZOS]:9999999,[e.Network.GHOSTNET]:9999998,[e.Network.BNB_SMART_CHAIN]:56,[e.Network.BNB_SMART_CHAIN_TESTNET]:97,[e.Network.KLAYTN]:8217,[e.Network.BAOBAB]:1001,[e.Network.SOLANA]:0,[e.Network.SOLANA_DEVNET]:0,[e.Network.NEAR]:0,[e.Network.NEAR_TESTNET]:0,[e.Network.BORA]:77001,[e.Network.BORA_TESTNET]:99001,[e.Network.APTOS]:1,[e.Network.APTOS_TESTNET]:2,[e.Network.MEVERSE]:7518,[e.Network.MEVERSE_TESTNET]:4759,[e.Network.PSM_TESTNET_DEV]:100,[e.Network.PSM_TESTNET_TEST]:400,[e.Network.PSM_TESTNET]:500,[e.Network.PSM]:91002,[e.Network.HOME_VERSE]:19011,[e.Network.HOME_VERSE_TESTNET]:40875,[e.Network.YOOLDO_VERSE]:411,[e.Network.SAND_VERSE]:20197,[e.Network.OASYS]:248,[e.Network.OASYS_TESTNET]:9372,[e.Network.MCH_VERSE]:29548,[e.Network.MCH_VERSE_TESTNET]:420,[e.Network.HEDERA]:295,[e.Network.HEDERA_TESTNET]:296,[e.Network.DEFI_VERSE]:16116,[e.Network.DEFI_VERSE_TESTNET]:17117,[e.Network.KROMA]:255,[e.Network.KROMA_SEPOLIA]:2358,[e.Network.ASM_QA]:807424,[e.Network.ASM_TEST]:595581,[e.Network.ASM_DEV]:955081,1:e.Network.ETHEREUM,3:e.Network.ROPSTEN,11155111:e.Network.SEPOLIA,137:e.Network.POLYGON,80001:e.Network.MUMBAI,9999999:e.Network.TEZOS,9999998:e.Network.GHOSTNET,56:e.Network.BNB_SMART_CHAIN,97:e.Network.BNB_SMART_CHAIN_TESTNET,8217:e.Network.KLAYTN,1001:e.Network.BAOBAB,77001:e.Network.BORA,99001:e.Network.BORA_TESTNET,7518:e.Network.MEVERSE,4759:e.Network.MEVERSE_TESTNET,100:e.Network.PSM_TESTNET_DEV,400:e.Network.PSM_TESTNET_TEST,500:e.Network.PSM_TESTNET,91002:e.Network.PSM,19011:e.Network.HOME_VERSE,40875:e.Network.HOME_VERSE_TESTNET,411:e.Network.YOOLDO_VERSE,20197:e.Network.SAND_VERSE,248:e.Network.OASYS,9372:e.Network.OASYS_TESTNET,29548:e.Network.MCH_VERSE,420:e.Network.MCH_VERSE_TESTNET,295:e.Network.HEDERA,296:e.Network.HEDERA_TESTNET,16116:e.Network.DEFI_VERSE,17117:e.Network.DEFI_VERSE_TESTNET,255:e.Network.KROMA,2358:e.Network.KROMA_SEPOLIA,807424:e.Network.ASM_QA,595581:e.Network.ASM_TEST,955081:e.Network.ASM_DEV};var E;e.Blockchain=void 0,(E=e.Blockchain||(e.Blockchain={})).ETHEREUM="ETHEREUM",E.POLYGON="POLYGON",E.BNB_SMART_CHAIN="BNB_SMART_CHAIN",E.KLAYTN="KLAYTN",E.SOLANA="SOLANA",E.TEZOS="TEZOS",E.NEAR="NEAR",E.BORA="BORA",E.APTOS="APTOS",E.MEVERSE="MEVERSE",E.PSM="PSM",E.PSM_TEST="PSM_TEST",E.PSM_DEV="PSM_DEV",E.HOME_VERSE="HOME_VERSE",E.YOOLDO_VERSE="YOOLDO_VERSE",E.OASYS="OASYS",E.MCH_VERSE="MCH_VERSE",E.HEDERA="HEDERA",E.DEFI_VERSE="DEFI_VERSE",E.KROMA="KROMA",E.ASM_TEST="ASM_TEST",E.ASM_QA="ASM_QA",E.ASM_DEV="ASM_DEV";const a=[e.Blockchain.ETHEREUM,e.Blockchain.POLYGON,e.Blockchain.BNB_SMART_CHAIN,e.Blockchain.KLAYTN,e.Blockchain.BORA,e.Blockchain.MEVERSE,e.Blockchain.PSM,e.Blockchain.PSM_DEV,e.Blockchain.PSM_TEST,e.Blockchain.HOME_VERSE,e.Blockchain.YOOLDO_VERSE,e.Blockchain.OASYS,e.Blockchain.MCH_VERSE,e.Blockchain.HEDERA,e.Blockchain.DEFI_VERSE,e.Blockchain.KROMA,e.Blockchain.ASM_QA,e.Blockchain.ASM_TEST,e.Blockchain.ASM_DEV];function n(r){switch(r){case e.Network.ETHEREUM:case e.Network.ROPSTEN:case e.Network.SEPOLIA:return e.Blockchain.ETHEREUM;case e.Network.POLYGON:case e.Network.MUMBAI:return e.Blockchain.POLYGON;case e.Network.TEZOS:case e.Network.GHOSTNET:return e.Blockchain.TEZOS;case e.Network.BNB_SMART_CHAIN:case e.Network.BNB_SMART_CHAIN_TESTNET:return e.Blockchain.BNB_SMART_CHAIN;case e.Network.KLAYTN:case e.Network.BAOBAB:return e.Blockchain.KLAYTN;case e.Network.SOLANA:case e.Network.SOLANA_DEVNET:return e.Blockchain.SOLANA;case e.Network.BORA:case e.Network.BORA_TESTNET:return e.Blockchain.BORA;case e.Network.NEAR:case e.Network.NEAR_TESTNET:return e.Blockchain.NEAR;case e.Network.APTOS:case e.Network.APTOS_TESTNET:return e.Blockchain.APTOS;case e.Network.MEVERSE:case e.Network.MEVERSE_TESTNET:return e.Blockchain.MEVERSE;case e.Network.PSM:case e.Network.PSM_TESTNET:return e.Blockchain.PSM;case e.Network.PSM_TESTNET_TEST:return e.Blockchain.PSM_TEST;case e.Network.PSM_TESTNET_DEV:return e.Blockchain.PSM_DEV;case e.Network.HOME_VERSE:case e.Network.HOME_VERSE_TESTNET:return e.Blockchain.HOME_VERSE;case e.Network.YOOLDO_VERSE:case e.Network.SAND_VERSE:return e.Blockchain.YOOLDO_VERSE;case e.Network.OASYS:case e.Network.OASYS_TESTNET:return e.Blockchain.OASYS;case e.Network.MCH_VERSE:case e.Network.MCH_VERSE_TESTNET:return e.Blockchain.MCH_VERSE;case e.Network.HEDERA:case e.Network.HEDERA_TESTNET:return e.Blockchain.HEDERA;case e.Network.DEFI_VERSE:case e.Network.DEFI_VERSE_TESTNET:return e.Blockchain.DEFI_VERSE;case e.Network.KROMA:case e.Network.KROMA_SEPOLIA:return e.Blockchain.KROMA;case e.Network.ASM_QA:return e.Blockchain.ASM_QA;case e.Network.ASM_TEST:return e.Blockchain.ASM_TEST;case e.Network.ASM_DEV:return e.Blockchain.ASM_DEV}throw new Error(`Unsupported network: ${r}`)}var c,s,_,N,T,S,i,A,R;e.BoraPortalConnectStatusEnum=void 0,(c=e.BoraPortalConnectStatusEnum||(e.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",c.Unconnected="UNCONNECTED";class k{constructor(e,r){k.ensureHexString(e),k.checkLength(e,r),this.hex=e,this.length=r}static empty(){return new k("",0)}static fromUint8Array(e){return new k(O(e),e.length)}static fromHex(e,r){return new k(e,r)}static ensureHexString(e){try{if(""===e)return;if(null==e)throw new Error(`hex is null ${e}`);if(!e.startsWith("0x"))throw new Error(`hex does not start with 0x ${e}`);if(null==e.match("0x[0-9a-fA-F]+"))throw new Error(`invalid hex data ${e}`)}catch(e){throw e}}static checkLength(e,r){if(0===e.length)return;if(4*(e.length-2)/8>r)throw new Error(`length is less than hex data ${e}, ${r}`)}toString(){return this.hex}toHex(){return this.hex}toBigNumber(){return r.BigNumber.from(this.hex)}toJSON(){return{hex:this.hex,length:this.length}}static fromJSON(e){const{hex:r,length:t}=JSON.parse(e);return new k(r,t)}static fromBigNumber(e,r){return k.fromHex(e.toHexString(),r)}toUInt8Array(){const e=this.hex.substring(2),r=[];for(let t=0;t<e.length;t+=2)r.push(parseInt(e.substring(t,t+2),16));return new Uint8Array(r)}static concat(e,r){try{const t=e.toUInt8Array(),o=r.toUInt8Array(),E=new Uint8Array(t.length+o.length);E.set(t),E.set(o,t.length);const a=O(E);return new k(a,t.length+o.length)}catch(e){return console.debug("concat error",e),k.empty()}}split(e){const r=this.toUInt8Array();return[k.fromUint8Array(r.slice(0,e)),k.fromUint8Array(r.slice(e))]}clone(){return new k(this.hex,this.length)}unsafeSetLength(e){this.length=e}}function O(e){return"0x"+[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function l(e){return function(e){return null===e}(e)||function(e){return void 0===e}(e)}e.Env=void 0,(s=e.Env||(e.Env={})).Local="Local",s.Dev="Dev",s.StageTest="StageTest",s.StageMainnet="StageMainnet",s.ProdTest="ProdTest",s.ProdMainnet="ProdMainnet",e.DesktopOS=void 0,(_=e.DesktopOS||(e.DesktopOS={})).Linux="linux",_.MacOS="mac_os",_.Unix="unix",_.Unknown="unknown",_.Windows="windows",e.MobileOS=void 0,(N=e.MobileOS||(e.MobileOS={})).Android="android",N.iOS="ios",N.Unknown="unknown",N.WindowsPhone="Windows Phone",e.JsonRpcMethod=void 0,(T=e.JsonRpcMethod||(e.JsonRpcMethod={})).face_logInSignUp="face_logInSignUp",T.face_loggedIn="face_loggedIn",T.face_logOut="face_logOut",T.face_open2fa="face_open2fa",T.face_currentUser="face_currentUser",T.face_accounts="face_accounts",T.face_getUserVerificationToken="face_getUserVerificationToken",T.face_openIframe="face_openIframe",T.face_closeIframe="face_closeIframe",T.face_ready="face_ready",T.face_openHome="face_openHome",T.face_openBuy="face_openBuy",T.face_openKit="face_openKit",T.face_connectExternalWallet="face_connectExternalWallet",T.face_openWalletConnect="face_openWalletConnect",T.face_confirmWalletConnectDapp="face_confirmWalletConnectDapp",T.face_switchNetwork="face_switchNetwork",T.face_directSocialLogin="face_directSocialLogin",T.face_getIdToken="face_getIdToken",T.face_loginWithIdToken="face_loginWithIdToken",T.face_loginWithAccessToken="face_loginWithAccessToken",T.face_showToast="face_showToast",T.bora_connect="bora_connect",T.bora_isConnected="bora_isConnected",T.eth_sendTransaction="eth_sendTransaction",T.eth_getBalance="eth_getBalance",T.eth_call="eth_call",T.eth_estimateGas="eth_estimateGas",T.eth_sign="eth_sign",T.eth_signTypedData_v3="eth_signTypedData_v3",T.eth_signTypedData_v4="eth_signTypedData_v4",T.eth_chainId="eth_chainId",T.eth_accounts="eth_accounts",T.personal_sign="personal_sign",T.personal_listAccounts="personal_listAccounts",T.wallet_switchEthereumChain="wallet_switchEthereumChain",T.solana_sendTransaction="solana_sendTransaction",T.near_broadcast_tx_async="near_broadcast_tx_async",T.near_get_balance="near_get_balance",T.aptos_signMultiAgentTransaction="aptos_signMultiAgentTransaction",T.aptos_signMessage="aptos_signMessage",T.aptos_signTransaction="aptos_signTransaction",T.aptos_signAndSubmitTransaction="aptos_signAndSubmitTransaction",T.hedera_associate="hedera_associate",T.tezos_publicKey="tezos_publicKey",T.tezos_transferFA2="tezos_transferFA2",T.tezos_transferCoin="tezos_transferCoin",T.hedera_getAccountId="hedera_getAccountId",T.hedera_getHashConnectPairString="hedera_getHashConnectPairString",T.hedera_initHashConnect="hedera_initHashConnect",T.hedera_pairHashConnect="hedera_pairHashConnect",T.hedera_disconnectHashConnect="hedera_disconnectHashConnect",e.JsonRpcSource=void 0,(S=e.JsonRpcSource||(e.JsonRpcSource={})).FACE_SDK="FACE_SDK",S.FACE_IFRAME="FACE_IFRAME",S.FACE_WALLET_CONNECT="FACE_WALLET_CONNECT",S.FACE_NATIVE_SDK="FACE_NATIVE_SDK",e.RpcErrorCode=void 0,(i=e.RpcErrorCode||(e.RpcErrorCode={}))[i.PARSE_ERROR=-32700]="PARSE_ERROR",i[i.INVALID_REQUEST=-32600]="INVALID_REQUEST",i[i.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",i[i.INVALID_PARAMS=-32602]="INVALID_PARAMS",i[i.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",e.HttpStatus=void 0,(A=e.HttpStatus||(e.HttpStatus={}))[A.SUCCESS=200]="SUCCESS",A[A.CREATED=201]="CREATED",A[A.BAD_REQUEST=400]="BAD_REQUEST",A[A.UNAUTHORIZED=401]="UNAUTHORIZED",A[A.FORBIDDEN=403]="FORBIDDEN",A[A.NOT_FOUND=404]="NOT_FOUND",A[A.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e.FaceErrorCode=void 0,(R=e.FaceErrorCode||(e.FaceErrorCode={}))[R.INVALID_ARGUMENT=4e3]="INVALID_ARGUMENT",R[R.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",R[R.NOT_IMPLEMENTED=4002]="NOT_IMPLEMENTED",R[R.BAD_REQUEST=4003]="BAD_REQUEST",R[R.SEND_TRANSACTION_FAILED=4004]="SEND_TRANSACTION_FAILED",R[R.SIGN_FAILED=4005]="SIGN_FAILED",R[R.UNAUTHORIZED=4100]="UNAUTHORIZED",R[R.NO_USER_DATA=4101]="NO_USER_DATA",R[R.AUTHENTICATION=4102]="AUTHENTICATION",R[R.UNSUPPORTED_SOCIAL_PROVIDER=4103]="UNSUPPORTED_SOCIAL_PROVIDER",R[R.INVALID_ENVIRONMENT=4200]="INVALID_ENVIRONMENT",R[R.UNSUPPORTED_METHOD=4201]="UNSUPPORTED_METHOD",R[R.UNSUPPORTED_CHAIN=4202]="UNSUPPORTED_CHAIN",R[R.INVALID_WALLET=4300]="INVALID_WALLET",R[R.PROVIDERS_AND_WALLETS_CONFIG_ERROR=4301]="PROVIDERS_AND_WALLETS_CONFIG_ERROR",R[R.NO_COIN_AVAILABLE_TO_BUY=4400]="NO_COIN_AVAILABLE_TO_BUY",R[R.INVALID_SIGNATURE_MESSAGE=4906]="INVALID_SIGNATURE_MESSAGE",R[R.INVALID_BORA_API_AND_SECRET_KEY=4907]="INVALID_BORA_API_AND_SECRET_KEY",R[R.ALREADY_CONNECTED_OTHER_BAPP_USN=4909]="ALREADY_CONNECTED_OTHER_BAPP_USN",R[R.BORA_SERVICE_REGION_IS_WRONG=4910]="BORA_SERVICE_REGION_IS_WRONG",R[R.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET=4911]="BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET",R[R.INTERNAL=5e3]="INTERNAL";class w extends Error{static isFaceError(e){return e.isFaceError}isValidErrorCode(r){return!l(t=r)&&"number"==typeof t&&Object.values(e.RpcErrorCode).includes(t)||function(r){return!l(r)&&"number"==typeof r&&Object.values(e.FaceErrorCode).includes(r)}(r);var t}constructor(r){var t;if(super(),this.isFaceError=!0,this.code=this.isValidErrorCode(r.code)?r.code:e.FaceErrorCode.INTERNAL,this.message=`Face Error: [${this.code}] ${r.message}`,r.origin){const e=r.origin.isFaceError&&r.origin.origin?r.origin.origin:r.origin,{message:o,stack:E,name:a,cause:n}=e;this.origin={message:o,stack:E,name:a,cause:n},e.isAxiosError&&(this.origin.data=null===(t=null==e?void 0:e.response)||void 0===t?void 0:t.data)}r.data&&(this.data=r.data),Object.setPrototypeOf(this,w.prototype),Error.captureStackTrace(this,this.constructor)}}function h(r,t){return u({message:`invalid ${r}`+(t?`: ${t}`:""),code:e.FaceErrorCode.INVALID_ARGUMENT})}function u(e){return new w(e)}function d(e,r,t){if(!e)throw r(...null!=t?t:[])}const M=["MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsY-w2HRh6VwRfOw5P7pMvQzxf3Hz3dOurwCeV4AHmVWpxh-DfQx8aKL8394dJVy7x2geVeKR62rSl58HsFsr9utgvHb7PzZluV6DlDQJKrsHIjYiOSKVadMUgNHV40NgrzQggxuOY0MhJ599GWeXps_PPzWv7hsLircae1PnVOQIDAQAB","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCnh7y9sFxoFWwjP9Xlg7s9kXqfRGMusccEFr-LcvzyfPrFohvaKw0YLdMdb8trgK5M5VCEGWJ8p_sMSwb6i_MkQwv2s711uKxHAasUmDtX6eMy3eNKowdZo5nXraQpQd529c0jtZt5l07ryHHts3k4MF0W83GpaoWgjSLXhMEK8QIDAQAB","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCqBmCzkl0ClfF_yuegA44dL5KGOq4BxtQlizFKFjh3VR2zIyHmp8Y6aFXhLmuJjiyRvZXi9K_dA0mEH458U9pf7iffGZOEa8fRELachZmd2-dZuI6mdL7XrNPY8XNPG4EcCtp3GVVefSr3dKEaTaBl6c0BUBWRBcpWLkX0cSe2bQIDAQAB","MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCS23ncDS7x8nmTuK1FFN0EfYo0vo6xhTBMBNWVbQsufv60X8hv3-TbAQ3JIyMEhLo-c-31oYrvrQ0G2e9j8yvJYEUnLuE-PaABo0y3V5m9g_qdTB5p9eEfqZlDrcUl1zUr4W7rJwFwkTlAFSKOqVCPnm8ozmcMyyrEHgl2AbehrQIDAQAB"],I=new Set([e.Blockchain.PSM,e.Blockchain.PSM_DEV,e.Blockchain.PSM_TEST]),B=new Set([e.Blockchain.ASM_QA,e.Blockchain.ASM_TEST,e.Blockchain.ASM_DEV]);function D(e){return M.includes(e)}var C;e.TxType=void 0,(C=e.TxType||(e.TxType={})).COIN="COIN",C.ERC20="ERC20",C.ERC721="ERC721",C.ERC1155="ERC1155",C.FT="FT",C.CONVERT="CONVERT",C.Associate="ASSOCIATE",C.FA2_FT="FA2_FT",C.FA2_NFT="FA2_NFT",C.FA2_MFT="FA2_MFT";var V;e.UserStatus=void 0,(V=e.UserStatus||(e.UserStatus={})).isWalletCreated="isWalletCreated",V.isNewUser="isNewUser",V.isRegisteredPinCode="isRegisteredPinCode",V.isAdmin="isAdmin",e.CryptoBuffer=k,e.FaceAuthSessionKey="Face-Auth-Session",e.FaceError=w,e.FaceOAuthResultKey="Face-OAuth-Result",e.FaceVersionLocalKey="Face-Version",e.LoginProvider={Google:"google.com",Apple:"apple.com",Twitter:"twitter.com",Discord:"discord.com",Facebook:"facebook.com",Kakao:"kakao.com"},e.NetworkChainIdMap=o,e.WalletPath="m/44'/60'/1'/0/0",e.alreadyConnectedToOtherBappusn=function(r){return u({message:"already connected to other bappusn",code:e.FaceErrorCode.ALREADY_CONNECTED_OTHER_BAPP_USN,origin:r})},e.assert=d,e.assertArgument=function(e,r,t,o=!0){(o||e)&&d(!!e&&r,h,[t])},e.bappusnAlreadyConnectedToOtherWallet=function(r){return u({message:"bappusn already connected to other wallet",code:e.FaceErrorCode.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET,origin:r})},e.boraServiceRegionIsWrong=function(r){return new w({message:"bora service region is wrong",code:e.FaceErrorCode.BORA_SERVICE_REGION_IS_WRONG,origin:r})},e.filterNexonBlockchains=function(e,r){if(D(e))return r;const t=new Set(r);for(const e of I)t.delete(e);for(const e of B)t.delete(e);return t},e.filterNexonNetworks=function(e,r,t){if(D(e))return r;const o=[];for(const e of r){const r=t(e);I.has(n(r))||B.has(n(r))||o.push(e)}return o},e.getEthlikeBlockchains=function(){return a},e.getPlatFormCoinDecimalByBlockchain=r=>{switch(r){case e.Blockchain.ETHEREUM:case e.Blockchain.POLYGON:case e.Blockchain.KLAYTN:case e.Blockchain.BNB_SMART_CHAIN:case e.Blockchain.BORA:case e.Blockchain.MEVERSE:case e.Blockchain.PSM:case e.Blockchain.PSM_DEV:case e.Blockchain.PSM_TEST:case e.Blockchain.HOME_VERSE:case e.Blockchain.YOOLDO_VERSE:case e.Blockchain.OASYS:case e.Blockchain.MCH_VERSE:case e.Blockchain.HEDERA:case e.Blockchain.DEFI_VERSE:case e.Blockchain.KROMA:case e.Blockchain.ASM_QA:case e.Blockchain.ASM_TEST:case e.Blockchain.ASM_DEV:return 18;case e.Blockchain.SOLANA:return 9;case e.Blockchain.NEAR:return 24;case e.Blockchain.APTOS:return 8;case e.Blockchain.TEZOS:return 6;default:throw new Error("unsupported blockchain")}},e.invalidApiKeyError=function(r){return u({message:"invalid api key error",code:e.FaceErrorCode.UNAUTHORIZED,origin:r})},e.invalidArgumentError=h,e.invalidBoraPortalIdAndSecretKey=function(r){return u({message:"Not found bapp. please contact FaceWallet Team to register BoraPortal Client Id/SecretKey.",code:e.FaceErrorCode.INVALID_BORA_API_AND_SECRET_KEY,origin:r})},e.invalidEnvironmentError=function(r){return u({message:"invalid environment",code:e.FaceErrorCode.INVALID_ENVIRONMENT,data:{env:r}})},e.invalidHostNameError=function(r){return u({message:"invalid host name error",code:e.FaceErrorCode.UNAUTHORIZED,origin:r})},e.invalidSignatureError=function(r){return u({message:"Invalid Signature message.",code:e.FaceErrorCode.INVALID_SIGNATURE_MESSAGE,origin:r})},e.invalidWallet=function(){return u({message:"invalid wallet error",code:e.FaceErrorCode.INVALID_WALLET})},e.isEthlikeBlockchain=function(e){return-1!==a.indexOf(e)},e.isEthlikeNetwork=r=>{switch(r){case e.Network.ETHEREUM:case e.Network.ROPSTEN:case e.Network.SEPOLIA:case e.Network.POLYGON:case e.Network.MUMBAI:case e.Network.BNB_SMART_CHAIN:case e.Network.BNB_SMART_CHAIN_TESTNET:case e.Network.KLAYTN:case e.Network.BAOBAB:case e.Network.BORA:case e.Network.BORA_TESTNET:case e.Network.MEVERSE:case e.Network.MEVERSE_TESTNET:case e.Network.PSM_TESTNET_DEV:case e.Network.PSM_TESTNET_TEST:case e.Network.PSM_TESTNET:case e.Network.PSM:case e.Network.HOME_VERSE:case e.Network.HOME_VERSE_TESTNET:case e.Network.YOOLDO_VERSE:case e.Network.SAND_VERSE:case e.Network.OASYS:case e.Network.OASYS_TESTNET:case e.Network.MCH_VERSE:case e.Network.MCH_VERSE_TESTNET:case e.Network.HEDERA:case e.Network.HEDERA_TESTNET:case e.Network.DEFI_VERSE:case e.Network.DEFI_VERSE_TESTNET:case e.Network.KROMA:case e.Network.KROMA_SEPOLIA:case e.Network.ASM_QA:case e.Network.ASM_TEST:case e.Network.ASM_DEV:return!0;default:return!1}},e.isSupportedNetwork=r=>{switch(r){case e.Network.ETHEREUM:case e.Network.SEPOLIA:case e.Network.POLYGON:case e.Network.MUMBAI:case e.Network.TEZOS:case e.Network.GHOSTNET:case e.Network.BNB_SMART_CHAIN:case e.Network.BNB_SMART_CHAIN_TESTNET:case e.Network.KLAYTN:case e.Network.BAOBAB:case e.Network.SOLANA:case e.Network.SOLANA_DEVNET:case e.Network.NEAR:case e.Network.NEAR_TESTNET:case e.Network.BORA:case e.Network.BORA_TESTNET:case e.Network.APTOS:case e.Network.APTOS_TESTNET:case e.Network.MEVERSE:case e.Network.MEVERSE_TESTNET:case e.Network.PSM_TESTNET:case e.Network.PSM_TESTNET_DEV:case e.Network.PSM_TESTNET_TEST:case e.Network.HOME_VERSE:case e.Network.HOME_VERSE_TESTNET:case e.Network.YOOLDO_VERSE:case e.Network.SAND_VERSE:case e.Network.OASYS:case e.Network.OASYS_TESTNET:case e.Network.MCH_VERSE:case e.Network.MCH_VERSE_TESTNET:case e.Network.HEDERA:case e.Network.HEDERA_TESTNET:case e.Network.DEFI_VERSE:case e.Network.DEFI_VERSE_TESTNET:case e.Network.KROMA:case e.Network.KROMA_SEPOLIA:case e.Network.ASM_QA:case e.Network.ASM_TEST:case e.Network.ASM_DEV:return!0;default:return!1}},e.kitProvidersAndWalletsConfigError=function(){return u({message:"Both wallets and providers cannot be empty.",code:e.FaceErrorCode.PROVIDERS_AND_WALLETS_CONFIG_ERROR})},e.makeError=u,e.networkToBlockchain=n,e.noCoinAvailableToBuy=function(r,t){return u({message:"No coin available to buy.",code:e.FaceErrorCode.NO_COIN_AVAILABLE_TO_BUY,data:{blockchains:r,contractAddress:t}})},e.noUserDataError=function(){return u({message:"no user data",code:e.FaceErrorCode.NO_USER_DATA})},e.notImplementedError=function(r){return u({message:r,code:e.FaceErrorCode.NOT_IMPLEMENTED})},e.oauthError=function(r,t){return u({message:`OAuth 2.0 Error: ${r}`,code:e.FaceErrorCode.AUTHENTICATION,origin:t})},e.parseFaceSolanaNearTransactionPayload=function(e){return null==e||"object"!=typeof e||null==e.serializedHex||"string"!=typeof e.serializedHex?null:e},e.sendTransactionError=function(r){return u({message:r.message,code:e.FaceErrorCode.SEND_TRANSACTION_FAILED,data:r.data})},e.signError=function(r){return u({message:r,code:e.FaceErrorCode.SIGN_FAILED})},e.unknownError=function(r){return u({message:"unknown error",code:e.FaceErrorCode.INTERNAL,origin:r})},e.unsupportedChainError=function(r){return u({message:"unsupported chain error",code:e.FaceErrorCode.UNSUPPORTED_CHAIN,origin:r})},e.unsupportedProviderError=function(r){return u({message:`${r} login is not supported.`,code:e.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},e.unsupportedTokenProviderError=function(r){return u({message:`${r} is not support get id token`,code:e.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},e.userRejectedRequest=function(r){return u({code:e.FaceErrorCode.USER_REJECTED_REQUEST,message:"user rejected request",data:{path:r}})},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("ethers")):"function"==typeof define&&define.amd?define(["exports","ethers"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).FaceTypes={},e.ethers)}(this,(function(e,t){"use strict";var r,n,o,a,E,s,_,i,c,A,T,N;e.Network=void 0,(r=e.Network||(e.Network={})).ETHEREUM="ethereum",r.SEPOLIA="sepolia",r.POLYGON="polygon",r.MUMBAI="mumbai",r.TEZOS="tezos",r.GHOSTNET="ghostnet",r.BNB_SMART_CHAIN="bnb_smart_chain",r.BNB_SMART_CHAIN_TESTNET="bnb_smart_chain_testnet",r.KLAYTN="klaytn",r.BAOBAB="baobab",r.SOLANA="solana",r.SOLANA_DEVNET="solana_devnet",r.NEAR="near",r.NEAR_TESTNET="near_testnet",r.BORA="bora",r.BORA_TESTNET="bora_testnet",r.ETH_MAINNET="ethereum",r.MATIC_MAINNET="polygon",r.MATIC_TESTNET="mumbai",r.BINANCE_COIN_MAINNET="bnb_smart_chain",r.BINANCE_COIN_TESTNET="bnb_smart_chain_testnet",r.KLAYTN_MAINNET="klaytn",r.KLAYTN_TESTNET="baobab",r.APTOS="aptoslab",r.APTOS_TESTNET="aptoslab_testnet",r.MEVERSE="meverse",r.MEVERSE_TESTNET="meverse_testnet",r.PSM="psm",r.PSM_TESTNET="psm_testnet",r.PSM_TESTNET_TEST="psm_testnet_test",r.PSM_TESTNET_DEV="psm_testnet_dev",r.HOME_VERSE="home_verse",r.HOME_VERSE_TESTNET="home_verse_testnet",r.YOOLDO_VERSE="yooldo_verse",r.SAND_VERSE="sand_verse",r.OASYS="oasys",r.OASYS_TESTNET="oasys_testnet",r.MCH_VERSE="mch_verse",r.MCH_VERSE_TESTNET="mch_verse_testnet",r.HEDERA="hedera",r.HEDERA_TESTNET="hedera_testnet",r.DEFI_VERSE_TESTNET="defi_verse_testnet",r.DEFI_VERSE="defi_verse",r.KROMA="kroma",r.KROMA_SEPOLIA="kroma_sepolia",r.ASM_QA="asm_qa",r.ASM_TEST="asm_test",r.ASM_DEV="asm_dev",r.LINEA="linea",r.LINEA_GOERLI="linea_goerli",e.Blockchain=void 0,(n=e.Blockchain||(e.Blockchain={})).ETHEREUM="ETHEREUM",n.POLYGON="POLYGON",n.BNB_SMART_CHAIN="BNB_SMART_CHAIN",n.KLAYTN="KLAYTN",n.SOLANA="SOLANA",n.TEZOS="TEZOS",n.NEAR="NEAR",n.BORA="BORA",n.APTOS="APTOS",n.MEVERSE="MEVERSE",n.PSM="PSM",n.PSM_TEST="PSM_TEST",n.PSM_DEV="PSM_DEV",n.HOME_VERSE="HOME_VERSE",n.YOOLDO_VERSE="YOOLDO_VERSE",n.OASYS="OASYS",n.MCH_VERSE="MCH_VERSE",n.HEDERA="HEDERA",n.DEFI_VERSE="DEFI_VERSE",n.KROMA="KROMA",n.ASM_TEST="ASM_TEST",n.ASM_QA="ASM_QA",n.ASM_DEV="ASM_DEV",n.LINEA="LINEA",e.BoraPortalConnectStatusEnum=void 0,(o=e.BoraPortalConnectStatusEnum||(e.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",o.Unconnected="UNCONNECTED";class d{constructor(e,t){d.ensureHexString(e),d.checkLength(e,t),this.hex=e,this.length=t}static empty(){return new d("",0)}static fromUint8Array(e){return new d(S(e),e.length)}static fromHex(e,t){return new d(e,t)}static ensureHexString(e){try{if(""===e)return;if(null==e)throw new Error(`hex is null ${e}`);if(!e.startsWith("0x"))throw new Error(`hex does not start with 0x ${e}`);if(null==e.match("0x[0-9a-fA-F]+"))throw new Error(`invalid hex data ${e}`)}catch(e){throw e}}static checkLength(e,t){if(0===e.length)return;if(4*(e.length-2)/8>t)throw new Error(`length is less than hex data ${e}, ${t}`)}toString(){return this.hex}toHex(){return this.hex}toBigNumber(){return t.BigNumber.from(this.hex)}toJSON(){return{hex:this.hex,length:this.length}}static fromJSON(e){const{hex:t,length:r}=JSON.parse(e);return new d(t,r)}static fromBigNumber(e,t){return d.fromHex(e.toHexString(),t)}toUInt8Array(){const e=this.hex.substring(2),t=[];for(let r=0;r<e.length;r+=2)t.push(parseInt(e.substring(r,r+2),16));return new Uint8Array(t)}static concat(e,t){try{const r=e.toUInt8Array(),n=t.toUInt8Array(),o=new Uint8Array(r.length+n.length);o.set(r),o.set(n,r.length);const a=S(o);return new d(a,r.length+n.length)}catch(e){return console.debug("concat error",e),d.empty()}}split(e){const t=this.toUInt8Array();return[d.fromUint8Array(t.slice(0,e)),d.fromUint8Array(t.slice(e))]}clone(){return new d(this.hex,this.length)}unsafeSetLength(e){this.length=e}}function S(e){return"0x"+[...e].map((e=>e.toString(16).padStart(2,"0"))).join("")}function R(e){return function(e){return null===e}(e)||function(e){return void 0===e}(e)}e.Env=void 0,(a=e.Env||(e.Env={})).Local="Local",a.Dev="Dev",a.StageTest="StageTest",a.StageMainnet="StageMainnet",a.ProdTest="ProdTest",a.ProdMainnet="ProdMainnet",e.DesktopOS=void 0,(E=e.DesktopOS||(e.DesktopOS={})).Linux="linux",E.MacOS="mac_os",E.Unix="unix",E.Unknown="unknown",E.Windows="windows",e.MobileOS=void 0,(s=e.MobileOS||(e.MobileOS={})).Android="android",s.iOS="ios",s.Unknown="unknown",s.WindowsPhone="Windows Phone",e.JsonRpcMethod=void 0,(_=e.JsonRpcMethod||(e.JsonRpcMethod={})).face_logInSignUp="face_logInSignUp",_.face_loggedIn="face_loggedIn",_.face_logOut="face_logOut",_.face_open2fa="face_open2fa",_.face_currentUser="face_currentUser",_.face_accounts="face_accounts",_.face_getUserVerificationToken="face_getUserVerificationToken",_.face_openIframe="face_openIframe",_.face_closeIframe="face_closeIframe",_.face_ready="face_ready",_.face_openHome="face_openHome",_.face_openBuy="face_openBuy",_.face_openKit="face_openKit",_.face_connectExternalWallet="face_connectExternalWallet",_.face_openWalletConnect="face_openWalletConnect",_.face_confirmWalletConnectDapp="face_confirmWalletConnectDapp",_.face_switchNetwork="face_switchNetwork",_.face_directSocialLogin="face_directSocialLogin",_.face_getIdToken="face_getIdToken",_.face_loginWithIdToken="face_loginWithIdToken",_.face_loginWithAccessToken="face_loginWithAccessToken",_.face_showToast="face_showToast",_.bora_connect="bora_connect",_.bora_isConnected="bora_isConnected",_.eth_sendTransaction="eth_sendTransaction",_.eth_getBalance="eth_getBalance",_.eth_call="eth_call",_.eth_estimateGas="eth_estimateGas",_.eth_sign="eth_sign",_.eth_signTypedData_v3="eth_signTypedData_v3",_.eth_signTypedData_v4="eth_signTypedData_v4",_.eth_chainId="eth_chainId",_.eth_accounts="eth_accounts",_.personal_sign="personal_sign",_.personal_listAccounts="personal_listAccounts",_.wallet_switchEthereumChain="wallet_switchEthereumChain",_.solana_sendTransaction="solana_sendTransaction",_.near_broadcast_tx_async="near_broadcast_tx_async",_.near_get_balance="near_get_balance",_.aptos_signMultiAgentTransaction="aptos_signMultiAgentTransaction",_.aptos_signMessage="aptos_signMessage",_.aptos_signTransaction="aptos_signTransaction",_.aptos_signAndSubmitTransaction="aptos_signAndSubmitTransaction",_.hedera_associate="hedera_associate",_.tezos_publicKey="tezos_publicKey",_.tezos_transferFA2="tezos_transferFA2",_.tezos_transferCoin="tezos_transferCoin",_.hedera_getAccountId="hedera_getAccountId",_.hedera_getHashConnectPairString="hedera_getHashConnectPairString",_.hedera_initHashConnect="hedera_initHashConnect",_.hedera_pairHashConnect="hedera_pairHashConnect",_.hedera_disconnectHashConnect="hedera_disconnectHashConnect",e.JsonRpcSource=void 0,(i=e.JsonRpcSource||(e.JsonRpcSource={})).FACE_SDK="FACE_SDK",i.FACE_IFRAME="FACE_IFRAME",i.FACE_WALLET_CONNECT="FACE_WALLET_CONNECT",i.FACE_NATIVE_SDK="FACE_NATIVE_SDK",e.RpcErrorCode=void 0,(c=e.RpcErrorCode||(e.RpcErrorCode={}))[c.PARSE_ERROR=-32700]="PARSE_ERROR",c[c.INVALID_REQUEST=-32600]="INVALID_REQUEST",c[c.METHOD_NOT_FOUND=-32601]="METHOD_NOT_FOUND",c[c.INVALID_PARAMS=-32602]="INVALID_PARAMS",c[c.INTERNAL_ERROR=-32603]="INTERNAL_ERROR",e.HttpStatus=void 0,(A=e.HttpStatus||(e.HttpStatus={}))[A.SUCCESS=200]="SUCCESS",A[A.CREATED=201]="CREATED",A[A.BAD_REQUEST=400]="BAD_REQUEST",A[A.UNAUTHORIZED=401]="UNAUTHORIZED",A[A.FORBIDDEN=403]="FORBIDDEN",A[A.NOT_FOUND=404]="NOT_FOUND",A[A.INTERNAL_SERVER_ERROR=500]="INTERNAL_SERVER_ERROR",e.FaceErrorCode=void 0,(T=e.FaceErrorCode||(e.FaceErrorCode={}))[T.INVALID_ARGUMENT=4e3]="INVALID_ARGUMENT",T[T.USER_REJECTED_REQUEST=4001]="USER_REJECTED_REQUEST",T[T.NOT_IMPLEMENTED=4002]="NOT_IMPLEMENTED",T[T.BAD_REQUEST=4003]="BAD_REQUEST",T[T.SEND_TRANSACTION_FAILED=4004]="SEND_TRANSACTION_FAILED",T[T.SIGN_FAILED=4005]="SIGN_FAILED",T[T.UNAUTHORIZED=4100]="UNAUTHORIZED",T[T.NO_USER_DATA=4101]="NO_USER_DATA",T[T.AUTHENTICATION=4102]="AUTHENTICATION",T[T.UNSUPPORTED_SOCIAL_PROVIDER=4103]="UNSUPPORTED_SOCIAL_PROVIDER",T[T.INVALID_ENVIRONMENT=4200]="INVALID_ENVIRONMENT",T[T.UNSUPPORTED_METHOD=4201]="UNSUPPORTED_METHOD",T[T.UNSUPPORTED_CHAIN=4202]="UNSUPPORTED_CHAIN",T[T.INVALID_WALLET=4300]="INVALID_WALLET",T[T.PROVIDERS_AND_WALLETS_CONFIG_ERROR=4301]="PROVIDERS_AND_WALLETS_CONFIG_ERROR",T[T.NO_COIN_AVAILABLE_TO_BUY=4400]="NO_COIN_AVAILABLE_TO_BUY",T[T.INVALID_SIGNATURE_MESSAGE=4906]="INVALID_SIGNATURE_MESSAGE",T[T.INVALID_BORA_API_AND_SECRET_KEY=4907]="INVALID_BORA_API_AND_SECRET_KEY",T[T.ALREADY_CONNECTED_OTHER_BAPP_USN=4909]="ALREADY_CONNECTED_OTHER_BAPP_USN",T[T.BORA_SERVICE_REGION_IS_WRONG=4910]="BORA_SERVICE_REGION_IS_WRONG",T[T.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET=4911]="BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET",T[T.INTERNAL=5e3]="INTERNAL";class u extends Error{static isFaceError(e){return e.isFaceError}isValidErrorCode(t){return!R(r=t)&&"number"==typeof r&&Object.values(e.RpcErrorCode).includes(r)||function(t){return!R(t)&&"number"==typeof t&&Object.values(e.FaceErrorCode).includes(t)}(t);var r}constructor(t){var r;if(super(),this.isFaceError=!0,this.code=this.isValidErrorCode(t.code)?t.code:e.FaceErrorCode.INTERNAL,this.message=`Face Error: [${this.code}] ${t.message}`,t.origin){const e=t.origin.isFaceError&&t.origin.origin?t.origin.origin:t.origin,{message:n,stack:o,name:a,cause:E}=e;this.origin={message:n,stack:o,name:a,cause:E},e.isAxiosError&&(this.origin.data=null===(r=null==e?void 0:e.response)||void 0===r?void 0:r.data)}t.data&&(this.data=t.data),Object.setPrototypeOf(this,u.prototype),Error.captureStackTrace(this,this.constructor)}}function l(t,r){return O({message:`invalid ${t}`+(r?`: ${r}`:""),code:e.FaceErrorCode.INVALID_ARGUMENT})}function O(e){return new u(e)}function I(e,t,r){if(!e)throw t(...null!=r?r:[])}e.TxType=void 0,(N=e.TxType||(e.TxType={})).COIN="COIN",N.ERC20="ERC20",N.ERC721="ERC721",N.ERC1155="ERC1155",N.FT="FT",N.CONVERT="CONVERT",N.Associate="ASSOCIATE",N.FA2_FT="FA2_FT",N.FA2_NFT="FA2_NFT",N.FA2_MFT="FA2_MFT";var h;e.UserStatus=void 0,(h=e.UserStatus||(e.UserStatus={})).isWalletCreated="isWalletCreated",h.isNewUser="isNewUser",h.isRegisteredPinCode="isRegisteredPinCode",h.isAdmin="isAdmin",e.CryptoBuffer=d,e.FaceAuthSessionKey="Face-Auth-Session",e.FaceError=u,e.FaceOAuthResultKey="Face-OAuth-Result",e.FaceVersionLocalKey="Face-Version",e.LoginProvider={Google:"google.com",Apple:"apple.com",Twitter:"twitter.com",Discord:"discord.com",Facebook:"facebook.com",Kakao:"kakao.com"},e.WalletPath="m/44'/60'/1'/0/0",e.alreadyConnectedToOtherBappusn=function(t){return O({message:"already connected to other bappusn",code:e.FaceErrorCode.ALREADY_CONNECTED_OTHER_BAPP_USN,origin:t})},e.assert=I,e.assertArgument=function(e,t,r,n=!0){(n||e)&&I(!!e&&t,l,[r])},e.bappusnAlreadyConnectedToOtherWallet=function(t){return O({message:"bappusn already connected to other wallet",code:e.FaceErrorCode.BAPP_USN_ALREADY_CONNECTED_OTHER_WALLET,origin:t})},e.boraServiceRegionIsWrong=function(t){return new u({message:"bora service region is wrong",code:e.FaceErrorCode.BORA_SERVICE_REGION_IS_WRONG,origin:t})},e.invalidApiKeyError=function(t){return O({message:"invalid api key error",code:e.FaceErrorCode.UNAUTHORIZED,origin:t})},e.invalidArgumentError=l,e.invalidBoraPortalIdAndSecretKey=function(t){return O({message:"Not found bapp. please contact FaceWallet Team to register BoraPortal Client Id/SecretKey.",code:e.FaceErrorCode.INVALID_BORA_API_AND_SECRET_KEY,origin:t})},e.invalidEnvironmentError=function(t){return O({message:"invalid environment",code:e.FaceErrorCode.INVALID_ENVIRONMENT,data:{env:t}})},e.invalidHostNameError=function(t){return O({message:"invalid host name error",code:e.FaceErrorCode.UNAUTHORIZED,origin:t})},e.invalidSignatureError=function(t){return O({message:"Invalid Signature message.",code:e.FaceErrorCode.INVALID_SIGNATURE_MESSAGE,origin:t})},e.invalidWallet=function(){return O({message:"invalid wallet error",code:e.FaceErrorCode.INVALID_WALLET})},e.kitProvidersAndWalletsConfigError=function(){return O({message:"Both wallets and providers cannot be empty.",code:e.FaceErrorCode.PROVIDERS_AND_WALLETS_CONFIG_ERROR})},e.makeError=O,e.noCoinAvailableToBuy=function(t,r){return O({message:"No coin available to buy.",code:e.FaceErrorCode.NO_COIN_AVAILABLE_TO_BUY,data:{blockchains:t,contractAddress:r}})},e.noUserDataError=function(){return O({message:"no user data",code:e.FaceErrorCode.NO_USER_DATA})},e.notImplementedError=function(t){return O({message:t,code:e.FaceErrorCode.NOT_IMPLEMENTED})},e.oauthError=function(t,r){return O({message:`OAuth 2.0 Error: ${t}`,code:e.FaceErrorCode.AUTHENTICATION,origin:r})},e.parseFaceSolanaNearTransactionPayload=function(e){return null==e||"object"!=typeof e||null==e.serializedHex||"string"!=typeof e.serializedHex?null:e},e.sendTransactionError=function(t){return O({message:t.message,code:e.FaceErrorCode.SEND_TRANSACTION_FAILED,data:t.data})},e.signError=function(t){return O({message:t,code:e.FaceErrorCode.SIGN_FAILED})},e.unknownError=function(t){return O({message:"unknown error",code:e.FaceErrorCode.INTERNAL,origin:t})},e.unsupportedChainError=function(t){return O({message:"unsupported chain error",code:e.FaceErrorCode.UNSUPPORTED_CHAIN,origin:t})},e.unsupportedProviderError=function(t){return O({message:`${t} login is not supported.`,code:e.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},e.unsupportedTokenProviderError=function(t){return O({message:`${t} is not support get id token`,code:e.FaceErrorCode.UNSUPPORTED_SOCIAL_PROVIDER})},e.userRejectedRequest=function(t){return O({code:e.FaceErrorCode.USER_REJECTED_REQUEST,message:"user rejected request",data:{path:t}})},Object.defineProperty(e,"__esModule",{value:!0})})); | ||
//# sourceMappingURL=index.js.map |
export declare enum Network { | ||
ETHEREUM = "ethereum", | ||
/** @deprecated NETWORK */ | ||
ROPSTEN = "ropsten", | ||
SEPOLIA = "sepolia", | ||
@@ -22,4 +20,2 @@ POLYGON = "polygon", | ||
ETH_MAINNET = "ethereum", | ||
/** @deprecated use ROPSTEN */ | ||
ETH_TESTNET = "ropsten", | ||
/** @deprecated use POLYGON */ | ||
@@ -61,8 +57,6 @@ MATIC_MAINNET = "polygon", | ||
ASM_TEST = "asm_test", | ||
ASM_DEV = "asm_dev" | ||
ASM_DEV = "asm_dev", | ||
LINEA = "linea", | ||
LINEA_GOERLI = "linea_goerli" | ||
} | ||
export declare const isSupportedNetwork: (network?: Network) => boolean; | ||
export declare const NetworkChainIdMap: { | ||
[key in Network | number]: Network | number; | ||
}; | ||
export declare enum Blockchain { | ||
@@ -91,7 +85,5 @@ ETHEREUM = "ETHEREUM", | ||
ASM_QA = "ASM_QA", | ||
ASM_DEV = "ASM_DEV" | ||
ASM_DEV = "ASM_DEV", | ||
LINEA = "LINEA" | ||
} | ||
export declare function networkToBlockchain(network: Network): Blockchain; | ||
export declare function isEthlikeBlockchain(blockchain: Blockchain): boolean; | ||
export declare function getEthlikeBlockchains(): Blockchain[]; | ||
export interface KeyPair { | ||
@@ -101,4 +93,2 @@ privateKey: Uint8Array; | ||
} | ||
export declare const getPlatFormCoinDecimalByBlockchain: (blockchain: Blockchain) => number; | ||
export declare const isEthlikeNetwork: (network: Network) => boolean; | ||
//# sourceMappingURL=blockchain.d.ts.map |
@@ -14,4 +14,4 @@ export * from './aptos'; | ||
export * from './kit'; | ||
export * from './nexon'; | ||
export * from './onRamp'; | ||
export * from './secret'; | ||
export * from './tezos'; | ||
@@ -18,0 +18,0 @@ export * from './transaction'; |
{ | ||
"name": "@haechi-labs/face-types", | ||
"version": "1.12.5", | ||
"version": "1.12.12", | ||
"description": "", | ||
@@ -33,3 +33,3 @@ "author": "", | ||
"@types/node": "^17.0.33", | ||
"@wagmi/connectors": "^3.1.4", | ||
"@wagmi/connectors": "^3.1.11", | ||
"ethers": "^5.6.8", | ||
@@ -47,3 +47,3 @@ "rollup": "^2.78.0", | ||
}, | ||
"gitHead": "f8e2f52db879088decf91e72ba495ad9457b350f", | ||
"gitHead": "3150bb726ccfd3b5c3843680a27c54c23f17d178", | ||
"publishConfig": { | ||
@@ -50,0 +50,0 @@ "access": "public" |
export enum Network { | ||
ETHEREUM = 'ethereum', | ||
/** @deprecated NETWORK */ | ||
ROPSTEN = 'ropsten', | ||
SEPOLIA = 'sepolia', | ||
@@ -22,4 +20,2 @@ POLYGON = 'polygon', | ||
ETH_MAINNET = 'ethereum', | ||
/** @deprecated use ROPSTEN */ | ||
ETH_TESTNET = 'ropsten', | ||
/** @deprecated use POLYGON */ | ||
@@ -63,137 +59,6 @@ MATIC_MAINNET = 'polygon', | ||
ASM_DEV = 'asm_dev', | ||
LINEA = 'linea', | ||
LINEA_GOERLI = 'linea_goerli', | ||
} | ||
export const isSupportedNetwork = (network?: Network) => { | ||
switch (network) { | ||
case Network.ETHEREUM: | ||
case Network.SEPOLIA: | ||
case Network.POLYGON: | ||
case Network.MUMBAI: | ||
case Network.TEZOS: | ||
case Network.GHOSTNET: | ||
case Network.BNB_SMART_CHAIN: | ||
case Network.BNB_SMART_CHAIN_TESTNET: | ||
case Network.KLAYTN: | ||
case Network.BAOBAB: | ||
case Network.SOLANA: | ||
case Network.SOLANA_DEVNET: | ||
case Network.NEAR: | ||
case Network.NEAR_TESTNET: | ||
case Network.BORA: | ||
case Network.BORA_TESTNET: | ||
case Network.APTOS: | ||
case Network.APTOS_TESTNET: | ||
case Network.MEVERSE: | ||
case Network.MEVERSE_TESTNET: | ||
case Network.PSM_TESTNET: | ||
case Network.PSM_TESTNET_DEV: | ||
case Network.PSM_TESTNET_TEST: | ||
case Network.HOME_VERSE: | ||
case Network.HOME_VERSE_TESTNET: | ||
case Network.YOOLDO_VERSE: | ||
case Network.SAND_VERSE: | ||
case Network.OASYS: | ||
case Network.OASYS_TESTNET: | ||
case Network.MCH_VERSE: | ||
case Network.MCH_VERSE_TESTNET: | ||
case Network.HEDERA: | ||
case Network.HEDERA_TESTNET: | ||
case Network.DEFI_VERSE: | ||
case Network.DEFI_VERSE_TESTNET: | ||
case Network.KROMA: | ||
case Network.KROMA_SEPOLIA: | ||
// case Network.ASM: | ||
case Network.ASM_QA: | ||
case Network.ASM_TEST: | ||
case Network.ASM_DEV: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
}; | ||
export const NetworkChainIdMap: { [key in Network | number]: Network | number } = { | ||
[Network.ETHEREUM]: 1, | ||
[Network.ROPSTEN]: 3, | ||
[Network.SEPOLIA]: 11155111, | ||
[Network.POLYGON]: 137, | ||
[Network.MUMBAI]: 80001, | ||
[Network.TEZOS]: 9999999, | ||
[Network.GHOSTNET]: 9999998, | ||
[Network.BNB_SMART_CHAIN]: 56, | ||
[Network.BNB_SMART_CHAIN_TESTNET]: 97, | ||
[Network.KLAYTN]: 8217, | ||
[Network.BAOBAB]: 1001, | ||
[Network.SOLANA]: 0, | ||
[Network.SOLANA_DEVNET]: 0, | ||
[Network.NEAR]: 0, | ||
[Network.NEAR_TESTNET]: 0, | ||
[Network.BORA]: 77001, | ||
[Network.BORA_TESTNET]: 99001, | ||
[Network.APTOS]: 1, | ||
[Network.APTOS_TESTNET]: 2, | ||
[Network.MEVERSE]: 7518, | ||
[Network.MEVERSE_TESTNET]: 4759, | ||
[Network.PSM_TESTNET_DEV]: 100, | ||
[Network.PSM_TESTNET_TEST]: 400, | ||
[Network.PSM_TESTNET]: 500, | ||
[Network.PSM]: 91002, | ||
[Network.HOME_VERSE]: 19011, | ||
[Network.HOME_VERSE_TESTNET]: 40875, | ||
[Network.YOOLDO_VERSE]: 411, | ||
[Network.SAND_VERSE]: 20197, | ||
[Network.OASYS]: 248, | ||
[Network.OASYS_TESTNET]: 9372, | ||
[Network.MCH_VERSE]: 29548, | ||
[Network.MCH_VERSE_TESTNET]: 420, | ||
[Network.HEDERA]: 295, | ||
[Network.HEDERA_TESTNET]: 296, | ||
[Network.DEFI_VERSE]: 16116, | ||
[Network.DEFI_VERSE_TESTNET]: 17117, | ||
[Network.KROMA]: 255, | ||
[Network.KROMA_SEPOLIA]: 2358, | ||
// [Network.ASM]: ?, | ||
[Network.ASM_QA]: 807424, | ||
[Network.ASM_TEST]: 595581, | ||
[Network.ASM_DEV]: 955081, | ||
1: Network.ETHEREUM, | ||
3: Network.ROPSTEN, | ||
11155111: Network.SEPOLIA, | ||
137: Network.POLYGON, | ||
80001: Network.MUMBAI, | ||
9999999: Network.TEZOS, | ||
9999998: Network.GHOSTNET, | ||
56: Network.BNB_SMART_CHAIN, | ||
97: Network.BNB_SMART_CHAIN_TESTNET, | ||
8217: Network.KLAYTN, | ||
1001: Network.BAOBAB, | ||
77001: Network.BORA, | ||
99001: Network.BORA_TESTNET, | ||
7518: Network.MEVERSE, | ||
4759: Network.MEVERSE_TESTNET, | ||
100: Network.PSM_TESTNET_DEV, | ||
400: Network.PSM_TESTNET_TEST, | ||
500: Network.PSM_TESTNET, | ||
91002: Network.PSM, | ||
19011: Network.HOME_VERSE, | ||
40875: Network.HOME_VERSE_TESTNET, | ||
411: Network.YOOLDO_VERSE, | ||
20197: Network.SAND_VERSE, | ||
248: Network.OASYS, | ||
9372: Network.OASYS_TESTNET, | ||
29548: Network.MCH_VERSE, | ||
420: Network.MCH_VERSE_TESTNET, | ||
295: Network.HEDERA, | ||
296: Network.HEDERA_TESTNET, | ||
16116: Network.DEFI_VERSE, | ||
17117: Network.DEFI_VERSE_TESTNET, | ||
255: Network.KROMA, | ||
2358: Network.KROMA_SEPOLIA, | ||
// ?: Network.ASM, | ||
807424: Network.ASM_QA, | ||
595581: Network.ASM_TEST, | ||
955081: Network.ASM_DEV, | ||
}; | ||
export enum Blockchain { | ||
@@ -224,109 +89,5 @@ ETHEREUM = 'ETHEREUM', | ||
ASM_DEV = 'ASM_DEV', | ||
LINEA = 'LINEA', | ||
} | ||
const EthLikeBlockchains = [ | ||
Blockchain.ETHEREUM, | ||
Blockchain.POLYGON, | ||
Blockchain.BNB_SMART_CHAIN, | ||
Blockchain.KLAYTN, | ||
Blockchain.BORA, | ||
Blockchain.MEVERSE, | ||
Blockchain.PSM, | ||
Blockchain.PSM_DEV, | ||
Blockchain.PSM_TEST, | ||
Blockchain.HOME_VERSE, | ||
Blockchain.YOOLDO_VERSE, | ||
Blockchain.OASYS, | ||
Blockchain.MCH_VERSE, | ||
Blockchain.HEDERA, | ||
Blockchain.DEFI_VERSE, | ||
Blockchain.KROMA, | ||
// Blockchain.ASM, | ||
Blockchain.ASM_QA, | ||
Blockchain.ASM_TEST, | ||
Blockchain.ASM_DEV, | ||
]; | ||
export function networkToBlockchain(network: Network): Blockchain { | ||
switch (network) { | ||
case Network.ETHEREUM: | ||
case Network.ROPSTEN: | ||
case Network.SEPOLIA: | ||
return Blockchain.ETHEREUM; | ||
case Network.POLYGON: | ||
case Network.MUMBAI: | ||
return Blockchain.POLYGON; | ||
case Network.TEZOS: | ||
case Network.GHOSTNET: | ||
return Blockchain.TEZOS; | ||
case Network.BNB_SMART_CHAIN: | ||
case Network.BNB_SMART_CHAIN_TESTNET: | ||
return Blockchain.BNB_SMART_CHAIN; | ||
case Network.KLAYTN: | ||
case Network.BAOBAB: | ||
return Blockchain.KLAYTN; | ||
case Network.SOLANA: | ||
case Network.SOLANA_DEVNET: | ||
return Blockchain.SOLANA; | ||
case Network.BORA: | ||
case Network.BORA_TESTNET: | ||
return Blockchain.BORA; | ||
case Network.NEAR: | ||
case Network.NEAR_TESTNET: | ||
return Blockchain.NEAR; | ||
case Network.APTOS: | ||
case Network.APTOS_TESTNET: | ||
return Blockchain.APTOS; | ||
case Network.MEVERSE: | ||
case Network.MEVERSE_TESTNET: | ||
return Blockchain.MEVERSE; | ||
case Network.PSM: | ||
case Network.PSM_TESTNET: | ||
return Blockchain.PSM; | ||
case Network.PSM_TESTNET_TEST: | ||
return Blockchain.PSM_TEST; | ||
case Network.PSM_TESTNET_DEV: | ||
return Blockchain.PSM_DEV; | ||
case Network.HOME_VERSE: | ||
case Network.HOME_VERSE_TESTNET: | ||
return Blockchain.HOME_VERSE; | ||
case Network.YOOLDO_VERSE: | ||
case Network.SAND_VERSE: | ||
return Blockchain.YOOLDO_VERSE; | ||
case Network.OASYS: | ||
case Network.OASYS_TESTNET: | ||
return Blockchain.OASYS; | ||
case Network.MCH_VERSE: | ||
case Network.MCH_VERSE_TESTNET: | ||
return Blockchain.MCH_VERSE; | ||
case Network.HEDERA: | ||
case Network.HEDERA_TESTNET: | ||
return Blockchain.HEDERA; | ||
case Network.DEFI_VERSE: | ||
case Network.DEFI_VERSE_TESTNET: | ||
return Blockchain.DEFI_VERSE; | ||
case Network.KROMA: | ||
case Network.KROMA_SEPOLIA: | ||
return Blockchain.KROMA; | ||
// case Network.ASM: | ||
// return Blockchain.ASM; | ||
case Network.ASM_QA: | ||
return Blockchain.ASM_QA; | ||
case Network.ASM_TEST: | ||
return Blockchain.ASM_TEST; | ||
case Network.ASM_DEV: | ||
return Blockchain.ASM_DEV; | ||
} | ||
throw new Error(`Unsupported network: ${network}`); | ||
} | ||
export function isEthlikeBlockchain(blockchain: Blockchain): boolean { | ||
return EthLikeBlockchains.indexOf(blockchain) !== -1; | ||
} | ||
export function getEthlikeBlockchains() { | ||
return EthLikeBlockchains; | ||
} | ||
export interface KeyPair { | ||
@@ -336,80 +97,1 @@ privateKey: Uint8Array; | ||
} | ||
export const getPlatFormCoinDecimalByBlockchain = (blockchain: Blockchain): number => { | ||
switch (blockchain) { | ||
case Blockchain.ETHEREUM: | ||
case Blockchain.POLYGON: | ||
case Blockchain.KLAYTN: | ||
case Blockchain.BNB_SMART_CHAIN: | ||
case Blockchain.BORA: | ||
case Blockchain.MEVERSE: | ||
case Blockchain.PSM: | ||
case Blockchain.PSM_DEV: | ||
case Blockchain.PSM_TEST: | ||
case Blockchain.HOME_VERSE: | ||
case Blockchain.YOOLDO_VERSE: | ||
case Blockchain.OASYS: | ||
case Blockchain.MCH_VERSE: | ||
case Blockchain.HEDERA: | ||
case Blockchain.DEFI_VERSE: | ||
case Blockchain.KROMA: | ||
// case Blockchain.ASM: | ||
case Blockchain.ASM_QA: | ||
case Blockchain.ASM_TEST: | ||
case Blockchain.ASM_DEV: | ||
return 18; | ||
case Blockchain.SOLANA: | ||
return 9; | ||
case Blockchain.NEAR: | ||
return 24; | ||
case Blockchain.APTOS: | ||
return 8; | ||
case Blockchain.TEZOS: | ||
return 6; | ||
default: | ||
throw new Error('unsupported blockchain'); | ||
} | ||
}; | ||
export const isEthlikeNetwork = (network: Network) => { | ||
switch (network) { | ||
case Network.ETHEREUM: | ||
case Network.ROPSTEN: | ||
case Network.SEPOLIA: | ||
case Network.POLYGON: | ||
case Network.MUMBAI: | ||
case Network.BNB_SMART_CHAIN: | ||
case Network.BNB_SMART_CHAIN_TESTNET: | ||
case Network.KLAYTN: | ||
case Network.BAOBAB: | ||
case Network.BORA: | ||
case Network.BORA_TESTNET: | ||
case Network.MEVERSE: | ||
case Network.MEVERSE_TESTNET: | ||
case Network.PSM_TESTNET_DEV: | ||
case Network.PSM_TESTNET_TEST: | ||
case Network.PSM_TESTNET: | ||
case Network.PSM: | ||
case Network.HOME_VERSE: | ||
case Network.HOME_VERSE_TESTNET: | ||
case Network.YOOLDO_VERSE: | ||
case Network.SAND_VERSE: | ||
case Network.OASYS: | ||
case Network.OASYS_TESTNET: | ||
case Network.MCH_VERSE: | ||
case Network.MCH_VERSE_TESTNET: | ||
case Network.HEDERA: | ||
case Network.HEDERA_TESTNET: | ||
case Network.DEFI_VERSE: | ||
case Network.DEFI_VERSE_TESTNET: | ||
case Network.KROMA: | ||
case Network.KROMA_SEPOLIA: | ||
// case Network.ASM: | ||
case Network.ASM_QA: | ||
case Network.ASM_TEST: | ||
case Network.ASM_DEV: | ||
return true; | ||
default: | ||
return false; | ||
} | ||
}; |
@@ -14,6 +14,6 @@ export * from './aptos'; | ||
export * from './kit'; | ||
export * from './nexon'; | ||
export * from './onRamp'; | ||
export * from './secret'; | ||
export * from './tezos'; | ||
export * from './transaction'; | ||
export * from './user'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
163
220656
3584