DataCap Actor is responsible for DataCap token management.
The ActorCode for DataCap actor is hex"0007" which will be used to call DataCap actor APIs. You also need to specify method number of which method you want to invoke. Please refer the each method for its method number.
func Name() String {}Return the name of DataCap token which is 'DataCap'.
Unit NameMethodNum : 48890204.
Params:
- null
Results:
String: DataCap
func Symbol() String {}Return the symbol of DataCap token which is 'DCAP'.
unit SymbolMethodNum: 2061153854.
Params:
- null
Results:
String: DCAP
func TotalSupply() TokenAmount {}Return the total supply of DataCap token.
uint TotalSupplyMethodNum: 114981429.
Params:
- null
Results:
int256TokenAmount - Total DataCap token supply.
func Balance(params Address) TokenAmount {}Return the DataCap token balance for the wallet address.
unit BalanceOfMethodNum: 3261979605.
Params:
bytesAddress - the wallet address.
Results:
int256TokenAmount - the DataCap token balance for the specified wallet address.
func Transfer(params TransferParams) TransferReturn {}Transfers DataCap tokens from caller address to the to address.
uint TransferMethodNum = 80475954;
Params:
structTransferParamsbytesTo - the address to receive DataCap token.int256Amount - A non-negative amount to transfer.bytes[]OperatorData - Arbitrary data to pass on via the receiver hook.
Results:
structTransferReturnint256FromBalance - the balance of from_address.int256ToBalance - the balance of to_address.bytesRecipientData: data returned from receive hook.
func TransferFrom(params TransferFromParams) TransferFromReturn {}Transfers DataCap tokens between from the from_address to the to_address.
uint TransferFromMethodNum = 3621052141.
Params:
bytesTransferFromParamsbytesFrom - the address to send DataCap Token.bytesTo - the address to receive DataCap Token.int256Amount - A non-negative amount to transfer.bytesOperatorData: Arbitrary data to pass on via the receiver hook.
Results:
structTransferFromReturnint256FromBalance - the balance of from_address.int256ToBalance - the balance of to_address.int256Allowance - the remaining allowance of owner address.bytesRecipientData - data returned from receive hook.
func IncreaseAllowance(params IncreaseAllowanceParams) TokenAmount {}Increase the DataCap token allowance that an operator can control of the owner's balance by the requested amount.
uint IncreaseAllowanceMethodNum = 1777121560.
Params:
structIncreaseAllowanceParamsbytesOperator - the wallet address of the operator.int256increaseAmount - increase DataCap token allowance for the operator address.
Results:
int256TokenAmount - the new DataCap allowance of the operator address.
func DecreaseAllowance(params DecreaseAllowanceParams) TokenAmount {}Decrease the DataCap token allowance that an operator controls of the owner's balance by the requested amount.
uint DecreaseAllowanceMethodNum = 1529376545;
Params:
structDecreaseAllowanceParamsbytesOperator - the wallet address of the operator.int256IncreaseAmount - the decreased DataCap token allowance of the operator address.
Results:
int256TokenAmount - the new DataCap allowance of the operator address.
func RevokeAllowance(params RevokeAllowanceParams) TokenAmount {}Revoke the DataCap token allowance from the operator and set the operator's allowance in behave of owner/caller address to 0.
uint RevokeAllowanceMethodNum = 2765635761.
Params:
structRevokeAllowanceParamsbytesOperator - the wallet address of the operator.
Results:
int256TokenAmount - the old Allowance amount of the operator address.
func Burn(params BurnParams) TokenAmount {}Burn an amount of DataCap token from the owner/caller address, decreasing total token supply.
uint BurnMethodNum = 1434719642.
Params:
structBurnParamsint256Amount - the amount the DataCap token to be burned.
Results:
int256TokenAmount - the updated DataCap token balance of the owner/caller address.
func BurnFrom(params BurnFromParams) BurnFromReturn {}Burn an amount of DataCap token from the specified address (owner address), decrease the allowance of operator/caller, and decrease total token supply.
uint BurnFromMethodNum = 2979674018.
Params:
structBurnFromParamsbytesOwner - the wallet address of the owner.int256Amount - the amount of DataCap token to be burned.
Results:
structBurnFromReturnbytesOwner - the wallet address of the owner.int256Amount - the new balance of owner wallet.
func Allowance(params GetAllowanceParams) TokenAmount {}Return the allowance between owner and operator address.
uint AllowanceMethodNum = 4205072950;
Params:
structGetAllowanceParamsbytesOwner : the wallet address of the owner.bytesOperator : the wallet address of the owner.
Results:
int256TokenAmount - the allowance that an operator can control of an owner's allowance.