Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@haechi-labs/face-types

Package Overview
Dependencies
Maintainers
0
Versions
93
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@haechi-labs/face-types - npm Package Compare versions

Comparing version 1.14.4 to 1.14.5

2

./dist/index.js

@@ -1,2 +0,2 @@

"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.AMOY="amoy",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.APTOS="aptos",r.APTOS_TESTNET="aptos_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.YOOLDO_VERSE_TESTNET="yooldo_verse_testnet",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.ASM_STAGE="asm_stage",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.SAND_VERSE="SAND_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.ASM_STAGE="ASM_STAGE",t.LINEA="LINEA",exports.BoraPortalConnectStatusEnum=void 0,(o=exports.BoraPortalConnectStatusEnum||(exports.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",o.Unconnected="UNCONNECTED";class S{constructor(e,r){S.ensureHexString(e),S.checkLength(e,r),this.hex=e,this.length=r}static empty(){return new S("",0)}static fromUint8Array(e){return new S(d(e),e.length)}static fromHex(e,r){return new S(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 S(r,t)}static fromBigNumber(e,r){return S.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 S(s,t.length+o.length)}catch(e){return console.debug("concat error",e),S.empty()}}split(e){const r=this.toUInt8Array();return[S.fromUint8Array(r.slice(0,e)),S.fromUint8Array(r.slice(e))]}clone(){return new S(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 N(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!N(r=e)&&"number"==typeof r&&Object.values(exports.RpcErrorCode).includes(r)||function(e){return!N(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=S,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}})};
"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.AMOY="amoy",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.APTOS="aptos",r.APTOS_TESTNET="aptos_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.YOOLDO_VERSE_TESTNET="yooldo_verse_testnet",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.LITH="lith",r.ASM_QA="asm_qa",r.ASM_TEST="asm_test",r.ASM_DEV="asm_dev",r.ASM_STAGE="asm_stage",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.SAND_VERSE="SAND_VERSE",t.OASYS="OASYS",t.MCH_VERSE="MCH_VERSE",t.HEDERA="HEDERA",t.DEFI_VERSE="DEFI_VERSE",t.KROMA="KROMA",t.LITH="LITH",t.ASM_TEST="ASM_TEST",t.ASM_QA="ASM_QA",t.ASM_DEV="ASM_DEV",t.ASM_STAGE="ASM_STAGE",t.LINEA="LINEA",exports.BoraPortalConnectStatusEnum=void 0,(o=exports.BoraPortalConnectStatusEnum||(exports.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",o.Unconnected="UNCONNECTED";class S{constructor(e,r){S.ensureHexString(e),S.checkLength(e,r),this.hex=e,this.length=r}static empty(){return new S("",0)}static fromUint8Array(e){return new S(d(e),e.length)}static fromHex(e,r){return new S(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 S(r,t)}static fromBigNumber(e,r){return S.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 S(s,t.length+o.length)}catch(e){return console.debug("concat error",e),S.empty()}}split(e){const r=this.toUInt8Array();return[S.fromUint8Array(r.slice(0,e)),S.fromUint8Array(r.slice(e))]}clone(){return new S(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 N(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!N(r=e)&&"number"==typeof r&&Object.values(exports.RpcErrorCode).includes(r)||function(e){return!N(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=S,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

@@ -41,2 +41,3 @@ export declare enum Network {

KROMA_SEPOLIA = "kroma_sepolia",
LITH = "lith",
ASM_QA = "asm_qa",

@@ -71,2 +72,3 @@ ASM_TEST = "asm_test",

KROMA = "KROMA",
LITH = "LITH",
ASM_TEST = "ASM_TEST",

@@ -73,0 +75,0 @@ ASM_QA = "ASM_QA",

@@ -89,2 +89,3 @@ import { BigNumber, BigNumberish } from 'ethers';

KROMA_SEPOLIA = "kroma_sepolia",
LITH = "lith",
ASM_QA = "asm_qa",

@@ -119,2 +120,3 @@ ASM_TEST = "asm_test",

KROMA = "KROMA",
LITH = "LITH",
ASM_TEST = "ASM_TEST",

@@ -121,0 +123,0 @@ ASM_QA = "ASM_QA",

@@ -1,2 +0,2 @@

"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.AMOY="amoy",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.APTOS="aptos",r.APTOS_TESTNET="aptos_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.YOOLDO_VERSE_TESTNET="yooldo_verse_testnet",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.ASM_STAGE="asm_stage",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.SAND_VERSE="SAND_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.ASM_STAGE="ASM_STAGE",t.LINEA="LINEA",exports.BoraPortalConnectStatusEnum=void 0,(o=exports.BoraPortalConnectStatusEnum||(exports.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",o.Unconnected="UNCONNECTED";class S{constructor(e,r){S.ensureHexString(e),S.checkLength(e,r),this.hex=e,this.length=r}static empty(){return new S("",0)}static fromUint8Array(e){return new S(d(e),e.length)}static fromHex(e,r){return new S(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 S(r,t)}static fromBigNumber(e,r){return S.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 S(s,t.length+o.length)}catch(e){return console.debug("concat error",e),S.empty()}}split(e){const r=this.toUInt8Array();return[S.fromUint8Array(r.slice(0,e)),S.fromUint8Array(r.slice(e))]}clone(){return new S(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 N(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!N(r=e)&&"number"==typeof r&&Object.values(exports.RpcErrorCode).includes(r)||function(e){return!N(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=S,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}})};
"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.AMOY="amoy",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.APTOS="aptos",r.APTOS_TESTNET="aptos_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.YOOLDO_VERSE_TESTNET="yooldo_verse_testnet",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.LITH="lith",r.ASM_QA="asm_qa",r.ASM_TEST="asm_test",r.ASM_DEV="asm_dev",r.ASM_STAGE="asm_stage",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.SAND_VERSE="SAND_VERSE",t.OASYS="OASYS",t.MCH_VERSE="MCH_VERSE",t.HEDERA="HEDERA",t.DEFI_VERSE="DEFI_VERSE",t.KROMA="KROMA",t.LITH="LITH",t.ASM_TEST="ASM_TEST",t.ASM_QA="ASM_QA",t.ASM_DEV="ASM_DEV",t.ASM_STAGE="ASM_STAGE",t.LINEA="LINEA",exports.BoraPortalConnectStatusEnum=void 0,(o=exports.BoraPortalConnectStatusEnum||(exports.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",o.Unconnected="UNCONNECTED";class S{constructor(e,r){S.ensureHexString(e),S.checkLength(e,r),this.hex=e,this.length=r}static empty(){return new S("",0)}static fromUint8Array(e){return new S(d(e),e.length)}static fromHex(e,r){return new S(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 S(r,t)}static fromBigNumber(e,r){return S.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 S(s,t.length+o.length)}catch(e){return console.debug("concat error",e),S.empty()}}split(e){const r=this.toUInt8Array();return[S.fromUint8Array(r.slice(0,e)),S.fromUint8Array(r.slice(e))]}clone(){return new S(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 N(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!N(r=e)&&"number"==typeof r&&Object.values(exports.RpcErrorCode).includes(r)||function(e){return!N(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=S,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

@@ -41,2 +41,3 @@ export declare enum Network {

KROMA_SEPOLIA = "kroma_sepolia",
LITH = "lith",
ASM_QA = "asm_qa",

@@ -71,2 +72,3 @@ ASM_TEST = "asm_test",

KROMA = "KROMA",
LITH = "LITH",
ASM_TEST = "ASM_TEST",

@@ -73,0 +75,0 @@ ASM_QA = "ASM_QA",

@@ -1,2 +0,2 @@

!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,d;e.Network=void 0,(r=e.Network||(e.Network={})).ETHEREUM="ethereum",r.SEPOLIA="sepolia",r.POLYGON="polygon",r.AMOY="amoy",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.APTOS="aptos",r.APTOS_TESTNET="aptos_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.YOOLDO_VERSE_TESTNET="yooldo_verse_testnet",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.ASM_STAGE="asm_stage",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.SAND_VERSE="SAND_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.ASM_STAGE="ASM_STAGE",n.LINEA="LINEA",e.BoraPortalConnectStatusEnum=void 0,(o=e.BoraPortalConnectStatusEnum||(e.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",o.Unconnected="UNCONNECTED";class S{constructor(e,t){S.ensureHexString(e),S.checkLength(e,t),this.hex=e,this.length=t}static empty(){return new S("",0)}static fromUint8Array(e){return new S(N(e),e.length)}static fromHex(e,t){return new S(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 S(t,r)}static fromBigNumber(e,t){return S.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=N(o);return new S(a,r.length+n.length)}catch(e){return console.debug("concat error",e),S.empty()}}split(e){const t=this.toUInt8Array();return[S.fromUint8Array(t.slice(0,e)),S.fromUint8Array(t.slice(e))]}clone(){return new S(this.hex,this.length)}unsafeSetLength(e){this.length=e}}function N(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 h(e,t,r){if(!e)throw t(...null!=r?r:[])}e.TxType=void 0,(d=e.TxType||(e.TxType={})).COIN="COIN",d.ERC20="ERC20",d.ERC721="ERC721",d.ERC1155="ERC1155",d.FT="FT",d.CONVERT="CONVERT",d.Associate="ASSOCIATE",d.FA2_FT="FA2_FT",d.FA2_NFT="FA2_NFT",d.FA2_MFT="FA2_MFT";var I;e.UserStatus=void 0,(I=e.UserStatus||(e.UserStatus={})).isWalletCreated="isWalletCreated",I.isNewUser="isNewUser",I.isRegisteredPinCode="isRegisteredPinCode",I.isAdmin="isAdmin",e.CryptoBuffer=S,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=h,e.assertArgument=function(e,t,r,n=!0){(n||e)&&h(!!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})}));
!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,d;e.Network=void 0,(r=e.Network||(e.Network={})).ETHEREUM="ethereum",r.SEPOLIA="sepolia",r.POLYGON="polygon",r.AMOY="amoy",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.APTOS="aptos",r.APTOS_TESTNET="aptos_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.YOOLDO_VERSE_TESTNET="yooldo_verse_testnet",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.LITH="lith",r.ASM_QA="asm_qa",r.ASM_TEST="asm_test",r.ASM_DEV="asm_dev",r.ASM_STAGE="asm_stage",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.SAND_VERSE="SAND_VERSE",n.OASYS="OASYS",n.MCH_VERSE="MCH_VERSE",n.HEDERA="HEDERA",n.DEFI_VERSE="DEFI_VERSE",n.KROMA="KROMA",n.LITH="LITH",n.ASM_TEST="ASM_TEST",n.ASM_QA="ASM_QA",n.ASM_DEV="ASM_DEV",n.ASM_STAGE="ASM_STAGE",n.LINEA="LINEA",e.BoraPortalConnectStatusEnum=void 0,(o=e.BoraPortalConnectStatusEnum||(e.BoraPortalConnectStatusEnum={})).Connected="CONNECTED",o.Unconnected="UNCONNECTED";class S{constructor(e,t){S.ensureHexString(e),S.checkLength(e,t),this.hex=e,this.length=t}static empty(){return new S("",0)}static fromUint8Array(e){return new S(N(e),e.length)}static fromHex(e,t){return new S(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 S(t,r)}static fromBigNumber(e,t){return S.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=N(o);return new S(a,r.length+n.length)}catch(e){return console.debug("concat error",e),S.empty()}}split(e){const t=this.toUInt8Array();return[S.fromUint8Array(t.slice(0,e)),S.fromUint8Array(t.slice(e))]}clone(){return new S(this.hex,this.length)}unsafeSetLength(e){this.length=e}}function N(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,(i=e.JsonRpcMethod||(e.JsonRpcMethod={})).face_logInSignUp="face_logInSignUp",i.face_loggedIn="face_loggedIn",i.face_logOut="face_logOut",i.face_open2fa="face_open2fa",i.face_currentUser="face_currentUser",i.face_accounts="face_accounts",i.face_getUserVerificationToken="face_getUserVerificationToken",i.face_openIframe="face_openIframe",i.face_closeIframe="face_closeIframe",i.face_ready="face_ready",i.face_openHome="face_openHome",i.face_openBuy="face_openBuy",i.face_openKit="face_openKit",i.face_connectExternalWallet="face_connectExternalWallet",i.face_openWalletConnect="face_openWalletConnect",i.face_confirmWalletConnectDapp="face_confirmWalletConnectDapp",i.face_switchNetwork="face_switchNetwork",i.face_directSocialLogin="face_directSocialLogin",i.face_getIdToken="face_getIdToken",i.face_loginWithIdToken="face_loginWithIdToken",i.face_loginWithAccessToken="face_loginWithAccessToken",i.face_showToast="face_showToast",i.bora_connect="bora_connect",i.bora_isConnected="bora_isConnected",i.eth_sendTransaction="eth_sendTransaction",i.eth_getBalance="eth_getBalance",i.eth_call="eth_call",i.eth_estimateGas="eth_estimateGas",i.eth_sign="eth_sign",i.eth_signTypedData_v3="eth_signTypedData_v3",i.eth_signTypedData_v4="eth_signTypedData_v4",i.eth_chainId="eth_chainId",i.eth_accounts="eth_accounts",i.personal_sign="personal_sign",i.personal_listAccounts="personal_listAccounts",i.wallet_switchEthereumChain="wallet_switchEthereumChain",i.solana_sendTransaction="solana_sendTransaction",i.near_broadcast_tx_async="near_broadcast_tx_async",i.near_get_balance="near_get_balance",i.aptos_signMultiAgentTransaction="aptos_signMultiAgentTransaction",i.aptos_signMessage="aptos_signMessage",i.aptos_signTransaction="aptos_signTransaction",i.aptos_signAndSubmitTransaction="aptos_signAndSubmitTransaction",i.hedera_associate="hedera_associate",i.tezos_publicKey="tezos_publicKey",i.tezos_transferFA2="tezos_transferFA2",i.tezos_transferCoin="tezos_transferCoin",i.hedera_getAccountId="hedera_getAccountId",i.hedera_getHashConnectPairString="hedera_getHashConnectPairString",i.hedera_initHashConnect="hedera_initHashConnect",i.hedera_pairHashConnect="hedera_pairHashConnect",i.hedera_disconnectHashConnect="hedera_disconnectHashConnect",e.JsonRpcSource=void 0,(_=e.JsonRpcSource||(e.JsonRpcSource={})).FACE_SDK="FACE_SDK",_.FACE_IFRAME="FACE_IFRAME",_.FACE_WALLET_CONNECT="FACE_WALLET_CONNECT",_.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,(d=e.TxType||(e.TxType={})).COIN="COIN",d.ERC20="ERC20",d.ERC721="ERC721",d.ERC1155="ERC1155",d.FT="FT",d.CONVERT="CONVERT",d.Associate="ASSOCIATE",d.FA2_FT="FA2_FT",d.FA2_NFT="FA2_NFT",d.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=S,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

@@ -41,2 +41,3 @@ export declare enum Network {

KROMA_SEPOLIA = "kroma_sepolia",
LITH = "lith",
ASM_QA = "asm_qa",

@@ -71,2 +72,3 @@ ASM_TEST = "asm_test",

KROMA = "KROMA",
LITH = "LITH",
ASM_TEST = "ASM_TEST",

@@ -73,0 +75,0 @@ ASM_QA = "ASM_QA",

{
"name": "@haechi-labs/face-types",
"version": "1.14.4",
"version": "1.14.5",
"description": "",

@@ -46,3 +46,3 @@ "author": "",

},
"gitHead": "dc4ac05957e548bc468ce174d48ad50e43a3d45c",
"gitHead": "b3503a37e495ba4d5c1d45f9e44cee2a12c74d01",
"publishConfig": {

@@ -49,0 +49,0 @@ "access": "public"

@@ -41,2 +41,3 @@ export enum Network {

KROMA_SEPOLIA = 'kroma_sepolia',
LITH = 'lith',
// ASM = 'asm',

@@ -73,2 +74,3 @@ ASM_QA = 'asm_qa',

KROMA = 'KROMA',
LITH = 'LITH',
// ASM = 'ASM',

@@ -75,0 +77,0 @@ ASM_TEST = 'ASM_TEST',

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc