Private
notePrivate
txPrivate
addPrivate
adoptPrivate
commitCreate proof for the secret account created.
An AppResp
object with data
property of type 'string[]' which contains a batch of proof for the createAccount.
The password used to decrypt the SecretAccount.
Private
createPrivate
createPrivate
curlCreate proof for the deposit of the asset from L1 to L2.
An AppResp
object with data
property of type 'string[]' which contains a batch of proof for the deposit.
The receiver account address for the deposit.
The amount of asset to be deposited.
The token to be deposited.
The nonce of the current transaction, usually obtained from a wallet like Metamask.
Private
fetchObtain user balance.
An AppResp
object with data
property of type 'Map' which contains user balance.
{
"assetInfo": [
{
"assetId": 2,
"balance": "20",
"tokenInfo": {
"chainId": "1",
"address": "0x0165878A594ca255338adfa4d48449f69242Eb8F",
"name": "TT",
"symbol": "TT",
"decimals": 18,
"logoURI": "https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/ethereum/assets/0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2/logo.png",
"extensions": ""
},
"balanceUSD": 20,
"profit24Hour": 0,
"return": 0
}
],
"totalBalanceUSD": 20,
"totalProfit24Hour": 0,
"totalReturn": 0
}
Private
getRetrieve all current user's unspent notes.
An AppResp
object with data
property of type Array<Note>
if notes are successfully retrieved.
is false if all notes(with val 0) are required to return
Fetch registered token list from server
token symbol to token asset id and it's contract address, e.g. { message: 'Success', errno: 0, data: [ { assetId: '2', latest_price: 1, latest_24h_price: 1, tokenInfo: { chainId: '', address: '0x0165878A594ca255338adfa4d48449f69242Eb8F', name: 'Unknown Token', symbol: '', decimals: 18, logoURI: '', extensions: '' } } ] }
Create proof for migrating the account to another ETH address.
An AppResp
object with data
property of type 'string[]' which contains a batch of proof for the migrateAccount.
The account key that which user renews.
The password used to decrypt the SecretAccount.
Creates proof for sending an asset from the sender to the receiver in L2.
An AppResp
object with data
property of type 'string[]' which contains a batch of proof for the send.
The receiver account address for the send.
The receiver's alias or ‘__DEFAULT_ALIAS__’.
The amount of asset to be sent.
The token to be sent.
Create a proof for updating the user's signing key.
An AppResp
object with data
property of type 'string[]' which contains a batch of proof for the updateAccount.
The new signing key to be updated to.
The password used to decrypt the SecretAccount.
Private
updateCreates a proof for withdrawing an asset from L2 to L1.
An AppResp
object with data
property of type 'string[]' which contains a batch of proof for the withdraw.
The amount to be withdrawn.
The token to be withdrawn.
Static
curlStatic
initSDKFromInitializes the SDK from either an existing account or no account.
An AppResp
object with data
property of type 'class' that contains the initialized SecretSDK
instance.
The address of the server to connect to.
The password used to encrypt the SecretAccount for secure storage.
The Ethereum address of the user.
The JSON object for the contract.
The path to the circuit file.
The ABI of the contract.
Optional
isCreate: boolean = falsethe flag indicating whether to create a new account. Optional.
Generated using TypeDoc
SecretSDK interface