wallaby-cash 3.16.0 → 3.16.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +1 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +11 -11
- package/dist/index.mjs.map +1 -1
- package/dist/package.json +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./r/oci-al0xoD5i.cjs"),t=require("bip39"),r=require("uuid"),s=require("loglevel"),a=require("crypto-js"),n=require("jwt-decode"),o=require("@simplewebauthn/browser"),i=require("js-base64"),c=require("scale-ts"),d=e=>e&&"object"==typeof e&&"default"in e?e:{default:e};function l(e){if(e&&"object"==typeof e&&"default"in e)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const u=l(t),h=d(s),p=l(o);var f,y,g,w,m,v,S,A,b,E,_,k,I,T,P,C,x,K,O,N,R,D,L,B,U,q;exports.PasskeyChallengeType=void 0,(f=exports.PasskeyChallengeType||(exports.PasskeyChallengeType={})).REGISTRATION="webauthn.create",f.AUTHENTICATION="webauthn.get",exports.PublicKeyCredentialAlgorithm=void 0,(y=exports.PublicKeyCredentialAlgorithm||(exports.PublicKeyCredentialAlgorithm={}))[y.RS256=-257]="RS256",y[y.ES256=-7]="ES256",exports.TransportEnum=void 0,(g=exports.TransportEnum||(exports.TransportEnum={})).Usb="usb",g.Nfc="nfc",g.Ble="ble",g.Internal="internal",g.Hybrid="hybrid";class M extends Error{constructor(e){var t;const{message:r,statusCode:s,errorCode:a,kind:n,data:o,cause:i,onError:c}=e;super(r),this.name="WallabyError",this.status=s,this.errorCode=a,this.kind=null!=n?n:M.inferKind(s,a),this.cause=i,this.onError=c,this.data=o,Object.setPrototypeOf(this,new.target.prototype),null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,new.target)}static isWallabyError(e){return e instanceof M}static inferKind(e,t){return 0===e?"network":"device_storage_unsupported"===t||(null==t?void 0:t.startsWith("sdk_"))?"sdk":"api"}toJSON(){return{name:this.name,message:this.message,kind:this.kind,status:this.status,errorCode:this.errorCode,data:this.data}}}exports.UserAssetSource=void 0,(w=exports.UserAssetSource||(exports.UserAssetSource={})).Merchant="merchant",w.User="user",w.republic="republic",exports.AssetConfigStatus=void 0,(m=exports.AssetConfigStatus||(exports.AssetConfigStatus={})).Active="active",m.Inactive="inactive",exports.AssetType=void 0,(v=exports.AssetType||(exports.AssetType={})).Coin="COIN",v.Token="TOKEN",exports.OwnershipType=void 0,(S=exports.OwnershipType||(exports.OwnershipType={})).SingleOwner="SINGLE_OWNER",S.MultiSig="MULTI_SIG",exports.TokenStandard=void 0,(A=exports.TokenStandard||(exports.TokenStandard={})).Erc20="ERC_20",A.Erc1404="ERC_1404",A.Arc20="ARC_20",A.Arc1404="ARC_1404",A.Mrc20="MRC_20",A.Bep20="BEP_20",A.AlgoStandard="ALGO_STANDARD",A.AlgoApp="ALGO_APP",A.TokenFactory="TOKEN_FACTORY",A.SeiErc20="SEI_ERC_20",A.AptFA="APT_FUNGIBLE_ASSET",exports.AddressType=void 0,(b=exports.AddressType||(exports.AddressType={})).Segwit="SEGWIT",b.Legacy="LEGACY",b.Default="DEFAULT",exports.BlockchainStatus=void 0,(E=exports.BlockchainStatus||(exports.BlockchainStatus={})).Up="UP",E.Down="DOWN",exports.BlockchainSlip44=void 0,(_=exports.BlockchainSlip44||(exports.BlockchainSlip44={}))[_.BTC=0]="BTC",_[_.ETH=60]="ETH",_[_.ALGO=283]="ALGO",_[_.AVAX=9e3]="AVAX",_[_.MATIC=966]="MATIC",_[_.BSC=519]="BSC",_[_.BASE=8453]="BASE",_[_.SUI=784]="SUI",_[_.INJ=2525]="INJ",_[_.SEI=19000118]="SEI",_[_.APT=637]="APT",_[_.HBAR=3030]="HBAR",_[_.POLYX=595]="POLYX",exports.BlockchainName=void 0,(k=exports.BlockchainName||(exports.BlockchainName={})).Algorand="ALGORAND",k.Aptos="APTOS",k.Avalanche="AVALANCHE",k.Base="BASE",k.Bitcoin="BITCOIN",k.Bsc="BSC",k.Canton="CANTON",k.Ethereum="ETHEREUM",k.Hedera="HEDERA",k.Injective="INJECTIVE",k.Polygon="POLYGON",k.Polymesh="POLYMESH",k.Sei="SEI",k.Sui="SUI",k.Solana="SOLANA",exports.RequestMethod=void 0,(I=exports.RequestMethod||(exports.RequestMethod={})).Post="POST",I.Get="GET",I.Put="PUT",I.Delete="DELETE",exports.ApiKeyStatus=void 0,(T=exports.ApiKeyStatus||(exports.ApiKeyStatus={})).Active="active",T.Inactive="inactive",exports.TransactionEntryType=void 0,(P=exports.TransactionEntryType||(exports.TransactionEntryType={})).INCOMING="INCOMING",P.OUTGOING="OUTGOING",P.UNKNOWN="UNKNOWN",exports.KeyTypeName=void 0,(C=exports.KeyTypeName||(exports.KeyTypeName={})).WallabyShare="wallaby_share",C.OwnerMainDeviceShare="owner_main_device_share",C.OwnerBackupDeviceShare="owner_backup_device_share",exports.SeedPhraseType=void 0,(x=exports.SeedPhraseType||(exports.SeedPhraseType={})).Standard="standard",x.Algorand="algorand",exports.WalletAddressTypeName=void 0,(K=exports.WalletAddressTypeName||(exports.WalletAddressTypeName={})).BTC_MAINNET_SEGWIT="BTC:MAINNET:SEGWIT",K.BTC_MAINNET_LEGACY="BTC:MAINNET:LEGACY",K.BTC_TESTNET_SEGWIT="BTC:TESTNET:SEGWIT",K.BTC_TESTNET_LEGACY="BTC:TESTNET:LEGACY",K.ETH="ETH:ALL:DEFAULT",K.ALGO="ALGO:ALL:DEFAULT",K.SUI="SUI:ALL:DEFAULT",K.INJ="INJ:ALL:DEFAULT",K.APT="APT:ALL:DEFAULT",K.POLYX="POLYX:ALL:DEFAULT",K.BSC="BSC:ALL:DEFAULT",K.AVAX="AVAX:ALL:DEFAULT",K.MATIC="MATIC:ALL:DEFAULT",K.BASE="BASE:ALL:DEFAULT",K.SEI="SEI:ALL:DEFAULT",K.HBAR="HBAR:ALL:DEFAULT",K.CC="CC:ALL:DEFAULT",exports.ReturnWalletOption=void 0,(O=exports.ReturnWalletOption||(exports.ReturnWalletOption={})).ReturnOnlyEncryptedShares="RETURN_ONLY_ENCRYPTED_SHARES",O.ReturnOnlyEncryptedSeedPhrase="RETURN_ONLY_ENCRYPTED_SEED_PHRASE",O.ReturnBothEncryptedSharesAndSeed="RETURN_BOTH_ENCRYPTED_SHARES_AND_SEED",exports.WalletOwnershipType=void 0,(N=exports.WalletOwnershipType||(exports.WalletOwnershipType={})).SingleOwner="SINGLE_OWNER",N.MultiOwner="MULTI_OWNER",exports.AuthType=void 0,(R=exports.AuthType||(exports.AuthType={})).Password="password",R.Passkey="passkey",exports.LocalStorageItems=void 0,(D=exports.LocalStorageItems||(exports.LocalStorageItems={})).AccessToken="access-token",D.RefreshToken="refresh-token",D.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",D.EncryptedKeyShares="encrypted-key-shares",D.PrimaryDeviceKeyShare="primary-device-key-share",D.BackupDeviceKeyShare="backup-device-key-share",D.EncryptedShare="encrypted-share",D.EncryptedAlgorandSeedPhrase="encrypted-algorand-seedPhrase",D.EncryptedDevicePrivateKey="encrypted-private-key",D.ClientAuthPublicKey="client-auth-pub-key",D.ClientAuthToken="republic-jwt",D.PasskeyCredential="pass-key-credential",D.Blob="blob",exports.LegacyKeyNames=void 0,(L=exports.LegacyKeyNames||(exports.LegacyKeyNames={})).EncryptedPrivateKey="encryptedPrivateKey",L.WallabyAuthPubKey="wallabyAuthPubKey",L.EncryptedAlgorandSeed="encryptedAlgorandSeed",L.EncryptedSeed="encryptedSeed",L.ClientAuthToken="republic_jwt",L.AccessToken="accessToken",exports.V1KeyNames=void 0,(B=exports.V1KeyNames||(exports.V1KeyNames={})).AccessToken="access-token",B.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",B.EncryptedAlgorandSeedPhrase="encrypted-algorand-seedPhrase",B.EncryptedDevicePrivateKey="encrypted-private-key",B.ClientAuthPublicKey="client-auth-pub-key",B.WallabyAuthPubKey="wallaby-auth-pub-key",B.ClientAuthToken="republic-jwt",exports.V2KeyNames=void 0,(U=exports.V2KeyNames||(exports.V2KeyNames={})).AccessToken="access-token",U.RefreshToken="refresh-token",U.BackupDeviceKeyShare="backup-device-key-share",U.ClientAuthPublicKey="client-auth-pub-key",U.ClientAuthToken="republic-jwt",U.EncryptedDevicePrivateKey="encrypted-private-key",U.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",U.PasskeyCredential="pass-key-credential",U.PrimaryDeviceKeyShare="primary-device-key-share",U.WallabyAuthPubKey="wallaby-auth-pub-key",U.MigrationVersion="wsdk_migrated_with_version",U.LastMigratedAt="wsdk_last_migrated_at",U.PasswordResetAttempts="wsdk_password_reset_attempts",U.MigrationAttempts="wsdk_migration_attempts",U.CredentialConversionInProgress="credential-conversion-in-progress",U.PendingCommit="pending-commit",U.LegacySeedClaimedWalletId="wsdk_legacy_seed_claimed_wallet_id",exports.ErrorResponseCodes=void 0,(q=exports.ErrorResponseCodes||(exports.ErrorResponseCodes={})).unknown_error="unknown_error",q.internal_server_error="internal_server_error",q.request_payload_missing="request_payload_missing",q.request_payload_wrong_format="request_payload_wrong_format",q.auth_api_key_invalid="auth_api_key_invalid",q.auth_api_key_not_active="auth_api_key_not_active",q.auth_api_key_pub_key_not_set="auth_api_key_pub_key_not_set",q.auth_api_key_pub_key_already_in_use="auth_api_key_pub_key_already_in_use",q.auth_api_key_not_provided="auth_api_key_not_provided",q.auth_api_key_not_found="auth_api_key_not_found",q.auth_origin_not_allowed="auth_origin_not_allowed",q.auth_api_jwt_invalid="auth_api_jwt_invalid",q.auth_api_jwt_not_active="auth_api_jwt_not_active",q.auth_api_jwt_not_provided="auth_api_jwt_not_provided",q.auth_api_jwt_expired="auth_api_jwt_expired",q.auth_api_unauthorized="auth_api_unauthorized",q.auth_client_jwt_invalid="auth_client_jwt_invalid",q.auth_client_jwt_missing_external_id_payload="auth_client_jwt_missing_external_id_payload",q.auth_client_jwt_missing_exp_payload="auth_client_jwt_missing_exp_payload",q.auth_client_jwt_external_id_not_match="auth_client_jwt_external_id_not_match",q.auth_client_jwt_expired="auth_client_jwt_expired",q.auth_client_jwt_not_provided="auth_client_jwt_not_provided",q.auth_client_jwt_invalid_auth_type="auth_client_jwt_invalid_auth_type",q.auth_client_jwt_invalid_passkey="auth_client_jwt_invalid_passkey",q.auth_client_pub_key_and_message_not_match="auth_client_pub_key_and_message_not_match",q.auth_client_pub_key_and_message_expired="auth_client_pub_key_and_message_expired",q.auth_client_pub_key_and_message_signature_failed="auth_client_pub_key_and_message_signature_failed",q.auth_client_pub_key_not_found="auth_client_pub_key_not_found",q.auth_client_pub_key_already_registered="auth_client_pub_key_already_registered",q.auth_user_not_allowed_to_perform_the_action="auth_user_not_allowed_to_perform_the_action",q.auth_upside_signature_not_provided="auth_upside_signature_not_provided",q.auth_upside_signature_invalid="auth_upside_signature_invalid",q.auth_upside_wrong_base64_signature="auth_upside_wrong_base64_signature",q.multisig_participant_not_found="multisig_participant_not_found",q.wallet_not_found="wallet_not_found",q.wallet_recovery_seed_mismatch="wallet_recovery_seed_mismatch",q.wallet_address_not_found="wallet_address_not_found",q.wallet_address_generation_failed="wallet_address_generation_failed",q.invalid_public_key="invalid_public_key",q.canton_registration_daily_limit_exceeded="canton_registration_daily_limit_exceeded",q.asset_not_found="asset_not_found",q.seedphrase_could_not_be_decrypted="seedphrase_could_not_be_decrypted",q.invalid_seed_phrase="invalid_seed_phrase",q.user_already_exists="user_already_exists",q.user_not_found="user_not_found",q.otp_code_invalid="otp_code_invalid",q.otp_code_expired="otp_code_expired",q.merchant_not_found="merchant_not_found",q.swap_provider_not_found="swap_provider_not_found",q.swap_chain_not_supported="swap_chain_not_supported",q.swap_asset_not_supported="swap_asset_not_supported",q.swap_quote_executing="swap_quote_executing",q.swap_quote_in_progress="swap_quote_in_progress",q.swap_quote_completed="swap_quote_completed",q.swap_quote_failed="swap_quote_failed",q.swap_quote_abandoned="swap_quote_abandoned",q.swap_quote_execution_failed="swap_quote_execution_failed",q.swap_quote_invalid="swap_quote_invalid",q.feature_not_enabled="feature_not_enabled",q.insufficient_balance="insufficient_balance",q.transaction_failed="transaction_failed",q.invalid_number_of_signatures="invalid_number_of_signatures",q.invalid_signature="invalid_signature",q.chain_adapter_not_found="chain_adapter_not_found",q.chain_not_found="chain_not_found",q.invalid_address="invalid_address",q.auth_refresh_token_not_found="auth_refresh_token_not_found",q.auth_refresh_token_expired="auth_refresh_token_expired",q.auth_refresh_token_reuse_detected="auth_refresh_token_reuse_detected",q.sdk_jwt_invalid="sdk_jwt_invalid",q.sdk_jwt_expired="sdk_jwt_expired",q.sdk_unknown_error="sdk_unknown_error",q.sdk_too_many_requests="sdk_too_many_requests",q.sdk_seed_phrase_decryption_failed="sdk_seed_phrase_decryption_failed",q.sdk_key_shares_not_found="sdk_key_shares_not_found",q.sdk_key_share_decryption_failed="sdk_key_share_decryption_failed",q.sdk_seed_phrase_not_found="sdk_seed_phrase_not_found",q.sdk_private_key_decryption_failed="sdk_private_key_decryption_failed",q.sdk_private_key_not_found="sdk_private_key_not_found",q.sdk_device_key_missing_with_existing_data="sdk_device_key_missing_with_existing_data",q.sdk_refresh_token_missing="sdk_refresh_token_missing",q.sdk_missing_parameter="sdk_missing_parameter",q.sdk_invalid_parameter="sdk_invalid_parameter",q.sdk_invalid_response="sdk_invalid_response",q.sdk_wrong_password="sdk_wrong_password",q.sdk_no_valid_seed_option="sdk_no_valid_seed_option",q.sdk_ambiguous_legacy_migration_data="sdk_ambiguous_legacy_migration_data",q.sdk_passkey_prf_not_available="sdk_passkey_prf_not_available",q.sdk_passkey_challenge_unavailable="sdk_passkey_challenge_unavailable",q.sdk_passkey_authentication_failed="sdk_passkey_authentication_failed",q.sdk_passkey_registration_failed="sdk_passkey_registration_failed";const V={error:"UnknownError",message:"An unknown error occurred"},F={error:"IOSVersionNotSupportedError",message:"Passkeys are not supported on this device. iOS 15 and above is required to use Passkeys"},$={error:"AndroidVersionNotSupportedError",message:"Passkeys are not supported on this device. Android 9 and above is required to use Passkeys"},W={error:"RequestFailed",message:"The request failed. No Credentials were returned."},j={error:"UserCancelled",message:"The user cancelled the request."},G={error:"InvalidChallenge",message:"The provided challenge was invalid"},H={error:"InvalidUserId",message:"The provided userId was invalid"},Y={error:"BadConfiguration",message:"Your app is not properly configured. Refer to the docs for help."},z={error:"NoCredentials",message:"No viable credential is available for the user."},J={error:"Interrupted",message:"The operation was interrupted and may be retried."},X={error:"TimedOut",message:"The operation timed out."},Z={error:"ERROR_CEREMONY_ABORTED",message:"User did not complete the request in time."},Q={error:"ERROR_INVALID_DOMAIN",message:"Invalid domain."},ee={error:"ERROR_INVALID_RP_ID",message:"Invalid Relying Party ID."},te={error:"ERROR_INVALID_USER_ID_LENGTH",message:"Invalid user ID length."},re={error:"ERROR_MALFORMED_PUBKEYCREDPARAMS",message:"Malformed public key credential parameters."},se={error:"ERROR_AUTHENTICATOR_GENERAL_ERROR",message:"Authenticator encountered a general error."},ae={error:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",message:"Authenticator does not support discoverable credentials."},ne={error:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",message:"Authenticator does not support user verification."},oe={error:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",message:"Authenticator was previously registered."},ie={error:"InvalidStateError",message:"The authenticator was previously registered"},ce={error:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",message:"Authenticator does not support any of the provided public key credential parameters algorithms."},de={error:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",message:"User verification failed during auto-registration."},le={error:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",message:"An error occurred. See the cause property for more details."},ue=[V,F,$,W,j,G,H,Y,z,J,X,Z,Q,ee,te,re,se,ae,ne,oe,ce,de,le];let he=!1;"undefined"!=typeof window&&window.localStorage&&(he="true"===window.localStorage.getItem("wsdk:enable_logging")),he&&h.default.setLevel("trace");const pe=h.default;var fe,ye=("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}).performance||{};ye.now||ye.mozNow||ye.msNow||ye.oNow||ye.webkitNow;const ge=null!==(fe={env:{}}.env.NODE_ENV)&&void 0!==fe?fe:"development",we="testnet",me="9fa9d3f3c77c20d3a50a08e5299644be29f6e6206ef3479fe75d907fe6db9e4c";exports.PublicKeyCredentialAlgorithm.RS256,exports.PublicKeyCredentialAlgorithm.ES256;const ve="undefined"!=typeof window&&"undefined"!=typeof document,Se={platform:"web",isNative:!ve,isWeb:ve},Ae="3.16.0",be="x-sdk-version",Ee=`wallaby-cash/${Ae}`,_e=e=>e.replace(/:/g,"_"),ke="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function Ie(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Te(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("./r/oci-al0xoD5i.cjs"),t=require("bip39"),r=require("uuid"),s=require("loglevel"),a=require("crypto-js"),n=require("jwt-decode"),o=require("@simplewebauthn/browser"),i=require("js-base64"),c=require("scale-ts"),d=e=>e&&"object"==typeof e&&"default"in e?e:{default:e};function l(e){if(e&&"object"==typeof e&&"default"in e)return e;const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const s=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,s.get?s:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const u=l(t),h=d(s),p=l(o);var f,y,g,w,m,v,S,A,b,E,_,k,I,T,P,C,x,K,O,N,R,D,L,B,U,q;exports.PasskeyChallengeType=void 0,(f=exports.PasskeyChallengeType||(exports.PasskeyChallengeType={})).REGISTRATION="webauthn.create",f.AUTHENTICATION="webauthn.get",exports.PublicKeyCredentialAlgorithm=void 0,(y=exports.PublicKeyCredentialAlgorithm||(exports.PublicKeyCredentialAlgorithm={}))[y.RS256=-257]="RS256",y[y.ES256=-7]="ES256",exports.TransportEnum=void 0,(g=exports.TransportEnum||(exports.TransportEnum={})).Usb="usb",g.Nfc="nfc",g.Ble="ble",g.Internal="internal",g.Hybrid="hybrid";class M extends Error{constructor(e){var t;const{message:r,statusCode:s,errorCode:a,kind:n,data:o,cause:i,onError:c}=e;super(r),this.name="WallabyError",this.status=s,this.errorCode=a,this.kind=null!=n?n:M.inferKind(s,a),this.cause=i,this.onError=c,this.data=o,Object.setPrototypeOf(this,new.target.prototype),null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,new.target)}static isWallabyError(e){return e instanceof M}static inferKind(e,t){return 0===e?"network":"device_storage_unsupported"===t||(null==t?void 0:t.startsWith("sdk_"))?"sdk":"api"}toJSON(){return{name:this.name,message:this.message,kind:this.kind,status:this.status,errorCode:this.errorCode,data:this.data}}}exports.UserAssetSource=void 0,(w=exports.UserAssetSource||(exports.UserAssetSource={})).Merchant="merchant",w.User="user",w.republic="republic",exports.AssetConfigStatus=void 0,(m=exports.AssetConfigStatus||(exports.AssetConfigStatus={})).Active="active",m.Inactive="inactive",exports.AssetType=void 0,(v=exports.AssetType||(exports.AssetType={})).Coin="COIN",v.Token="TOKEN",exports.OwnershipType=void 0,(S=exports.OwnershipType||(exports.OwnershipType={})).SingleOwner="SINGLE_OWNER",S.MultiSig="MULTI_SIG",exports.TokenStandard=void 0,(A=exports.TokenStandard||(exports.TokenStandard={})).Erc20="ERC_20",A.Erc1404="ERC_1404",A.Arc20="ARC_20",A.Arc1404="ARC_1404",A.Mrc20="MRC_20",A.Bep20="BEP_20",A.AlgoStandard="ALGO_STANDARD",A.AlgoApp="ALGO_APP",A.TokenFactory="TOKEN_FACTORY",A.SeiErc20="SEI_ERC_20",A.AptFA="APT_FUNGIBLE_ASSET",exports.AddressType=void 0,(b=exports.AddressType||(exports.AddressType={})).Segwit="SEGWIT",b.Legacy="LEGACY",b.Default="DEFAULT",exports.BlockchainStatus=void 0,(E=exports.BlockchainStatus||(exports.BlockchainStatus={})).Up="UP",E.Down="DOWN",exports.BlockchainSlip44=void 0,(_=exports.BlockchainSlip44||(exports.BlockchainSlip44={}))[_.BTC=0]="BTC",_[_.ETH=60]="ETH",_[_.ALGO=283]="ALGO",_[_.AVAX=9e3]="AVAX",_[_.MATIC=966]="MATIC",_[_.BSC=519]="BSC",_[_.BASE=8453]="BASE",_[_.SUI=784]="SUI",_[_.INJ=2525]="INJ",_[_.SEI=19000118]="SEI",_[_.APT=637]="APT",_[_.HBAR=3030]="HBAR",_[_.POLYX=595]="POLYX",exports.BlockchainName=void 0,(k=exports.BlockchainName||(exports.BlockchainName={})).Algorand="ALGORAND",k.Aptos="APTOS",k.Avalanche="AVALANCHE",k.Base="BASE",k.Bitcoin="BITCOIN",k.Bsc="BSC",k.Canton="CANTON",k.Ethereum="ETHEREUM",k.Hedera="HEDERA",k.Injective="INJECTIVE",k.Polygon="POLYGON",k.Polymesh="POLYMESH",k.Sei="SEI",k.Sui="SUI",k.Solana="SOLANA",exports.RequestMethod=void 0,(I=exports.RequestMethod||(exports.RequestMethod={})).Post="POST",I.Get="GET",I.Put="PUT",I.Delete="DELETE",exports.ApiKeyStatus=void 0,(T=exports.ApiKeyStatus||(exports.ApiKeyStatus={})).Active="active",T.Inactive="inactive",exports.TransactionEntryType=void 0,(P=exports.TransactionEntryType||(exports.TransactionEntryType={})).INCOMING="INCOMING",P.OUTGOING="OUTGOING",P.UNKNOWN="UNKNOWN",exports.KeyTypeName=void 0,(C=exports.KeyTypeName||(exports.KeyTypeName={})).WallabyShare="wallaby_share",C.OwnerMainDeviceShare="owner_main_device_share",C.OwnerBackupDeviceShare="owner_backup_device_share",exports.SeedPhraseType=void 0,(x=exports.SeedPhraseType||(exports.SeedPhraseType={})).Standard="standard",x.Algorand="algorand",exports.WalletAddressTypeName=void 0,(K=exports.WalletAddressTypeName||(exports.WalletAddressTypeName={})).BTC_MAINNET_SEGWIT="BTC:MAINNET:SEGWIT",K.BTC_MAINNET_LEGACY="BTC:MAINNET:LEGACY",K.BTC_TESTNET_SEGWIT="BTC:TESTNET:SEGWIT",K.BTC_TESTNET_LEGACY="BTC:TESTNET:LEGACY",K.ETH="ETH:ALL:DEFAULT",K.ALGO="ALGO:ALL:DEFAULT",K.SUI="SUI:ALL:DEFAULT",K.INJ="INJ:ALL:DEFAULT",K.APT="APT:ALL:DEFAULT",K.POLYX="POLYX:ALL:DEFAULT",K.BSC="BSC:ALL:DEFAULT",K.AVAX="AVAX:ALL:DEFAULT",K.MATIC="MATIC:ALL:DEFAULT",K.BASE="BASE:ALL:DEFAULT",K.SEI="SEI:ALL:DEFAULT",K.HBAR="HBAR:ALL:DEFAULT",K.CC="CC:ALL:DEFAULT",exports.ReturnWalletOption=void 0,(O=exports.ReturnWalletOption||(exports.ReturnWalletOption={})).ReturnOnlyEncryptedShares="RETURN_ONLY_ENCRYPTED_SHARES",O.ReturnOnlyEncryptedSeedPhrase="RETURN_ONLY_ENCRYPTED_SEED_PHRASE",O.ReturnBothEncryptedSharesAndSeed="RETURN_BOTH_ENCRYPTED_SHARES_AND_SEED",exports.WalletOwnershipType=void 0,(N=exports.WalletOwnershipType||(exports.WalletOwnershipType={})).SingleOwner="SINGLE_OWNER",N.MultiOwner="MULTI_OWNER",exports.AuthType=void 0,(R=exports.AuthType||(exports.AuthType={})).Password="password",R.Passkey="passkey",exports.LocalStorageItems=void 0,(D=exports.LocalStorageItems||(exports.LocalStorageItems={})).AccessToken="access-token",D.RefreshToken="refresh-token",D.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",D.EncryptedKeyShares="encrypted-key-shares",D.PrimaryDeviceKeyShare="primary-device-key-share",D.BackupDeviceKeyShare="backup-device-key-share",D.EncryptedShare="encrypted-share",D.EncryptedAlgorandSeedPhrase="encrypted-algorand-seedPhrase",D.EncryptedDevicePrivateKey="encrypted-private-key",D.ClientAuthPublicKey="client-auth-pub-key",D.ClientAuthToken="republic-jwt",D.PasskeyCredential="pass-key-credential",D.Blob="blob",exports.LegacyKeyNames=void 0,(L=exports.LegacyKeyNames||(exports.LegacyKeyNames={})).EncryptedPrivateKey="encryptedPrivateKey",L.WallabyAuthPubKey="wallabyAuthPubKey",L.EncryptedAlgorandSeed="encryptedAlgorandSeed",L.EncryptedSeed="encryptedSeed",L.ClientAuthToken="republic_jwt",L.AccessToken="accessToken",exports.V1KeyNames=void 0,(B=exports.V1KeyNames||(exports.V1KeyNames={})).AccessToken="access-token",B.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",B.EncryptedAlgorandSeedPhrase="encrypted-algorand-seedPhrase",B.EncryptedDevicePrivateKey="encrypted-private-key",B.ClientAuthPublicKey="client-auth-pub-key",B.WallabyAuthPubKey="wallaby-auth-pub-key",B.ClientAuthToken="republic-jwt",exports.V2KeyNames=void 0,(U=exports.V2KeyNames||(exports.V2KeyNames={})).AccessToken="access-token",U.RefreshToken="refresh-token",U.BackupDeviceKeyShare="backup-device-key-share",U.ClientAuthPublicKey="client-auth-pub-key",U.ClientAuthToken="republic-jwt",U.EncryptedDevicePrivateKey="encrypted-private-key",U.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",U.PasskeyCredential="pass-key-credential",U.PrimaryDeviceKeyShare="primary-device-key-share",U.WallabyAuthPubKey="wallaby-auth-pub-key",U.MigrationVersion="wsdk_migrated_with_version",U.LastMigratedAt="wsdk_last_migrated_at",U.PasswordResetAttempts="wsdk_password_reset_attempts",U.MigrationAttempts="wsdk_migration_attempts",U.CredentialConversionInProgress="credential-conversion-in-progress",U.PendingCommit="pending-commit",U.LegacySeedClaimedWalletId="wsdk_legacy_seed_claimed_wallet_id",exports.ErrorResponseCodes=void 0,(q=exports.ErrorResponseCodes||(exports.ErrorResponseCodes={})).unknown_error="unknown_error",q.internal_server_error="internal_server_error",q.request_payload_missing="request_payload_missing",q.request_payload_wrong_format="request_payload_wrong_format",q.auth_api_key_invalid="auth_api_key_invalid",q.auth_api_key_not_active="auth_api_key_not_active",q.auth_api_key_pub_key_not_set="auth_api_key_pub_key_not_set",q.auth_api_key_pub_key_already_in_use="auth_api_key_pub_key_already_in_use",q.auth_api_key_not_provided="auth_api_key_not_provided",q.auth_api_key_not_found="auth_api_key_not_found",q.auth_origin_not_allowed="auth_origin_not_allowed",q.auth_api_jwt_invalid="auth_api_jwt_invalid",q.auth_api_jwt_not_active="auth_api_jwt_not_active",q.auth_api_jwt_not_provided="auth_api_jwt_not_provided",q.auth_api_jwt_expired="auth_api_jwt_expired",q.auth_api_unauthorized="auth_api_unauthorized",q.auth_client_jwt_invalid="auth_client_jwt_invalid",q.auth_client_jwt_missing_external_id_payload="auth_client_jwt_missing_external_id_payload",q.auth_client_jwt_missing_exp_payload="auth_client_jwt_missing_exp_payload",q.auth_client_jwt_external_id_not_match="auth_client_jwt_external_id_not_match",q.auth_client_jwt_expired="auth_client_jwt_expired",q.auth_client_jwt_not_provided="auth_client_jwt_not_provided",q.auth_client_jwt_invalid_auth_type="auth_client_jwt_invalid_auth_type",q.auth_client_jwt_invalid_passkey="auth_client_jwt_invalid_passkey",q.auth_client_pub_key_and_message_not_match="auth_client_pub_key_and_message_not_match",q.auth_client_pub_key_and_message_expired="auth_client_pub_key_and_message_expired",q.auth_client_pub_key_and_message_signature_failed="auth_client_pub_key_and_message_signature_failed",q.auth_client_pub_key_not_found="auth_client_pub_key_not_found",q.auth_client_pub_key_already_registered="auth_client_pub_key_already_registered",q.auth_user_not_allowed_to_perform_the_action="auth_user_not_allowed_to_perform_the_action",q.auth_upside_signature_not_provided="auth_upside_signature_not_provided",q.auth_upside_signature_invalid="auth_upside_signature_invalid",q.auth_upside_wrong_base64_signature="auth_upside_wrong_base64_signature",q.multisig_participant_not_found="multisig_participant_not_found",q.wallet_not_found="wallet_not_found",q.wallet_recovery_seed_mismatch="wallet_recovery_seed_mismatch",q.wallet_address_not_found="wallet_address_not_found",q.wallet_address_generation_failed="wallet_address_generation_failed",q.invalid_public_key="invalid_public_key",q.canton_registration_daily_limit_exceeded="canton_registration_daily_limit_exceeded",q.asset_not_found="asset_not_found",q.seedphrase_could_not_be_decrypted="seedphrase_could_not_be_decrypted",q.invalid_seed_phrase="invalid_seed_phrase",q.user_already_exists="user_already_exists",q.user_not_found="user_not_found",q.otp_code_invalid="otp_code_invalid",q.otp_code_expired="otp_code_expired",q.merchant_not_found="merchant_not_found",q.swap_provider_not_found="swap_provider_not_found",q.swap_chain_not_supported="swap_chain_not_supported",q.swap_asset_not_supported="swap_asset_not_supported",q.swap_quote_executing="swap_quote_executing",q.swap_quote_in_progress="swap_quote_in_progress",q.swap_quote_completed="swap_quote_completed",q.swap_quote_failed="swap_quote_failed",q.swap_quote_abandoned="swap_quote_abandoned",q.swap_quote_execution_failed="swap_quote_execution_failed",q.swap_quote_invalid="swap_quote_invalid",q.feature_not_enabled="feature_not_enabled",q.insufficient_balance="insufficient_balance",q.transaction_failed="transaction_failed",q.invalid_number_of_signatures="invalid_number_of_signatures",q.invalid_signature="invalid_signature",q.chain_adapter_not_found="chain_adapter_not_found",q.chain_not_found="chain_not_found",q.invalid_address="invalid_address",q.auth_refresh_token_not_found="auth_refresh_token_not_found",q.auth_refresh_token_expired="auth_refresh_token_expired",q.auth_refresh_token_reuse_detected="auth_refresh_token_reuse_detected",q.sdk_jwt_invalid="sdk_jwt_invalid",q.sdk_jwt_expired="sdk_jwt_expired",q.sdk_unknown_error="sdk_unknown_error",q.sdk_too_many_requests="sdk_too_many_requests",q.sdk_seed_phrase_decryption_failed="sdk_seed_phrase_decryption_failed",q.sdk_key_shares_not_found="sdk_key_shares_not_found",q.sdk_key_share_decryption_failed="sdk_key_share_decryption_failed",q.sdk_seed_phrase_not_found="sdk_seed_phrase_not_found",q.sdk_private_key_decryption_failed="sdk_private_key_decryption_failed",q.sdk_private_key_not_found="sdk_private_key_not_found",q.sdk_device_key_missing_with_existing_data="sdk_device_key_missing_with_existing_data",q.sdk_refresh_token_missing="sdk_refresh_token_missing",q.sdk_missing_parameter="sdk_missing_parameter",q.sdk_invalid_parameter="sdk_invalid_parameter",q.sdk_invalid_response="sdk_invalid_response",q.sdk_wrong_password="sdk_wrong_password",q.sdk_no_valid_seed_option="sdk_no_valid_seed_option",q.sdk_ambiguous_legacy_migration_data="sdk_ambiguous_legacy_migration_data",q.sdk_passkey_prf_not_available="sdk_passkey_prf_not_available",q.sdk_passkey_challenge_unavailable="sdk_passkey_challenge_unavailable",q.sdk_passkey_authentication_failed="sdk_passkey_authentication_failed",q.sdk_passkey_registration_failed="sdk_passkey_registration_failed";const V={error:"UnknownError",message:"An unknown error occurred"},F={error:"IOSVersionNotSupportedError",message:"Passkeys are not supported on this device. iOS 15 and above is required to use Passkeys"},$={error:"AndroidVersionNotSupportedError",message:"Passkeys are not supported on this device. Android 9 and above is required to use Passkeys"},W={error:"RequestFailed",message:"The request failed. No Credentials were returned."},j={error:"UserCancelled",message:"The user cancelled the request."},G={error:"InvalidChallenge",message:"The provided challenge was invalid"},H={error:"InvalidUserId",message:"The provided userId was invalid"},Y={error:"BadConfiguration",message:"Your app is not properly configured. Refer to the docs for help."},z={error:"NoCredentials",message:"No viable credential is available for the user."},J={error:"Interrupted",message:"The operation was interrupted and may be retried."},X={error:"TimedOut",message:"The operation timed out."},Z={error:"ERROR_CEREMONY_ABORTED",message:"User did not complete the request in time."},Q={error:"ERROR_INVALID_DOMAIN",message:"Invalid domain."},ee={error:"ERROR_INVALID_RP_ID",message:"Invalid Relying Party ID."},te={error:"ERROR_INVALID_USER_ID_LENGTH",message:"Invalid user ID length."},re={error:"ERROR_MALFORMED_PUBKEYCREDPARAMS",message:"Malformed public key credential parameters."},se={error:"ERROR_AUTHENTICATOR_GENERAL_ERROR",message:"Authenticator encountered a general error."},ae={error:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",message:"Authenticator does not support discoverable credentials."},ne={error:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",message:"Authenticator does not support user verification."},oe={error:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",message:"Authenticator was previously registered."},ie={error:"InvalidStateError",message:"The authenticator was previously registered"},ce={error:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",message:"Authenticator does not support any of the provided public key credential parameters algorithms."},de={error:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",message:"User verification failed during auto-registration."},le={error:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",message:"An error occurred. See the cause property for more details."},ue=[V,F,$,W,j,G,H,Y,z,J,X,Z,Q,ee,te,re,se,ae,ne,oe,ce,de,le];let he=!1;"undefined"!=typeof window&&window.localStorage&&(he="true"===window.localStorage.getItem("wsdk:enable_logging")),he&&h.default.setLevel("trace");const pe=h.default;var fe,ye=("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}).performance||{};ye.now||ye.mozNow||ye.msNow||ye.oNow||ye.webkitNow;const ge=null!==(fe={env:{}}.env.NODE_ENV)&&void 0!==fe?fe:"development",we="testnet",me="9fa9d3f3c77c20d3a50a08e5299644be29f6e6206ef3479fe75d907fe6db9e4c";exports.PublicKeyCredentialAlgorithm.RS256,exports.PublicKeyCredentialAlgorithm.ES256;const ve="undefined"!=typeof window&&"undefined"!=typeof document,Se={platform:"web",isNative:!ve,isWeb:ve},Ae="3.16.1",be="x-sdk-version",Ee=`wallaby-cash/${Ae}`,_e=e=>e.replace(/:/g,"_"),ke="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function Ie(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Te(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");
|
|
2
2
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3
3
|
var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function Pe(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");Ie(e.outputLen),Ie(e.blockLen)}function Ce(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function xe(e,t){Te(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Ke(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function Oe(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ne(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function Re(e,t){return e<<32-t|e>>>t}const De=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function Le(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Be=De?e=>e:e=>Le(e);const Ue=De?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=Le(e[t]);return e},qe=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),Me=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Ve(e){if(Te(e),qe)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=Me[e[r]];return t}const Fe=48,$e=57,We=65,je=70,Ge=97,He=102;function Ye(e){return e>=Fe&&e<=$e?e-Fe:e>=We&&e<=je?e-(We-10):e>=Ge&&e<=He?e-(Ge-10):void 0}function ze(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function Je(e){return"string"==typeof e&&(e=ze(e)),Te(e),e}function Xe(e){return"string"==typeof e&&(e=ze(e)),Te(e),e}class Ze{}function Qe(e){const t=t=>e().update(Je(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function et(e){const t=(t,r)=>e(r).update(Je(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function tt(e=32){if(ke&&"function"==typeof ke.getRandomValues)return ke.getRandomValues(new Uint8Array(e));if(ke&&"function"==typeof ke.randomBytes)return Uint8Array.from(ke.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function rt(e){return tt(e)}
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const st=BigInt(0),at=BigInt(1);function nt(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function ot(e){if(!nt(e))throw new Error("Uint8Array expected")}function it(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)}function ct(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function dt(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?st:BigInt("0x"+e)}const lt="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,ut=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function ht(e){if(ot(e),lt)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=ut[e[r]];return t}const pt=48,ft=57,yt=65,gt=70,wt=97,mt=102;function vt(e){return e>=pt&&e<=ft?e-pt:e>=yt&&e<=gt?e-(yt-10):e>=wt&&e<=mt?e-(wt-10):void 0}function St(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(lt)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const s=new Uint8Array(r);for(let t=0,a=0;t<r;t++,a+=2){const r=vt(e.charCodeAt(a)),n=vt(e.charCodeAt(a+1));if(void 0===r||void 0===n){const t=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+a)}s[t]=16*r+n}return s}function At(e){return dt(ht(e))}function bt(e){return ot(e),dt(ht(Uint8Array.from(e).reverse()))}function Et(e,t){return St(e.toString(16).padStart(2*t,"0"))}function _t(e,t){return Et(e,t).reverse()}function kt(e,t,r){let s;if("string"==typeof t)try{s=St(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!nt(t))throw new Error(e+" must be hex string or Uint8Array");s=Uint8Array.from(t)}const a=s.length;if("number"==typeof r&&a!==r)throw new Error(e+" of length "+r+" expected, got "+a);return s}function It(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];ot(s),t+=s.length}const r=new Uint8Array(t);for(let t=0,s=0;t<e.length;t++){const a=e[t];r.set(a,s),s+=a.length}return r}const Tt=e=>"bigint"==typeof e&&st<=e;function Pt(e,t,r){return Tt(e)&&Tt(t)&&Tt(r)&&t<=e&&e<r}function Ct(e,t,r,s){if(!Pt(t,r,s))throw new Error("expected valid "+e+": "+r+" <= n < "+s+", got "+t)}const xt=e=>(at<<BigInt(e))-at,Kt=e=>new Uint8Array(e),Ot=e=>Uint8Array.from(e);const Nt={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||nt(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function Rt(e,t,r={}){const s=(t,r,s)=>{const a=Nt[r];if("function"!=typeof a)throw new Error("invalid validator function");const n=e[t];if(!(s&&void 0===n||a(n,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+n)};for(const[e,r]of Object.entries(t))s(e,r,!1);for(const[e,t]of Object.entries(r))s(e,t,!0);return e}function Dt(e){const t=new WeakMap;return(r,...s)=>{const a=t.get(r);if(void 0!==a)return a;const n=e(r,...s);return t.set(r,n),n}}const Lt=Te;function Bt(e){return function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(qe)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const s=new Uint8Array(r);for(let t=0,a=0;t<r;t++,a+=2){const r=Ye(e.charCodeAt(a)),n=Ye(e.charCodeAt(a+1));if(void 0===r||void 0===n){const t=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+a)}s[t]=16*r+n}return s}(e.startsWith("0x")?e.substring(2):e)}function Ut(e){return t=>(Lt(t),e(t))}const qt=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return(e=>{if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]})(e)?e.slice(2):e},Mt=e=>e.startsWith("0x")?e:"0x"+e,Vt=e=>{let t=e;return 64===Bt(e).length&&(t="04"+e),t.substring(2)},Ft=e=>{const t=e.reduce(((e,t)=>e+t.byteLength),0),r=new Uint8Array(t);let s=0;return e.forEach((e=>{r.set(e,s),s+=e.byteLength})),r},$t=e=>{if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);const t=[];for(let r=0;r<e.length;r++){const s=e.codePointAt(r);if(!s)throw new Error("Invalid code point");s<128?t.push(s):s<2048?t.push(192|s>>6,128|63&s):s<65536?t.push(224|s>>12,128|s>>6&63,128|63&s):(r++,t.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|63&s))}return new Uint8Array(t)};function Wt(e,t,r){return e&t^e&r^t&r}class jt extends Ze{constructor(e,t,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(e),this.view=Ne(this.buffer)}update(e){Ce(this),Te(e=Je(e));const{view:t,buffer:r,blockLen:s}=this,a=e.length;for(let n=0;n<a;){const o=Math.min(s-this.pos,a-n);if(o!==s)r.set(e.subarray(n,n+o),this.pos),this.pos+=o,n+=o,this.pos===s&&(this.process(t,0),this.pos=0);else{const t=Ne(e);for(;s<=a-n;n+=s)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){Ce(this),xe(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:s,isLE:a}=this;let{pos:n}=this;t[n++]=128,Oe(this.buffer.subarray(n)),this.padOffset>s-n&&(this.process(r,0),n=0);for(let e=n;e<s;e++)t[e]=0;!function(e,t,r,s){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,s);const a=BigInt(32),n=BigInt(4294967295),o=Number(r>>a&n),i=Number(r&n),c=s?4:0,d=s?0:4;e.setUint32(t+c,o,s),e.setUint32(t+d,i,s)}(r,s-8,BigInt(8*this.length),a),this.process(r,0);const o=Ne(e),i=this.outputLen;if(i%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=i/4,d=this.get();if(c>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)o.setUint32(4*e,d[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:s,finished:a,destroyed:n,pos:o}=this;return e.destroyed=n,e.finished=a,e.length=s,e.pos=o,s%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const Gt=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),Ht=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),Yt=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),zt=BigInt(2**32-1),Jt=BigInt(32);function Xt(e,t=!1){return t?{h:Number(e&zt),l:Number(e>>Jt&zt)}:{h:0|Number(e>>Jt&zt),l:0|Number(e&zt)}}function Zt(e,t=!1){const r=e.length;let s=new Uint32Array(r),a=new Uint32Array(r);for(let n=0;n<r;n++){const{h:r,l:o}=Xt(e[n],t);[s[n],a[n]]=[r,o]}return[s,a]}const Qt=(e,t,r)=>e>>>r,er=(e,t,r)=>e<<32-r|t>>>r,tr=(e,t,r)=>e>>>r|t<<32-r,rr=(e,t,r)=>e<<32-r|t>>>r,sr=(e,t,r)=>e<<64-r|t>>>r-32,ar=(e,t,r)=>e>>>r-32|t<<64-r;function nr(e,t,r,s){const a=(t>>>0)+(s>>>0);return{h:e+r+(a/2**32|0)|0,l:0|a}}const or=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),ir=(e,t,r,s)=>t+r+s+(e/2**32|0)|0,cr=(e,t,r,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0),dr=(e,t,r,s,a)=>t+r+s+a+(e/2**32|0)|0,lr=(e,t,r,s,a)=>(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0)+(a>>>0),ur=(e,t,r,s,a,n)=>t+r+s+a+n+(e/2**32|0)|0,hr=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),pr=new Uint32Array(64);class fr extends jt{constructor(e=32){super(64,e,8,!1),this.A=0|Gt[0],this.B=0|Gt[1],this.C=0|Gt[2],this.D=0|Gt[3],this.E=0|Gt[4],this.F=0|Gt[5],this.G=0|Gt[6],this.H=0|Gt[7]}get(){const{A:e,B:t,C:r,D:s,E:a,F:n,G:o,H:i}=this;return[e,t,r,s,a,n,o,i]}set(e,t,r,s,a,n,o,i){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|s,this.E=0|a,this.F=0|n,this.G=0|o,this.H=0|i}process(e,t){for(let r=0;r<16;r++,t+=4)pr[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=pr[e-15],r=pr[e-2],s=Re(t,7)^Re(t,18)^t>>>3,a=Re(r,17)^Re(r,19)^r>>>10;pr[e]=a+pr[e-7]+s+pr[e-16]|0}let{A:r,B:s,C:a,D:n,E:o,F:i,G:c,H:d}=this;for(let e=0;e<64;e++){const t=d+(Re(o,6)^Re(o,11)^Re(o,25))+((l=o)&i^~l&c)+hr[e]+pr[e]|0,u=(Re(r,2)^Re(r,13)^Re(r,22))+Wt(r,s,a)|0;d=c,c=i,i=o,o=n+t|0,n=a,a=s,s=r,r=t+u|0}var l;r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,n=n+this.D|0,o=o+this.E|0,i=i+this.F|0,c=c+this.G|0,d=d+this.H|0,this.set(r,s,a,n,o,i,c,d)}roundClean(){Oe(pr)}destroy(){this.set(0,0,0,0,0,0,0,0),Oe(this.buffer)}}const yr=(()=>Zt(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),gr=(()=>yr[0])(),wr=(()=>yr[1])(),mr=new Uint32Array(80),vr=new Uint32Array(80);class Sr extends jt{constructor(e=64){super(128,e,16,!1),this.Ah=0|Yt[0],this.Al=0|Yt[1],this.Bh=0|Yt[2],this.Bl=0|Yt[3],this.Ch=0|Yt[4],this.Cl=0|Yt[5],this.Dh=0|Yt[6],this.Dl=0|Yt[7],this.Eh=0|Yt[8],this.El=0|Yt[9],this.Fh=0|Yt[10],this.Fl=0|Yt[11],this.Gh=0|Yt[12],this.Gl=0|Yt[13],this.Hh=0|Yt[14],this.Hl=0|Yt[15]}get(){const{Ah:e,Al:t,Bh:r,Bl:s,Ch:a,Cl:n,Dh:o,Dl:i,Eh:c,El:d,Fh:l,Fl:u,Gh:h,Gl:p,Hh:f,Hl:y}=this;return[e,t,r,s,a,n,o,i,c,d,l,u,h,p,f,y]}set(e,t,r,s,a,n,o,i,c,d,l,u,h,p,f,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|s,this.Ch=0|a,this.Cl=0|n,this.Dh=0|o,this.Dl=0|i,this.Eh=0|c,this.El=0|d,this.Fh=0|l,this.Fl=0|u,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)mr[r]=e.getUint32(t),vr[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|mr[e-15],r=0|vr[e-15],s=tr(t,r,1)^tr(t,r,8)^Qt(t,0,7),a=rr(t,r,1)^rr(t,r,8)^er(t,r,7),n=0|mr[e-2],o=0|vr[e-2],i=tr(n,o,19)^sr(n,o,61)^Qt(n,0,6),c=rr(n,o,19)^ar(n,o,61)^er(n,o,6),d=cr(a,c,vr[e-7],vr[e-16]),l=dr(d,s,i,mr[e-7],mr[e-16]);mr[e]=0|l,vr[e]=0|d}let{Ah:r,Al:s,Bh:a,Bl:n,Ch:o,Cl:i,Dh:c,Dl:d,Eh:l,El:u,Fh:h,Fl:p,Gh:f,Gl:y,Hh:g,Hl:w}=this;for(let e=0;e<80;e++){const t=tr(l,u,14)^tr(l,u,18)^sr(l,u,41),m=rr(l,u,14)^rr(l,u,18)^ar(l,u,41),v=l&h^~l&f,S=lr(w,m,u&p^~u&y,wr[e],vr[e]),A=ur(S,g,t,v,gr[e],mr[e]),b=0|S,E=tr(r,s,28)^sr(r,s,34)^sr(r,s,39),_=rr(r,s,28)^ar(r,s,34)^ar(r,s,39),k=r&a^r&o^a&o,I=s&n^s&i^n&i;g=0|f,w=0|y,f=0|h,y=0|p,h=0|l,p=0|u,({h:l,l:u}=nr(0|c,0|d,0|A,0|b)),c=0|o,d=0|i,o=0|a,i=0|n,a=0|r,n=0|s;const T=or(b,_,I);r=ir(T,A,E,k),s=0|T}({h:r,l:s}=nr(0|this.Ah,0|this.Al,0|r,0|s)),({h:a,l:n}=nr(0|this.Bh,0|this.Bl,0|a,0|n)),({h:o,l:i}=nr(0|this.Ch,0|this.Cl,0|o,0|i)),({h:c,l:d}=nr(0|this.Dh,0|this.Dl,0|c,0|d)),({h:l,l:u}=nr(0|this.Eh,0|this.El,0|l,0|u)),({h:h,l:p}=nr(0|this.Fh,0|this.Fl,0|h,0|p)),({h:f,l:y}=nr(0|this.Gh,0|this.Gl,0|f,0|y)),({h:g,l:w}=nr(0|this.Hh,0|this.Hl,0|g,0|w)),this.set(r,s,a,n,o,i,c,d,l,u,h,p,f,y,g,w)}roundClean(){Oe(mr,vr)}destroy(){Oe(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Ar extends Sr{constructor(){super(48),this.Ah=0|Ht[0],this.Al=0|Ht[1],this.Bh=0|Ht[2],this.Bl=0|Ht[3],this.Ch=0|Ht[4],this.Cl=0|Ht[5],this.Dh=0|Ht[6],this.Dl=0|Ht[7],this.Eh=0|Ht[8],this.El=0|Ht[9],this.Fh=0|Ht[10],this.Fl=0|Ht[11],this.Gh=0|Ht[12],this.Gl=0|Ht[13],this.Hh=0|Ht[14],this.Hl=0|Ht[15]}}const br=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class Er extends Sr{constructor(){super(32),this.Ah=0|br[0],this.Al=0|br[1],this.Bh=0|br[2],this.Bl=0|br[3],this.Ch=0|br[4],this.Cl=0|br[5],this.Dh=0|br[6],this.Dl=0|br[7],this.Eh=0|br[8],this.El=0|br[9],this.Fh=0|br[10],this.Fl=0|br[11],this.Gh=0|br[12],this.Gl=0|br[13],this.Hh=0|br[14],this.Hl=0|br[15]}}const _r=Qe((()=>new fr)),kr=Qe((()=>new Sr)),Ir=Qe((()=>new Ar)),Tr=Qe((()=>new Er));class Pr extends Ze{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,Pe(e);const r=Je(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),Oe(a)}update(e){return Ce(this),this.iHash.update(e),this}digestInto(e){Ce(this),Te(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:s,destroyed:a,blockLen:n,outputLen:o}=this;return e.finished=s,e.destroyed=a,e.blockLen=n,e.outputLen=o,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Cr=(e,t,r)=>new Pr(e,t).update(r).digest();Cr.create=(e,t)=>new Pr(e,t)
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{H as e,A as t,_ as r,a as s,b as a}from"./r/oci-DzAn0PLg.js";import*as n from"bip39";import{validateMnemonic as i,wordlists as o}from"bip39";import{v4 as c}from"uuid";import d from"loglevel";import{AES as l,enc as u}from"crypto-js";import{jwtDecode as h}from"jwt-decode";import*as p from"react-native-passkey";import{atob as f,toUint8Array as y}from"js-base64";import{Bytes as g,Enum as w,u64 as m,_void as v,Struct as S,u128 as b,u32 as _,compact as A,Option as E,Vector as k}from"scale-ts";var I,T,P,C,O,K,N,D,x,R,B,U,L,q,F,$,M,j,W,V,G,H,Y,z,J,X;!function(e){e.REGISTRATION="webauthn.create",e.AUTHENTICATION="webauthn.get"}(I||(I={})),function(e){e[e.RS256=-257]="RS256",e[e.ES256=-7]="ES256"}(T||(T={})),function(e){e.Usb="usb",e.Nfc="nfc",e.Ble="ble",e.Internal="internal",e.Hybrid="hybrid"}(P||(P={}));class Z extends Error{constructor(e){var t;const{message:r,statusCode:s,errorCode:a,kind:n,data:i,cause:o,onError:c}=e;super(r),this.name="WallabyError",this.status=s,this.errorCode=a,this.kind=null!=n?n:Z.inferKind(s,a),this.cause=o,this.onError=c,this.data=i,Object.setPrototypeOf(this,new.target.prototype),null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,new.target)}static isWallabyError(e){return e instanceof Z}static inferKind(e,t){return 0===e?"network":"device_storage_unsupported"===t||(null==t?void 0:t.startsWith("sdk_"))?"sdk":"api"}toJSON(){return{name:this.name,message:this.message,kind:this.kind,status:this.status,errorCode:this.errorCode,data:this.data}}}!function(e){e.Merchant="merchant",e.User="user",e.republic="republic"}(C||(C={})),function(e){e.Active="active",e.Inactive="inactive"}(O||(O={})),function(e){e.Coin="COIN",e.Token="TOKEN"}(K||(K={})),function(e){e.SingleOwner="SINGLE_OWNER",e.MultiSig="MULTI_SIG"}(N||(N={})),function(e){e.Erc20="ERC_20",e.Erc1404="ERC_1404",e.Arc20="ARC_20",e.Arc1404="ARC_1404",e.Mrc20="MRC_20",e.Bep20="BEP_20",e.AlgoStandard="ALGO_STANDARD",e.AlgoApp="ALGO_APP",e.TokenFactory="TOKEN_FACTORY",e.SeiErc20="SEI_ERC_20",e.AptFA="APT_FUNGIBLE_ASSET"}(D||(D={})),function(e){e.Segwit="SEGWIT",e.Legacy="LEGACY",e.Default="DEFAULT"}(x||(x={})),function(e){e.Up="UP",e.Down="DOWN"}(R||(R={})),function(e){e[e.BTC=0]="BTC",e[e.ETH=60]="ETH",e[e.ALGO=283]="ALGO",e[e.AVAX=9e3]="AVAX",e[e.MATIC=966]="MATIC",e[e.BSC=519]="BSC",e[e.BASE=8453]="BASE",e[e.SUI=784]="SUI",e[e.INJ=2525]="INJ",e[e.SEI=19000118]="SEI",e[e.APT=637]="APT",e[e.HBAR=3030]="HBAR",e[e.POLYX=595]="POLYX"}(B||(B={})),function(e){e.Algorand="ALGORAND",e.Aptos="APTOS",e.Avalanche="AVALANCHE",e.Base="BASE",e.Bitcoin="BITCOIN",e.Bsc="BSC",e.Canton="CANTON",e.Ethereum="ETHEREUM",e.Hedera="HEDERA",e.Injective="INJECTIVE",e.Polygon="POLYGON",e.Polymesh="POLYMESH",e.Sei="SEI",e.Sui="SUI",e.Solana="SOLANA"}(U||(U={})),function(e){e.Post="POST",e.Get="GET",e.Put="PUT",e.Delete="DELETE"}(L||(L={})),function(e){e.Active="active",e.Inactive="inactive"}(q||(q={})),function(e){e.INCOMING="INCOMING",e.OUTGOING="OUTGOING",e.UNKNOWN="UNKNOWN"}(F||(F={})),function(e){e.WallabyShare="wallaby_share",e.OwnerMainDeviceShare="owner_main_device_share",e.OwnerBackupDeviceShare="owner_backup_device_share"}($||($={})),function(e){e.Standard="standard",e.Algorand="algorand"}(M||(M={})),function(e){e.BTC_MAINNET_SEGWIT="BTC:MAINNET:SEGWIT",e.BTC_MAINNET_LEGACY="BTC:MAINNET:LEGACY",e.BTC_TESTNET_SEGWIT="BTC:TESTNET:SEGWIT",e.BTC_TESTNET_LEGACY="BTC:TESTNET:LEGACY",e.ETH="ETH:ALL:DEFAULT",e.ALGO="ALGO:ALL:DEFAULT",e.SUI="SUI:ALL:DEFAULT",e.INJ="INJ:ALL:DEFAULT",e.APT="APT:ALL:DEFAULT",e.POLYX="POLYX:ALL:DEFAULT",e.BSC="BSC:ALL:DEFAULT",e.AVAX="AVAX:ALL:DEFAULT",e.MATIC="MATIC:ALL:DEFAULT",e.BASE="BASE:ALL:DEFAULT",e.SEI="SEI:ALL:DEFAULT",e.HBAR="HBAR:ALL:DEFAULT",e.CC="CC:ALL:DEFAULT"}(j||(j={})),function(e){e.ReturnOnlyEncryptedShares="RETURN_ONLY_ENCRYPTED_SHARES",e.ReturnOnlyEncryptedSeedPhrase="RETURN_ONLY_ENCRYPTED_SEED_PHRASE",e.ReturnBothEncryptedSharesAndSeed="RETURN_BOTH_ENCRYPTED_SHARES_AND_SEED"}(W||(W={})),function(e){e.SingleOwner="SINGLE_OWNER",e.MultiOwner="MULTI_OWNER"}(V||(V={})),function(e){e.Password="password",e.Passkey="passkey"}(G||(G={})),function(e){e.AccessToken="access-token",e.RefreshToken="refresh-token",e.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",e.EncryptedKeyShares="encrypted-key-shares",e.PrimaryDeviceKeyShare="primary-device-key-share",e.BackupDeviceKeyShare="backup-device-key-share",e.EncryptedShare="encrypted-share",e.EncryptedAlgorandSeedPhrase="encrypted-algorand-seedPhrase",e.EncryptedDevicePrivateKey="encrypted-private-key",e.ClientAuthPublicKey="client-auth-pub-key",e.ClientAuthToken="republic-jwt",e.PasskeyCredential="pass-key-credential",e.Blob="blob"}(H||(H={})),function(e){e.EncryptedPrivateKey="encryptedPrivateKey",e.WallabyAuthPubKey="wallabyAuthPubKey",e.EncryptedAlgorandSeed="encryptedAlgorandSeed",e.EncryptedSeed="encryptedSeed",e.ClientAuthToken="republic_jwt",e.AccessToken="accessToken"}(Y||(Y={})),function(e){e.AccessToken="access-token",e.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",e.EncryptedAlgorandSeedPhrase="encrypted-algorand-seedPhrase",e.EncryptedDevicePrivateKey="encrypted-private-key",e.ClientAuthPublicKey="client-auth-pub-key",e.WallabyAuthPubKey="wallaby-auth-pub-key",e.ClientAuthToken="republic-jwt"}(z||(z={})),function(e){e.AccessToken="access-token",e.RefreshToken="refresh-token",e.BackupDeviceKeyShare="backup-device-key-share",e.ClientAuthPublicKey="client-auth-pub-key",e.ClientAuthToken="republic-jwt",e.EncryptedDevicePrivateKey="encrypted-private-key",e.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",e.PasskeyCredential="pass-key-credential",e.PrimaryDeviceKeyShare="primary-device-key-share",e.WallabyAuthPubKey="wallaby-auth-pub-key",e.MigrationVersion="wsdk_migrated_with_version",e.LastMigratedAt="wsdk_last_migrated_at",e.PasswordResetAttempts="wsdk_password_reset_attempts",e.MigrationAttempts="wsdk_migration_attempts",e.CredentialConversionInProgress="credential-conversion-in-progress",e.PendingCommit="pending-commit",e.LegacySeedClaimedWalletId="wsdk_legacy_seed_claimed_wallet_id"}(J||(J={})),function(e){e.unknown_error="unknown_error",e.internal_server_error="internal_server_error",e.request_payload_missing="request_payload_missing",e.request_payload_wrong_format="request_payload_wrong_format",e.auth_api_key_invalid="auth_api_key_invalid",e.auth_api_key_not_active="auth_api_key_not_active",e.auth_api_key_pub_key_not_set="auth_api_key_pub_key_not_set",e.auth_api_key_pub_key_already_in_use="auth_api_key_pub_key_already_in_use",e.auth_api_key_not_provided="auth_api_key_not_provided",e.auth_api_key_not_found="auth_api_key_not_found",e.auth_origin_not_allowed="auth_origin_not_allowed",e.auth_api_jwt_invalid="auth_api_jwt_invalid",e.auth_api_jwt_not_active="auth_api_jwt_not_active",e.auth_api_jwt_not_provided="auth_api_jwt_not_provided",e.auth_api_jwt_expired="auth_api_jwt_expired",e.auth_api_unauthorized="auth_api_unauthorized",e.auth_client_jwt_invalid="auth_client_jwt_invalid",e.auth_client_jwt_missing_external_id_payload="auth_client_jwt_missing_external_id_payload",e.auth_client_jwt_missing_exp_payload="auth_client_jwt_missing_exp_payload",e.auth_client_jwt_external_id_not_match="auth_client_jwt_external_id_not_match",e.auth_client_jwt_expired="auth_client_jwt_expired",e.auth_client_jwt_not_provided="auth_client_jwt_not_provided",e.auth_client_jwt_invalid_auth_type="auth_client_jwt_invalid_auth_type",e.auth_client_jwt_invalid_passkey="auth_client_jwt_invalid_passkey",e.auth_client_pub_key_and_message_not_match="auth_client_pub_key_and_message_not_match",e.auth_client_pub_key_and_message_expired="auth_client_pub_key_and_message_expired",e.auth_client_pub_key_and_message_signature_failed="auth_client_pub_key_and_message_signature_failed",e.auth_client_pub_key_not_found="auth_client_pub_key_not_found",e.auth_client_pub_key_already_registered="auth_client_pub_key_already_registered",e.auth_user_not_allowed_to_perform_the_action="auth_user_not_allowed_to_perform_the_action",e.auth_upside_signature_not_provided="auth_upside_signature_not_provided",e.auth_upside_signature_invalid="auth_upside_signature_invalid",e.auth_upside_wrong_base64_signature="auth_upside_wrong_base64_signature",e.multisig_participant_not_found="multisig_participant_not_found",e.wallet_not_found="wallet_not_found",e.wallet_recovery_seed_mismatch="wallet_recovery_seed_mismatch",e.wallet_address_not_found="wallet_address_not_found",e.wallet_address_generation_failed="wallet_address_generation_failed",e.invalid_public_key="invalid_public_key",e.canton_registration_daily_limit_exceeded="canton_registration_daily_limit_exceeded",e.asset_not_found="asset_not_found",e.seedphrase_could_not_be_decrypted="seedphrase_could_not_be_decrypted",e.invalid_seed_phrase="invalid_seed_phrase",e.user_already_exists="user_already_exists",e.user_not_found="user_not_found",e.otp_code_invalid="otp_code_invalid",e.otp_code_expired="otp_code_expired",e.merchant_not_found="merchant_not_found",e.swap_provider_not_found="swap_provider_not_found",e.swap_chain_not_supported="swap_chain_not_supported",e.swap_asset_not_supported="swap_asset_not_supported",e.swap_quote_executing="swap_quote_executing",e.swap_quote_in_progress="swap_quote_in_progress",e.swap_quote_completed="swap_quote_completed",e.swap_quote_failed="swap_quote_failed",e.swap_quote_abandoned="swap_quote_abandoned",e.swap_quote_execution_failed="swap_quote_execution_failed",e.swap_quote_invalid="swap_quote_invalid",e.feature_not_enabled="feature_not_enabled",e.insufficient_balance="insufficient_balance",e.transaction_failed="transaction_failed",e.invalid_number_of_signatures="invalid_number_of_signatures",e.invalid_signature="invalid_signature",e.chain_adapter_not_found="chain_adapter_not_found",e.chain_not_found="chain_not_found",e.invalid_address="invalid_address",e.auth_refresh_token_not_found="auth_refresh_token_not_found",e.auth_refresh_token_expired="auth_refresh_token_expired",e.auth_refresh_token_reuse_detected="auth_refresh_token_reuse_detected",e.sdk_jwt_invalid="sdk_jwt_invalid",e.sdk_jwt_expired="sdk_jwt_expired",e.sdk_unknown_error="sdk_unknown_error",e.sdk_too_many_requests="sdk_too_many_requests",e.sdk_seed_phrase_decryption_failed="sdk_seed_phrase_decryption_failed",e.sdk_key_shares_not_found="sdk_key_shares_not_found",e.sdk_key_share_decryption_failed="sdk_key_share_decryption_failed",e.sdk_seed_phrase_not_found="sdk_seed_phrase_not_found",e.sdk_private_key_decryption_failed="sdk_private_key_decryption_failed",e.sdk_private_key_not_found="sdk_private_key_not_found",e.sdk_device_key_missing_with_existing_data="sdk_device_key_missing_with_existing_data",e.sdk_refresh_token_missing="sdk_refresh_token_missing",e.sdk_missing_parameter="sdk_missing_parameter",e.sdk_invalid_parameter="sdk_invalid_parameter",e.sdk_invalid_response="sdk_invalid_response",e.sdk_wrong_password="sdk_wrong_password",e.sdk_no_valid_seed_option="sdk_no_valid_seed_option",e.sdk_ambiguous_legacy_migration_data="sdk_ambiguous_legacy_migration_data",e.sdk_passkey_prf_not_available="sdk_passkey_prf_not_available",e.sdk_passkey_challenge_unavailable="sdk_passkey_challenge_unavailable",e.sdk_passkey_authentication_failed="sdk_passkey_authentication_failed",e.sdk_passkey_registration_failed="sdk_passkey_registration_failed"}(X||(X={}));const Q={error:"UnknownError",message:"An unknown error occurred"},ee={error:"IOSVersionNotSupportedError",message:"Passkeys are not supported on this device. iOS 15 and above is required to use Passkeys"},te={error:"AndroidVersionNotSupportedError",message:"Passkeys are not supported on this device. Android 9 and above is required to use Passkeys"},re={error:"RequestFailed",message:"The request failed. No Credentials were returned."},se={error:"UserCancelled",message:"The user cancelled the request."},ae={error:"InvalidChallenge",message:"The provided challenge was invalid"},ne={error:"InvalidUserId",message:"The provided userId was invalid"},ie={error:"BadConfiguration",message:"Your app is not properly configured. Refer to the docs for help."},oe={error:"NoCredentials",message:"No viable credential is available for the user."},ce={error:"Interrupted",message:"The operation was interrupted and may be retried."},de={error:"TimedOut",message:"The operation timed out."},le={error:"ERROR_CEREMONY_ABORTED",message:"User did not complete the request in time."},ue={error:"ERROR_INVALID_DOMAIN",message:"Invalid domain."},he={error:"ERROR_INVALID_RP_ID",message:"Invalid Relying Party ID."},pe={error:"ERROR_INVALID_USER_ID_LENGTH",message:"Invalid user ID length."},fe={error:"ERROR_MALFORMED_PUBKEYCREDPARAMS",message:"Malformed public key credential parameters."},ye={error:"ERROR_AUTHENTICATOR_GENERAL_ERROR",message:"Authenticator encountered a general error."},ge={error:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",message:"Authenticator does not support discoverable credentials."},we={error:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",message:"Authenticator does not support user verification."},me={error:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",message:"Authenticator was previously registered."},ve={error:"InvalidStateError",message:"The authenticator was previously registered"},Se={error:"ERROR_AUTHENTICATOR_NOT_REGISTERED",message:"Authenticator is not registered."},be={error:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",message:"Authenticator does not support any of the provided public key credential parameters algorithms."},_e={error:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",message:"User verification failed during auto-registration."},Ae={error:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",message:"An error occurred. See the cause property for more details."},Ee={error:"NotAllowedError",message:"CredentialContainer request is not allowed."},ke=(e="An unknown error occurred")=>({error:"Unknown",message:e}),Ie=[Q,ee,te,re,se,ae,ne,ie,oe,ce,de,le,ue,he,pe,fe,ye,ge,we,me,be,_e,Ae];let Te=!1;"undefined"!=typeof window&&window.localStorage&&(Te="true"===window.localStorage.getItem("wsdk:enable_logging")),Te&&d.setLevel("trace");const Pe=d;var Ce,Oe=("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}).performance||{};Oe.now||Oe.mozNow||Oe.msNow||Oe.oNow||Oe.webkitNow;const Ke=null!==(Ce={env:{}}.env.NODE_ENV)&&void 0!==Ce?Ce:"development",Ne="testnet",De="9fa9d3f3c77c20d3a50a08e5299644be29f6e6206ef3479fe75d907fe6db9e4c";T.RS256,T.ES256;const xe="undefined"!=typeof window&&"undefined"!=typeof document,Re={platform:"web",isNative:!xe,isWeb:xe},Be="3.16.0",Ue="x-sdk-version",Le=`wallaby-cash/${Be}`,qe=e=>e.replace(/:/g,"_"),Fe="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function $e(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Me(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");
|
|
1
|
+
import{H as e,A as t,_ as r,a as s,b as a}from"./r/oci-DzAn0PLg.js";import*as n from"bip39";import{validateMnemonic as i,wordlists as o}from"bip39";import{v4 as c}from"uuid";import d from"loglevel";import{AES as l,enc as u}from"crypto-js";import{jwtDecode as h}from"jwt-decode";import*as p from"react-native-passkey";import{atob as f,toUint8Array as y}from"js-base64";import{Bytes as g,Enum as w,u64 as m,_void as v,Struct as S,u128 as b,u32 as _,compact as A,Option as E,Vector as k}from"scale-ts";var I,T,P,C,O,K,N,D,x,R,B,U,L,q,F,$,M,j,W,V,G,H,Y,z,J,X;!function(e){e.REGISTRATION="webauthn.create",e.AUTHENTICATION="webauthn.get"}(I||(I={})),function(e){e[e.RS256=-257]="RS256",e[e.ES256=-7]="ES256"}(T||(T={})),function(e){e.Usb="usb",e.Nfc="nfc",e.Ble="ble",e.Internal="internal",e.Hybrid="hybrid"}(P||(P={}));class Z extends Error{constructor(e){var t;const{message:r,statusCode:s,errorCode:a,kind:n,data:i,cause:o,onError:c}=e;super(r),this.name="WallabyError",this.status=s,this.errorCode=a,this.kind=null!=n?n:Z.inferKind(s,a),this.cause=o,this.onError=c,this.data=i,Object.setPrototypeOf(this,new.target.prototype),null===(t=Error.captureStackTrace)||void 0===t||t.call(Error,this,new.target)}static isWallabyError(e){return e instanceof Z}static inferKind(e,t){return 0===e?"network":"device_storage_unsupported"===t||(null==t?void 0:t.startsWith("sdk_"))?"sdk":"api"}toJSON(){return{name:this.name,message:this.message,kind:this.kind,status:this.status,errorCode:this.errorCode,data:this.data}}}!function(e){e.Merchant="merchant",e.User="user",e.republic="republic"}(C||(C={})),function(e){e.Active="active",e.Inactive="inactive"}(O||(O={})),function(e){e.Coin="COIN",e.Token="TOKEN"}(K||(K={})),function(e){e.SingleOwner="SINGLE_OWNER",e.MultiSig="MULTI_SIG"}(N||(N={})),function(e){e.Erc20="ERC_20",e.Erc1404="ERC_1404",e.Arc20="ARC_20",e.Arc1404="ARC_1404",e.Mrc20="MRC_20",e.Bep20="BEP_20",e.AlgoStandard="ALGO_STANDARD",e.AlgoApp="ALGO_APP",e.TokenFactory="TOKEN_FACTORY",e.SeiErc20="SEI_ERC_20",e.AptFA="APT_FUNGIBLE_ASSET"}(D||(D={})),function(e){e.Segwit="SEGWIT",e.Legacy="LEGACY",e.Default="DEFAULT"}(x||(x={})),function(e){e.Up="UP",e.Down="DOWN"}(R||(R={})),function(e){e[e.BTC=0]="BTC",e[e.ETH=60]="ETH",e[e.ALGO=283]="ALGO",e[e.AVAX=9e3]="AVAX",e[e.MATIC=966]="MATIC",e[e.BSC=519]="BSC",e[e.BASE=8453]="BASE",e[e.SUI=784]="SUI",e[e.INJ=2525]="INJ",e[e.SEI=19000118]="SEI",e[e.APT=637]="APT",e[e.HBAR=3030]="HBAR",e[e.POLYX=595]="POLYX"}(B||(B={})),function(e){e.Algorand="ALGORAND",e.Aptos="APTOS",e.Avalanche="AVALANCHE",e.Base="BASE",e.Bitcoin="BITCOIN",e.Bsc="BSC",e.Canton="CANTON",e.Ethereum="ETHEREUM",e.Hedera="HEDERA",e.Injective="INJECTIVE",e.Polygon="POLYGON",e.Polymesh="POLYMESH",e.Sei="SEI",e.Sui="SUI",e.Solana="SOLANA"}(U||(U={})),function(e){e.Post="POST",e.Get="GET",e.Put="PUT",e.Delete="DELETE"}(L||(L={})),function(e){e.Active="active",e.Inactive="inactive"}(q||(q={})),function(e){e.INCOMING="INCOMING",e.OUTGOING="OUTGOING",e.UNKNOWN="UNKNOWN"}(F||(F={})),function(e){e.WallabyShare="wallaby_share",e.OwnerMainDeviceShare="owner_main_device_share",e.OwnerBackupDeviceShare="owner_backup_device_share"}($||($={})),function(e){e.Standard="standard",e.Algorand="algorand"}(M||(M={})),function(e){e.BTC_MAINNET_SEGWIT="BTC:MAINNET:SEGWIT",e.BTC_MAINNET_LEGACY="BTC:MAINNET:LEGACY",e.BTC_TESTNET_SEGWIT="BTC:TESTNET:SEGWIT",e.BTC_TESTNET_LEGACY="BTC:TESTNET:LEGACY",e.ETH="ETH:ALL:DEFAULT",e.ALGO="ALGO:ALL:DEFAULT",e.SUI="SUI:ALL:DEFAULT",e.INJ="INJ:ALL:DEFAULT",e.APT="APT:ALL:DEFAULT",e.POLYX="POLYX:ALL:DEFAULT",e.BSC="BSC:ALL:DEFAULT",e.AVAX="AVAX:ALL:DEFAULT",e.MATIC="MATIC:ALL:DEFAULT",e.BASE="BASE:ALL:DEFAULT",e.SEI="SEI:ALL:DEFAULT",e.HBAR="HBAR:ALL:DEFAULT",e.CC="CC:ALL:DEFAULT"}(j||(j={})),function(e){e.ReturnOnlyEncryptedShares="RETURN_ONLY_ENCRYPTED_SHARES",e.ReturnOnlyEncryptedSeedPhrase="RETURN_ONLY_ENCRYPTED_SEED_PHRASE",e.ReturnBothEncryptedSharesAndSeed="RETURN_BOTH_ENCRYPTED_SHARES_AND_SEED"}(W||(W={})),function(e){e.SingleOwner="SINGLE_OWNER",e.MultiOwner="MULTI_OWNER"}(V||(V={})),function(e){e.Password="password",e.Passkey="passkey"}(G||(G={})),function(e){e.AccessToken="access-token",e.RefreshToken="refresh-token",e.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",e.EncryptedKeyShares="encrypted-key-shares",e.PrimaryDeviceKeyShare="primary-device-key-share",e.BackupDeviceKeyShare="backup-device-key-share",e.EncryptedShare="encrypted-share",e.EncryptedAlgorandSeedPhrase="encrypted-algorand-seedPhrase",e.EncryptedDevicePrivateKey="encrypted-private-key",e.ClientAuthPublicKey="client-auth-pub-key",e.ClientAuthToken="republic-jwt",e.PasskeyCredential="pass-key-credential",e.Blob="blob"}(H||(H={})),function(e){e.EncryptedPrivateKey="encryptedPrivateKey",e.WallabyAuthPubKey="wallabyAuthPubKey",e.EncryptedAlgorandSeed="encryptedAlgorandSeed",e.EncryptedSeed="encryptedSeed",e.ClientAuthToken="republic_jwt",e.AccessToken="accessToken"}(Y||(Y={})),function(e){e.AccessToken="access-token",e.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",e.EncryptedAlgorandSeedPhrase="encrypted-algorand-seedPhrase",e.EncryptedDevicePrivateKey="encrypted-private-key",e.ClientAuthPublicKey="client-auth-pub-key",e.WallabyAuthPubKey="wallaby-auth-pub-key",e.ClientAuthToken="republic-jwt"}(z||(z={})),function(e){e.AccessToken="access-token",e.RefreshToken="refresh-token",e.BackupDeviceKeyShare="backup-device-key-share",e.ClientAuthPublicKey="client-auth-pub-key",e.ClientAuthToken="republic-jwt",e.EncryptedDevicePrivateKey="encrypted-private-key",e.EncryptedStandardSeedPhrase="encrypted-standard-seedPhrase",e.PasskeyCredential="pass-key-credential",e.PrimaryDeviceKeyShare="primary-device-key-share",e.WallabyAuthPubKey="wallaby-auth-pub-key",e.MigrationVersion="wsdk_migrated_with_version",e.LastMigratedAt="wsdk_last_migrated_at",e.PasswordResetAttempts="wsdk_password_reset_attempts",e.MigrationAttempts="wsdk_migration_attempts",e.CredentialConversionInProgress="credential-conversion-in-progress",e.PendingCommit="pending-commit",e.LegacySeedClaimedWalletId="wsdk_legacy_seed_claimed_wallet_id"}(J||(J={})),function(e){e.unknown_error="unknown_error",e.internal_server_error="internal_server_error",e.request_payload_missing="request_payload_missing",e.request_payload_wrong_format="request_payload_wrong_format",e.auth_api_key_invalid="auth_api_key_invalid",e.auth_api_key_not_active="auth_api_key_not_active",e.auth_api_key_pub_key_not_set="auth_api_key_pub_key_not_set",e.auth_api_key_pub_key_already_in_use="auth_api_key_pub_key_already_in_use",e.auth_api_key_not_provided="auth_api_key_not_provided",e.auth_api_key_not_found="auth_api_key_not_found",e.auth_origin_not_allowed="auth_origin_not_allowed",e.auth_api_jwt_invalid="auth_api_jwt_invalid",e.auth_api_jwt_not_active="auth_api_jwt_not_active",e.auth_api_jwt_not_provided="auth_api_jwt_not_provided",e.auth_api_jwt_expired="auth_api_jwt_expired",e.auth_api_unauthorized="auth_api_unauthorized",e.auth_client_jwt_invalid="auth_client_jwt_invalid",e.auth_client_jwt_missing_external_id_payload="auth_client_jwt_missing_external_id_payload",e.auth_client_jwt_missing_exp_payload="auth_client_jwt_missing_exp_payload",e.auth_client_jwt_external_id_not_match="auth_client_jwt_external_id_not_match",e.auth_client_jwt_expired="auth_client_jwt_expired",e.auth_client_jwt_not_provided="auth_client_jwt_not_provided",e.auth_client_jwt_invalid_auth_type="auth_client_jwt_invalid_auth_type",e.auth_client_jwt_invalid_passkey="auth_client_jwt_invalid_passkey",e.auth_client_pub_key_and_message_not_match="auth_client_pub_key_and_message_not_match",e.auth_client_pub_key_and_message_expired="auth_client_pub_key_and_message_expired",e.auth_client_pub_key_and_message_signature_failed="auth_client_pub_key_and_message_signature_failed",e.auth_client_pub_key_not_found="auth_client_pub_key_not_found",e.auth_client_pub_key_already_registered="auth_client_pub_key_already_registered",e.auth_user_not_allowed_to_perform_the_action="auth_user_not_allowed_to_perform_the_action",e.auth_upside_signature_not_provided="auth_upside_signature_not_provided",e.auth_upside_signature_invalid="auth_upside_signature_invalid",e.auth_upside_wrong_base64_signature="auth_upside_wrong_base64_signature",e.multisig_participant_not_found="multisig_participant_not_found",e.wallet_not_found="wallet_not_found",e.wallet_recovery_seed_mismatch="wallet_recovery_seed_mismatch",e.wallet_address_not_found="wallet_address_not_found",e.wallet_address_generation_failed="wallet_address_generation_failed",e.invalid_public_key="invalid_public_key",e.canton_registration_daily_limit_exceeded="canton_registration_daily_limit_exceeded",e.asset_not_found="asset_not_found",e.seedphrase_could_not_be_decrypted="seedphrase_could_not_be_decrypted",e.invalid_seed_phrase="invalid_seed_phrase",e.user_already_exists="user_already_exists",e.user_not_found="user_not_found",e.otp_code_invalid="otp_code_invalid",e.otp_code_expired="otp_code_expired",e.merchant_not_found="merchant_not_found",e.swap_provider_not_found="swap_provider_not_found",e.swap_chain_not_supported="swap_chain_not_supported",e.swap_asset_not_supported="swap_asset_not_supported",e.swap_quote_executing="swap_quote_executing",e.swap_quote_in_progress="swap_quote_in_progress",e.swap_quote_completed="swap_quote_completed",e.swap_quote_failed="swap_quote_failed",e.swap_quote_abandoned="swap_quote_abandoned",e.swap_quote_execution_failed="swap_quote_execution_failed",e.swap_quote_invalid="swap_quote_invalid",e.feature_not_enabled="feature_not_enabled",e.insufficient_balance="insufficient_balance",e.transaction_failed="transaction_failed",e.invalid_number_of_signatures="invalid_number_of_signatures",e.invalid_signature="invalid_signature",e.chain_adapter_not_found="chain_adapter_not_found",e.chain_not_found="chain_not_found",e.invalid_address="invalid_address",e.auth_refresh_token_not_found="auth_refresh_token_not_found",e.auth_refresh_token_expired="auth_refresh_token_expired",e.auth_refresh_token_reuse_detected="auth_refresh_token_reuse_detected",e.sdk_jwt_invalid="sdk_jwt_invalid",e.sdk_jwt_expired="sdk_jwt_expired",e.sdk_unknown_error="sdk_unknown_error",e.sdk_too_many_requests="sdk_too_many_requests",e.sdk_seed_phrase_decryption_failed="sdk_seed_phrase_decryption_failed",e.sdk_key_shares_not_found="sdk_key_shares_not_found",e.sdk_key_share_decryption_failed="sdk_key_share_decryption_failed",e.sdk_seed_phrase_not_found="sdk_seed_phrase_not_found",e.sdk_private_key_decryption_failed="sdk_private_key_decryption_failed",e.sdk_private_key_not_found="sdk_private_key_not_found",e.sdk_device_key_missing_with_existing_data="sdk_device_key_missing_with_existing_data",e.sdk_refresh_token_missing="sdk_refresh_token_missing",e.sdk_missing_parameter="sdk_missing_parameter",e.sdk_invalid_parameter="sdk_invalid_parameter",e.sdk_invalid_response="sdk_invalid_response",e.sdk_wrong_password="sdk_wrong_password",e.sdk_no_valid_seed_option="sdk_no_valid_seed_option",e.sdk_ambiguous_legacy_migration_data="sdk_ambiguous_legacy_migration_data",e.sdk_passkey_prf_not_available="sdk_passkey_prf_not_available",e.sdk_passkey_challenge_unavailable="sdk_passkey_challenge_unavailable",e.sdk_passkey_authentication_failed="sdk_passkey_authentication_failed",e.sdk_passkey_registration_failed="sdk_passkey_registration_failed"}(X||(X={}));const Q={error:"UnknownError",message:"An unknown error occurred"},ee={error:"IOSVersionNotSupportedError",message:"Passkeys are not supported on this device. iOS 15 and above is required to use Passkeys"},te={error:"AndroidVersionNotSupportedError",message:"Passkeys are not supported on this device. Android 9 and above is required to use Passkeys"},re={error:"RequestFailed",message:"The request failed. No Credentials were returned."},se={error:"UserCancelled",message:"The user cancelled the request."},ae={error:"InvalidChallenge",message:"The provided challenge was invalid"},ne={error:"InvalidUserId",message:"The provided userId was invalid"},ie={error:"BadConfiguration",message:"Your app is not properly configured. Refer to the docs for help."},oe={error:"NoCredentials",message:"No viable credential is available for the user."},ce={error:"Interrupted",message:"The operation was interrupted and may be retried."},de={error:"TimedOut",message:"The operation timed out."},le={error:"ERROR_CEREMONY_ABORTED",message:"User did not complete the request in time."},ue={error:"ERROR_INVALID_DOMAIN",message:"Invalid domain."},he={error:"ERROR_INVALID_RP_ID",message:"Invalid Relying Party ID."},pe={error:"ERROR_INVALID_USER_ID_LENGTH",message:"Invalid user ID length."},fe={error:"ERROR_MALFORMED_PUBKEYCREDPARAMS",message:"Malformed public key credential parameters."},ye={error:"ERROR_AUTHENTICATOR_GENERAL_ERROR",message:"Authenticator encountered a general error."},ge={error:"ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT",message:"Authenticator does not support discoverable credentials."},we={error:"ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT",message:"Authenticator does not support user verification."},me={error:"ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED",message:"Authenticator was previously registered."},ve={error:"InvalidStateError",message:"The authenticator was previously registered"},Se={error:"ERROR_AUTHENTICATOR_NOT_REGISTERED",message:"Authenticator is not registered."},be={error:"ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG",message:"Authenticator does not support any of the provided public key credential parameters algorithms."},_e={error:"ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE",message:"User verification failed during auto-registration."},Ae={error:"ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY",message:"An error occurred. See the cause property for more details."},Ee={error:"NotAllowedError",message:"CredentialContainer request is not allowed."},ke=(e="An unknown error occurred")=>({error:"Unknown",message:e}),Ie=[Q,ee,te,re,se,ae,ne,ie,oe,ce,de,le,ue,he,pe,fe,ye,ge,we,me,be,_e,Ae];let Te=!1;"undefined"!=typeof window&&window.localStorage&&(Te="true"===window.localStorage.getItem("wsdk:enable_logging")),Te&&d.setLevel("trace");const Pe=d;var Ce,Oe=("undefined"!=typeof global?global:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{}).performance||{};Oe.now||Oe.mozNow||Oe.msNow||Oe.oNow||Oe.webkitNow;const Ke=null!==(Ce={env:{}}.env.NODE_ENV)&&void 0!==Ce?Ce:"development",Ne="testnet",De="9fa9d3f3c77c20d3a50a08e5299644be29f6e6206ef3479fe75d907fe6db9e4c";T.RS256,T.ES256;const xe="undefined"!=typeof window&&"undefined"!=typeof document,Re={platform:"web",isNative:!xe,isWeb:xe},Be="3.16.1",Ue="x-sdk-version",Le=`wallaby-cash/${Be}`,qe=e=>e.replace(/:/g,"_"),Fe="object"==typeof globalThis&&"crypto"in globalThis?globalThis.crypto:void 0;function $e(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("positive integer expected, got "+e)}function Me(e,...t){if(!((r=e)instanceof Uint8Array||ArrayBuffer.isView(r)&&"Uint8Array"===r.constructor.name))throw new Error("Uint8Array expected");
|
|
2
2
|
/*! noble-hashes - MIT License (c) 2022 Paul Miller (paulmillr.com) */
|
|
3
3
|
var r;if(t.length>0&&!t.includes(e.length))throw new Error("Uint8Array expected of length "+t+", got length="+e.length)}function je(e){if("function"!=typeof e||"function"!=typeof e.create)throw new Error("Hash should be wrapped by utils.createHasher");$e(e.outputLen),$e(e.blockLen)}function We(e,t=!0){if(e.destroyed)throw new Error("Hash instance has been destroyed");if(t&&e.finished)throw new Error("Hash#digest() has already been called")}function Ve(e,t){Me(e);const r=t.outputLen;if(e.length<r)throw new Error("digestInto() expects output buffer of length at least "+r)}function Ge(e){return new Uint32Array(e.buffer,e.byteOffset,Math.floor(e.byteLength/4))}function He(...e){for(let t=0;t<e.length;t++)e[t].fill(0)}function Ye(e){return new DataView(e.buffer,e.byteOffset,e.byteLength)}function ze(e,t){return e<<32-t|e>>>t}const Je=(()=>68===new Uint8Array(new Uint32Array([287454020]).buffer)[0])();function Xe(e){return e<<24&4278190080|e<<8&16711680|e>>>8&65280|e>>>24&255}const Ze=Je?e=>e:e=>Xe(e);const Qe=Je?e=>e:function(e){for(let t=0;t<e.length;t++)e[t]=Xe(e[t]);return e},et=(()=>"function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex)(),tt=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function rt(e){if(Me(e),et)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=tt[e[r]];return t}const st=48,at=57,nt=65,it=70,ot=97,ct=102;function dt(e){return e>=st&&e<=at?e-st:e>=nt&&e<=it?e-(nt-10):e>=ot&&e<=ct?e-(ot-10):void 0}function lt(e){if("string"!=typeof e)throw new Error("string expected");return new Uint8Array((new TextEncoder).encode(e))}function ut(e){return"string"==typeof e&&(e=lt(e)),Me(e),e}function ht(e){return"string"==typeof e&&(e=lt(e)),Me(e),e}class pt{}function ft(e){const t=t=>e().update(ut(t)).digest(),r=e();return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=()=>e(),t}function yt(e){const t=(t,r)=>e(r).update(ut(t)).digest(),r=e({});return t.outputLen=r.outputLen,t.blockLen=r.blockLen,t.create=t=>e(t),t}function gt(e=32){if(Fe&&"function"==typeof Fe.getRandomValues)return Fe.getRandomValues(new Uint8Array(e));if(Fe&&"function"==typeof Fe.randomBytes)return Uint8Array.from(Fe.randomBytes(e));throw new Error("crypto.getRandomValues must be defined")}function wt(e){return gt(e)}
|
|
4
4
|
/*! noble-curves - MIT License (c) 2022 Paul Miller (paulmillr.com) */const mt=BigInt(0),vt=BigInt(1);function St(e){return e instanceof Uint8Array||ArrayBuffer.isView(e)&&"Uint8Array"===e.constructor.name}function bt(e){if(!St(e))throw new Error("Uint8Array expected")}function _t(e,t){if("boolean"!=typeof t)throw new Error(e+" boolean expected, got "+t)}function At(e){const t=e.toString(16);return 1&t.length?"0"+t:t}function Et(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);return""===e?mt:BigInt("0x"+e)}const kt="function"==typeof Uint8Array.from([]).toHex&&"function"==typeof Uint8Array.fromHex,It=Array.from({length:256},((e,t)=>t.toString(16).padStart(2,"0")));function Tt(e){if(bt(e),kt)return e.toHex();let t="";for(let r=0;r<e.length;r++)t+=It[e[r]];return t}const Pt=48,Ct=57,Ot=65,Kt=70,Nt=97,Dt=102;function xt(e){return e>=Pt&&e<=Ct?e-Pt:e>=Ot&&e<=Kt?e-(Ot-10):e>=Nt&&e<=Dt?e-(Nt-10):void 0}function Rt(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(kt)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const s=new Uint8Array(r);for(let t=0,a=0;t<r;t++,a+=2){const r=xt(e.charCodeAt(a)),n=xt(e.charCodeAt(a+1));if(void 0===r||void 0===n){const t=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+a)}s[t]=16*r+n}return s}function Bt(e){return Et(Tt(e))}function Ut(e){return bt(e),Et(Tt(Uint8Array.from(e).reverse()))}function Lt(e,t){return Rt(e.toString(16).padStart(2*t,"0"))}function qt(e,t){return Lt(e,t).reverse()}function Ft(e,t,r){let s;if("string"==typeof t)try{s=Rt(t)}catch(t){throw new Error(e+" must be hex string or Uint8Array, cause: "+t)}else{if(!St(t))throw new Error(e+" must be hex string or Uint8Array");s=Uint8Array.from(t)}const a=s.length;if("number"==typeof r&&a!==r)throw new Error(e+" of length "+r+" expected, got "+a);return s}function $t(...e){let t=0;for(let r=0;r<e.length;r++){const s=e[r];bt(s),t+=s.length}const r=new Uint8Array(t);for(let t=0,s=0;t<e.length;t++){const a=e[t];r.set(a,s),s+=a.length}return r}const Mt=e=>"bigint"==typeof e&&mt<=e;function jt(e,t,r){return Mt(e)&&Mt(t)&&Mt(r)&&t<=e&&e<r}function Wt(e,t,r,s){if(!jt(t,r,s))throw new Error("expected valid "+e+": "+r+" <= n < "+s+", got "+t)}const Vt=e=>(vt<<BigInt(e))-vt,Gt=e=>new Uint8Array(e),Ht=e=>Uint8Array.from(e);const Yt={bigint:e=>"bigint"==typeof e,function:e=>"function"==typeof e,boolean:e=>"boolean"==typeof e,string:e=>"string"==typeof e,stringOrUint8Array:e=>"string"==typeof e||St(e),isSafeInteger:e=>Number.isSafeInteger(e),array:e=>Array.isArray(e),field:(e,t)=>t.Fp.isValid(e),hash:e=>"function"==typeof e&&Number.isSafeInteger(e.outputLen)};function zt(e,t,r={}){const s=(t,r,s)=>{const a=Yt[r];if("function"!=typeof a)throw new Error("invalid validator function");const n=e[t];if(!(s&&void 0===n||a(n,e)))throw new Error("param "+String(t)+" is invalid. Expected "+r+", got "+n)};for(const[e,r]of Object.entries(t))s(e,r,!1);for(const[e,t]of Object.entries(r))s(e,t,!0);return e}function Jt(e){const t=new WeakMap;return(r,...s)=>{const a=t.get(r);if(void 0!==a)return a;const n=e(r,...s);return t.set(r,n),n}}const Xt=Me;function Zt(e){return function(e){if("string"!=typeof e)throw new Error("hex string expected, got "+typeof e);if(et)return Uint8Array.fromHex(e);const t=e.length,r=t/2;if(t%2)throw new Error("hex string expected, got unpadded hex of length "+t);const s=new Uint8Array(r);for(let t=0,a=0;t<r;t++,a+=2){const r=dt(e.charCodeAt(a)),n=dt(e.charCodeAt(a+1));if(void 0===r||void 0===n){const t=e[a]+e[a+1];throw new Error('hex string expected, got non-hex character "'+t+'" at index '+a)}s[t]=16*r+n}return s}(e.startsWith("0x")?e.substring(2):e)}function Qt(e){return t=>(Xt(t),e(t))}const er=e=>{if("string"!=typeof e)throw new Error("[stripHexPrefix] input must be type 'string', received "+typeof e);return(e=>{if("string"!=typeof e)throw new Error("[isHexPrefixed] input must be type 'string', received type "+typeof e);return"0"===e[0]&&"x"===e[1]})(e)?e.slice(2):e},tr=e=>e.startsWith("0x")?e:"0x"+e,rr=e=>{let t=e;return 64===Zt(e).length&&(t="04"+e),t.substring(2)},sr=e=>{const t=e.reduce(((e,t)=>e+t.byteLength),0),r=new Uint8Array(t);let s=0;return e.forEach((e=>{r.set(e,s),s+=e.byteLength})),r},ar=e=>{if("string"!=typeof e)throw new Error("utf8ToBytes expected string, got "+typeof e);const t=[];for(let r=0;r<e.length;r++){const s=e.codePointAt(r);if(!s)throw new Error("Invalid code point");s<128?t.push(s):s<2048?t.push(192|s>>6,128|63&s):s<65536?t.push(224|s>>12,128|s>>6&63,128|63&s):(r++,t.push(240|s>>18,128|s>>12&63,128|s>>6&63,128|63&s))}return new Uint8Array(t)};function nr(e,t,r){return e&t^e&r^t&r}class ir extends pt{constructor(e,t,r,s){super(),this.finished=!1,this.length=0,this.pos=0,this.destroyed=!1,this.blockLen=e,this.outputLen=t,this.padOffset=r,this.isLE=s,this.buffer=new Uint8Array(e),this.view=Ye(this.buffer)}update(e){We(this),Me(e=ut(e));const{view:t,buffer:r,blockLen:s}=this,a=e.length;for(let n=0;n<a;){const i=Math.min(s-this.pos,a-n);if(i!==s)r.set(e.subarray(n,n+i),this.pos),this.pos+=i,n+=i,this.pos===s&&(this.process(t,0),this.pos=0);else{const t=Ye(e);for(;s<=a-n;n+=s)this.process(t,n)}}return this.length+=e.length,this.roundClean(),this}digestInto(e){We(this),Ve(e,this),this.finished=!0;const{buffer:t,view:r,blockLen:s,isLE:a}=this;let{pos:n}=this;t[n++]=128,He(this.buffer.subarray(n)),this.padOffset>s-n&&(this.process(r,0),n=0);for(let e=n;e<s;e++)t[e]=0;!function(e,t,r,s){if("function"==typeof e.setBigUint64)return e.setBigUint64(t,r,s);const a=BigInt(32),n=BigInt(4294967295),i=Number(r>>a&n),o=Number(r&n),c=s?4:0,d=s?0:4;e.setUint32(t+c,i,s),e.setUint32(t+d,o,s)}(r,s-8,BigInt(8*this.length),a),this.process(r,0);const i=Ye(e),o=this.outputLen;if(o%4)throw new Error("_sha2: outputLen should be aligned to 32bit");const c=o/4,d=this.get();if(c>d.length)throw new Error("_sha2: outputLen bigger than state");for(let e=0;e<c;e++)i.setUint32(4*e,d[e],a)}digest(){const{buffer:e,outputLen:t}=this;this.digestInto(e);const r=e.slice(0,t);return this.destroy(),r}_cloneInto(e){e||(e=new this.constructor),e.set(...this.get());const{blockLen:t,buffer:r,length:s,finished:a,destroyed:n,pos:i}=this;return e.destroyed=n,e.finished=a,e.length=s,e.pos=i,s%t&&e.buffer.set(r),e}clone(){return this._cloneInto()}}const or=Uint32Array.from([1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225]),cr=Uint32Array.from([3418070365,3238371032,1654270250,914150663,2438529370,812702999,355462360,4144912697,1731405415,4290775857,2394180231,1750603025,3675008525,1694076839,1203062813,3204075428]),dr=Uint32Array.from([1779033703,4089235720,3144134277,2227873595,1013904242,4271175723,2773480762,1595750129,1359893119,2917565137,2600822924,725511199,528734635,4215389547,1541459225,327033209]),lr=BigInt(2**32-1),ur=BigInt(32);function hr(e,t=!1){return t?{h:Number(e&lr),l:Number(e>>ur&lr)}:{h:0|Number(e>>ur&lr),l:0|Number(e&lr)}}function pr(e,t=!1){const r=e.length;let s=new Uint32Array(r),a=new Uint32Array(r);for(let n=0;n<r;n++){const{h:r,l:i}=hr(e[n],t);[s[n],a[n]]=[r,i]}return[s,a]}const fr=(e,t,r)=>e>>>r,yr=(e,t,r)=>e<<32-r|t>>>r,gr=(e,t,r)=>e>>>r|t<<32-r,wr=(e,t,r)=>e<<32-r|t>>>r,mr=(e,t,r)=>e<<64-r|t>>>r-32,vr=(e,t,r)=>e>>>r-32|t<<64-r;function Sr(e,t,r,s){const a=(t>>>0)+(s>>>0);return{h:e+r+(a/2**32|0)|0,l:0|a}}const br=(e,t,r)=>(e>>>0)+(t>>>0)+(r>>>0),_r=(e,t,r,s)=>t+r+s+(e/2**32|0)|0,Ar=(e,t,r,s)=>(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0),Er=(e,t,r,s,a)=>t+r+s+a+(e/2**32|0)|0,kr=(e,t,r,s,a)=>(e>>>0)+(t>>>0)+(r>>>0)+(s>>>0)+(a>>>0),Ir=(e,t,r,s,a,n)=>t+r+s+a+n+(e/2**32|0)|0,Tr=Uint32Array.from([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]),Pr=new Uint32Array(64);class Cr extends ir{constructor(e=32){super(64,e,8,!1),this.A=0|or[0],this.B=0|or[1],this.C=0|or[2],this.D=0|or[3],this.E=0|or[4],this.F=0|or[5],this.G=0|or[6],this.H=0|or[7]}get(){const{A:e,B:t,C:r,D:s,E:a,F:n,G:i,H:o}=this;return[e,t,r,s,a,n,i,o]}set(e,t,r,s,a,n,i,o){this.A=0|e,this.B=0|t,this.C=0|r,this.D=0|s,this.E=0|a,this.F=0|n,this.G=0|i,this.H=0|o}process(e,t){for(let r=0;r<16;r++,t+=4)Pr[r]=e.getUint32(t,!1);for(let e=16;e<64;e++){const t=Pr[e-15],r=Pr[e-2],s=ze(t,7)^ze(t,18)^t>>>3,a=ze(r,17)^ze(r,19)^r>>>10;Pr[e]=a+Pr[e-7]+s+Pr[e-16]|0}let{A:r,B:s,C:a,D:n,E:i,F:o,G:c,H:d}=this;for(let e=0;e<64;e++){const t=d+(ze(i,6)^ze(i,11)^ze(i,25))+((l=i)&o^~l&c)+Tr[e]+Pr[e]|0,u=(ze(r,2)^ze(r,13)^ze(r,22))+nr(r,s,a)|0;d=c,c=o,o=i,i=n+t|0,n=a,a=s,s=r,r=t+u|0}var l;r=r+this.A|0,s=s+this.B|0,a=a+this.C|0,n=n+this.D|0,i=i+this.E|0,o=o+this.F|0,c=c+this.G|0,d=d+this.H|0,this.set(r,s,a,n,i,o,c,d)}roundClean(){He(Pr)}destroy(){this.set(0,0,0,0,0,0,0,0),He(this.buffer)}}const Or=(()=>pr(["0x428a2f98d728ae22","0x7137449123ef65cd","0xb5c0fbcfec4d3b2f","0xe9b5dba58189dbbc","0x3956c25bf348b538","0x59f111f1b605d019","0x923f82a4af194f9b","0xab1c5ed5da6d8118","0xd807aa98a3030242","0x12835b0145706fbe","0x243185be4ee4b28c","0x550c7dc3d5ffb4e2","0x72be5d74f27b896f","0x80deb1fe3b1696b1","0x9bdc06a725c71235","0xc19bf174cf692694","0xe49b69c19ef14ad2","0xefbe4786384f25e3","0x0fc19dc68b8cd5b5","0x240ca1cc77ac9c65","0x2de92c6f592b0275","0x4a7484aa6ea6e483","0x5cb0a9dcbd41fbd4","0x76f988da831153b5","0x983e5152ee66dfab","0xa831c66d2db43210","0xb00327c898fb213f","0xbf597fc7beef0ee4","0xc6e00bf33da88fc2","0xd5a79147930aa725","0x06ca6351e003826f","0x142929670a0e6e70","0x27b70a8546d22ffc","0x2e1b21385c26c926","0x4d2c6dfc5ac42aed","0x53380d139d95b3df","0x650a73548baf63de","0x766a0abb3c77b2a8","0x81c2c92e47edaee6","0x92722c851482353b","0xa2bfe8a14cf10364","0xa81a664bbc423001","0xc24b8b70d0f89791","0xc76c51a30654be30","0xd192e819d6ef5218","0xd69906245565a910","0xf40e35855771202a","0x106aa07032bbd1b8","0x19a4c116b8d2d0c8","0x1e376c085141ab53","0x2748774cdf8eeb99","0x34b0bcb5e19b48a8","0x391c0cb3c5c95a63","0x4ed8aa4ae3418acb","0x5b9cca4f7763e373","0x682e6ff3d6b2b8a3","0x748f82ee5defb2fc","0x78a5636f43172f60","0x84c87814a1f0ab72","0x8cc702081a6439ec","0x90befffa23631e28","0xa4506cebde82bde9","0xbef9a3f7b2c67915","0xc67178f2e372532b","0xca273eceea26619c","0xd186b8c721c0c207","0xeada7dd6cde0eb1e","0xf57d4f7fee6ed178","0x06f067aa72176fba","0x0a637dc5a2c898a6","0x113f9804bef90dae","0x1b710b35131c471b","0x28db77f523047d84","0x32caab7b40c72493","0x3c9ebe0a15c9bebc","0x431d67c49c100d4c","0x4cc5d4becb3e42b6","0x597f299cfc657e2a","0x5fcb6fab3ad6faec","0x6c44198c4a475817"].map((e=>BigInt(e)))))(),Kr=(()=>Or[0])(),Nr=(()=>Or[1])(),Dr=new Uint32Array(80),xr=new Uint32Array(80);class Rr extends ir{constructor(e=64){super(128,e,16,!1),this.Ah=0|dr[0],this.Al=0|dr[1],this.Bh=0|dr[2],this.Bl=0|dr[3],this.Ch=0|dr[4],this.Cl=0|dr[5],this.Dh=0|dr[6],this.Dl=0|dr[7],this.Eh=0|dr[8],this.El=0|dr[9],this.Fh=0|dr[10],this.Fl=0|dr[11],this.Gh=0|dr[12],this.Gl=0|dr[13],this.Hh=0|dr[14],this.Hl=0|dr[15]}get(){const{Ah:e,Al:t,Bh:r,Bl:s,Ch:a,Cl:n,Dh:i,Dl:o,Eh:c,El:d,Fh:l,Fl:u,Gh:h,Gl:p,Hh:f,Hl:y}=this;return[e,t,r,s,a,n,i,o,c,d,l,u,h,p,f,y]}set(e,t,r,s,a,n,i,o,c,d,l,u,h,p,f,y){this.Ah=0|e,this.Al=0|t,this.Bh=0|r,this.Bl=0|s,this.Ch=0|a,this.Cl=0|n,this.Dh=0|i,this.Dl=0|o,this.Eh=0|c,this.El=0|d,this.Fh=0|l,this.Fl=0|u,this.Gh=0|h,this.Gl=0|p,this.Hh=0|f,this.Hl=0|y}process(e,t){for(let r=0;r<16;r++,t+=4)Dr[r]=e.getUint32(t),xr[r]=e.getUint32(t+=4);for(let e=16;e<80;e++){const t=0|Dr[e-15],r=0|xr[e-15],s=gr(t,r,1)^gr(t,r,8)^fr(t,0,7),a=wr(t,r,1)^wr(t,r,8)^yr(t,r,7),n=0|Dr[e-2],i=0|xr[e-2],o=gr(n,i,19)^mr(n,i,61)^fr(n,0,6),c=wr(n,i,19)^vr(n,i,61)^yr(n,i,6),d=Ar(a,c,xr[e-7],xr[e-16]),l=Er(d,s,o,Dr[e-7],Dr[e-16]);Dr[e]=0|l,xr[e]=0|d}let{Ah:r,Al:s,Bh:a,Bl:n,Ch:i,Cl:o,Dh:c,Dl:d,Eh:l,El:u,Fh:h,Fl:p,Gh:f,Gl:y,Hh:g,Hl:w}=this;for(let e=0;e<80;e++){const t=gr(l,u,14)^gr(l,u,18)^mr(l,u,41),m=wr(l,u,14)^wr(l,u,18)^vr(l,u,41),v=l&h^~l&f,S=kr(w,m,u&p^~u&y,Nr[e],xr[e]),b=Ir(S,g,t,v,Kr[e],Dr[e]),_=0|S,A=gr(r,s,28)^mr(r,s,34)^mr(r,s,39),E=wr(r,s,28)^vr(r,s,34)^vr(r,s,39),k=r&a^r&i^a&i,I=s&n^s&o^n&o;g=0|f,w=0|y,f=0|h,y=0|p,h=0|l,p=0|u,({h:l,l:u}=Sr(0|c,0|d,0|b,0|_)),c=0|i,d=0|o,i=0|a,o=0|n,a=0|r,n=0|s;const T=br(_,E,I);r=_r(T,b,A,k),s=0|T}({h:r,l:s}=Sr(0|this.Ah,0|this.Al,0|r,0|s)),({h:a,l:n}=Sr(0|this.Bh,0|this.Bl,0|a,0|n)),({h:i,l:o}=Sr(0|this.Ch,0|this.Cl,0|i,0|o)),({h:c,l:d}=Sr(0|this.Dh,0|this.Dl,0|c,0|d)),({h:l,l:u}=Sr(0|this.Eh,0|this.El,0|l,0|u)),({h:h,l:p}=Sr(0|this.Fh,0|this.Fl,0|h,0|p)),({h:f,l:y}=Sr(0|this.Gh,0|this.Gl,0|f,0|y)),({h:g,l:w}=Sr(0|this.Hh,0|this.Hl,0|g,0|w)),this.set(r,s,a,n,i,o,c,d,l,u,h,p,f,y,g,w)}roundClean(){He(Dr,xr)}destroy(){He(this.buffer),this.set(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0)}}class Br extends Rr{constructor(){super(48),this.Ah=0|cr[0],this.Al=0|cr[1],this.Bh=0|cr[2],this.Bl=0|cr[3],this.Ch=0|cr[4],this.Cl=0|cr[5],this.Dh=0|cr[6],this.Dl=0|cr[7],this.Eh=0|cr[8],this.El=0|cr[9],this.Fh=0|cr[10],this.Fl=0|cr[11],this.Gh=0|cr[12],this.Gl=0|cr[13],this.Hh=0|cr[14],this.Hl=0|cr[15]}}const Ur=Uint32Array.from([573645204,4230739756,2673172387,3360449730,596883563,1867755857,2520282905,1497426621,2519219938,2827943907,3193839141,1401305490,721525244,746961066,246885852,2177182882]);class Lr extends Rr{constructor(){super(32),this.Ah=0|Ur[0],this.Al=0|Ur[1],this.Bh=0|Ur[2],this.Bl=0|Ur[3],this.Ch=0|Ur[4],this.Cl=0|Ur[5],this.Dh=0|Ur[6],this.Dl=0|Ur[7],this.Eh=0|Ur[8],this.El=0|Ur[9],this.Fh=0|Ur[10],this.Fl=0|Ur[11],this.Gh=0|Ur[12],this.Gl=0|Ur[13],this.Hh=0|Ur[14],this.Hl=0|Ur[15]}}const qr=ft((()=>new Cr)),Fr=ft((()=>new Rr)),$r=ft((()=>new Br)),Mr=ft((()=>new Lr));class jr extends pt{constructor(e,t){super(),this.finished=!1,this.destroyed=!1,je(e);const r=ut(t);if(this.iHash=e.create(),"function"!=typeof this.iHash.update)throw new Error("Expected instance of class which extends utils.Hash");this.blockLen=this.iHash.blockLen,this.outputLen=this.iHash.outputLen;const s=this.blockLen,a=new Uint8Array(s);a.set(r.length>s?e.create().update(r).digest():r);for(let e=0;e<a.length;e++)a[e]^=54;this.iHash.update(a),this.oHash=e.create();for(let e=0;e<a.length;e++)a[e]^=106;this.oHash.update(a),He(a)}update(e){return We(this),this.iHash.update(e),this}digestInto(e){We(this),Me(e,this.outputLen),this.finished=!0,this.iHash.digestInto(e),this.oHash.update(e),this.oHash.digestInto(e),this.destroy()}digest(){const e=new Uint8Array(this.oHash.outputLen);return this.digestInto(e),e}_cloneInto(e){e||(e=Object.create(Object.getPrototypeOf(this),{}));const{oHash:t,iHash:r,finished:s,destroyed:a,blockLen:n,outputLen:i}=this;return e.finished=s,e.destroyed=a,e.blockLen=n,e.outputLen=i,e.oHash=t._cloneInto(e.oHash),e.iHash=r._cloneInto(e.iHash),e}clone(){return this._cloneInto()}destroy(){this.destroyed=!0,this.oHash.destroy(),this.iHash.destroy()}}const Wr=(e,t,r)=>new jr(e,t).update(r).digest();Wr.create=(e,t)=>new jr(e,t)
|