Const
Bid to name auction
Domain name
Name fee (bid fee)
Options
Transaction result
const name = 'test.chain'
const bidFee = computeBidFee(name, { startFee, increment: 0.42 })
await sdkInstance.aensBid(name, 213109412839123, { ttl, fee, nonce })
Claim a previously preclaimed registration. This can only be done after the preclaim step
AENS name
Salt from pre-claim, or 0 if it's a bid or claiming without preclaim (in Ceres)
options
Transaction result
const name = 'test.chain'
const salt = preclaimResult.salt // salt from pre-claim transaction
await sdkInstance.aensClaim(name, salt, { ttl, fee, nonce, nameFee })
Preclaim a name. Sends a hash of the name and a random salt to the node
AENS name
Options
const name = 'test.chain'
const salt = preclaimResult.salt // salt from pre-claim transaction
await sdkInstance.aensPreclaim(name, { ttl, fee, nonce })
{
...transactionResult,
claim, // Claim function (options={}) => claimTransactionResult
salt,
commitmentId
}
Query the AENS name info from the node and return the object with info and predefined functions for manipulating name
AENS name
Options
const nameObject = sdkInstance.aensQuery('test.chain')
console.log(nameObject)
{
id, // name hash
pointers, // array of pointers
update, // Update name function
extendTtl, // Extend Ttl name function
transfer, // Transfer name function
revoke // Revoke name function
}
Revoke a name
Name hash
Options
Transaction result
const name = 'test.chain'
const nameObject = await sdkInstance.aensQuery(name)
await sdkInstance.aensRevoke(name, { fee, ttl , nonce })
// or
await nameObject.revoke({ fee, ttl, nonce })
Transfer a domain to another account
AENS name
Recipient account publick key
Options
Transaction result
const name = 'test.chain'
const recipientPub = 'ak_asd23dasdas...'
const nameObject = await sdkInstance.aensQuery(name)
await sdkInstance.aensTransfer(name, recipientPub, { ttl, fee, nonce })
// or
await nameObject.transfer(recipientPub, { ttl, fee, nonce })
Update a name
AENS name
Map of pointer keys to corresponding addresses
Options
Invalid pointer array error
const name = 'test.chain'
const pointersArray = ['ak_asd23dasdas...,' 'ct_asdf34fasdasd...']
const nameObject = await sdkInstance.aensQuery(name)
await sdkInstance.aensUpdate(name, pointersArray, { nameTtl, ttl, fee, nonce, clientTtl })
// or
await nameObject.update(pointers, { nameTtl, ttl, fee, nonce, clientTtl })
Build a transaction hash the same as Auth.tx_hash
by GaMetaTx payload
Transaction hash
Helper to generate a signature to delegate
Address of contract to delegate access
The list of id's to prepend
Options
Optional
isOptional
omitPrepend delegation signature with an account address
Account to use
Node to use
Signature
use methods sign*DelegationToContract
of Account instance instead
const aeSdk = new AeSdk({ ... })
const contractAddress = 'ct_asd2ks...'
const aensName = 'example.chain'
const onAccount = new MemoryAccount(...) // Sign with a specific account
// Preclaim signature
const preclaimSig = await aeSdk.createDelegationSignature(contractAddress, [], { onAccount })
// Claim, transfer and revoke signature
const aensDelegationSig = await aeSdk
.createDelegationSignature(contractAddress, [aensName], { onAccount })
const oracleQueryId = 'oq_...'
const onAccount = new MemoryAccount(...) // Sign with a specific account
// Oracle register and extend signature
const oracleDelegationSig = await aeSdk
.createDelegationSignature(contractAddress, [], { onAccount })
// Oracle respond signature
const respondSig = await aeSdk
.createDelegationSignature(contractAddress, [oracleQueryId], { onAccount, omitAddress: true })
Convert current account to GA
Authorization function name
init arguments
Options
General Account Object
Extend oracle ttl
Options object
Oracle object
Get account by account public key
Account address (public key)
Options
Optional
hash?: `kh_${string}` | `mh_${string}`Get account on specific block by micro block hash or key block hash
Optional
height?: numberGet account on specific block by block height
Node to use
Request the balance of specified account
The public account address to obtain the balance for
Options
Get contract entry
Get contract byte code
Obtain current generation
Current Generation
Get generation by hash or height
Generation
Get key block
Key Block
Get micro block header
Micro block header
Get micro block transactions
Transactions
Get name entry
Constructor for Oracle Object (helper object for using Oracle)
Oracle public key
Options
Oracle object
Constructor for OracleQuery Object (helper object for using OracleQuery)
Oracle public key
Oracle Query id
Options
OracleQuery object
Submit transaction of another account paying for it (fee and gas)
tx_
Options
Object Transaction
Return transaction details if it is mined, fail otherwise. If the transaction has ttl specified then would wait till it leaves the mempool. Otherwise would fail if a specified amount of blocks were mined.
The transaction as it was mined
Poll for oracle queries
Oracle public key
OnQuery callback
Options object
Callback to stop polling function
Poll for oracle query response
OracleQuery object
Post query to oracle
Oracle public key
Oracle query object
Options object
Query object
Register oracle
Format of query
Format of query response
Options
Oracle object
Resolve AENS name and return name hash
AENS name or address
in AENS pointers record
Options
Node to use
Optional
resolveEnables pointer resolving using node
Optional
verify?: booleanTo ensure that name exist and have a corresponding pointer // TODO: avoid that to don't trust to current api gateway
Address or AENS name hash
Extend oracle ttl
Oracle query id
Oracle query response
Options object
Oracle object
Signs and submits transaction for mining
Transaction to sign and submit
Options
Transaction details
Send coins to another account
Amount to spend
Address or name of recipient account
Options
Transaction
Spend a fraction of coin balance to another account. Useful if needed to drain account balance completely, sending funds to another account (with fraction set to 1).
Fraction of balance to spend (between 0 and 1)
Address or name of recipient account
Options
// `fraction` * 100 = % of AE to be transferred (e.g. `0.42` for 42% or `1` for 100%)
const { blockHeight } = await aeSdk.transferFunds(
0.42,
'ak_21A27UVVt3hDkBE5J7rhhqnH5YNb4Y1dqo4PnSybrH85pnWo7E',
);
console.log('Transaction mined at', blockHeight);
Transaction dry-run
transaction to execute
address that will be used to execute transaction
Options
Optional
combine?: booleanEnables combining of similar requests to a single dry-run call
Node to use
Optional
top?: number | `kh_${string}` | `mh_${string}`hash of block on which to make dry-run
Optional
txcollect and return on-chain tx events that would result from the call
Wait for transaction confirmation
Current Height
Generated using TypeDoc
Type