action
action module
action object
Usage:use in js contract of fibos
1 | var js_code = `exports.hi = v => console.error(action.is_account(action.account), action.is_account("notexists"));`; |
Static function
is_account
check whether the account exist
1 | action.is_account(name); |
Parameter Usage:
- name: String, account name
Results:
- Boolean, if the account exist then return true, otherwise retrun false
Example:
1 | exports.hi = v => { |
has_recipient
after action executed,the account names name will receive a notification
1 | action.has_recipient(name); |
Parameter Usage:
- name: String,
Results:
- Boolean, if the account names name received notification then returns true,otherwise returns false
Example:
1 | exports.hi = v => { |
require_recipient
add specific account to notification list
1 | action.require_recipient(name); |
Parameter Usage:
- name: String, account name
Example:
1 | exports.hi = v => { |
Note:A notification message sent by one contract to another is a message received by the contract, including code, action, and parameters.
has_auth
Verify that the action requires authorization for a specific account
1 | action.has_auth(name); |
Parameter Usage:
- name: String, the account name to be verified
Results:
- Boolean, if this account authorization is required then returns true,otherwise returns false
Example:
1 | exports.hi = v => { |
require_auth
Add a specific account and corresponding permissions to the action’s authorization list, and an exception is returned if the addition fails
1 | action.require_auth(name, permission); |
Parameter Usage:
- name: String, The account name to be verified.
- permission: String, Permission to authorize this account is required
Example:
1 | exports.hi = v => { |
Static Property
name
action name
Type: String
Example:
1 | exports.hi = v => { |
account
action sender account name
Type: String
Example:
1 | exports.hi = v => { |
receiver
action receiver
Type: String
Example:
1 | exports.hi = v => { |
publication_time
Return the millisecond number of block produced since 1970.01.01 0pm 0min 0sec (UTC)
Type: Number
Example:
1 | exports.hi = v => { |
authorization
Executing action requires all the accounts in array authorized
Type: Array
Example:
1 | exports.hi = v => { |