/** * Copyright 2025 Circle Internet Group, Inc. All rights reserved. * * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ import * as React from "react"; import { ViewProperties } from "react-native"; import { AddressTags, ApiHistoryItem, CallAbiFunctionResult, CreateKycResult, CurrencyFailResult, GetCurrenciesResult, getEstimateGas, GetEstimateGasResult, GetHistoryResult, GetMultipleTokenUriResult, GetNonceResult, getSameCurrencyWalletLimit, RegisterPhoneNumberResult, SendSignedTxResult, SignedMessageResult, SignedRawTxResult, TokenUri, Transaction, VerifyOtpResult, WalletIdStatus, GetKycAccessTokenResult, GetKycShareTokenResult, RegisterReferralCodeResult, CheckKycSettingResult, SetupPinCodeResult, ValidatePinCodeResult, ConnectWrapper } from '@cybavo/react-native-wallet-service'; import SignClient from "@walletconnect/sign-client"; declare module "@cybavo/react-native-wallet-service" { namespace WalletConnectSdk { /**Session status*/ export enum ConnectStatus { /** initilized, not received session request yet */ INIT = 0, /** There's a pending session request which is waiting to be approved or rejected */ SESSION_REQUESTING = 1, /** Session request has been approved */ SESSION_APPROVED = 2 } /** Prodive walletconnect releated utils*/ namespace WalletConnectHelper { /** * Return a valid tx json string for eip155 transaction * @param tx tx object to be sign, compliance with eth_sendTransaction's parameter, https://docs.walletconnect.org/json-rpc-api-methods/ethereum#eth_sendtransaction * @param transactionFee * @param nonce * @param onLog receive log callback * @param customGasLimit custom gas limit * */ function getValidSignParams(tx: object, transactionFee: string, nonce: number,onLog: function, customGasLimit: string,): object /** * Return if it's a session request by method * @param method */ function isSessionRequest(method: string): boolean /** * Unify hex string, e.g. '0x00' to '0x0 * @param hexStr */ function unifyHex(hexStr: string): string function convertNumToHex(value: number, decimals: number): string function convertStringToHex(value: string | number): string function convertHexToString(hex: string): string function convertAmountToRawNumber(value: string | number, decimals: number): string function sanitizeHex(hex: string, originLength: boolean): string /** * Parse and adjust session request according to request method, return wallet, adjusted request and address * @param requestEvent */ function getWalletAndParsedRequest(requestEvent): {wallet: Wallets.Wallet, requestEvent, address: string} /** * Parse session proposal and classify wallets by chains listed in proposal. * Returns the requiredNamespaces and optionalNamespaces from the proposal, along with the chainWalletsMap. Returns an empty object on failure. * @param requestEvent */ function getNamespaceWithChainWalletsMap(proposal, allWallets: Array): {wallet: Wallets.Wallet, requestEvent, address: string} } namespace V2Manager { /** WalletConnect SignClien */ var signClient: SignClient; /** WalletConnect Core */ var core; /** WalletConnect Web3Wallet */ var web3Wallet; /** A map for connecting wallet use account as key*/ var accountWalletMap: { [key: string]: Wallets.Wallet }; /** Callback for listenting session_proposal * @param proposal Session proposal */ function onSessionProposal(proposal): void; /** Callback for listenting session_request * @param requestEvent Session request * @param address The wallet address parsed from session request * @param wallet The wallet found from accountWalletMap according to session request * */ function onSessionRequest(requestEvent, address, wallet): void; /** Callback for listenting session_ping * @param data Ping data */ function onSessionPin(data): void; /** Callback for listenting session_event * @param data Event data * */ function onSessionEvent(data): void; /** Callback for listenting session_update * @param data Session update data which includes topic and new namespaces*/ function onSessionUpdate(data: { topic: string, namespaces }): void; /** Callback for listenting session_delete * @param data Session delete data * */ function onSessionDelete(data): void; /** SignClient initialization * @param opts Options to init WalletConnect Core * @param metadata Wallet's metadata*/ function initSignClient(opts, metadata): Promise; /** Pair v2 URI * @param uri WalletConect v2 URI*/ function pair(uri: string): Promise; /** Approve session proposal * @param proposal Session proposal * @param chainWalletMap key: required caip2CainId, value: to be connected wallets * @param onLog Callback to receive log * */ function approveSessionProposal(proposal, chainWalletMap, onLog): Promise; /** Initialize the accountWalletMap according to connecting sessions and accounts * @param allWallets All wallet list * */ function initAccountWalletMap(allWallets: Array): void; /** Find wallet from allWallets, if the address is empty, return wallet which caip2ChainId matches the given caip2ChainId. * @param caip2ChainId chain ID from session request * @param address Wallet address * @param allWallets All wallet list * */ function findWalletByAccount(caip2ChainId: string, address: string, allWallets: Array) /** Reject session proposal * @param proposal Session proposal * @param onLog Callback to receive log * @param reason Reject reason*/ function rejectSessionProposal(proposal, onLog, reason?: { message: string; code: number; }): Promise; /** Approve session request * @param requestEvent Session request * @param result Approve result * @param onLog Callback to receive log * */ function approveSessionRequest(requestEvent, result, onLog): Promise; /** Reject session request * @param requestEvent Session request * @param onLog Callback to receive log * @param response Reject reason * */ function rejectSessionRequest(requestEvent, onLog, response?: { message: string; code: number; }): Promise; /** Disconnect a session or pairing * @param topic Topic of session or pairing that to be disconnected * */ function disconnect(topic: string): Promise; /** Disconnect all sessions and pairings */ function disconnectAllSessionPairing(): Promise; } namespace WalletConnectManager { /** * Get approved and connecting session map */ function getConnectingMap(): { [key: string]:ConnectWrapper }; /** * Get waiting approval session map */ function getPendingMap(): { [key: string]:ConnectWrapper }; /** * Get wallet ID by peer ID * @param peerId walletConnect sender's peer ID * @return walletId */ function getWalletId(peerId: string): number; /** * Get wallet address by peer ID * @param peerId walletConnect sender's peer ID * @return walletAddress */ function getAddress(peerId: string): string; /** * @deprecated This method has been removed and will throw if used. Use {@link V2Manager.initSignClient} instead. * @param uri walletConnect uri * @param walletId * @param clientMeta app's client metadata * @param callback called with sender's session request * @return ConnectWrapper */ function newSession( uri: string, address: string, walletId: number, clientMeta: ClientMeta, callback: (error: any | null, payload: Payload | null) => void ): ConnectWrapper /** * Reject a session request by peer ID * @param peerId walletConnect sender's peer ID * @param sessionError response information */ function rejectSession(peerId: string, sessionError?: SessionError): void; /** * Approve a session request by peer ID * @param peerId walletConnect sender's peer ID * @param sessionStatus response information * @param requestListener listener to receive call request * @param disconnectListener listener to receive disconnection event */ function approveSession( peerId: string, sessionStatus: SessionStatus, requestListener: (error: any | null, payload: Payload | null) => void, disconnectListener: (error: any | null, payload: Payload | null) => void ): void; /** * Approve a call request by peer ID * @param peerId walletConnect sender's peer ID * @param response response information */ function approveRequest(peerId: string, response: Partial): void; /** * Reject a call request by peer ID * @param peerId walletConnect sender's peer ID */ function rejectRequest(peerId: string, response: Partial): void; /** * Kill all pending and connecting sessions */ function killAllSession(sessionError?: SessionError): void; /** * Kill a session by peer ID * @param peerId walletConnect sender's peer ID * @param sessionError response information */ function killSession(peerId: string, sessionError?: SessionError): void; /** * Update a session peer ID * @param peerId walletConnect sender's peer ID * @param sessionStatus response information */ function updateSession(peerId: string, sessionStatus: SessionStatus): void; /** * Subscribe a specific event * @param peerId walletConnect sender's peer ID * @param event event name * @param callback event's callback */ function on(peerId: string, event: string, callback: (error: Error | null, payload: any | null) => void): void; } // function getWalletConnectors(): Promise>; type Payload = { id: number, jsonrpc: string, method: string, params: any[] } type ClientMeta = { /** User has finished PIN setup */ description: string; /** User has setup BackupChallenges */ url: string; /** Real name of user */ icons: string[]; /** Email of user */ name: string; }; type SessionStatus = { chainId: number; accounts: string[]; networkId?: number; rpcUrl?: string; } type SessionError = { message?: string; } type JsonRpcResponseSuccess = { id: number; jsonrpc: string; result: any; } type JsonRpcErrorMessage = { code?: number; message: string; } type JsonRpcResponseError = { id: number; jsonrpc: string; error: JsonRpcErrorMessage; } } /** * Facade of Wallet SDK Core. Must be initialized before invoke any of APIs */ namespace WalletSdk { /** * Init SDK, must be invoked before using any API * @param configuration SDK Configuration */ function init(configuration: { /** Service endpoint */ endpoint: string; /** Service API code */ apiCode: string; /** is apnsSandbox */ apnsSandbox: boolean; }): void; /** * Sdk meta info such as version, buildTypes, ... */ namespace sdkInfo { /** version name of SDK */ var VERSION_NAME: string; /** version code of SDK */ var VERSION_CODE: string; /** build type of SDK */ var BUILD_TYPE: string; } /** * Definition of all error codes */ namespace ErrorCodes { /** Unknown error */ const ErrUnknown = "-1"; /** Not signed in */ const ErrNotSignedIn = "-2"; /** Invalid PIN code */ const ErrInvalidPinCode = "-3"; /** Concurrent execution */ const ErrConcurrentExecution = "-4"; /** PIN secret not valid */ const ErrInvalidPinSecret = "-5"; /** Biometric Unsupported */ const ErrBiometricUnsupported = "-6"; /** User cancel operation */ const ErrUserCancel = "-7"; /** Admin cannot disable */ const ErrDisableAdmin = "101"; /** The Email address or password provided is not correct */ const ErrUserOrPasswordIncorrect = "102"; /** Account already exists */ const ErrUserExist = "103"; /** Account was banned by admin */ const ErrUserDisabled = "104"; /** Email cannot be empty */ const ErrUserEmailEmpty = "105"; /** Email has been used */ const ErrUserEmailExist = "106"; /** Email format is incorrect */ const ErrUserEmailFormatError = "107"; /** Password should be 8-18 chars */ const ErrUserPasswordFormatError = "108"; /** Account can only be english char and 3-50 chars */ const ErrUserAccountFormatError = "109"; /** Permission is incorrect */ const ErrUserRoleError = "110"; /** Old password is incorrect */ const ErrorUserPasswordError = "111"; /** Invalid parameter */ const ErrInvalidParameter = "112"; /** Permission denied */ const ErrPermissionDenied = "113"; /** Need user setup PIN before do this */ const ErrNotAuthByPIN = "114"; /** Need user bind OTP before do this */ const ErrNotAuthByOTP = "115"; /** Token is Invalid */ const ErrUserInvalidPasswordToken = "116"; /** Reject by User */ const ErrUserReject = "117"; /** Not Implemented */ const ErrNotImplemented = "118"; /** Error Encrypt failed */ const ErrEncryptFailed = "119"; /** Not support this kind of authorization */ const ErrUserAuthMethodInvalid = "120"; /** Unactivated user */ const ErrUserUnactivated = "125"; /** invalid user */ const ErrUserInvalid = "126"; /** User already activated */ const ErrUserAlreadyActivated = "127"; /** Need to setup OTP for auth before operation this action */ const ErrUserRequireOTPSetup = "128"; /** Only admin can be added from web */ const ErrOnlyAdminCanBeAdded = "129"; /** Get user info failed */ const ErrUserGetInfoFailed = "130"; /** User does not set pin yet */ const ErrUserNoPIN = "131"; /** User already exist */ const ErrAddUserDuplicate = "132"; /** Add User failed */ const ErrAddUserFailed = "133"; /** User unauthorized */ const ErrUserUnauthorized = "134"; /** Incorrect user PIN */ const ErrUserIncorrectPIN = "135"; /** Unknown client version */ const ErrClientVersion = "136"; /** Please update you CYBAVO Vault to access to the latest features! */ const ErrAppMustUpdate = "137"; /** Invalid device token */ const ErrInvalidDeviceToken = "138"; /** Incorrect user PIN. Retry limit exceeded. */ const ErrUserIncorrectPINMaxRetry = "139"; /** Shutdown in progress */ const ErrShutdownInProgress = "140"; /** User has been deactivated */ const ErrUserDeactivated = "141"; /** User name is empty */ const ErrUserNameEmpty = "142"; /** Create mapped wallet fail */ const ErrMappedWallet = "143"; /** Only Token can create mapped wallet */ const ErrNotTokenWallet = "144"; /** Cannot create 2 mapped wallet to 1 wallet address */ const ErrNotCreateMultiMappedToSameAddr = "145"; /** Only Mapped Wallet can use Mapped ID */ const ErrMappedWalletOnly = "146"; /** Failed to connect CC server */ const ErrConnectCCServer = "147"; /** User is locked */ const ErrUserIsLocked = "148"; /** Unlock link expired */ const ErrUnlockCodeExpired = "149"; /** Operation too frequent */ const ErrOperationTooFrequent = "150"; /** Update key in progress */ const ErrUpdateKeyInProgress = "151"; /** Invalid QR Code */ const ErrInvalidQRCode = "152"; /** Not able to restore PIN yet. Please contact admin to initial this process */ const ErrForgotPINNotReady = "153"; /** Invalid restore code */ const ErrInvalidRestoreCode = "154"; /** No wallet recovery data for user */ const ErrNoRecoveryCode = "155"; /** Register fail */ const ErrRegisterFail = "156"; /** Registration required */ const ErrRegistrationRequired = "157"; /** Unable to disable yourself */ const ErrDisableSelf = "158"; /** User did not request to recovery PIN */ const ErrForgotPINInvalid = "159"; /** Forgot PIN expired. Please ask user to submit again */ const ErrForgotPINExpired = "160"; /** Unable to change role */ const ErrUnableChangeRole = "161"; /** Already handle by other admin */ const ErrForgotPINHandled = "162"; /** Not approve by admin */ const ErrForgotPINNotApprove = "163"; /** Admin info not found */ const ErrAdminInfoNotFound = "164"; /** User permission was changed by others */ const ErrInvalidAdminPerm = "165"; /** The account is temporarily blocked because you entered the wrong PIN too many times */ const ErrUserIncorrectPINLock = "166"; /** User was unlocked */ const ErrUserIsUnlocked = "167"; /** The account is temporarily blocked because you entered the wrong answer too many times */ const ErrUserIncorrectSQLock = "168"; /** User already set PIN */ const ErrUserPINAlreadySet = "169"; /** Secure token not ready */ const ErrUserSecureTokenNotReady = "170"; /** User has not setup security questions yet */ const ErrUserSecurityQuestionsNotReady = "171"; /** Invalid Unlock token */ const ErrInvalidUnlockToken = "172"; /** Hash is required to be exactly 32 bytes */ const ErrInvalidHashLength = "173"; /** Invalid ABI function */ const ErrInvalidAbiFunction = "174"; /** Frequent operation, please try again after 1 sec */ const ErrOperationTooFrequentShortly = "175"; /** User phone number not verified, need register phone number */ const ErrUserPhoneNumUnverified = "180"; /** Action token invalid */ const ErrActionTokenInvalid = "181"; /** OTP code(SMS code) invalid */ const ErrOTPCodeInvalid = "182"; /** Require too frequent */ const ErrRequireTooFrequent = "183"; /** Invalid Signature */ const ErrInvalidSignature = "184"; /** Biometrics setting not found, need updateDeviceInfo */ const ErrBiometricsNotFound = "185"; /** Device otp(SMS code) unverified, need getLoginSms then verifyOtp */ const ErrDeviceOtpUnverified = "186"; /*** Exceed daily SMS limit */ const ErrOverSMSLimit = "187"; /*** Skip user SMS/Biometrics verify */ const ErrUserSkipSMSVerify = "188"; /*** User phone has been verified */ const ErrUserSMSVerifed = "189"; /*** User's referral code has been set */ const ErrUserReferralAlreadySet = "190"; /*** Cannot set your own referral code here */ const ErrUserReferralNotSetSelf = "191"; /*** Your referrer's registration time must be earlier than your registration time and cannot be yourself or your referral. */ const ErrReferralUserIdGreaterThenSelf = "192"; /*** invalid department */ const ErrDepartmentInvalid = "193"; /*** Cannot find any transaction in this department */ const ErrDepartmentTransactionNotFound = "194"; /*** The keyword for search is too short */ const ErrKeywordForSearchTooShort = "195"; /*** The input string is too long */ const ErrInputStringTooLong = "196"; /*** Account is revoked */ const ErrUserRevoked = "197"; /** Wallet Create Failed */ const ErrWalletCreateFailed = "301"; /** Invalid Address, please make sure your address format is correct */ const ErrWalletAddressInvalid = "302"; /** Invalid currency */ const ErrWalletCurrencyInvalid = "303"; /** Wallet ID invalid */ const ErrWalletIDInvalid = "304"; /** Parse SetWalletPolicyRequest failed */ const ErrWalletPolicyParseFailed = "305"; /** Set SetWalletPolicyRequest failed */ const ErrWalletPolicySetFailed = "306"; /** Get SetWalletPolicyRequest failed */ const ErrWalletPolicyGetFailed = "307"; /** Policy Sign fail */ const ErrPolicySignFail = "308"; /** Policy Sign invalid */ const ErrPolicySignInvalid = "309"; /** Policy state error */ const ErrPolicyState = "310"; /** Policy transfer fail */ const ErrPolicyTransFail = "311"; /** Policy not found */ const ErrPolicyNotFound = "312"; /** Not pass policy enforcement */ const ErrPolicyNotPass = "313"; /** Invalid policy approver */ const ErrPolicyApprover = "314"; /** Policy: wallet not found */ const ErrPolicyWalletNotFound = "315"; /** Policy: currency not match */ const ErrPolicyCurrencyNotMatch = "316"; /** Policy: currency not support */ const ErrPolicyCurrencyNotSupport = "317"; /** Policy: not wallet creator */ const ErrPolicyNotWalletCreator = "318"; /** Policy: wallet address is incorrect */ const ErrPolicyWalletAddressDiff = "319"; /** Policy: the transaction count of wallet should be greater than zero */ const ErrPolicyWalletHeaderTrans = "320"; /** Policy: amount trans to value fail */ const ErrPolicyAmountTransferFail = "321"; /** Policy: the transaction amount of wallet should greater than zero */ const ErrPolicyWalletHeaderAmount = "322"; /** Policy: no outgoing address */ const ErrPolicyOutgoingAddressNull = "323"; /** Policy: outgoing address incorrect */ const ErrPolicyOutgoingAddressQFail = "324"; /** Policy: outgoing address inconsistent */ const ErrPolicyOutgoingAddressInconsistent = "325"; /** Policy: auditor duplicate order */ const ErrPolicyAuditorDuplicateOrder = "326"; /** Policy: auditor duplicated user */ const ErrPolicyAuditorDuplicateUser = "327"; /** Policy: approver duplicate order */ const ErrPolicyApproverDuplicateOrder = "328"; /** Policy: approver duplicate user */ const ErrPolicyApproverDuplicateUser = "329"; /** Policy: operator duplicate order */ const ErrPolicyOperatorDuplicateOrder = "330"; /** Policy: operator duplicate user */ const ErrPolicyOperatorDuplicateUser = "331"; /** Policy: operator amount trans fail */ const ErrPolicyOperatorAmountTransFail = "332"; /** Policy: the amount of operator should be greater than zero */ const ErrPolicyOperatorAmountUnderZero = "333"; /** Policy: the transaction count of operator should be greater than zero */ const ErrPolicyOperatorTransUnderZero = "334"; /** Policy: the amount of wallet should be greater than the amount of operator */ const ErrPolicyOperatorAmountOverMax = "335"; /** Policy: the transaction count of wallet should be greater than the transaction count of operator */ const ErrPolicyOperatorTransOverMax = "336"; /** Policy: approver amount trans fail */ const ErrPolicyApproverAmountTransFail = "337"; /** Policy: the amount of approver should be greater than zero */ const ErrPolicyApproverAmountUnderZero = "338"; /** Policy: the maximum operator amount should be greater than the minimum approver amount */ const ErrPolicyMaxAppOverMaxOp = "339"; /** Policy: No operator */ const ErrPolicyNoOperator = "340"; /** Policy: some user has not set pin */ const ErrPolicyPINNotSet = "341"; /** Policy: some user not exist */ const ErrPolicyUserNotExist = "342"; /** Policy: approver is not cosigner */ const ErrPolicyApproverNotCosigner = "343"; /** Policy: cosigners not approvers */ const ErrPolicyAllCosignersNotApprover = "344"; /** Policy: approver configure incorrectly */ const ErrPolicyApproverConfigureIncorrectly = "345"; /** Policy: level incorrect */ const ErrPolicyLevelIncorrect = "346"; /** Policy: Owner count incorrect */ const ErrPolicyOwnerIncorrect = "347"; /** Not wallet operator */ const ErrWalletNotOperation = "348"; /** Invalid schedule withdraw */ const ErrScheduleWithdrawNotFound = "349"; /** Permission denied. Only creator can delete schedule withdraw */ const ErrScheduleWithdrawNotCreator = "350"; /** No wallet to backup */ const ErrNoWalletToBackup = "351"; /** Invalid backup answer */ const ErrInvalidBackupAnswer = "352"; /** Another activated user with same mnemonic */ const ErrWalletMnemonicDuplicate = "353"; /** Exceed Operator Allow Amount */ const ErrScheduleWithdrawExceedPolicyAmount = "354"; /** Not Operator in WalletPolicy */ const ErrScheduleWithdrawNotOperator = "355"; /** Not Outgoing in WalletPolicy */ const ErrScheduleWithdrawNotOutgoing = "356"; /** Check balance failed */ const ErrScheduleWithdrawCheckBalanceFailed = "357"; /** Schedule withdraw invalid */ const ErrScheduleWithdrawInvalid = "358"; /** Fail to get transaction fee */ const ErrGetTransactionFeeError = "359"; /** Policy changed, unlock again if needed */ const ErrNotPendingNow = "360"; /** Invalid fee level */ const ErrInvalidFeeLevel = "361"; /** Fail to sign batch transaction */ const ErrSignBatchTransactionFailed = "362"; /** Wallet not ready to withdraw */ const ErrWalletKeyNotReady = "363"; /** Not batch wallet */ const ErrNotBatchWallet = "364"; /** Not batch transaction */ const ErrNotBatchTransaction = "365"; /** Exceed max batch amount */ const ErrExceedMaxBatchAmount = "366"; /** Doing batch transaction */ const ErrOngoingBatchTransaction = "367"; /** Transaction id not found */ const ErrTxIDNotFound = "368"; /** Not wallet owner */ const ErrNotWalletOwner = "369"; /** Not Admin */ const ErrNotAdmin = "370"; /** Invalid wallet */ const ErrInvalidWalletId = "371"; /** Wallet already created */ const ErrWalletAlreadyCreated = "372"; /** Cannot send amount to yourself address */ const ErrTransactionSameAddress = "373"; /** Destination address must in outgoing address */ const ErrDestinationNotInOutgoingAddress = "374"; /** API Secret expired */ const ErrApiSecretExpired = "384"; /** API Secret not valid */ const ErrAPISecretNotValid = "385"; /** Transaction is expired */ const ErrExpiredTx = "386"; /** CPU usage exceeded, please delegate CPU for usage */ const ErrCPUUsageExceeded = "387"; /** NET usage exceeded, please delegate NET for usage */ const ErrNetUsageExceeded = "388"; /** RAM usage exceeded, please purchase RAM for usage */ const ErrRAMUsageExceeded = "389"; /** Insufficient staked CPU bandwidth, please delegate CPU for usage */ const ErrorInsufficientStakedCPU = "390"; /** Insufficient staked NET bandwidth, please delegate NET for usage */ const ErrorInsufficientStakedNet = "391"; /** Insufficient RAM quota, please purchase RAM for usage */ const ErrorInsufficientQuota = "392"; /** Transaction not replaceable */ const ErrTransactionNotReplaceable = "393"; /** Balance: upper bound value transfer fail */ const ErrBalanceUpperTransFail = "401"; /** Balance: lower bound value transfer fail */ const ErrBalanceLowerTransFail = "402"; /** Balance: lower bound >= upper bound */ const ErrBalanceLOverU = "403"; /** Balance: Interval should between 1800 (30 minutes) ~ 86400 (1 day) */ const ErrBalanceIntervalIncorrect = "404"; /** Balance: Not found item in DB */ const ErrBalanceDBNotFound = "405"; /** Balance: Item not match */ const ErrBalanceItemNotMatch = "406"; /** Invalid ID */ const ErrBalanceIdInvalid = "407"; /** No contract code at given address */ const ErrNoContractCode = "408"; /** Invalid ledger server config */ const ErrInvalidLedgerConfig = "432"; /** Expired Token */ const ErrExpiredToken = "500"; /** Verify fail, incorrect number */ const ErrVerifyFail = "501"; /** Exceed maximum retry counts, please resend the verify number again */ const ErrVerifyExceed = "502"; /** No token present */ const ErrParameterNoToken = "701"; /** Unknown operation */ const ErrParameterInvalidOperation = "702"; /** Operation failed */ const ErrOperationFailed = "703"; /** Failed to get SKU info */ const ErrSKUInfoFailed = "704"; /** Exceed max allow user limitation, Upgrade your SKU to get more users */ const ErrSKUUserLimit = "705"; /** Exceed max allow wallet limitation, Upgrade your SKU to get more wallets */ const ErrSKUWalletLimit = "706"; /** Exceed max allow outgoing address limitation, Upgrade your SKU to get more outgoing address */ const ErrSKUOutgoingLimit = "707"; /** Insufficient fund */ const ErrTransactionInsufficientFund = "801"; /** UTXO Insufficient fund */ const ErrTransactionUTXOInsufficientFund = "802"; /** UTXO Temporarily Not Available */ const ErrUTXOTemporarilyNotAvailable = "803"; /** Full nodes' syncing now, wait a few minutes to do the transaction */ const ErrFullNodeSyncing = "804"; /** Duplicate outgoing address */ const ErrOutgoingAddressDuplicate = "901"; /** Invalid outgoing address ID */ const ErrOutgoingAddressIdInvalid = "902"; /** KMS out of service. Please try again later. */ const ErrKMSNotReady = "903"; /** Invalid Api Code */ const ErrInvalidApiCode = "904"; /** Duplicate entry */ const ErrDuplicateApp = "905"; /** WalletSDK is outdated. Please upgrade your SDK */ const ErrSDKOutdated = "906"; /** Inner Fee less than lower bound */ const ErrorFeeLowerBound = "907"; /** Inner Fee higher than upper bound */ const ErrorFeeUpperBound = "908"; /** Inner fee configuration incorrect */ const ErrorInnerFeeAmount = "909"; /** Inner fee transfer amount fail */ const ErrorTransferAmountFail = "910"; /** Inner fee fail to check fee */ const ErrFailToGetFee = "911"; /** Inner fee higher than amount */ const ErrFeeTooHigh = "912"; /** Parse transaction fail */ const ErrParseTransactionFail = "913"; /** Batch transaction not support inner fee now, please contact CYBAVO for next step */ const ErrNotSupportInnerFee = "914"; /** Transaction fee over upper bound */ const ErrorFeeOverUpper = "915"; /** Inner Fee address incorrect */ const ErrorInnerFeeAddress = "916"; /** Need at least 1 TRX in wallet for energy usage. */ const ErrNoTRONForEnergy = "917"; /** Insufficient bandwidth, need to delegate bandwidth or Tron */ const ErrorInsufficientBandWidth = "918"; /** Destination not create. Too little XRP(< 20) sent to create it */ const ErrorDestNotExist = "919"; /** BTC is not enough to pay for transaction fee */ const ErrTransactionInsufficientBTCFee = "920"; /** ETH is not enough to pay for transaction fee */ const ErrTransactionInsufficientETHFee = "921"; /** BTC UTXOs is not enough to pay for transaction fee */ const ErrTransactionInsufficientBTCUTXOFee = "922"; /** Transfer amount is too small and considered as dust by blockchain */ const ErrDustFail = "923"; /** The number of UTXO set exceed max allow number (2500) */ const ErrUTXOExceedMax = "924"; /** BTC UTXOs are not enough to pay for platform fee */ const ErrUTXONotEnough = "925"; /** Insufficient fund, you must leave 0.000625 BNB for transaction fee */ const ErrInsufficientFundBNB = "926"; /** No Result from BNB full node */ const ErrorTxNoResult = "927"; /** Send Tx to BNB full node fail */ const ErrorSendTxFail = "928"; /** Illegal transaction format */ const ErrorIllegalFormat = "929"; /** Account was not created, please send at least 1 TRX to this address for account creation */ const ErrorAccountNotCreate = "930"; /** Destination Tag must be integer */ const ErrorIncorrectTag = "931"; /** Invalid EOS Account format */ const ErrInvalidEOSFormat = "932"; /** Invalid app id */ const ErrInvalidAppId = "933"; /** Invalid AWS Pinpoint App ID */ const ErrInvalidPinpointAppId = "934"; /** This EOS Account already existed */ const ErrEOSAccountExisted = "935"; /** User account not exist, referral code incorrect */ const ErrReferralCodeIncorrect = "936"; /** Google Auth error */ const ErrGoogleAuthError = "1001"; /** WeChat Auth error */ const ErrWechatAuthError = "1002"; /** Facebook Auth error */ const ErrFacebookAuthError = "1003"; /** LINE Auth error */ const ErrLineAuthError = "1004"; /** PIN token expired, need to sign in again to recover */ const ErrInvalidPINToken = "10001"; /** RAM operation bytes smaller than minimal amounts */ const ErrorRamOperationMinAmount = "10301"; /** Outgoing address is not matched with raw transaction */ const ErrOutgoingAddressNotMatch = "10302"; /** Wallet inner fee calculate incorrectly */ const ErrWalletInnerFeeIncorrect = "10303"; /** Create Tx with inner fee failed */ const ErrWalletCreateInnerTxFail = "10304"; /** Translation not ready */ const ErrNoTranslation = "10936"; /** LTC is not enough to pay for transaction fee */ const ErrTransactionInsufficientLTCFee = "10937"; /** LTC UTXOs is not enough to pay for transaction fee */ const ErrTransactionInsufficientLTCUTXOFee = "10938"; /** BCH is not enough to pay for transaction fee */ const ErrTransactionInsufficientBCHFee = "10939"; /** BCH UTXOs is not enough to pay for transaction fee */ const ErrTransactionInsufficientBCHUTXOFee = "10940"; /** Exceed personal currency limit */ const ErrOverPersonalCurrencyLimit = "10941"; /** Not createKyc before getApplicantStatus */ const ErrKycNotCreated = "10942"; /** KYC setting not exist when getApplicantStatus */ const ErrKycSettingsNotFound = "10943"; /** Invalid memo format, only allow numbers */ const ErrSmartChainInvalidMemoFormat = "12001"; /** Invalid amount format */ const ErrSmartChainInvalidAmountFormat = "12002"; /** Amount or balance format invalid */ const ErrSmartChainBalanceCheckFailed = "12003"; /** Deposit amount smaller than the minimum limit */ const ErrSmartChainDepositMinCheckFailed = "12004"; /** Deposit amount greater than the maximum limit */ const ErrSmartChainDepositMaxCheckFailed = "12005"; /** Smart chain product is out of stock */ const ErrSmartChainProductIsOutOfStock = "12006"; /** Smart chain operation failed */ const ErrSmartChainOperationFailed = "12007"; /** Balance smaller than the minimum withdraw amount and the platform fee */ const ErrSmartchainBalanceSmallerThanMinWithdraw = "12008"; /** Smart chain amount exceeds balance */ const ErrSmartchainCallAmountExceedsBalance = "12101"; /** Smart chain amount exceeds allowance */ const ErrSmartchainCallAmountExceedsAllowance = "12102"; /** Smart chain zero address */ const ErrSmartchainCallZeroAddr = "12103"; /** Smart chain deposit should not stop */ const ErrSmartchainCallDepositStop = "12104"; /** Smart chain withdraw should not stop */ const ErrSmartchainCallWithdrawStop = "12105"; /** Smart chain rate limiting */ const ErrSmartchainCallRateLimit = "12106"; /** Smart chain exceed withdraw limit */ const ErrSmartchainCallWithdrawLimit = "12107"; /** Smart chain exceed max user limit */ const ErrSmartchainCallMaxUserLimit = "12108"; /** Smart chain exceed max user orders limit */ const ErrSmartchainCallMaxUserOrderLimit = "12109"; /** Smart chain exceed max deposit amount limit */ const ErrSmartchainCallMaxDepositAmountLimit = "12110"; /** Smart chain amount not match */ const ErrSmartchainCallAmountNotMatch = "12111"; /** Smart chain order not exist */ const ErrSmartchainCallOrderNotExist = "12112"; /** Smart chain order already exist */ const ErrSmartchainCallOrderExist = "12113"; /** Smart chain no profit sharing */ const ErrSmartchainCallNoProfitSharing = "12114"; /** Smart chain amount should grater than 0 */ const ErrSmartchainCallAmountSmallThenZero = "12115"; /** Smart chain payee is not allowed to withdraw */ const ErrSmartchainCallNotAllowWithdraw = "12116"; /** Smart chain should do withdraw directly */ const ErrSmartchainCallNotAllowEarlyWithdraw = "12117"; /** Smart chain transferAmount is smaller than zero */ const ErrSmartchainCallTransferSmallThenZero = "12118"; } } /** * Auth includes user authentication related APIs. * * Once signed in, SDK core will maintain a session * * If session expires, [[Events.onSignInStateChanged]] with [[SignInState.SESSION_EXPIRED]] will be emitted * * ## Authentication * * Sign in with a new account will get an [[ErrorCodes.ErrRegistrationRequired]] error. * You can check this error and guide user to registration process. * Identity provider is corresponding to configuration on backend, such as "Google", "Facebook" or "WeChat" * * ```js * try { * await Auth.signIn(idToken, "Google") * } catch (error) { * if (ErrorCodes.ErrRegistrationRequired === error.code) { * // do registration instead * } else { * // error handling... * } * } * ``` * * ## SignInState * * Please note that SignInState is a local state, and not represent to real-time session state. * * When any API call requires a valid session, however, the session has been expired. The API call will receive an [[ErrorCodes.ErrExpiredToken]] error, * and [[Events.onSignInStateChanged]] will be emitted with [[SignInState.SESSION_EXPIRED]], too. * * Thus, the most common usage is when the app launching, invoke [[Auth.getSignInState]] to get current session state. If get [[SignInState.SIGNED_OUT]], * lead user to the Sign-in page. Register event [[Auth.Events.onSignInStateChanged]] with [[Auth.addListener]], and handle the state change anytime callback arrived. * * - **[[SignInState.SIGNED_IN]]**- Lead user to main page * - **[[SignInState.SIGNED_OUT]]** - Lead user to sign-in page * - **[[SignInState.SESSION_EXPIRED]] or [[SignInState.SESSION_INVALID]]** - Try to restore session or just lead user to sign-in page * * ## PIN Code Input * * PIN code can only be retrieved with a PinCodeInputView instance, such as [[NumericPinCodeInputView]]. * Render a PinCodeInputView, pass a callback function to [[NumericPinCodeInputViewProps.onChanged]] property. * The onChanged callback will be invoked when user input changed with current PIN code length. * Once the length matched your PIN code length, invoke [[NumericPinCodeInputViewProps.submit]] and retrieve a pinSecret. * Then, you can pass the PIN secret to APIs required a PIN code, such as [[Wallets.createTransaction]] * Once you get the PIN secret, consume it as soon as possible. * If you need to invoke another API, use PinCodeInputView to retrieve another PIN hash from user again. * * ### Example * * ```js * class MyComponent extends Component { * _onInputPinCode: async (length) => { * if (length === 6) { * const pinSecret = await this.refs.pinCodeInput.submit(); * await Auth.createWallet(pinSecret); * } * } * render: () => { * * } * } * ``` * * ## Retaining PinSecret * * By default, PinSecret can only be access ***ONCE***, unless you retain it explicitly by pass retain = true via a [[PinSecretBearer]], * then the PinSecret will be retained ***ONCE more*** to survive next access. If you need to extend it's lifecycle, pass retain = true via a [[PinSecretBearer]] * to retain one more time and so on. * * ### Example of retain * * ```js * const pinSecret = await this.refs.pinCodeInput.submit(); * // retain it to survive setupPinCode() * Auth.setupPinCode({ pinSecret, retain: true }, ...); * // since we've retained it, we can pass it to createWallet() * Wallets.createWallet(..., pinSecret, ...); * ``` * * ## PIN Code setup * [[getUserState]] returns an [[UserState]], which contains a [[UserState.setPin]] flag, indicates if the user has finished PIN code setup * * After User sign in, you could invoke [[getUserState]] to check if user has finished PIN code setup, If not, init the setup process. * * ```js * const { userState } = await Auth.getUserState() * if (!userState.setPin) { * // start PIN code setup * } * ``` * * * ## Perform PIN Code setup * ```js * // get pinSecret from PinCodeInputView... * Auth.setupPinCode(pinSecret); * ``` * * ## PIN Code change and recovery * [[getUserState]] returns an [[UserState]], which contains a [[UserState.setSecurityQuestions]]} flag, * indicates if the user has finished Security Questions setup * * Setup Backup Challenge for PIN code restoration needs few parameters: * - The PIN code string * - Three [[BackupChallenge]] object, contains a pair of String as question and answer. They will be necessary to backup and restore PIN code * * ```js * await Auth.setupBackupChallenge( * pinSecret, // PIN code * { question: q1, answer: a1 }, // Q&A #1 * { question: q2, answer: a2 }, // Q&A #2 * { question: q3, answer: a3 } // Q&A #3 * ); * ``` * * There are few ways to change PIN code: * * ### Change with Current PIN Code * If user still remembers current PIN code, use [[changePinCode]] API to change to new PIN code * * ### Change with Backup Challenges * If user forgot PIN coe but still remembers [[BackupChallenge]] use [[restorePinCode]] * to change PIN code by answering Backup Challenges. Use [[getRestoreQuestions]] to get questions, * and [[verifyRestoreQuestions]] to check questions before change PIN code * * ### Recovery by Administrator's assists * If user lost PIN code and Backup Challenges, use [[forgotPinCode]] API to notice administrator to initialize PIN code recovery process. * Once administrator approved, user will get a verification code via E-mail. Input the verification code and the new PIN code, * invoke [[recoverPinCode]] to recover PIN code. * */ namespace Auth { /** * Emit events when authentication state updated * * ```js * import { Auth } from '@cybavo/react-native-wallet-service'; * * Auth.addListener(Auth.Events.onSignInStateChanged, * signInState => { * // do some handling * } * ); * ``` */ namespace Events { /** emit when SignInState changed */ const onSignInStateChanged = "onSignInStateChanged"; } /** * Definition of user session states, see [[Events.onSignInStateChanged]] */ enum SignInState { /** User signed in */ SIGNED_IN = 0, /** User signed out */ SIGNED_OUT = 1, /** User has signed in but session has expired */ SESSION_EXPIRED = 2, /** User has signed in but session is invalid */ SESSION_INVALID = 3, /** Unknown sign-in state. e.g., SDK initializing */ UNKNOWN = 4, /** User has signed in but need verify otp(sms code) */ NEED_VERIFY_OTP = 5, /** User has signed in but need register phone */ NEED_REGISTER_PHONE = 6, } /** * State of user * * see [[getUserState]], [[GetUserStateResult]] */ type UserState = { /** User has finished PIN setup */ setPin: boolean; /** User has setup BackupChallenges */ setSecurityQuestions: boolean; /** Real name of user */ realName: string; /** Email of user */ email: string; /** Preferred language setting of User */ language: string; /** Is enable biometric authentication */ enableBiometrics: boolean; /** Is SMS verified */ smsVerified: boolean; /** Is skip SMS/Biometrics verify */ skipSmsVerify: boolean; /** Is skip SMS for specific case, ex. Apple account */ accountSkipSmsVerify: boolean; /** Is enable walletconnect */ enableWalletconnect: boolean; /** Registered country code of user */ countryCode: string; /** Registered phone of user */ phone: string; /** User referral code */ userReferralCode: string; /** Link user referral code (referral by this code, only one per user) */ linkUserReferralCode: string; /** Liquid API Key */ String: string; }; /** * A pair of question and answer for backup/restoring PIN codes * * see [[setupPinCode]] * see [[restorePinCode]] * see [[recoverPinCode]] * see [[verifyRestoreQuestions]] * see [[getRestoreQuestions]] */ type BackupChallenge = { /** Qeuestion */ question: string; /** Answer */ answer: string; }; /** * Result of [[signIn]] API */ type SignInResult = {}; /** * Result of [[signUp]] API */ type SignUpResult = {}; /** * Result of [[getUserState]] API */ type GetUserStateResult = { /** Current user state */ userState: UserState; }; /** * Result of [[setupPinCode]] API */ type SetupPinCodeResult = {}; /** * Result of [[changePinCode]] API */ type ChangePinCodeResult = {}; /** * Result of [[setupBackupChallenge]] API */ type SetupBackupChallengeResult = {}; /** * Result of [[restorePinCode]] API */ type RestorePinCodeResult = {}; /** * Result of [[forgotPinCode]] API */ type ForgotPinCodeResult = {}; /** * Result of [[recoverPinCode]] API */ type RecoverPinCodeResult = {}; /** * Result of [[verifyRecoveryCode]] API */ type VerifyRecoveryCodeResult = {}; /** * Result of [[getRestoreQuestions]] API */ type GetRestoreQuestionsResult = { /** 1st question */ question1: string; /** 2nd question */ question2: string; /** 3rd question */ question3: string; }; /** * Result of [[verifyRestoreQuestions]] API */ type VerifyRestoreQuestionsResult = {}; /** * Result of [[setPushDeviceToken]] API */ type SetPushDeviceTokenResult = {}; /** * Result of [[RegisterPhoneNumber]] API */ type RegisterPhoneNumberResult = { /** actionToken for verifyOtp */ actionToken: string; }; /** * Result of [[VerifyOtp]] API */ type VerifyOtpResult = {}; /** * Result of [[createKyc]] API */ type CreateKycResult = {}; /** * Result of [[getKycAccessToken]] API */ type GetKycAccessTokenResult = { /** Sumsub access token */ token: string; /** Sumsub flow name */ flowName: string; /** Sumsub api url */ apiUrl: string; }; /** * Result of [[getKycShareToken]] API */ type GetKycShareTokenResult = { /** Sumsub share token */ token: string; /** Sumsub for client ID */ forClientId: string; }; /** * Result of [[checkKycSetting]] API */ type CheckKycSettingResult = { /** 1: setting exist, 0: setting not exist */ result: number; }; /** * Result of [[revokeUser]] API */ type RevokeUserResult = { /** 1: success */ result: number; }; /** * Result of [[validatePinCode]] API */ type ValidatePinCodeResult = { /** Is PIN code correct */ pass: boolean; }; /** * Result of [[getApplicantStatus]] API */ type GetApplicantStatusResult = { /** Date of creation of the applicant. e.g. 2018-10-06 12:47:57+0000 */ createDate: string; /** Review result */ reviewResult: ReviewResult; /** * Current status of an applicant. The value can be one of the following: *
    *
  • init - Initial registration has started. A client is still in the process of filling out the applicant profile. Not all required documents are currently uploaded.
  • *
  • pending - An applicant is ready to be processed.
  • *
  • prechecked - The check is in a half way of being finished.
  • *
  • queued - The checks have been started for the applicant.
  • *
  • completed - The check has been completed.
  • *
  • onHold - Applicant waits for a final decision from compliance officer (manual check was initiated) or waits for all beneficiaries to pass KYC in case of company verification.
  • *
* */ reviewStatus: string; }; /** * Result of [[searchUser]] API */ type SearchUserResult = { /** The list of user searchable info which match the keyword */ infos: Array; }; /** * Result of [[updateRealName]] API */ type UpdateRealNameResult = {}; /** * Searchable fields of user */ type UserSearchableInfo = { /** * User referral code */ referralCode: string; /** * Real name of user */ realName: string; } /** * Result of [[getApplicantStatus]] API */ type ReviewResult = { /** * A human-readable comment that can be shown to the end user */ moderationComment: string; /** * A human-readable comment that should not be shown to the end user. */ clientComment: string; /** * Verification results. The value can be one of the following: *
    *
  • GREEN - Everything is fine
  • *
  • RED - Some violations found /li> *
*/ reviewAnswer: string; /** * A machine-readable constant that describes the problems in case of verification failure */ rejectLabels: Array; /** * The rejection type (if the RED answer is given). The following values are possible: *
    *
  • FINAL - Final reject, e.g. when a person is a fraudster, or a client does not want to accept such kinds of clients in his/her system
  • *
  • RETRY - A reject that can be fixed, e.g. by uploading an image of better quality
  • *
*/ reviewRejectType: string; } /** * Result of [[registerReferralCode]] API */ type RegisterReferralCodeResult = {}; /** * Adds a listener to be invoked when events of the specified type are * emitted. An optional calling context may be provided. The data arguments * emitted will be passed to the listener function. * * @param eventType - Name of the event to listen to * @param listener - Function to invoke when the specified event is emitted */ function addListener(eventType: string, listener: (...args: any[]) => any); /** * Get current SignInState, see [[SignInState]] */ function getSignInState(): Promise; /** * Sign in with 3rd party account system token * [[Events.onSignInStateChanged]] will be emitted * * @param token 3rd party user token * @param identityProvider 3rd party authentication identity provider, such as "Google", "Facebook", "LoginWithAmazon" ...etc * * If there is already a session, it will be replaced by new session, a [[SignInState.SIGNED_OUT]] * will be emitted followed by a [[SignInState.SIGNED_IN]] */ function signIn( token: string, identityProvider: string ): Promise; /** * Sign up with 3rd party account system token * @param token 3rd party user token * @param identityProvider 3rd party authentication identity provider, such as "Google", "Facebook", "LoginWithAmazon" ...etc * @param extras Extra attributes */ function signUp( token: string, identityProvider: string, extras: object ): Promise; /** * Sign out current session * [[SignInState.SIGNED_OUT]] will be emitted */ function signOut(): Promise; /** * Get current user state. i.e. is PIN Code setup completed */ function getUserState(): Promise; /** * Set user PIN code * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function setupPinCode(pinSecret: number | PinSecretBearer | string): Promise; /** * Change user PIN code with current PIN code * @param newPinSecret New PIN code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext * @param currentPinSecret Current PIN code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function changePinCode( newPinSecret: number | PinSecretBearer | string, currentPinSecret: number | PinSecretBearer | string ): Promise; /** * Set backup challenges, see [[restorePinCode]] * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext * @param challenge1 First BackupChallenge * @param challenge2 Second BackupChallenge * @param challenge3 Third BackupChallenge */ function setupBackupChallenge( pinSecret: number | PinSecretBearer | string, challenge1: BackupChallenge, challenge2: BackupChallenge, challenge3: BackupChallenge ): Promise; /** * Restore user PIN code with BackupChallenges, see [[setupBackupChallenge]] * @param newPinSecret New PIN code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext * @param challenge1 First BackupChallenge * @param challenge2 Second BackupChallenge * @param challenge3 Third BackupChallenge */ function restorePinCode( newPinSecret: number | PinSecretBearer | string, challenge1: BackupChallenge, challenge2: BackupChallenge, challenge3: BackupChallenge ): Promise; /** * Make a request to initiate PIN code recover process. After got the verificationCode, invoke [[recoverPinCode]] to reset PIN code */ function forgotPinCode(): Promise; /** * Recover user PIN code * @param newPinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext * @param recoveryCode The verification code generated in reset process */ function recoverPinCode( newPinSecret: number | PinSecretBearer | string, recoveryCode: string ): Promise; /** * Verify recovery code generated in reset process * @param recoveryCode The verification code generated in reset process */ function verifyRecoveryCode( recoveryCode: string ): Promise; /** * Get restore questions setup with setupPinCode() API */ function getRestoreQuestions(): Promise; /** * Verify restore questions setup with setupPinCode() API * @param challenge1 First BackupChallenge * @param challenge2 Second BackupChallenge * @param challenge3 Third BackupChallenge */ function verifyRestoreQuestions( challenge1: BackupChallenge, challenge2: BackupChallenge, challenge3: BackupChallenge ): Promise; /** * Set Push notification device token: Firebase Cloud Messaging (FCM) for Android and Apple Push Notification Service (APNS) for iOS * @param pushDeviceToken The device token retrieved from corresponding SDK depend on platforms */ function setPushDeviceToken(pushDeviceToken: string): Promise; /** * Register phone number * * @param country code ex. 886 * @param rest part of phone number ex. 900123456 * @param SMS expire time( second) */ function registerPhoneNumber( countryCode: string, phone: string, duration: number, ): Promise; /** * Verify otp(SMS code) * * @param actionToken returned by getSmsCod * @param SMS code that registered phone received */ function verifyOtp( actionToken: string, code: string ): Promise; /** * Create KYC Applicant * * @param country ISO code of applicant * - https://en.wikipedia.org/wiki/List_of_ISO_3166_country_codes */ function createKyc( country: string, ): Promise; /** * Get user's access token for KYC, synchronize version * - https://developers.sumsub.com/msdk/#backend-routines */ function getKycAccessToken(): Promise; /** * Get user's share token for KYC */ function getKycShareToken(): Promise; /** * Check KYC setting exist: *
    *
  • Sumsub server URL
  • *
  • Sumsub Token
  • *
  • Sumsub Secret
  • *
*/ function checkKycSetting(): Promise; /** * Get applicant KYC status for current user * The response is based on Sumsub API's definition, see * https://developers.sumsub.com/api-reference/#getting-applicant-status-sdk */ function getApplicantStatus(): Promise; /** * Search user by keyword * * @param keyword The keyword for query, length cannot less then 3, otherwise the API will return [[ErrorCodes.ErrKeywordForSearchTooShort]] error. * The searchable fields and rules: *
    *
  • referralCode (string) - Fully match
  • *
  • realName (string)- Partial match
  • *
*/ function searchUser(keyword: string): Promise; /** * Update user real name * * @param realName New real name of the user, the length limit: *
    *
  • Cannot less then 3, otherwise the API will return [[ErrorCodes.ErrKeywordForSearchTooShort]] error
  • *
  • Cannot over 255, otherwise the API will return [[ErrorCodes.ErrInputStringTooLong]] error
  • *
*/ function updateRealName( realName: string, ): Promise; /** * Register referral code * * @param code referral code */ function registerReferralCode( code: string, ): Promise; /** * Revoke personally identifiable information (PII) *

* Before the administrator enable this account, * the user will receive [[ErrorCodes.ErrUserRevoked]] error * if he/she wants to sign in with this account *

* @param pinSecret? PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext * If the user didn't set PIN, pass null or leave it blank */ function revokeUser(pinSecret: number | PinSecretBearer | string): Promise; /** * Validate if PIN code is correct. * @param currentPinSecret Current PIN Code */ function validatePinCode(currentPinSecret: number | PinSecretBearer | string): Promise; } } /** * Wallets includes user wallet related APIs * * # About Secure Token * * With Secure Token, user can make transaction without input PIN Code in a designated period. The Secure Token will NOT be persistent stored and will be reset after app life cycle * * ## Request Secure Token * * PIN Code is required to request Secure Token * * ```js * await Wallets.requestSecureToken(pinSecret); * ``` * * ## Make Transactions with Secure Token * Make a transaction with Secure Token but PIN Code. * If the Secure Token is Expired or Invalid, it will return [[ErrorCodes.ErrUserSecureTokenNotReady]] error code. * App shall redirect user to **Request Secure Token** flow described in above section. * * ```js * try { * await Wallets.createTransaction( * walletId, * outgoingAddress, * amount, * transactionFee, * description * ); * } catch (error) { * if (ErrorCodes.ErrUserSecureTokenNotReady === error.code) { * // request user to input PIN code * } * } * ``` * * ## Clear Secure Token * Clear Secure Token requested with [[requestSecureToken]], the promise rejected, Secure Token stored in SDK will still be revoked * * ```js * Wallets.clearSecureToken(); * ``` */ export namespace Wallets { /** * Wallet type represents a wallet */ type Wallet = { /** Wallet ID */ walletId: number; /** Wallet type */ type: Wallet.Type; /** Wallet Address */ address: string; /** Name of wallet */ name: string; /** * Wallet currency, refer to [[getCurrencies]] API */ currency: number; /** * Wallet token contract address, refer to [[getCurrencies]] API */ tokenAddress: string; /** * Wallet simple currency name. i.e., BTC, ETH, BCH, ... For more detail, refer to [[getCurrencies]] API */ currencySymbol: string; /** * Parent wallet id for token wallets, such as ERC-20 wallets to Ethereum wallet */ parentWalletId: number; /** * Currency chain ID */ chainId: number; /** * Name of supported chain for WalletConnect */ chainName: string; /** * CAIP-2 chain ID of supported chain for WalletConnect */ caip2ChainId: string; //for private wallet /** * Is private chain (CPC) */ isPrivate: boolean; /** * Public chain's currency */ mapToPublicCurrency: number; /** * Public chain's tokenAddress */ mapToPublicTokenAddress: string; /** * Public chain's currency_name */ mapToPublicName: string; /** * Address(referral code) for transaction in private chain */ walletCode: string; /** * Address(referral code) for transaction in private chain */ depositAddresses: Array; /** * Is disabled private currency */ isPrivateDisabled: boolean; }; namespace Wallet { /** * Wallet types definition */ export enum Type { /** Regular wallet */ REGULAR = 0, /** Mapped wallet. i.e., an ERC-20 wallet maps to a parent ETH wallet */ MAPPED_WALLET = 2, /** Relayer wallet */ RELAYER_WALLET = 3, } } /** * Type of OTP */ export enum OtpType { /** (app didn't use)*/ SMS_SETUP_PHONE_OTP = 0, /** otp for transaction*/ SMS_VERIFY_OTP = 1, /** otp for signin*/ SMS_LOGIN_OTP = 2, /** (app didn't use)*/ EMAIL_VERIFY_OTP = 3, } /** * Type of biometric */ export enum BiometricsType { /* unknown */ UNKNOWN = 0, /* device not support biometric*/ NONE = 1, /* face ID*/ FACE = 2, /* finger print*/ FINGER = 3, } /** * Type definitions of EOS resource transactions */ enum EosResourceTransactionType { /** * Buy RAM */ BUY_RAM = 1, /** * Sell RAM */ SELL_RAM = 2, /** * Delegate CPU */ DELEGATE_CPU = 3, /** * Un-delegate CPU */ UNDELEGATE_CPU = 4, /** * Delegate NET */ DELEGATE_NET = 5, /** * Un-Delegate NET */ UNDELEGATE_NET = 6 } /** * Balance in an address, see [[getBalances]], [[GetBalancesResult]] */ type Balance = { /** Balance */ balance: string; /** Balance of token */ tokenBalance: string; /** Balance unconfirmed */ unconfirmedBalance: string; /** Non-Fungible token IDs */ tokens: Array; /** Available balance */ availableBalance: string | null; /** Non-Fungible token ID and amount for ERC-1155 */ tokenIdAmount: Array }; /** * Non-Fungible token ID and amount for ERC-1155 */ type TokenIdAmount = { /** Non-Fungible token ID */ tokenId: string; /** Amount of the token*/ amount: string; } /** * Deposit address for private chain */ type DepositAddress = { /** Public chain's currency */ mapToPublicCurrency: number; /**Public chain's tokenAddress*/ mapToPublicTokenAddress: string; /**private chain currency*/ currency: number; /**private chain tokenAddress*/ tokenAddress: string; /**Deposit address, public chain to private chain*/ address: string; /** Deposit memo, public chain to private chain*/ memo: string; } /** * More info for other purpose transaction */ type TransactionExplain = { /** The kind of TransactionExplain*/ kind: TransactionExplain.Kind; /** Is amount meaningful & should show, true: should show, false: should not show */ isShowAmount: boolean; /** Name of Finance product with multi-language*/ name: I18nStr; } namespace TransactionExplain { /** * Transaction direction */ export enum Kind { /** unknow(init) */ UNKNOWN = 0, /** burn */ BURN = 1, /** mint */ MINT = 2, /** approve */ APPROVE = 3, /** deposit */ DEPOSIT = 4, /** withdraw */ WITHDRAW = 5, /** earlyWithdraw */ EARLY_WITHDRAW = 6, /** withdrawReward */ WITHDRAW_REWARD = 7, /** withdrawBonus */ WITHDRAW_BONUS = 8 } } /** * Strings for multi-language */ type I18nStr = { /** English */ en: string; /** Traditional Chinese */ tw: string; /** Simplified Chinese */ ch: string; } /**addContractCurrencies * Transaction item * * see [[getHistory]], [[GetHistoryResult]] */ type Transaction = { /** TxID / TransactionId */ txid: string; /** Transfer from address */ fromAddress: string; /** Transfer to address */ toAddress: string; /** Transfer direction */ direction: Transaction.Direction; /** Transfer amount, token ID foc ERC-721 and BSC-721 */ amount: string; /** Token ID for ERC-1155 */ tokenId: string; /** Transfer transaction fee */ transactionFee: string; /** Transfer timestamp */ timestamp: number; /** Is transaction pending */ pending: boolean; /** Is transaction successful */ success: boolean; /** Error message */ error: string; /** Memo for XRP, XML, EOS, BNB */ memo: string; /** Description of the transaction, private to this wallet */ description: string; /** Is transaction for platform fee */ platformFee: boolean; /** Is transaction dropped from chain */ dropped: boolean; /** ABI method */ abiMethod: string; /** ABI arguments */ abiArguments: string; /** Is transaction replaceable */ replaceable: boolean; /** Is transaction replaced by another transaction */ replaced: boolean; /** TXID of replacement of this transaction if [[replaced]] == true */ replaceTxid: string; /** Nonce of transaction, only valid on ETH, same nonce means replacements */ nonce: number; /** Is preparing fee for this relayer transaction */ preparingFee: boolean; /** More info for other purpose transaction */ explain: TransactionExplain; /** Currency of the transaction. */ currency: number; /** Token contract address of the transaction. */ tokenAddress: string; /** Type of the transaction. Only available in the result of Wallets#getUserHistory()*/ type: Transaction.Type; }; namespace Transaction { /** * Transaction direction */ export enum Direction { /** Transfer In */ IN = 0, /** Transfer Out */ OUT = 1 } /** * Type for Transaction */ export enum Type { /** Unknown(0), Default value when no type data available */ Unknown = 0, /** MainDeposit(1), Deposit history on public chain */ MainDeposit = 1, /** MainWithdraw(2), Withdraw history on public chain */ MainWithdraw = 2, /** PrivDeposit(3), Deposit history on private chain, including inner transfer and depositing from public to private chain (mint) */ PrivDeposit = 3, /** PrivWithdraw(4), Withdraw history on private chain, including inner transfer and withdrawal from private to public chain (burn) */ PrivWithdraw = 4, /** PrivOuterDeposit(5), For depositing from public to private chain, the history on public chain */ PrivOuterDeposit = 5, /** PrivOuterWithdraw(6), For withdrawal from private to public chain, the history on public chain */ PrivOuterWithdraw = 6, /** PrivProductDeposit(7), Deposit history of financial product */ PrivProductDeposit = 7, /** PrivProductWithdraw(8), Withdraw and earlyWithdraw history of financial product */ PrivProductWithdraw = 8, /** PrivProductReward(9), WithdrawReward history of financial product */ PrivProductReward = 9, } } /** CPC Financial Product, see [[getFinancialProducts]], [[GetFinancialProductsResults]] */ type FinancialProduct = { /** TXID of replacement of this transaction if [[replaced]] == true */ uuid: string; /** Product kind, 1: FixedDeposit , 2: DemandDeposit */ kind: FinancialProduct.Kind; /** Map to public currency */ publicCurrency: number; /** Map to public token address */ publicTokenAddress: string; /** Display currency name*/ publicName: string; /** Product title */ title: I18nStr; /** User reward amount */ userReward: string; /** User deposit amount */ userDeposit: string; /** Total amount of user deposit and reward */ userTotal: string; /** Wait to withdraw timestamp in sec */ userWaitToWithdraw: number; /** All product reward amount of all user */ allReward: string; /** All product deposit amount of all user */ allDeposit: string; /** All product deposit & reward of all user */ allTotal: string; /** Current user count */ userCount: number; /** Threshold for user percent UI */ userPercent: number; /** Max user count */ maxUsers: number; /** Min deposit amount */ minDeposit: string; /** Max deposit amount */ maxDeposit: string; /** ex. "2.0" for 2.0% */ rate: string; /** Annualized Rate, ex. 1.02 */ ratePercent: number; /** Currency */ currency: number; /** Token address */ tokenAddress: string; /** Is need approve before withdraw or deposit */ isNeedApprove: boolean; /** Is withdraw operation available */ isCanWithdraw: boolean; /** Is withdraw reward operation available */ isCanWithdrawReward: boolean; /** Is early withdraw operation available */ isCanEarlyWithdraw: boolean; /** Is deposit operation available */ isCanDeposit: boolean; /** Start timestamp in sec*/ startTimestamp: number; /** Expiry timestamp in sec*/ endTimestamp: number; /** Value timestamp in sec*/ rewardTimestamp: number; } namespace FinancialProduct { /** * enum for [[getFinancialProducts]] API kind parameter */ export enum ListKind { /** All(0), return all financial product, * including UserDeposit, DemandDeposit, FixedDeposit, Campaign */ All = 0, /** User depositing(1) */ UserDeposit = 1, /** Demand deposit(2) */ DemandDeposit = 2, /** Fixed deposit(3) */ FixedDeposit = 3, /** Campaign(4) */ Campaign = 4, } /** FinancialProduct kind */ export enum Kind { /** Unknown(-1) */ Unknown = -1, /** Fixed deposit(1) */ FixedDeposit = 1, /** Demand deposit(2) */ DemandDeposit = 2, } } /** CPC Financial History, see [[getFinancialHistoryByKind]], * [[getFinancialHistoryByProduct]], [[GetFinancialHistoryResult]] */ type FinancialHistory = { /** Product UUID (contract address)*/ productUuid: string; /** UUID */ uuid: string; /** Status */ status: FinancialHistory.Status; /** User reward amount */ userReward: string; /** User deposit amount */ userDeposit: string; /** Total amount of user deposit and reward */ userTotal: string; /** Wait to withdraw timestamp in sec */ userWaitToWithdraw: number; /** Start timestamp in sec */ startTimestamp: number; /** Expiry timestamp in sec*/ endTimestamp: number; /** Value timestamp in sec*/ rewardTimestamp: number; /** Is need approve before withdraw or deposit */ isNeedApprove: boolean; /** Is withdraw operation available */ isCanWithdraw: boolean; /** Is withdraw reward operation available */ isCanWithdrawReward: boolean; /** Is early withdraw operation available */ isCanEarlyWithdraw: boolean; /** Is deposit operation available */ isCanDeposit: boolean; /** Order ID*/ orderId: string; } namespace FinancialHistory { /** FinancialProduct kind */ export enum ListKind { /** Unknown(-1) */ Unknown = -1, /** Depositing history(1) */ Depositing = 1, /** Withdraw principle history(2) */ Withdraw = 2, /** Withdraw interest history(3) */ WithdrawReward = 3, } /** FinancialProduct status */ export enum Status { /** Unknown(-1) */ Unknown = -1, /** Depositing(1) */ Depositing = 1, /** Can be withdraw, finished(2) */ CanWithdraw = 2, /** Already withdraw(3) */ Withdraw = 3, /** Already performed early withdraw(4) */ EarlyWithdraw = 4, } } type FinancialBonus = { /** Map to public currency */ publicCurrency: number; /** Map to public token address */ publicTokenAddress: string; /** Display currency name*/ publicName: string; /** Bonus kind */ kind: FinancialBonus.Kind; /** Is the bonus already withdraw, * false: allow perform abi method withdrawBonus through [[callAbiFunctionTransaction]]*/ isAlreadyWithdrawn: boolean; /** Currency */ currency: number; /** Token address */ tokenAddress: string; /** Product UUID */ uuid: string; /** Reward detail */ rewards: Array; /** Last update time in sec */ lastTimestamp: number } namespace FinancialBonus{ /** FinancialBonus kind */ export enum Kind { /** Unknown(-1) */ Unknown = -1, /** First time reward and rebate(1) */ FirstTimeRebate = 1, /** Savings rebate(2) */ SavingRebate = 2, } } /** Detail of [[FinancialBonus]], list amount and from which user code * see [[getFinancialBonusList]] * */ type FinancialReward = { /** Bonus amount */ amount: string; /** The user code of the user who contribute the rebate */ fromUserCode: string; } namespace TransactionExplain{ /** FinancialBonus kind */ export enum Kind { /** Unknown(0) */ Unknown = 0, /** Burn(1) */ Burn = 1, /** Mint(2) */ Mint = 2, /** Approve(3) */ Approve = 3, /** Deposit(4) */ Deposit = 4, /** Withdraw(5) */ Withdraw = 5, /** EarlyWithdraw(6) */ EarlyWithdraw = 6, /** WithdrawReward(7) */ WithdrawReward = 7, /** WithdrawBonus(8) */ WithdrawBonus = 8, } } /** * Transaction Fee * * see [[getTransactionFee]], [[GetTransactionFeeResult]] */ type Fee = { /** Transaction fee amount */ amount: string; /** Transaction fee description. i.e. Estimated time */ description: string; }; /** * Currency, refer to [[getCurrencies]] */ type Currency = { /** * Currency of the cryptocurrency * If this cryptocurrency is a token such as ERC-20, the currency value will be the same as ETH */ currency: number; /** * Token contract address of the cryptocurrency. Only token will has this value */ tokenAddress: string; /** * Symbol of the cryptocurrency. i.e., BTC, ETH, XRP, ... */ symbol: string; /** * Display name of cryptocurrency. i.e., Bitcoin, Ethereum, Ripple, ... */ displayName: string; /** * Token version. ex ETH 721 */ tokenVersion: number; /** * Token decimals */ decimals: string; /** * Currency chain ID */ chainId: number; /** * Name of supported chain for WalletConnect */ chainName: string; /** * CAIP-2 chain ID of supported chain for WalletConnect */ caip2ChainId: string; //for private wallet /** * Is private chain (CPC) */ isPrivate: boolean; /** * Public chain's currency type */ mapToPublicType: number; /** * Public chain's token address */ mapToPublicTokenAddress: string; /** * Public chain's currency name */ mapToPublicName: string; /** * Can create finance wallet */ canCreateFinanceWallet: boolean; }; /** * MarketInfo, */ type MarketInfo = { /** * Currency */ currency: string; /** * Token symble */ symbol: string; price: string; trend: string; capitalization: string; dominance: string; queryDate: number; iconUrl: string; }; /** * Wallet types definition */ export enum TokenStandard { /** Metadata unavailable */ Unknown = -1, /** NFT */ NonFungible = 0, /** SFT, semi-fungible token */ FungibleAsset = 1, /** FT, currency */ Fungible = 2, } /** * NFT Token meta */ type TokenMeta = { /** * NFT token address */ tokenAddress: string; /** * NFT name */ name: string; /** * NFT symbol */ symbol: string; /** * NFT URI */ uri: string; /** * Token decimal, NFT, SFT should be 0 */ decimals: number; /** * Total supply amount */ supply: string; /** * Token type, ex. NFT, SFT, FT */ tokenStandard: TokenStandard; /** * Balance of SFT */ balance?: string; }; /** * CoinType, */ type CoinType = { /** * Currency of the cryptocurrency * If this cryptocurrency is a token such as ERC-20, the currency value will be the same as ETH */ currency: number; /** * Token contract address of the cryptocurrency. Only token will has this value */ tokenAddress: string; }; /** * API history item represents API log in walletconnect category * * see [[getWalletConnectApiHistory]], [[GetApiHistoryResult]] */ type ApiHistoryItem = { /** WalletID */ walletId: number; /** Wallet Name */ walletName: string; /** User ID */ userId: number; /** User Email */ userEmail: string; /** API name */ apiName: string; /** Create Time */ createTime: string; /** TXID for eth_sendRawTransaction */ txid: string; /** Failed message for eth_sendRawTransaction */ message: string; /** Transaction status */ status: number; /** access ID for eth_sendRawTransaction */ accessId: string; /** Used nonce status */ nonce?: number; /** Gas price */ gasPrice: string; /** Gas limit */ gasLimit: string; /** The contract address that the wallet interact with when calling Wallets.shared.walletConnectSendSignedTransaction */ tokenAddress: string; }; namespace ApiHistoryItem{ export enum Status { /** Transaction is pending */ WAITING = 0, /** Transaction is failed*/ FAILED = 1, /** Transaction is successful*/ DONE = 2, /** Transaction is dropped*/ DROPPED = 3, } } /** * Result of [[registerTokenIds]] API */ type RegisterTokenIdsResult = {}; /** * Result of [[addContractCurrencies]], [[addContractCurrency]] API */ type AddContractCurrenciesResult = { successResults: Array; failResults: Array; }; /** * Result of [[addContractCurrencies]], [[addContractCurrency]], * ID of the new created wallet and wallet status API, * 1: success */ type WalletIdStatus = { walletId: number; status: number; }; /** * Result of [[addContractCurrencies]], [[addContractCurrency]], * failed currency, token contract address and error message, */ type CurrencyFailResult = { currency: number; contractAddress: string; errorMessage: string; }; /** * Result of [[createWallet]] API */ type CreateWalletResult = { walletId: number; }; /** * Result of [[createWallet]] API */ type GetWalletsResult = { /** The wallets */ wallets: Array; }; /** * Result of [[getSolNftTokens]] API */ type GetSolNftTokensResult = { /** SOL NFT tokens */ tokens: Array; }; /** * Result of [[getWallet]] API */ type GetWalletResult = { /** The wallet */ wallet: Wallet; }; /** * Result of [[getBalances]] API */ type GetBalancesResult = { /** * The Map of balances, the key will be same with parameters passed into [[getBalances]] */ balances: { [key: number]: Balance }; }; /** * Result of [[getFinancialProducts]] API */ type GetFinancialProductsResult = { /** User depositing financial products */ userDeposits: Array; /** Demand deposit financial products */ demandDeposits: Array; /** Fixed deposit financial products */ fixedDeposits: Array; /** Campaign deposit financial products */ campaign: Array; }; /** * Result of [[getFinancialHistory]] API */ type GetFinancialHistoryResult = { /** FinancialHistory list kind*/ kind: FinancialHistory.ListKind; /** Flag for paging, page parameter of [[getFinancialHistory]]*/ prevPage: string; /** Flag for paging, page parameter of [[getFinancialHistory]]*/ nextPage: string; /** A Financial product lookup map for histories, * key is product UUID(appeared in histories item's productUuid), * value is the financial product. */ products: {[keye: string]: FinancialProduct} /** The result financial history list */ histories: Array; } /** * Result of [[getFinancialBonusList]] API */ type GetFinancialBonusResult = { /** Result financial bonus list */ bonusList: Array; }; /** * Result of [[getFinancialOrder]] API */ type GetFinancialOrderResult = { /** FinancialProduct uuid */ productUuid: string; /** Financial order uuid */ uuid: string; /** * Product kind, * Unknown(-1) means this order is not exist * */ kind: FinancialProduct.Kind; /** User reward amount */ userReward: string; /** User deposit amount */ userDeposit: string; /** Total amount of user deposit and reward */ userTotal: string; /** * For FixedDeposit, * the deducted interest (userReward - penalty) of performing earlyWithdraw * */ earlyReward: string; /** * For FixedDeposit, * the principle (userDeposit - penalty) of performing earlyWithdraw. * */ earlyDeposit: string; /** * For FixedDeposit, * total amount of earlyReward and earlyDeposit * */ earlyTotal: string; }; /** * Result of [[getHistory]] API */ type GetHistoryResult = { /** Start index of result, given by wallet.Wallets#getHistory() API */ start: number; /** Transaction items in range */ transactions: Array; /** Total count of history */ total: number; }; /** * Result of [[getTransactionFee]] API */ type GetTransactionFeeResult = { /** High transaction fee */ high: Fee; /** Medium transaction fee */ medium: Fee; /** Low transaction fee */ low: Fee; /** Minimum transfer amount for private*/ withdrawMin: string; }; /** * Result of [[getWalletUsage]] API */ type GetWalletUsageResult = { dailyTransactionAmountUsage: string; dailyTransactionAmountQuota: string; }; /** * Result of [[renameWallet]] API */ type RenameWalletResult = {}; /** * Result of [[requestSecureToken]] API */ type RequestSecureTokenResult = { /** * expiration time of secure token */ expireTime: number; /** * Unlock token */ unlockToken: string; }; /** * Result of [[walletConnectSync]] API */ type WalletConnectSyncResult = { /** Wallet IDs of added wallets */ walletIds: Array; }; /** * Result of [[getNonce]] API */ type GetNonceResult = { /** Pending nonce of specified wallet */ nonce: number; }; /** * Result of [[createTransaction]] API */ type CreateTransactionResult = { /** Unique system number of the transaction */ txno: number; /** Blockchain TX ID */ txid: string; }; /** * Result of [[replaceTransaction]] and [[cancelTransaction]] API */ type ReplaceTransactionResult = { /** Unique system number of the transaction */ txno: number; /** Blockchain TX ID */ txid: string; }; /** * Result of [[clearSecureToken]] API */ type ClearSecureTokenResult = {}; /** * Result of [[getCurrencies]] API */ type GetCurrenciesResult = { /** Completely currency list current supported */ currencies: Array; }; /** * Result of [[queryCoinType]] API */ type QueryCoinTypeResult = { /** Matched coin types */ coinItems: Array; /** The query address which is removed prefix */ trimmedAddress: string; }; /** * Result of [[callAbiFunction]] API */ type CallAbiFunctionResult = { /** Blockchain TX ID */ txid: string; /** Signed Transaction */ signedTx: string; /** ABI function output */ output: string; }; /** * Result of [[getAddressesTags]] API */ type GetAddressesTagsResult = { /** key: query address, value: address tag info */ addressTagMap: { [key: string]: AddressTags }; }; /** * Result of [[getMultipleTokenUri]] API */ type GetMultipleTokenUriResult = { /** key: currency#tokenAddress#tokenId */ tokenUriMap: { [key: string]: TokenUri }; }; /** * Address tag item represents address AML tag query result */ type AddressTags = { /** Is address in black list */ blackList: boolean; /** Is address in white list */ whiteList: boolean; /** Tags */ tags: Array<{string}>; /** Provider and tags map */ providers: { [key: string]: Array<{string}> }; /** Provider of score */ provider: string; /** Score */ score: number; } /** * TokenURI class contains URI info of a NFT token */ type TokenUri = { /** Token URI */ tokenUri: string; /** Token name */ name: string; /** Token image URL */ image: string; /** Token description */ description: string; /** Error message */ errorMessage: string; }; /** * Result of [[getTransactionInfo]] API */ type GetTransactionInfoResult = { /** the number of block includes this transaction */ blockNumber: number; /** the confirm blocks of this transaction */ confirmBlocks: number; /** timestamp of blockNumber */ blockTimestamp: number; /** transaction fee */ fee: string; /** result string from chain. Can be used to identify error if failed */ result: string; /** If transaction was succeed */ success: boolean; /** transaction amount */ amount: string; /** transaction from address */ from: string; /** transaction to address */ to: string; /** contract address */ contractAddress: string; /** transaction data */ data: string; /** ABI method */ abiMethod: string; /** ABI arguments */ abiArguments: string; /** Is transaction replaceable */ replaceable: boolean; /** Is transaction replaced by another transaction */ replaced: boolean; /** TXID of replacement of this transaction if [[replaced]] == true */ replaceTxid: string; /** Nonce of transaction, only valid on ETH, same nonce means replacements */ nonce: number; /** Is preparing fee for this relayer transaction */ preparingFee: boolean; }; /** * Result of [[getTransactionsInfo]] API */ type GetTransactionsInfoResult = { /** * Result of transactions, TXID as key and [[GetTransactionInfoResult]] as value */ transactionsInfo: { [txid: string]: GetTransactionInfoResult; }; }; /** * Result of [[getEosRamPrice]] API */ type GetEosRamPriceResult = { /** Price of RAM per KBytes */ ramPrice: string; }; /** * Result of [[getCurrencyTraits]] API */ type GetCurrencyTraitsResult = { /** EPI-777: withdraw must be multiples of granularity */ granularity: string; /** * The minimum balance after transaction (ALGO, DOT, KSM) * */ existentialDeposit: string; /** * The minimum balance after transaction (XLM, FLOW) * */ minimumAccountBalance: string; }; /** * Result of [[getSameCurrencyWalletLimit]] API */ type GetSameCurrencyWalletLimitResult = { /** wallet limit per currency */ walletLimit: number; }; /** * Result of [[getEstimateGas]] API */ type GetEstimateGasResult = { /** Gas limit */ gasLimit: number; }; /** * Result of [[getEosResourceState]] API */ type GetEosResourceStateResult = { /** Quota of RAM in bytes */ ramQuota: number; /** Usage of RAM in bytes */ ramUsage: number; /** Used NET in bytes */ netUsed: number; /** Available NET in bytes */ netAvailable: number; /** Max NET in bytes */ netMax: number; /** NET amount */ netAmount: number; /** NET amount exponential precision */ netAmountPrecision: number; /** NET refund */ netRefund: number; /** NET refund exponential precision */ netRefundPrecision: number; /** Used CPU in μs */ cpuUsed: number; /** Available CPU in μs */ cpuAvailable: number; /** Max CPU in μs */ cpuMax: number; /** CPU amount */ cpuAmount: number; /** CPU amount exponential precision */ cpuAmountPrecision: number; /** CPU refund */ cpuRefund: number; /** CPU refund exponential precision */ cpuRefundPrecision: number; }; /** * Result of [[validateEosAccount]] API */ type ValidateEosAccountResult = { /** Is given EOS account valid */ valid: boolean; /** Is given EOS account already exists */ exist: boolean; }; /** * Result of [[signRawTx]] API */ type SignedRawTxResult = { /** Signed Transaction */ signedTx: string; /** The map of wallet address and signature of signed transaction */ signatures: { [key: string]: string }; }; /** * Chain info */ type ChainInfo = { /** Currency */ currency: number; /** Chain name */ chainName: string; /** CAIP-2 chain ID */ caip2ChainId: string; }; /** * Result of [[walletConnectGetSupportedChainResult]] API */ type WalletConnectGetSupportedChainResult = { /** The map of CAIP-2 chain ID and CurrencyChainInfo */ chainMap: { [key: string]: ChainInfo }; }; /** * Result of [[setSolTokenAccountTransaction]] API */ type SetSolTokenAccountTransactionResult = { /** TXID of create SOL token account transaction* */ txid: string; }; /** * Result of [[sendSignedTx]] API */ type SendSignedTxResult = { /** Transaction result */ state: boolean; /** Transaction Id*/ txid: string; }; /** * Result of [[estimateTransaction]] API */ type EstimateTransactionResult = { /** Estimated total amount to transaction */ transactionAmount: string; /** @deprecated Use transactionAmount instead */ tranasctionAmout: string; /** Estimated platform fee of transaction *

* On private chain, this is the fee for transfer. ex. inner transfer, transaction for finance product *

* */ platformFee: string; /** Estimated blockchain fee of transaction *

* On private chain, this is the fee for withdraw to public chain *

* */ blockchainFee: string; }; /** * Result of [[Wallets.exportPrivateKey]] API */ type ExportPrivateKeyResult = { /** Wallet ID */ walletId: number; /** Wallet Address */ address: string; /** Public Key */ publicKey: string; /** Private Key */ privateKey: string; }; /** * Result of [[signMessage]] API */ type SignedMessageResult = { /** Signed message */ signedMessage: string; }; /** * Result of [[getWalletConnectApiHistory]] API */ type GetApiHistoryResult = { /** Start index of result, given by wallet.Wallets#getHistory() API */ start: number; /** Api history items in range, given by wallet.Wallets#getWalletConnectApiHistory() API */ apiHistoryItems: Array; /** Total count of history */ total: number; }; /** * Result of [[Wallets.getActionToken]] API */ type GetActionTokenResult = { actionToken: string; }; /** * Result of [[Wallets.getMarketInfos]] API */ type GetMarketInfosResult = { marketInfos: Array; }; /** * Result of [[Wallets.getSignedActionToken]] API */ type GetSignedActionTokenResult = {}; /** * Result of [[Wallets.registerPubkey]] API */ type RegisterPubkeyResult = {}; /** * Result of [[Wallets.updateDeviceInfo]] API */ type UpdateDeviceInfoResult = {}; /** * Result of [[Wallets.isBioKeyExist]] API */ type IsBioKeyExistResult = { exist: boolean }; type GetBiometricsTypeResult = { biometricsType: number }; /** * Create a new wallet * @param currency Currency of desired new wallet * @param tokenAddress Token address for tokens, i.e. an ERC-20 token wallet maps to an Ethereum wallet * @param parentWalletId Parent wallet for tokens, i.e. an ERC-20 token wallet maps to an Ethereum wallet * @param name Name of new wallet * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext * @param extraAttributes Extra attributes for specific currencies, pass null if unspecified. Supported extras: *
    *
  • account_name: string - Account name for EOS
  • *
*/ function createWallet( currency: number, tokenAddress: string, parentWalletId: number, name: string, pinSecret: number | PinSecretBearer | string, extraAttributes: object ): Promise; /** * Add a new token & create first wallet * @param currency Currency of desired new wallet * @param tokenAddress Token address for tokens, i.e. an ERC-20 token wallet maps to an Ethereum wallet * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function addContractCurrency( currency: number, tokenAddress: string, pinSecret: number | PinSecretBearer | string, ): Promise; /** * Register ERC-1155 token IDs * @param walletId wallet ID * @param tokenIds Token IDs */ function registerTokenIds( walletId: number, tokenIds: Array<{string}>, ): Promise; /** * Add new tokens & create first wallet * @param currency Currency of desired new wallet * @param tokenAddress Token address for tokens, i.e. an ERC-20 token wallet maps to an Ethereum wallet * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function addContractCurrencies( currency: Array<{number}>, tokenAddress: Array<{string}>, pinSecret: number | PinSecretBearer | string, ): Promise; /** * Get wallet list of signed in user */ function getWallets(): Promise; /** * Get wallet list by chain IDs of signed in user. caip2ChainId and chainName of returned wallet are not available. * @param chainIds Currency chain IDs, pass -1 get all wallets */ function getWalletsByChainIds(chainIds: Array): Promise; /** * Get wallet list by CAIP-2 chain IDs of signed in user. chainId of returned wallet is not available. * @param caip2ChainIds CAIP-2 chain ID */ function getWalletsByCaip2ChainIds(caip2ChainIds: Array): Promise; /** * Get single wallet partial information (only currency, tokenAddress, currencySymbol, walletId, address, name, parentWalletId) * @param walletId Wallet ID to query * @deprecated User getWallet instead */ function getWalletLegacy(walletId: number): Promise; /** * Get single wallet information * @param walletId Wallet ID to query */ function getWallet(walletId: number): Promise; /** * Get small number balances on a batch of addresses * @param addresses Array of addresses to query, the key of Map will be same with [[GetBalancesResult.balances]] * @deprecated User getBlances instead */ function getBalancesLegacy( addresses: Array<{ /** currency, refer to [[getCurrencies]] API */ currency: number; /** token contract address, refer to [[getCurrencies]] API */ tokenAddress: string; /** wallet address */ address: string; }> ): Promise; /** * Get large number balances on a batch of addresses * @param addresses Array of addresses to query, the key of Map will be same with [[GetBalancesResult.balances]] */ function getBalances( addresses: Array<{ /** currency, refer to [[getCurrencies]] API */ currency: number; /** token contract address, refer to [[getCurrencies]] API */ tokenAddress: string; /** wallet address */ address: string; }> ): Promise; /** * Get financial products * @param kinds Refers to FinancialProduct.ListKind, 0: All, 1: UserDeposit, 2: DemandDeposit, 3: FixedDeposit, 4: Campaign * @see [[FinancialProduct.ListKind]] */ function getFinancialProducts( kinds: Array<{number}>, ): Promise; /** * Get financial histories by kind * @param kind Refers to FinancialHistory.ListKind, 1: Depositing, 2: Withdraw, 3: WithdrawReward * @see [[FinancialHistory.ListKind]] * @param page Flag for paging, pass null for the first page, or nextPage or prevPage of GetFinancialHistoryResult * @see [[GetFinancialHistoryResult.prevPage]] * @see [[GetFinancialHistoryResult.nextPage]] */ function getFinancialHistoryByKind( kind: number, page: string, ): Promise; /** * Get financial histories by product UUID * @param productUuid Financial product uuid * @param page Flag for paging, pass null for the first page, or nextPage or prevPage of GetFinancialHistoryResult * @see [[GetFinancialHistoryResult.prevPage]] * @see [[GetFinancialHistoryResult.nextPage]] */ function getFinancialHistoryByProduct( productUuid: string, page: string, ): Promise; /** * Get financial bonus list for current signed in user */ function getFinancialBonusList( ): Promise; /** * Get financial order info * @param productUuid Product UUID * @param uuid Fixed Deposit order ID * @see [[FinancialHistory.orderId]] */ function getFinancialOrder( productUuid: string, orderId: string, ): Promise; /** * Get transaction history from * * @param currency Currency of the address * @param tokenAddress Token Contract Address of thw address * @param walletAddress Wallet address * @param start Query start offset * @param count Query count returned * @param filters Filter parameters: *
    *
  • direction: Transaction.Direction - Direction of transaction
  • *
  • pending: boolean - Pending state of transactions
  • *
  • success: boolean - Success state of transactions
  • *
  • start_time: number - Start of time period to query, in Unix timestamp
  • *
  • end_time: number - End of time period to query, in Unix timestamp
  • *
*/ function getHistory( currency: number, tokenAddress: string, address: string, start: number, count: number, filters?: object ): Promise; /** * Get transaction history of the user * * @param start Query start offset * @param count Query count returned * @param filters Filter parameters: *
    *
  • type: Transaction.Type, Transaction.Type[] - Transaction type
  • *
  • pending: boolean - Pending state of transactions
  • *
  • success: boolean - Success state of transactions
  • *
  • start_time: number - Start of time period to query, in Unix timestamp
  • *
  • end_time: number - End of time period to query, in Unix timestamp
  • *
  • currency: number - Currency of the transaction
  • *
  • token_address: string - Token Contract Address of the transaction
  • *
*/ function getUserHistory( start: number, count: number, filters?: object ): Promise; /** * Get transaction history from * * @param currency Currency of the address * @param tokenAddress Token Contract Address of thw address * @param walletAddress Wallet address * @param start Query start offset * @param count Query count returned * @param crossChain For private chain transaction history filtering. 0: history for private chain transfer; 1: history for crossing private and public chain * @param filters Filter parameters: *
    *
  • direction: Transaction.Direction - Direction of transaction
  • *
  • pending: boolean - Pending state of transactions
  • *
  • success: boolean - Success state of transactions
  • *
  • start_time: number - Start of time period to query, in Unix timestamp
  • *
  • end_time: number - End of time period to query, in Unix timestamp
  • *
*/ function getHistoryWithCrossChain( currency: number, tokenAddress: string, address: string, start: number, count: number, crocessChain: number, filters?: object ): Promise; /** * Get transaction transactionFee of specified currency * @param currency Currency to query * @param tokenAddress Token address to query, only needed when get transaction fee of withdraw to public transaction */ function getTransactionFee( currency: number, tokenAddress?: string, ): Promise; /** * Get wallet usage today * @param walletId Wallet ID to query */ function getWalletUsage(walletId: number): Promise; /** * Rename an existing wallet * @param walletId Wallet ID to rename * @param name New name of the wallet */ function renameWallet( walletId: number, name: string ): Promise; /** * Create a transaction from specified wallet to specified address * @param fromWalletId ID of wallet to withdraw from * @param toAddress Target address to send * @param amount Amount to transfer * @param transactionFee Transaction transactionFee to pay * @param description Description of the transaction * @param extraAttributes Extra attributes for specific currencies, pass null if unspecified. Supported extras: *
    *
  • memo: string - Memo for XRP, XLM, EOS, BNB
  • *
  • eos_transaction_type: [[EosResourceTransactionType]] - Resource transaction type for EOS, such as buy RAM, delegate CPU
  • *
  • num_bytes: number - Bytes of RAM for EOS RAM delegation/undelegation transactions. The minimal amounts are 1024 bytes
  • *
  • input_data: string - Hex string of input data. Must also set gas_limit when have this attributes
  • *
  • gas_limit: number - Must specify this if there were input_data
  • *
  • skip_email_notification: boolean - Determined whether or not to skip sending notification mail after create a transaction
  • *
  • token_id: string - token ID for ERC-1155
  • *
  • kind: string - kind for private chain, code: private to private; out: private to public
  • *
  • to_address_tag: string[] - AML tag, get from wallet.Wallets#getAddressesTags(long, Array *
  • custom_nonce: number - Specific nonce
  • *
  • custom_gas_limit: number - Specific gas limit
  • *
  • sol_token_id: string - token ID of SOL NFT, if get from [[getSolNftTokens]] API, it would be tokenAddress of [[TokenMeta]]
  • *
  • force_send: boolean - For SOL transaction, true means create ATA account for receiver
  • *
*

* Note: When eos_transaction_type is [[SELL_RAM]], [[UNDELEGATE_CPU]] or [[UNDELEGATE_NET]], the receiver should always be address of wallet "fromWalletId" *

* @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function createTransaction( fromWalletId: number, toAddress: string, amount: string, transactionFee: string, description: string, pinSecret?: number | PinSecretBearer | string, extraAttributes?: object ): Promise; /** * Create a transaction from specified wallet to specified address *
Authenticate by SMS * @param actionToken action token * @param smsCode sms code * @param fromWalletId ID of wallet to withdraw from * @param toAddress Target address to send * @param amount Amount to transfer * @param transactionFee Transaction transactionFee to pay * @param description Description of the transaction * @param extraAttributes Extra attributes for specific currencies, pass null if unspecified. Supported extras: *

    *
  • memo: string - Memo for XRP, XLM, EOS, BNB
  • *
  • eos_transaction_type: [[EosResourceTransactionType]] - Resource transaction type for EOS, such as buy RAM, delegate CPU
  • *
  • num_bytes: number - Bytes of RAM for EOS RAM delegation/undelegation transactions. The minimal amounts are 1024 bytes
  • *
  • input_data: string - Hex string of input data. Must also set gas_limit when have this attributes
  • *
  • gas_limit: number - Must specify this if there were input_data
  • *
  • skip_email_notification: boolean - Determined whether or not to skip sending notification mail after create a transaction
  • *
  • token_id: string - token ID for ERC-1155
  • *
  • kind: string - kind for private chain, code: private to private; out: private to public
  • *
  • to_address_tag: string[] - AML tag, get from wallet.Wallets#getAddressesTags(long, Array *
  • custom_nonce: number - Specific nonce
  • *
  • custom_gas_limit: number - Specific gas limit
  • *
  • sol_token_id: string - token ID of SOL NFT, if get from [[getSolNftTokens]] API, it would be tokenAddress of [[TokenMeta]]
  • *
  • force_send: boolean - For SOL transaction, true means create ATA account for receiver
  • *
*

* Note: When eos_transaction_type is [[SELL_RAM]], [[UNDELEGATE_CPU]] or [[UNDELEGATE_NET]], the receiver should always be address of wallet "fromWalletId" *

* @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function createTransactionSms( actionToken: string, smsCode: string, fromWalletId: number, toAddress: string, amount: string, transactionFee: string, description: string, pinSecret?: number | PinSecretBearer | string, extraAttributes?: object ): Promise; /** * Create a transaction from specified wallet to specified address *
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param fromWalletId ID of wallet to withdraw from * @param toAddress Target address to send * @param amount Amount to transfer * @param transactionFee Transaction transactionFee to pay * @param description Description of the transaction * @param extraAttributes Extra attributes for specific currencies, pass null if unspecified. Supported extras: *

    *
  • memo: string - Memo for XRP, XLM, EOS, BNB
  • *
  • eos_transaction_type: [[EosResourceTransactionType]] - Resource transaction type for EOS, such as buy RAM, delegate CPU
  • *
  • num_bytes: number - Bytes of RAM for EOS RAM delegation/undelegation transactions. The minimal amounts are 1024 bytes
  • *
  • input_data: string - Hex string of input data. Must also set gas_limit when have this attributes
  • *
  • gas_limit: number - Must specify this if there were input_data
  • *
  • skip_email_notification: boolean - Determined whether or not to skip sending notification mail after create a transaction
  • *
  • token_id: string - token ID for ERC-1155
  • *
  • kind: string - kind for private chain, code: private to private; out: private to public
  • *
  • to_address_tag: string[] - AML tag, get from wallet.Wallets#getAddressesTags(long, Array *
  • custom_nonce: number - Specific nonce
  • *
  • custom_gas_limit: number - Specific gas limit
  • *
  • sol_token_id: string - token ID of SOL NFT, if get from [[getSolNftTokens]] API, it would be tokenAddress of [[TokenMeta]]
  • *
  • force_send: boolean - For SOL transaction, true means create ATA account for receiver
  • *
*

* Note: When eos_transaction_type is [[SELL_RAM]], [[UNDELEGATE_CPU]] or [[UNDELEGATE_NET]], the receiver should always be address of wallet "fromWalletId" *

* @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function createTransactionBio( promptMessage: string, cancelButtonText: string, fromWalletId: number, toAddress: string, amount: string, transactionFee: string, description: string, pinSecret?: number | PinSecretBearer | string, extraAttributes?: object ): Promise; /** * Replace an existing transaction with a greater fee * @param fromWalletId ID of wallet to withdraw from * @param txid TXID of transaction to replace * @param transactionFee Transaction transactionFee to pay * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function increaseTransactionFee( fromWalletId: number, txid: string, transactionFee: string, pinSecret?: number | PinSecretBearer | string, ): Promise; /** * Replace an existing transaction with a greater fee *
Authenticate by SMS * * @param actionToken action token * @param smsCode sms code * @param fromWalletId ID of wallet to withdraw from * @param txid TXID of transaction to replace * @param transactionFee Transaction transactionFee to pay * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function increaseTransactionFeeSms( actionToken: string, smsCode: string, fromWalletId: number, txid: string, transactionFee: string, pinSecret?: number | PinSecretBearer | string, ): Promise; /** * Replace an existing transaction with a greater fee *
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param fromWalletId ID of wallet to withdraw from * @param txid TXID of transaction to replace * @param transactionFee Transaction transactionFee to pay * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function increaseTransactionFeeBio( promptMessage: string, cancelButtonText: string, fromWalletId: number, txid: string, transactionFee: string, pinSecret?: number | PinSecretBearer | string, ): Promise; /** * Cancel an existing transaction (Replace with a transaction with zero amount) * @param fromWalletId ID of wallet to withdraw from * @param txid TXID of transaction to replace * @param transactionFee Transaction transactionFee to pay * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function cancelTransaction( fromWalletId: number, txid: string, transactionFee: string, pinSecret?: number | PinSecretBearer | string, ): Promise; /** * Cancel an existing transaction (Replace with a transaction with zero amount) *
Authenticate by SMS * @param actionToken action token * @param smsCode sms code * @param fromWalletId ID of wallet to withdraw from * @param txid TXID of transaction to replace * @param transactionFee Transaction transactionFee to pay * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function cancelTransactionSms( actionToken: string, smsCode: string, fromWalletId: number, txid: string, transactionFee: string, pinSecret?: number | PinSecretBearer | string, ): Promise; /** * Cancel an existing transaction (Replace with a transaction with zero amount) *
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param fromWalletId ID of wallet to withdraw from * @param txid TXID of transaction to replace * @param transactionFee Transaction transactionFee to pay * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function cancelTransactionBio( promptMessage: string, cancelButtonText: string, fromWalletId: number, txid: string, transactionFee: string, pinSecret?: number | PinSecretBearer | string , ): Promise; /** * Request a Secure Token that can be used to perform Wallet manipulations such as [[createTransaction]] without input PIN code in a specific time * The Secure Token will not be persistent stored and will be reset next application lifecycle * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function requestSecureToken( pinSecret: number | PinSecretBearer | string ): Promise; /** * Request a Secure Token that can be used to perform Wallet manipulations such as [[createTransaction]] without input PIN code in a specific time * The Secure Token will not be persistent stored and will be reset next application lifecycle *
Authenticate by SMS * @param actionToken action token * @param smsCode sms code * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function requestSecureTokenSms( actionToken: string, smsCode: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Request a Secure Token that can be used to perform Wallet manipulations such as [[createTransaction]] without input PIN code in a specific time * The Secure Token will not be persistent stored and will be reset next application lifecycle *
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param pinSecret PIN Code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function requestSecureTokenBio( promptMessage: string, cancelButtonText: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Revoke current Secure Token created via [[requestSecureToken]] */ function clearSecureToken(): Promise; /** * Get matched coin types by checking address format * @param address Address to query */ function queryCoinType( address: string ): Promise; /** * Get supported currency list */ function getCurrencies(): Promise; /** * Get currency price list * @param wallets Array of currency/wallet to query * @param exchangeCurrencies Array of currencies which need to get price. e.g. 'USD','TWD' * @param approximateRates rate reference. When the price is 0, it can be calculated by other exchange currency's price multiply the rate. e.g. ["TWD", ["USD", 29.45]] */ function getCurrencyPrices(wallets: Array<{ /** currency, refer to [[getCurrencies]] API */ currency: number; /** token contract address, refer to [[getCurrencies]] API */ tokenAddress: string; }>, exchangeCurrencies: Array<{string}>, approximateRates: object): Promise; /** * Get AML tag for address * @param currency query currency * @param addresses query address */ function getAddressesTags( currency: number, addresses: Array<{string}>, ): Promise; /** * Get supported chain as a map for WalletConnect. The map key is CAIP-2 chain ID. */ function walletConnectGetSupportedChain(): Promise; /** * Get NFT Token URI * @param currency Currency of token to query * @param tokenAddress Array of token address to query * @param tokenIds Array of token ID to query */ function getMultipleTokenUri( currency: number, tokenAddresses: Array<{string}>, tokenIds: Array<{string}>, ): Promise; /** * Call ABI function * * @param walletId ID of wallet to call ABI function * @param name function name of ABI * @param inputs inputs of ABI function * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function callAbiFunction( walletId: number, name: string, inputs: object, pinSecret: number | PinSecretBearer | string ): Promise; /** * Call ABI function *
Authenticate by SMS * @param actionToken action token * @param smsCode sms code * @param walletId ID of wallet to call ABI function * @param name function name of ABI * @param inputs inputs of ABI function * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function callAbiFunctionSms( actionToken: string, smsCode: string, walletId: number, name: string, inputs: object, pinSecret: number | PinSecretBearer | string ): Promise; /** * Call ABI function *
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId ID of wallet to call ABI function * @param name function name of ABI * @param inputs inputs of ABI function * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function callAbiFunctionBio( promptMessage: string, cancelButtonText: string, walletId: number, name: string, inputs: object, pinSecret: number | PinSecretBearer | string ): Promise; /** * Call general ABI function with read operation * * @param walletId ID of wallet to call ABI function * @param name Function name of ABI * @param contractAddress contract address of ABI * @param abiJson ABI contract json * @param args Argument array of ABI function */ function callAbiFunctionRead( walletId: number, name: string, contractAddress: string, abiJson: string, args: Array, ): Promise; /** * Call general ABI function with write operation * * @param walletId ID of wallet to call ABI function * @param name Function name of ABI * @param contractAddress contract address of ABI * @param abiJson ABI contract json * @param args Argument array of ABI function * @param transactionFee Transaction fee to pay * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function callAbiFunctionTransaction( walletId: number, name: string, contractAddress: string, abiJson: string, args: Array, transactionFee: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Call general ABI function with write operation *
Authenticate by SMS * @param actionToken action token * @param smsCode sms code * @param walletId ID of wallet to call ABI function * @param name Function name of ABI * @param contractAddress contract address of ABI * @param abiJson ABI contract json * @param args Argument array of ABI function * @param transactionFee Transaction fee to pay * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function callAbiFunctionTransactionSms( actionToken: string, smsCode: string, walletId: number, name: string, contractAddress: string, abiJson: string, args: Array, transactionFee: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Call general ABI function with write operation *
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId ID of wallet to call ABI function * @param name Function name of ABI * @param contractAddress contract address of ABI * @param abiJson ABI contract json * @param args Argument array of ABI function * @param transactionFee Transaction fee to pay * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function callAbiFunctionTransactionBio( promptMessage: string, cancelButtonText: string, walletId: number, name: string, contractAddress: string, abiJson: string, args: Array, transactionFee: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Get transaction result for given txid * * @param currency currency to get transaction result * @param txid txid of transaction */ function getTransactionInfo( currency: number, txid: string ): Promise; /** * Get transactions result for given txids * * @param currency currency to get transaction result * @param txids txid of transaction */ function getTransactionsInfo( currency: number, txid: string[] ): Promise; /** * Get EOS RAM price */ function getEosRamPrice(): Promise; /** * Get currency traits for withdraw restriction */ function getCurrencyTraits( currency: number, tokenAddress: string, tokenVersion: number, walletAddress: string ): Promise; /** * Get estimate gas limit according to sign content */ function getEstimateGas( walletId: number, content: string, ): Promise; /** * Get wallet count limit per currency */ function getSameCurrencyWalletLimit(): Promise; /** * Get EOS account resource state */ function getEosResourceState(): Promise; /** * Validate EOS account, such as format valid or already exists * * @param accountName EOS account name to validate */ function validateEosAccount( accountName: string ): Promise; /** * Sign raw transaction * * @param walletId wallet ID * @param rawTx raw transaction * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function signRawTx( walletId: number, rawTx: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Sign raw transaction and record to history, currently support currency: * * @param walletId wallet ID * @param rawTx raw transaction * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function commonSignRawTx( walletId: number, rawTx: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Sign raw transaction *

* Authenticate by SMS *

* @param actionToken action token * @param smsCode sms code * @param walletId wallet ID * @param rawTx raw transaction * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function signRawTxSms( actionToken: string, smsCode: string, walletId: number, rawTx: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Sign raw transaction and record to history, currently support currency: * *

* Authenticate by SMS *

* @param actionToken action token * @param smsCode sms code * @param walletId wallet ID * @param rawTx raw transaction * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function commonSignRawTxSms( actionToken: string, smsCode: string, walletId: number, rawTx: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Sign raw transaction *

* Authenticate by Biometric *

* @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId wallet ID * @param signedTx signed transaction * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function signRawTxBio( promptMessage: string, cancelButtonText: string, walletId: number, signedTx: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Sign raw transaction and record to history, currently support currency: * *

* Authenticate by Biometric *

* @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId wallet ID * @param rawTx raw transaction * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function commonSignRawTxBio( promptMessage: string, cancelButtonText: string, walletId: number, rawTx: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Create SOL token account * @param walletId SOL token wallet ID * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext *

* Note 1: The SOL token wallet must have SOL for transaction fee, otherwise, the API will return empty TXID *

*

* Note 2: If the SOL token wallet have created token account, the API will also return empty TXID *

*/ function setSolTokenAccountTransaction( walletId: number, pinSecret: number | PinSecretBearer | string ): Promise; /** * Create SOL token account *

* Authenticate by SMS *

* @param actionToken action token * @param smsCode sms code * @param walletId SOL token wallet ID * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext *

* Note 1: The SOL token wallet must have SOL for transaction fee, otherwise, the API will return empty TXID *

*

* Note 2: If the SOL token wallet have created token account, the API will also return empty TXID *

*/ function setSolTokenAccountTransactionSms( actionToken: string, smsCode: string, walletId: number, pinSecret: number | PinSecretBearer | string ): Promise; /** * Create SOL token account *

* Authenticate by Biometric *

* @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId SOL token wallet ID * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext *

* Note 1: The SOL token wallet must have SOL for transaction fee, otherwise, the API will return empty TXID *

*

* Note 2: If the SOL token wallet have created token account, the API will also return empty TXID *

*/ function setSolTokenAccountTransactionBio( promptMessage: string, cancelButtonText: string, walletId: number, pinSecret: number | PinSecretBearer | string ): Promise; /** * Create transaction by signed transaction * * @param walletId wallet ID * @param signedTx signed transaction */ function sendSignedTx( walletId: number, signedTx: string ): Promise; /** * Estimate platform fee / chain fee for given transaction information * * @param currency Currency of desired new wallet * @param tokenAddress Token address for tokens, i.e. an ERC-20 token wallet maps to an Ethereum wallet * @param amount Amount to transfer * @param transactionFee Transaction transactionFee to pay * @param walletId Wallet ID to estimated transaction *

* On private chain, a valid walletId is required, otherwise, the API will return [[ErrorCodes.ErrOperationFailed]] error. *

* @param toAddress To address to estimated transaction */ function estimateTransaction( currency: number, tokenAddress: string, amount: string, transactionFee: string, walletId?: number, toAddress?: string, ): Promise; /** * Export private key by pinCode. * * @param walletId - The ID of wallet to call ABI function. * @param pinCode - The pinCode is an integral component of the wallet's master key, ensuring that only the authorized user can unlock and access the wallet. * @returns A Promise that resolves to an `ExportPrivateKeyResult` object containing the wallet's key information. */ function exportPrivateKey( walletId: number, pinCode: string, extras: object ): Promise; /** * Sign message by wallet private key * note: Only support ETH & TRX. Result is same as following links: *
    *
  • ETH: https://github.com/MetaMask/eth-sig-util/blob/v4.0.0/src/personal-sign.ts#L27-L45
  • *
  • TRX: https://github.com/TRON-US/tronweb/blob/461934e246707bca41529ab82ebe76cf894ab460/src/lib/trx.js#L712-L731
  • *
* @param walletId wallet ID * @param message message to sign * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext * @param extras Extra attributes for specific currencies, pass null if unspecified. Supported extras: *
    *
  • eip55: boolean - true - Use EIP 155 format to sign message
  • *
  • is_hex: boolean - true - Send Hex as message
  • *
  • legacy: boolean - true - Use legacy sign and suggest send hex as message(is_hex set true), please also check confirmed_action_token for EVM compatible currency
  • *
  • confirmed_action_token: string - It's required for these 2 cases: *
      *
    • SOL
    • *
    • EVM compatible currency and legacy is true
    • *
    * Get the action token from [[Wallets.getSignMessageActionToken]], otherwise, the API will return [[ErrorCodes.ErrActionTokenInvalid]] error code *
  • *
*/ function signMessage( walletId: number, message: string, pinSecret: number | PinSecretBearer | string, extras: object ): Promise; /** * Sign message by wallet private key * note: Only support ETH & TRX. Result is same as following links: *
    *
  • ETH: https://github.com/MetaMask/eth-sig-util/blob/v4.0.0/src/personal-sign.ts#L27-L45
  • *
  • TRX: https://github.com/TRON-US/tronweb/blob/461934e246707bca41529ab82ebe76cf894ab460/src/lib/trx.js#L712-L731
  • *
*
Authenticate by SMS * @param actionToken action token * @param smsCode sms code * @param walletId wallet ID * @param message message to sign * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext * @param extras Extra attributes for specific currencies, pass null if unspecified. Supported extras: *
    *
  • eip55: boolean - true - Use EIP 155 format to sign message
  • *
  • is_hex: boolean - true - Send Hex as message
  • *
  • legacy: boolean - true - Use legacy sign and suggest send hex as message(is_hex set true), please also check confirmed_action_token for EVM compatible currency
  • *
  • confirmed_action_token: string - It's required for these 2 cases: *
      *
    • SOL
    • *
    • EVM compatible currency and legacy is true
    • *
    * Get the action token from [[Wallets.getSignMessageActionToken]], otherwise, the API will return [[ErrorCodes.ErrActionTokenInvalid]] error code *
  • *
*/ function signMessageSms( actionToken: string, smsCode: string, walletId: number, message: string, pinSecret: number | PinSecretBearer | string, extras: object ): Promise; /** * Sign message by wallet private key * note: Only support ETH & TRX. Result is same as following links: *
    *
  • ETH: https://github.com/MetaMask/eth-sig-util/blob/v4.0.0/src/personal-sign.ts#L27-L45
  • *
  • TRX: https://github.com/TRON-US/tronweb/blob/461934e246707bca41529ab82ebe76cf894ab460/src/lib/trx.js#L712-L731
  • *
*
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId wallet ID * @param message message to sign * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext * @param extras Extra attributes for specific currencies, pass null if unspecified. Supported extras: *
    *
  • eip55: boolean - true - Use EIP 155 format to sign message
  • *
  • is_hex: boolean - true - Send Hex as message
  • *
  • legacy: boolean - true - Use legacy sign and suggest send hex as message(is_hex set true), please also check confirmed_action_token for EVM compatible currency
  • *
  • confirmed_action_token: string - It's required for these 2 cases: *
      *
    • SOL
    • *
    • EVM compatible currency and legacy is true
    • *
    * Get the action token from [[Wallets.getSignMessageActionToken]], otherwise, the API will return [[ErrorCodes.ErrActionTokenInvalid]] error code *
  • *
*/ function signMessageBio( promptMessage: string, cancelButtonText: string, walletId: number, message: string, pinSecret: number | PinSecretBearer | string, extras: object ): Promise; /** * Sign typed data(eth_signTypedData) for WalletConnect, this call will be logged as ApiHistoryItem with API name: eth_signTypedData * - https://docs.walletconnect.org/json-rpc-api-methods/ethereum#eth_signtypeddata * @param walletId wallet ID * @param typedData typed data json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function walletConnectSignTypedData( walletId: number, typedData: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Sign typed data(eth_signTypedData) via WalletConnect, this call will be logged as ApiHistoryItem with API name: eth_signTypedData * - https://docs.walletconnect.org/json-rpc-api-methods/ethereum#eth_signtypeddata *
Authenticate by SMS * @param actionToken action token * @param smsCode sms code * @param walletId wallet ID * @param typedData typed data json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function walletConnectSignTypedDataSms( actionToken: string, smsCode: string, walletId: number, typedData: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Sign typed data(eth_signTypedData) via WalletConnect, this call will be logged as ApiHistoryItem with API name: eth_signTypedData * - https://docs.walletconnect.org/json-rpc-api-methods/ethereum#eth_signtypeddata *
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId wallet ID * @param typedData typed data json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function walletConnectSignTypedDataBio( promptMessage: string, cancelButtonText: string, walletId: number, typedData: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Sign a transaction for WalletConnect, this call will be logged as ApiHistoryItem with API name. * * * * * * * * * * * * * * * * * * * * * * * *
Usage for Different Namespaces
MethodAPI NameResult
eip155 * eth_signTransaction * * eth_signTransaction * * result.signedTx *
solana * solana_signTransaction * * solana_signTransaction * * result.signatures[wallet.address]
* (base58 encoded) *
* @param walletId wallet ID * @param tx transaction object or json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext */ function walletConnectSignTransactionCommon( walletId: number, tx: object | string, pinSecret: number | PinSecretBearer | string, ): Promise; /** * Revise sign parameters and sign an eip155 transaction for WalletConnect, this call will be logged as ApiHistoryItem with API name: eth_signTransaction. * @param walletId wallet ID * @param tx transaction object or json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass plaintext * @param autoNonce if true, auto fill transaction's nonce with wallet's current pending nonce * @param onLog receive log callback * @param customGasLimit custom gas limit */ function walletConnectSignTransaction( walletId: number, tx: object | string, transactionFee: string, pinSecret: number | PinSecretBearer | string, autoNonce: boolean, onLog: (log: string) => void, customGasLimit: string, ): Promise; /** * Sign a transaction for WalletConnect, this call will be logged as ApiHistoryItem with API name. * * * * * * * * * * * * * * * * * * * * * * * *
Usage for Different Namespaces
MethodAPI NameResult
eip155 * eth_signTransaction * * eth_signTransaction * * result.signedTx *
solana * solana_signTransaction * * solana_signTransaction * * result.signatures[wallet.address]
* (base58 encoded) *
* @param actionToken action token * @param smsCode sms code * @param walletId wallet ID * @param tx transaction object or json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass pliantext */ function walletConnectSignTransactionCommonSms( actionToken: string, smsCode: string, walletId: number, tx: object | string, pinSecret: number | PinSecretBearer | string, ): Promise; /** * Revise sign parameters and sign an eip155 transaction for WalletConnect, this call will be logged as ApiHistoryItem with API name: eth_signTransaction. * @param actionToken action token * @param smsCode sms code * @param walletId wallet ID * @param tx transaction object or json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass pliantext * @param autoNonce if true, auto fill transaction's nonce with wallet's current pending nonce * @param onLog receive log callback * @param customGasLimit custom gas limit */ function walletConnectSignTransactionSms( actionToken: string, smsCode: string, walletId: number, tx: object | string, transactionFee: string, pinSecret: number | PinSecretBearer | string, autoNonce: boolean, onLog: (log: string) => void, customGasLimit: string, ): Promise; /** * * Sign a transaction for WalletConnect, this call will be logged as ApiHistoryItem with API name. * * * * * * * * * * * * * * * * * * * * * * * *
Usage for Different Namespaces
MethodAPI NameResult
eip155 * eth_signTransaction * * eth_signTransaction * * result.signedTx *
solana * solana_signTransaction * * solana_signTransaction * * result.signatures[wallet.address]
* (base58 encoded) *
*
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId wallet ID * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass pliantext */ function walletConnectSignTransactionCommonBio( promptMessage: string, cancelButtonText: string, walletId: number, tx: object | string, pinSecret: number | PinSecretBearer | string, ): Promise; /** * Revise sign parameters and sign an eip155 transaction for WalletConnect, this call will be logged as ApiHistoryItem with API name: eth_signTransaction. *
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId wallet ID * @param tx transaction object or json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass pliantext * @param autoNonce if true, auto fill transaction's nonce with wallet's current pending nonce * @param onLog receive log callback * @param customGasLimit custom gas limit */ function walletConnectSignTransactionBio( promptMessage: string, cancelButtonText: string, walletId: number, tx: object | string, transactionFee: string, pinSecret: number | PinSecretBearer | string, autoNonce: boolean, onLog: (log: string) => void, customGasLimit: string, ): Promise; /** * Sign message by wallet private key for WalletConnect, this call will be logged as ApiHistoryItem with API name.
* Supported namespaces are eip155 and solana.
* * * * * * * * * * * * * * * * * * * * * * *
Usage for Different Namespaces
MethodAPI NameResult
eip155 * eth_sign
* personal_sign *
* eth_sign * * result.signedMessage *
solana * solana_signMessage * * solana_sign * * result.signedMessage
* (base58 encoded) *
* Note: For ETH & TRX. Result is same as following links: *
    *
  • ETH: https://github.com/MetaMask/eth-sig-util/blob/v4.0.0/src/personal-sign.ts#L27-L45
  • *
  • TRX: https://github.com/TRON-US/tronweb/blob/461934e246707bca41529ab82ebe76cf894ab460/src/lib/trx.js#L712-L731
  • *
* @param walletId wallet ID * @param message message to sign * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass pliantext * @param extras Extra attributes for specific currencies, pass null if unspecified. Supported extras: *
    *
  • eip55: boolean - true - Use EIP 155 format to sign message
  • *
  • is_hex: boolean - true - Send Hex as message
  • *
  • legacy: boolean - true - Use legacy sign. It's suggested that sending hex as message(is_hex set true) when using legacy sign. Please also check confirmed_action_token for EVM compatible currency.
  • *
  • confirmed_action_token: string - It's required for these 2 cases: *
      *
    • SOL
    • *
    • EVM compatible currency and legacy is true
    • *
    * Get the action token from [[Wallets.getSignMessageActionToken]], otherwise, the API will return [[ErrorCodes.ErrActionTokenInvalid]] error code *
  • *
*/ function walletConnectSignMessage( walletId: number, message: string, pinSecret: number | PinSecretBearer | string, extras: object ): Promise; /** * Sign message by wallet private key for WalletConnect, this call will be logged as ApiHistoryItem with API name.
* Supported namespaces are eip155 and solana.
* * * * * * * * * * * * * * * * * * * * * * *
Usage for Different Namespaces
MethodAPI NameResult
eip155 * eth_sign
* personal_sign *
* eth_sign * * result.signedMessage *
solana * solana_signMessage * * solana_sign * * result.signedMessage
* (base58 encoded) *
* Note: For ETH & TRX. Result is same as following links: *
    *
  • ETH: https://github.com/MetaMask/eth-sig-util/blob/v4.0.0/src/personal-sign.ts#L27-L45
  • *
  • TRX: https://github.com/TRON-US/tronweb/blob/461934e246707bca41529ab82ebe76cf894ab460/src/lib/trx.js#L712-L731
  • *
*
Authenticate by SMS * @param actionToken action token * @param smsCode sms code * @param walletId wallet ID * @param message message to sign * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass pliantext * @param extras Extra attributes for specific currencies, pass null if unspecified. Supported extras: *
    *
  • eip55: boolean - true - Use EIP 155 format to sign message
  • *
  • is_hex: boolean - true - Send Hex as message
  • *
  • legacy: boolean - true - Use legacy sign and suggest send hex as message(is_hex set true), please also check confirmed_action_token for EVM compatible currency
  • *
  • confirmed_action_token: string - It's required for these 2 cases: *
      *
    • SOL
    • *
    • EVM compatible currency and legacy is true
    • *
    * Get the action token from [[Wallets.getSignMessageActionToken]], otherwise, the API will return [[ErrorCodes.ErrActionTokenInvalid]] error code *
  • *
*/ function walletConnectSignMessageSms( actionToken: string, smsCode: string, walletId: number, message: string, pinSecret: number | PinSecretBearer | string, extras: object ): Promise; /** * Sign message by wallet private key for WalletConnect, this call will be logged as ApiHistoryItem with API name.
* Supported namespaces are eip155 and solana.
* * * * * * * * * * * * * * * * * * * * * * *
Usage for Different Namespaces
MethodAPI NameResult
eip155 * eth_sign
* personal_sign *
* eth_sign * * result.signedMessage *
solana * solana_signMessage * * solana_sign * * result.signedMessage
* (base58 encoded) *
* Note: For ETH & TRX. Result is same as following links: *
    *
  • ETH: https://github.com/MetaMask/eth-sig-util/blob/v4.0.0/src/personal-sign.ts#L27-L45
  • *
  • TRX: https://github.com/TRON-US/tronweb/blob/461934e246707bca41529ab82ebe76cf894ab460/src/lib/trx.js#L712-L731
  • *
*
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId wallet ID * @param message message to sign * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass pliantext * @param extras Extra attributes for specific currencies, pass null if unspecified. Supported extras: *
    *
  • eip55: boolean - true - Use EIP 155 format to sign message
  • *
  • is_hex: boolean - true - Send Hex as message
  • *
  • legacy: boolean - true - Use legacy sign and suggest send hex as message(is_hex set true), please also check confirmed_action_token for EVM compatible currency
  • *
  • confirmed_action_token: string - It's required for these 2 cases: *
      *
    • SOL
    • *
    • EVM compatible currency and legacy is true
    • *
    * Get the action token from [[Wallets.getSignMessageActionToken]], otherwise, the API will return [[ErrorCodes.ErrActionTokenInvalid]] error code *
  • *
*/ function walletConnectSignMessageBio( promptMessage: string, cancelButtonText: string, walletId: number, message: string, pinSecret: number | PinSecretBearer | string, extras: object ): Promise; /** * Create transaction by signed transaction(eth_sendTransaction) via WalletConnect, * this call will be logged as ApiHistoryItem with API name: eth_sendRawTransaction * * @param walletId wallet ID * @param signedTx signed transaction */ function walletConnectSendSignedTransaction( walletId: number, signedTx: string ): Promise; /** * Result of [[getWalletConnectSignedTx]] API */ type GetWalletConnectSignedTxResult = { /** Signed TX for [[walletConnectSendSignedTransaction]] */ signedTx: string; }; /** * Result of [[getWalletConnectUnsignedData]] API */ type GetWalletConnectUnsignedDataResult = { /** Unsigned data for[[walletConnectSignTypedData]], walletConnectSignTransaction]] */ unsignedData: string; }; /** * Get signed TX for [[walletConnectSendSignedTransaction]] * @param walletId wallet ID * @param accessId accessId from API history, result of [[getWalletConnectApiHistory]] */ function getWalletConnectSignedTx( walletId: number, accessId: string, ): Promise; /** * Get unsigned data for [[walletConnectSignTypedData]], [[walletConnectSignTransaction]] * @param walletId wallet ID * @param accessId accessId from API history, result of [[getWalletConnectApiHistory]] */ function getWalletConnectUnsignedData( walletId: number, accessId: string, ): Promise; /** * Get WalletConnect API history from * * @param walletId wallet ID * @param start Query start offset * @param count Query count returned * @param filters Filter parameters: *
    *
  • api_name: string - API name
  • *
  • start_time: number - Start of time period to query, in Unix timestamp
  • *
  • end_time: number - End of time period to query, in Unix timestamp
  • *
*/ function getWalletConnectApiHistory( walletId: number, start: number, count: number, filters?: object ): Promise; /** * Trigger update to add pending currency and wallet which created by [[walletConnectSendSignedTransaction]] * without filter * */ function walletConnectSync(): Promise; /** * Get pending nonce of specified wallet * without filter * * * @param walletId wallet ID */ function getNonce( walletId: number ): Promise; /** * Cancel an existing transaction which created by [[walletConnectSendSignedTransaction]] (Replace with a transaction with zero amount) * * @param walletId wallet ID * @param accessId ID of ApiHistoryItem to replace * @param transactionFee transaction object json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass pliantext */ function cancelWalletConnectTransaction( walletId: number, accessId: string, transactionFee: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Cancel an existing transaction which created by [[walletConnectSendSignedTransaction]] (Replace with a transaction with zero amount) *
Authenticate by SMS * @param actionToken action token * @param smsCode sms code * @param walletId wallet ID * @param accessId ID of ApiHistoryItem to replace * @param transactionFee transaction object json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass pliantext */ function cancelWalletConnectTransactionSms( actionToken: string, smsCode: string, walletId: number, accessId: string, transactionFee: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * Cancel an existing transaction which created by [[walletConnectSendSignedTransaction]] (Replace with a transaction with zero amount) *
Authenticate by Biometric * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * @param cancelButtonText (Android only) Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` * @param walletId wallet ID * @param accessId ID of ApiHistoryItem to replace * @param transactionFee transaction object json string * @param pinSecret User Pin code, if the type is number or PinSecretBearer means pass pinSecret, string means pass pliantext */ function cancelWalletConnectTransactionBio( promptMessage: string, cancelButtonText: string, walletId: number, accessId: string, transactionFee: string, pinSecret: number | PinSecretBearer | string ): Promise; /** * get SMS code by passing OtpType * * * @param otpType OtpType * * @param SMS expire duration */ function getSmsCode( otpType: number, duration: number ): Promise; /** * get SMS code for sign-in * * * @param SMS expire duration */ function getLoginSmsCode( duration: number ): Promise; /** * get SMS code for transaction * * * @param SMS expire duration */ function getTransactionSmsCode( duration: number ): Promise; /** * get SMS code for transaction * * * @param promptMessage Message that will be displayed in the fingerprint or face id prompt * * @param cancelButtonText (Android only)Text to be displayed for the cancel button on biometric prompts, defaults to `Cancel` */ function getSignedActionToken( promptMessage: string, cancelButtonText: number ): Promise; /** * is biometrics key pair exist */ function isBioKeyExist( ): Promise; /** * Get device's biometrics type */ function getBiometricsType( ): Promise; /** * Update device's biometrics type, biometricsType will auto assign if passed null value * * @param biometricsType BiometricsType */ function updateDeviceInfo( biometricsType: number ): Promise; /** * register public key for biometrics authentication */ function registerPubkey( ): Promise; /** * Get action token for security enhancement */ function getActionToken( ): Promise; /** * Get action token for [[Wallets.signMessage]] in these 2 cases: *
    *
  • SOL
  • *
  • EVM compatible currency and legacy is true
  • *
*/ function getSignMessageActionToken( message: string, ): Promise; /** * get market infos */ function getMarketInfos( ): Promise; /** * Get SOL NFTs for single wallet * @param walletId wallet ID */ function getSolNftTokens( walletId: number, ): Promise; } // views interface PinCodeInputViewProps extends ViewProperties { /** Maximum length of PIN code */ maxLength?: number, } interface NumericPinCodeInputViewProps extends PinCodeInputViewProps { /** Is keep the pinSecret key while notify onPinCodeChanged */ keepKey?: boolean, /** Make keypad order fixed */ fixedOrder?: boolean, /** Vibrate when keypad button pressed */ hapticFeedback?: boolean, /** Horizontal spacing of buttons in keypad */ horizontalSpacing?: number, /** Vertical spacing of buttons in keypad */ verticalSpacing?: number, // button styles /** Width of buttons */ buttonWidth?: number, /** Height of buttons */ buttonHeight?: number, /** Text size of buttons */ buttonTextSize?: number, /** Text color of buttons */ buttonTextColor?: string, /** Pressed text color of buttons */ buttonTextColorPressed?: string, /** Disabled text color of buttons */ buttonTextColorDisabled?: string, /** Background color of buttons */ buttonBackgroundColor?: string, /** Pressed background color of buttons */ buttonBackgroundColorPressed?: string, /** Disabled background color of buttons */ buttonBackgroundColorDisabled?: string, /** Border radius of buttons */ buttonBorderRadius?: number, /** Border width of buttons */ buttonBorderWidth?: number, /** Border color of buttons */ buttonBorderColor?: string, /** Pressed order radius of buttons */ buttonBorderColorPressed?: string, /** Disabled order radius of buttons */ buttonBorderColorDisabled?: string, /** (Android-only) Ripple color of buttons */ androidButtonRippleColor?: string, // backspace button styles /** Width of the BACKSPACE(⌫) button */ backspaceButtonWidth?: number, /** Height of the BACKSPACE(⌫) button */ backspaceButtonHeight?: number, /** Text size of the BACKSPACE(⌫) button */ backspaceButtonTextSize?: number, /** Text color of the BACKSPACE(⌫) button */ backspaceButtonTextColor?: string, /** Pressed text color of the BACKSPACE(⌫) button */ backspaceButtonTextColorPressed?: string, /** Disabled text color of the BACKSPACE(⌫) button */ backspaceButtonTextColorDisabled?: string, /** Background color of the BACKSPACE(⌫) button */ backspaceButtonBackgroundColor?: string, /** Pressed background color of the BACKSPACE(⌫) button */ backspaceButtonBackgroundColorPressed?: string, /** Disabled background color of the BACKSPACE(⌫) button */ backspaceButtonBackgroundColorDisabled?: string, /** Border radius of the BACKSPACE(⌫) button */ backspaceButtonBorderRadius?: number, /** Border width of the BACKSPACE(⌫) button */ backspaceButtonBorderWidth?: number, /** Border color of the BACKSPACE(⌫) button */ backspaceButtonBorderColor?: string, /** Pressed border color of the BACKSPACE(⌫) button */ backspaceButtonBorderColorPressed?: string, /** Disabled border color of the BACKSPACE(⌫) button */ backspaceButtonBorderColorDisabled?: string, /** (Android-only) Ripple color of the the BACKSPACE(⌫) button */ androidBackspaceButtonRippleColor?: string, /** Backspace text */ backspaceButtonText?: string, /** * Callback when PIN code changed * @param length length of current input */ onChanged?: (length: number) => void, } type PinSecretBearer = { /** The PinSecret retrieved from [[NumericPinCodeInputView.submit]] API */ pinSecret: number; /** To retain the pinSecret or not */ retain?: boolean; }; /** * PIN code input view Component with numeric inputs (0-9) */ class NumericPinCodeInputView extends React.Component { /** * Submit PIN code to SDK core and get PIN secret * * @returns A promise of PIN secret corresponding to current PIN code */ submit(): Promise /** * Submit PIN code to SDK core and get PIN secret(for multiple time) * * @returns A promise of PIN secret corresponding to current PIN code */ submitForMultiple(): Promise /** * Get input plain text * * @returns A promise of plain text */ submitPlain(): Promise /** * Reset current PIN code input */ clear(): void } /** * Push notification helper class provides definition of notification and helpers */ namespace PushNotification { export enum Type { /** Unknown type */ UNKNOWN = 0, /** Transaction push notification */ TRANSACTION = 1, } /** * Helper function to parse payload of Push notification * param payload The payload string from FCM, typically remoteMessage.getData().get("pinpoint.jsonBody") */ function parse(payload: string): PushNotification | TransactionNotification; } type PushNotification = { /** * Type of the notification */ type: number; } interface TransactionNotification extends PushNotification { /** Wallet ID */ walletID: number; /** Currency */ currency: number; /** Token address */ tokenAddress: string; /** Transaction direction */ direction: Wallets.Transaction.Direction; /** Transaction amount */ amount: string; /** Transaction fee */ fee: string; /** Transaction from address */ fromAddress: string; /** Transaction to address */ toAddress: string; /** Transaction timestamp */ timestamp: number; /** Transaction TXID */ txid: string; /** Transaction description */ description: string; }