Contract Details
Additional info on contract parameters and use cases
The parameters are used in the IPayload in the contract
E.g.:
const payload: ITransfer = {
amount: 100 * 10 ** 6,
receiver: 'receiverAddress',
kda: 'KLV',
}
const Contract: IContract = {
type: TransactionType.Transfer,
payload,
}
Transfer
Transfer assets to another address.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | receiver | string | Receiver address |
✅ | amount | number | Amount to be sent (precision) |
kda | string | AssetID. If empty, defaults to KLV | |
kdaRoyalties | number | Transfer royalties to pay if a fungible token has enabled the Transfer Percentage Royalties. See Royalties |
Freeze
Freezes a certain amount of a token for staking. This frozen amount will be referred as a "bucket".
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | amount | number | Amount to be frozen (with precision) |
kda | string | Defaults to KLV |
Unfreeze
Unfreezes a bucket.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | bucketId | string | Bucket to be unfrozen |
kda | string | Unfrozen asset ID, defaults to KLV if empty |
Delegate
Delegates a bucket to a validator. Buckets can only be delegated to a validator address.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | receiver | string | Address to be delegated to |
✅ | bucketId | string | Bucket to be delegated |
Undelegate
Removes the delegation of a bucket.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | bucketId | string | Bucket ID to be undelegated |
Claim
Claim either staking rewards, delegation rewards or expired marketplace orders.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | claimType | number | Check list below |
✅ | id | string | Check list below |
Claim types All claim types and your function and referral param
Type ID | Type | ID Field Description |
---|---|---|
0 | StakingClaim | Asset ID to be claimed |
1 | AllowanceClaim | Asset ID to be claimed |
2 | MarketClaim | Order ID to be claimed |
Withdraw
Retrieves the assets from an unfrozen bucket or assets from KDAPool.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | kda | string | Asset ID to be withdrawn |
withdrawType | number | 0: Staking, 1: KDAPool | |
amount | number | Amount to be withdrawn from pool | |
currencyID | string | Asset to be withdrawn from pool |
Withdraw Type
Type ID | Type Name | Description |
---|---|---|
0 | Staking | Withdraw all unstaked buckets from target asset |
1 | KDAPool | Withdraws an amount from target asset KDAPool deposits |
Create Asset
Creates a new fungible token or a NFT/SFT collection.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | name | string | Asset name |
✅ | ticker | string | Asset shorthand (ticker) |
✅ | ownerAddress | string | Owner address |
✅ | precision | number | Asset precision (0 to 8) |
uris | {[label: string]: string} | Relevant URI's | |
logo | string | Logo URI | |
initialSupply | number | Initial minted supply (fungible only) (with precision) | |
maxSupply | number | Maximum supply of the asset (with precision) | |
type | number | 0: Fungible Token, 1: NFT, 2: SFT | |
staking | Staking object | Staking info | |
✅ | royalties | Royalties object | Royalties info |
roles | {[label: string]: Role} | Other addresses roles info | |
properties | Properties object | Asset properties details | |
attributes | Attributes object | Is paused/mint stopped? |
Staking Structure
Required | Parameter | Type | Description |
---|---|---|---|
interestType | number | 0: APR, 1: FPR | |
apr | number | Percentage | |
minEpochsToClaim | number | Minimum epochs to claim rewards | |
minEpochsToUnstake | number | Minimum epochs to unstake | |
minEpochsToWithdraw | number | Minimum epochs to withdraw after unstake |
Royalties Structure
Required | Parameter | Type | Description |
---|---|---|---|
✅ | address | string | Royalty receiver address |
transferPercentage | RoyaltyInfo object array | Transfer fee for fungible tokens (precision 2) | |
transferFixed | number | Transfer fee for non-fungible tokens | |
marketPercentage | number | Market percentage fee details for non-fungible tokens (precision 2) | |
marketFixed | number | Market fixed fee for non-fungible tokens | |
itoPercentage | number | ITO percentage fee precision 2 | |
itoFixed | number | ITO fixed fee (in the currency asset precision) | |
splitRoyalties | {[address: string]: RoyaltySplitInfo} | Defines the percentage of the fees when multiple addresses receive royalties |
RoyaltySplitInfo Structure
Required | Parameter | Type | Description |
---|---|---|---|
percentTransferPercentage | number | Percentage that the given address will receive from transfer percentage precision 2 | |
percentTransferFixed | number | Percentage that the given address will receive from transfer fixed precision 2 | |
percentMarketPercentage | number | Percentage that the given address will receive from market percentage precision 2 | |
percentMarketFixed | number | Percentage that the given address will receive from market fixed precision 2 | |
percentITOPercentage | number | Percentage that the given address will receive from ito percentage precision 2 | |
percentITOFixed | number | Percentage that the given address will receive from ito fixed precision 2 |
RoyaltyInfo structure
Required | Parameter | Type | Description |
---|---|---|---|
amount | number | Max amount for that percentage | |
percentage | number | Fee % (precision 2) |
Role structure
Required | Parameter | Type | Description |
---|---|---|---|
address | string | Other wallet's address | |
hasRoleMint | boolean | Should be able to mint? | |
hasRoleSetITOPrices | boolean | Should be able to set ITO prices? |
Properties Structure
Required | Parameter | Type | Description |
---|---|---|---|
canFreeze | boolean | Should be freezable? | |
canWipe | boolean | Should be wipeable? | |
canPause | boolean | Should be pausable? | |
canMint | boolean | Should be mintable? | |
canBurn | boolean | Should be burnable? | |
canChangeOwner | boolean | Should the owner be changeable? | |
canAddRoles | boolean | Should roles be add-able? |
Attributes structure
Required | Parameter | Type | Description |
---|---|---|---|
isPaused | boolean | Should be currently paused? | |
isNFTMintStopped | boolean | Should be currently NFT mint stopped? |
Asset Trigger
Updates the properties or trigger functionalities of a fungible token, NFT collection or a single NFT.
The required parameters will depend on the trigger type. Trigger Type and AssetID are required in all of them.
Trigger Types: List with all trigger types values and its required payload
fields. You can see more info about each field here. Any parameter you send beyond the required ones will be ignored.
ID | Type | Description | Parameters |
---|---|---|---|
0 | Mint | Directly mint assets in the receiver, amount | target account, if the type is a SFT you can use the field value to set the max supply |
1 | Burn | Directly burn owned assets | amount, you can change the asset to EXAMPLESFT-1234/1 to mint directly to a SFT using the nonce. |
2 | Wipe | Directly burn assets of the target account (asset owner only). Useful mostly for stable coins | receiver, amount |
3 | Pause | Pauses all transactions of the target asset | - |
4 | Resume | Resumes all transactions of the target asset | - |
5 | ChangeOwner | Changes the asset owner | receiver |
6 | AddRole | Add a permission role to the asset | role |
7 | RemoveRole | Remove a permission role of the asset | receiver |
8 | UpdateMetadata | Update the metadata of a given NFT | mime, receiver (you may want to send transaction as well) |
9 | StopNFTMint | Stop all NFT mints for that asset (forever) | - |
10 | UpdateLogo | Updates the asset's logo | logo URI |
11 | UpdateURIs | Update the stored relevant URIs | uris URIs |
12 | ChangeRoyaltiesReceiver | Changes the address that receives royalties | receiver |
13 | UpdateStaking | Update staking params | staking |
14 | UpdateRoyalties | Update royalties params | royalties |
15 | UpdateKDAFeePool | Update KDA pool params | kdaPool |
16 | StopRoyaltiesChange | Stop royalties changes from the asset | |
17 | StopNFTMetadataChange | Stop Metadata changes for a given NFT |
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | triggerType | number | Sets the trigger type (check here) |
✅ | assetId | string | Target Asset |
receiver | string | Target address for transaction | |
amount | number | Amount (with precision) | |
uris | {[key:string]: string} | Ex: Ex: {"foo" : "http://bar.com"} | |
logo | string | Logo image URL | |
mime | string | The nature and format of the metadata | |
role | Role object array | Role for Add/Remove Role types | |
staking | Staking object | Used for updating staking params | |
royalties | Royalties object | Used for updating royalties params | |
kdaPool | KDAPool object | Used for updating kdaPool params |
Royalties structure
Required | Parameter | Type | Description |
---|---|---|---|
✅ | address | string | Royalty receiver address |
transferPercentage | RoyaltyInfo object array | Transfer fee for fungible tokens (precision 2) | |
transferFixed | number | Transfer fee for non-fungible tokens | |
marketPercentage | number | Market percentage fee details for non-fungible tokens (precision 2) | |
marketFixed | number | Market fixed fee for non-fungible tokens | |
itoPercentage | number | ITO percentage fee precision 2 | |
itoFixed | number | ITO fixed fee (in the currency asset precision) | |
splitRoyalties | {[address:string]: RoyaltySplitInfo} | Defines the percentage of the fees when multiple addresses receive royalties |
RoyaltySplitInfo structure
Required | Parameter | Type | Description |
---|---|---|---|
percentTransferPercentage | number | Percentage that the given address will receive from transfer percentage precision 2 | |
percentTransferFixed | number | Percentage that the given address will receive from transfer fixed precision 2 | |
percentMarketPercentage | number | Percentage that the given address will receive from market percentage precision 2 | |
percentMarketFixed | number | Percentage that the given address will receive from market fixed precision 2 | |
percentITOPercentage | number | Percentage that the given address will receive from ito percentage precision 2 | |
percentITOFixed | number | Percentage that the given address will receive from ito fixed precision 2 |
RoyaltyInfo structure
Required | Parameter | Type | Description |
---|---|---|---|
amount | number | Max amount for that percentage | |
percentage | number | Fee % (precision 2) |
KDAPool
Required | Parameter | Type | Description |
---|---|---|---|
✅ | active | boolean | True if the pooling should be active |
✅ | adminAddress | string | Admin Address |
✅ | fRatioKLV | number | Fixed ratio for KLV |
✅ | fRatioKDA | number | Fixed ratio for KDA |
Fixed Ratio calculation:
quotient = (Fixed ratio for KDA) / (Fixed ratio for KLV)
Ex: When Fixed ratio for KLV is 1,and the Fixed ratio for KDA is 2, the cost will be 2 KDA per 1 KLV
Warning: Always use testnet to test the KDAPool ratio before spending real assets.
Role Structure List with all role values
Required | Parameter | Type | Description |
---|---|---|---|
✅ | address | string | Target Address |
✅ | hasRoleMint | boolean | Should be able to mint? |
✅ | hasRoleSetITOPrices | boolean | Should be able to set ITO prices? |
Staking Structure
Required | Parameter | Type | Description |
---|---|---|---|
✅ | interestType | number | 0: APR, 1: FPR |
apr | number | Percentage | |
minEpochsToClaim | number | Minimum epochs to claim rewards | |
minEpochsToUnstake | number | Minimum epochs to unstake | |
minEpochsToWithdraw | number | Minimum epochs to withdraw after unstake |
Deposit
Deposits an asset into a FPR pool or into an auto-swapping fee system.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | depositType | number | 0: FPR Deposit, 1: KDA Pool, For more info, check Deposit Type |
✅ | kda | string | Target Asset |
✅ | currencyId | string | Currency to be deposited |
✅ | amount | number | Amount of currency to be deposited |
Deposit Type
Type ID | Type Name | Description |
---|---|---|
0 | FPR Deposit | Deposits an amount of currency to be distributed to all holders of target asset. |
1 | KDA Pool | Deposits an amount of KLV to pay the fees of the target asset's transactions. |
Config ITO
Sets up an Initial Token Offering for either a token or a NFT collection.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | receiverAddress | string | Wallet address that will receive the currency |
✅ | kda | string | Target Asset |
maxAmount | number | Max amount of assets sold in the ITO (precision) | |
✅ | status | number | See Status |
✅ | packInfo | {[assetID: string]: Pack[]} | Defines the currency in which the packs will be sold. |
defaultLimitPerAddress | number | Max amount of NFTs an address can buy, if specific amount is not provided. | |
whitelistStatus | number | See Status | |
whitelistInfo | {[address: string]: WhiteListInfo} | Defines specific NFT mint limit to given addresses | |
whitelistStartTime | number | Whitelist start time (in UnixTime (seconds)) | |
whitelistEndTime | number | Whitelist end time (in UnixTime (seconds)) | |
startTime | number | ITO start time (in UnixTime (seconds)) | |
endTime | number | ITO end time (in UnixTime (seconds)) |
Pack structure
Required | Parameter | Type | Description |
---|---|---|---|
✅ | amount | number | For NFTs: Amount sold; For tokens: Minimum amount for the price to be applied (with precision). |
✅ | price | number | For NFTs: Price for each NFT; For tokens: Price for that amount. |
WhiteListInfo structure
Required | Parameter | Type | Description |
---|---|---|---|
✅ | limit | number | Max amount of NFTs an address can buy. |
Status
Status Value | Status Name | Description |
---|---|---|
0 | DefaultITO | Keeps previous status value |
1 | ActiveITO | Enables ITO/Whitelist |
2 | PausedITO | Pauses ITO/Whitelist |
ITO Trigger
Updates the properties or trigger functionalities of a fungible token, NFT collection or a single NFT.
The required parameters will depend on the trigger type. Trigger Type and AssetID are required in all of them.
Trigger Types List with all trigger types values and its required payload
fields. You can see more info about each field here. Any parameter you send beyond the required ones will be ignored.
ID | Type | Description | Parameters |
---|---|---|---|
0 | SetITOPrices | Update ITOs packs prices | packInfo |
1 | UpdateStatus | Update status | status |
2 | UpdateReceiverAddress | Update receiver address | receiverAddress |
3 | UpdateMaxAmount | Update max amount of minted NFTs | maxAmount |
4 | UpdateDefaultLimitPerAddress | Update default limit per address | defaultLimitPerAddress |
5 | UpdateTimes | Update start and end time of ITO | startTime, endTime |
6 | UpdateWhitelistStatus | Update whitelist status | whitelistStatus |
7 | AddToWhitelist | Adds address to whitelist | whitelistInfo |
8 | RemoveFromWhitelist | Remove address from whitelist | whitelistInfo |
9 | UpdateWhitelistTimes | Update start and end time of whitelist | whitelistStartTime, whilelistEndTime |
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | triggerType | number | Sets the trigger type (check list above) |
✅ | kda | string | Target Asset |
receiverAddress | string | Address that will receive the currency | |
status | number | See Status | |
maxAmount | number | Maximum minted amount (with precision) | |
packInfo | {[assetID: string]: { Packs: Pack []}} | Defines the currency in which the packs will be sold. | |
defaultLimitPerAddress | number | Max amount of NFTs an address can buy, if not provided. | |
whitelistStatus | number | See Status | |
whitelistInfo | {[address: string]: WhiteListInfo } | Defines specific NFT mint limit to given addresses | |
whitelistStartTime | number | Whitelist start time (in UnixTime (seconds)) | |
whitelistEndTime | number | Whitelist end time (in UnixTime (seconds)) | |
startTime | number | ITO start time (in UnixTime (seconds)) | |
endTime | number | ITO end time (in UnixTime (seconds)) |
Obs: Javascript's Date.prototype.getTime() should be divided by 1000 for it to be converted to Unix Time (seconds)
Status
Status Value | Status Name | Description |
---|---|---|
0 | DefaultITO | Keeps previous status value |
1 | ActivelTO | Enables ITO/Whitelist |
2 | PausedITO | Pauses ITO/Whitelist |
Pack structure
Required | Parameter | Type | Description |
---|---|---|---|
✅ | amount | number | For NFTs: Amount sold; For token: Min amount for that price to be applied (with precision). |
✅ | price | number | For NFTs: Price for each NFT; For Tokens: Price for that amount. |
WhiteListInfo structure
Required | Parameter | Type | Description |
---|---|---|---|
✅ | limit | number | Max amount of NFTs an address can buy. |
Set ITO Prices
DEPRECATED: Updates the ITO prices, useful for ITO's that use an oracle-like pricing system.
This contract is deprecated, please use an ITO Trigger of type SetITOPrices.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | kda | string | Target Asset |
✅ | packinfo | {[assetID: string]: Pack []} | Defines the currency in which the packs will be sold. |
Pack structure
Required | Parameter | Type | Description |
---|---|---|---|
✅ | amount | number | For NFTs: Amount sold; For token: Min amount for that price to be applied (with precision). |
✅ | price | number | For NFTs: Price for each NFT; For Tokens: Price for that amount. |
Create Marketplace
Creates a marketplace
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | name | string | Marketplace name |
referralAddress | string | Royalties receiving address | |
referralPercentage | number | Royalties percentage (precision 2) |
Config Marketplace
Changes the parameters of a marketplace
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | name | string | New marketplace name |
✅ | marketplaceId | string | Target Marketplace ID |
✅ | referralPercentage | number | New referral percentage (precision 2) |
referralAddress | string | New referral address |
Sell
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | marketType | number | 0: Instant Sell, 1: Auction |
✅ | marketplaceId | string | Maketplace ID in which the sell order will be created |
✅ | assetId | string | Asset to be sold |
✅ | currencyId | string | Transaction currency token |
price | number | Price for instant sell (with precision) | |
reservePrice | number | Minimum auction price (with precision) | |
✅ | endTime | number | Expiration sell time (in Unix Time). Max end time = 1 Year from creation date |
price is required on Instant Sell Orders, but optional in Auction Orders. As explained below:
Required | MarketType | Price | Meaning |
---|---|---|---|
✅ | 0 (Instant Sell) | Price for instant sell | Bids above this price instantly sell, ending the auction. |
1 (Auction) | Price | Auction start price. |
Obs: Javascript's Date.prototype.getTime() should be divided by 1000 for it to be converted to Unix Time (seconds)
Buy
Creates a buy (or bid) order for a given market sell order.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | buyType | number | 0: ITOBuy, 1: MarketBuy |
✅ | id | string | ITOBuy: ITO Asset ID, MarketBuy: order ID |
✅ | currencyId | string | ID of the trade currency |
✅ | amount | number | ITOBuy: Amount to be bought, MarkeyBuy: item price / amount bidden(check precision) |
Send the 'amount' parameter with the correct precision based on the currency asset
Cancel Market Order
Cancels a sell order
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | orderId | string | ID generated on 'Sell Order' |
Proposal
Creates a proposal to change the chain network parameters.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | parameters | {[paramKeyID:number]: string} | A object that includes all chain parameters you would like to propose a change. (The value will most likely be a numeric string for current parameters) See parameter list below for correct key input |
✅ | epochsDuration | number | Proposal epochs duration |
description | string | Proposal description |
Parameter key
ID | Type | Description |
---|---|---|
0 | FeePerDataByte | Bandwidth fee value |
1 | KAppFeeCreateValidator | Create validator fee value |
2 | KAppFeeCreateAsset | Asset fee value |
3 | MaxEpochsUnclaimed | Max unclaimed time (in epochs) for buckets |
4 | MinSelfDelegatedAmount | Min self-delegated amount needed to be a validator |
5 | MinTotalDelegatedAmount | Min total delegated amount needed to be a validator |
6 | BlockRewards | Block rewards for validators |
7 | StakingRewards | Staking rewards value |
8 | KApp Fee for Transfer | KApp Fee for Transfer |
9 | KApp Fee for Asset Trigger | KApp Fee for Asset Trigger |
10 | KApp Fee for Validator Config | KApp Fee for Validator Config |
11 | KApp Fee for Freeze | KApp Fee for Freeze |
12 | KApp Fee for Unfreeze | KApp Fee for Unfreeze |
13 | KApp Fee for Delegation | KApp Fee for Delegation |
14 | KApp Fee for Delegation | KApp Fee for Delegation |
15 | KApp Fee for Withdraw | KApp Fee for Withdraw |
16 | KApp Fee for Claim | KApp Fee for Claim |
17 | KApp Fee for Unjail | KApp Fee for Unjail |
18 | KApp Fee for Account Name | KApp Fee for Account Name |
19 | KApp Fee for Proposal | KApp Fee for Proposal |
20 | KApp Fee for Vote | KApp Fee for Vote |
21 | KApp Fee for Config ITO | KApp Fee for Config ITO |
22 | KApp Fee for Set ITO Prices | KApp Fee for Set ITO Prices |
23 | KApp Fee for Buy | KApp Fee for Buy |
24 | KApp Fee for Sell | KApp Fee for Sell |
25 | KApp Fee for Cancel Market Order | KApp Fee for Cancel Market Order |
26 | KApp Fee for Marketplace Creation | KApp Fee for Marketplace Creation |
27 | KApp Fee for Config Marketplace | KApp Fee for Config Marketplace |
28 | KApp Fee for Update Account Permission | KApp Fee for Update Account Permission |
29 | Max NFT Mint per batch | Max NFT Minted in one contract |
30 | Min KFI staked to enable Proposals Kapps | Min overall KFI staked to enable Proposals |
31 | Min KLV Bucket Amount | Minimum KLV Amount per bucket |
32 | Max bucket size | Max buckets per account |
33 | Leader Validator rewards percentage | Leader Validator rewards percentage |
34 | Max Epochs for active proposal duration | Max Epochs an proposal will remain active |
35 | KApp Fee for ITO Trigger | KApp Fee for ITO Trigger |
36 | KApp Fee for Deposit | KApp Fee for Deposit |
Vote
Votes on an active proposal, the weight of the vote depends on the staked KFI of the sender address (The KFI is not consumed).
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | amount | number | Weight of the vote, maximum amount depends on address' KFI |
✅ | proposalId | number | Proposal id to be voted in |
✅ | type | number | 0: Vote Yes, 1: Vote No |
Create Validator
Creates a validator for an address, controlled by a BLS key.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | name | string | Validator name |
✅ | ownerAddress | string | Owner address |
✅ | rewardAddress | string | Rewards address |
✅ | blsPublicKey | string | BLS public key |
canDelegate | boolean | Permission to delegate | |
maxDelegationAmount | number | Max delegation amount | |
commission | number | Validation commission (precision 2) | |
logo | string | Logo URI | |
uris | {[key: string]: string} * | Relevant URI's |
*Object in which the keys are the URI labels and the values are the URIs
Config Validator
Changes the params of a given validator.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
name | string | Change validator name | |
rewardAddress | string | Change rewards address | |
✅ | blsPublicKey | string | Change BLS public key |
canDelegate | boolean | Change permission to delegate | |
commission | number | Change commission (precision 2) | |
maxDelegationAmount | number | Change max delegation amount | |
logo | string | Change logo | |
uris | {[key: string]: string} * | Change uris |
*Object in which the keys are the URI labels and the values are the URIs
Unjail
Sends an unjail request for the sender validator address.
Payload Parameters
Send Unjail request of sender address, no params required.
Set Account Name
Defines a name for the account.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | name | string | Set sender account's name |
Update Account Permission
Updates the permissions of an account, setting multi-signature permissions with a set signature threshold. Useful for creating a safely shared account.
Payload Parameters
Required | Parameter | Type | Description |
---|---|---|---|
✅ | permissions | Array of AccPermission Object | Set sender account's name |
AccPermission structure
Required | Parameter | Type | Description |
---|---|---|---|
✅ | type | number | 0: Owner, 1: User |
✅ | permissionName | string | Permission identifier |
✅ | threshold | number | Minimum sign amount to permit transaction |
✅ | operations | string | See Operations |
✅ | signers | AccKey object array | Defines the |
weight of the accounts' votes |
AccKey structure
Required | Parameter | Type | Description |
---|---|---|---|
✅ | address | string | Target address |
✅ | weight | number | Target address vote weight |
Operations
The operations
property defines which operations the account should be able to do.
The value that this property receives is a hexadecimal string, where each bit represents a contract.
Ex:
"01af" is the hexadecimal to 000110101111.
The 1's represent the contracts it should be able to do (following this table)
This account will be able to do contracts of type 0, 1, 2, 3, 5, 7, 8 (Transfer, Create Asset, Create Validator, Config Validator, Unfreeze, Undelegate, Withdraw).
Relevant Link: binary to hex calculator
After getting the hexadecimal string, you need to invert the byte order, for proper processing in the blockchain.
you can use either of the following JS code to do so:
utils.parseAccountPermissionBinaryOperations('000110101111')
utils.reverseHexBytes('01af')
Both return the same "af01" which is the correct value for said operations.