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:
int256
TokenAmount - Total DataCap token supply.
func Balance(params Address) TokenAmount {}
Return the DataCap token balance for the wallet address.
unit
BalanceOfMethodNum: 3261979605.
Params:
bytes
Address - the wallet address.
Results:
int256
TokenAmount - 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:
struct
TransferParamsbytes
To - the address to receive DataCap token.int256
Amount - A non-negative amount to transfer.bytes[]
OperatorData - Arbitrary data to pass on via the receiver hook.
Results:
struct
TransferReturnint256
FromBalance - the balance of from_address.int256
ToBalance - the balance of to_address.bytes
RecipientData: 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:
bytes
TransferFromParamsbytes
From - the address to send DataCap Token.bytes
To - the address to receive DataCap Token.int256
Amount - A non-negative amount to transfer.bytes
OperatorData: Arbitrary data to pass on via the receiver hook.
Results:
struct
TransferFromReturnint256
FromBalance - the balance of from_address.int256
ToBalance - the balance of to_address.int256
Allowance - the remaining allowance of owner address.bytes
RecipientData - 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:
struct
IncreaseAllowanceParamsbytes
Operator - the wallet address of the operator.int256
increaseAmount - increase DataCap token allowance for the operator address.
Results:
int256
TokenAmount - 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:
struct
DecreaseAllowanceParamsbytes
Operator - the wallet address of the operator.int256
IncreaseAmount - the decreased DataCap token allowance of the operator address.
Results:
int256
TokenAmount - 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:
struct
RevokeAllowanceParamsbytes
Operator - the wallet address of the operator.
Results:
int256
TokenAmount - 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:
struct
BurnParamsint256
Amount - the amount the DataCap token to be burned.
Results:
int256
TokenAmount - 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:
struct
BurnFromParamsbytes
Owner - the wallet address of the owner.int256
Amount - the amount of DataCap token to be burned.
Results:
struct
BurnFromReturnbytes
Owner - the wallet address of the owner.int256
Amount - the new balance of owner wallet.
func Allowance(params GetAllowanceParams) TokenAmount {}
Return the allowance between owner and operator address.
uint
AllowanceMethodNum = 4205072950;
Params:
struct
GetAllowanceParamsbytes
Owner : the wallet address of the owner.bytes
Operator : the wallet address of the owner.
Results:
int256
TokenAmount - the allowance that an operator can control of an owner's allowance.