eosjs API学习

getCurrencyBalance


"get_currency_balance": {
  "params": {
    "code": "name",
    "account": "name",
    "symbol": "optional<string>"
  },
  "results": "asset[]"
}

getCurrencyStats


"get_currency_stats": {
  "params": {
    "code": "name",
    "symbol": "string"
  },
  "results": {
    "supply": "asset",
    "max_supply": "asset",
    "issuer": "account_name"
  }
}

getProducers


"get_producers": {
  "brief": "Fetch smart contract data from producer.",
  "params": {
    "json": { "type": "bool", "default": false},
    "lower_bound": "string",
    "limit": {"type": "uint32", "default": "10"}
  },
  "results": {
    "rows": {
      "type": "vector",
      "doc": "one row per item, either encoded as hex String or JSON object"
    },
    "total_producer_vote_weight": {
      "type": "float64",
      "doc": "total vote"
    },
    "more": {
      "type": "string",
      "doc": "fill lower_bound with this value to fetch more rows"
    }
  }
}

getInfo


"get_info": {
  "brief": "Return general network information.",
  "params": null,
  "results": {
    "server_version" : "string",
    "head_block_num" : "uint32",
    "last_irreversible_block_num" : "uint32",
    "last_irreversible_block_id" : "block_id",
    "head_block_id" : "block_id",
    "head_block_time" : "time_point_sec",
    "head_block_producer" : "account_name",
    "virtual_block_cpu_limit" : "uint64",
    "virtual_block_net_limit" : "uint64",
    "block_cpu_limit" : "uint64",
    "block_net_limit" : "uint64"
  }
}

getBlock


"get_block": {
  "brief": "Fetch a block from the blockchain.",
  "params": {
    "block_num_or_id": "string"
  },
  "results": "variant",
  "errors": {
    "unknown block": null
  }
}

getAccount


"get_account": {
  "brief": "Fetch a blockchain account",
  "params": {
    "account_name": "name"
  },
  "results": {
    "account_name": "name",
    "privileged": "bool",
    "last_code_update": "time_point",
    "created": "time_point",
    "ram_quota": "int64",
    "net_weight": "int64",
    "cpu_weight": "int64",
    "net_limit": "int64",
    "cpu_limit": "int64",
    "ram_usage": "int64",
    "permissions": "vector<permission>",
    "total_resources": "variant",
    "delegated_bandwidth": "variant",
    "voter_info": "variant"
  }
}

getCode


"get_code": {
  "brief": "Fetch smart contract code",
  "params": {
    "account_name": "name"
  },
  "results": {
    "account_name": "name",
    "wast": "string",
    "code_hash": "sha256",
    "abi": "optional<abi_def>"
  }
}

getTableRows


"get_table_rows": {
  "brief": "Fetch smart contract data from an account.",
  "params": {
    "json": { "type": "bool", "default": false},
    "code": "name",
    "scope": "name",
    "table": "name",
    "table_key": "string",
    "lower_bound": {"type": "string", "default": "0"},
    "upper_bound": {"type": "string", "default": "-1"},
    "limit": {"type": "uint32", "default": "10"}
  },
  "results": {
    "rows": {
      "type": "vector",
      "doc": "one row per item, either encoded as hex String or JSON object"
    },
    "more": {
      "type": "bool",
      "doc": "true if last element"
    }
  }
}

abiJsonToBin


"abi_json_to_bin": {
  "brief": "Manually serialize json into binary hex.  The binayargs is usually stored in Action.data.",
  "params": {
    "code": "name",
    "action": "name",
    "args": "bytes"
  },
  "results": {
    "binargs": "bytes"
  }
}

abiBinToJson


"abi_bin_to_json": {
  "brief": "Convert bin hex back into Abi json definition.",
  "params": {
    "code": "name",
    "action": "name",
    "binargs": "bytes"
  },
  "results": {
    "args": "bytes",
    "required_scope": "name[]",
    "required_auth": "name[]"
  }
}

getRequiredKeys


"get_required_keys": {
  "params": {
    "transaction": "transaction",
    "available_keys": "set[public_key]"
  },
  "results": "Set[public_key]"
}

pushBlock


"push_block": {
  "brief": "Append a block to the chain database.",
  "params": {
    "block": "signed_block"
  },
  "results": null
}

pushTransaction


"push_transaction": {
  "brief": "Attempts to push the transaction into the pending queue.",
  "params": {
    "signed_transaction": "signed_transaction"
  },
  "results": {
    "transaction_id": "fixed_bytes32",
    "processed": "bytes"
  }
}

pushTransactions


"push_transactions": {
  "brief": "Attempts to push transactions into the pending queue.",
  "params": {
    "signed_transaction[]": "signed_transaction"
  },
  "results": "vector[push_transaction.results]"
}

getActions


"get_actions": {
  "params": {
    "account_name": "account_name",
    "pos": "int32?",
    "offset": "int32?"
  },
  "results": {
    "actions": "ordered_action_result[]",
    "last_irreversible_block": "uint32",
    "time_limit_exceeded_error": "bool?"
  },
  "structs": [{
    "name": "ordered_action_result",
    "fields": {
      "global_action_seq": "uint64",
      "account_action_seq": "int32",
      "block_num": "uint32",
      "block_time": "block_timestamp_type",
      "action_trace": "variant"
    }
  }]
}

getControlledAccounts


"get_controlled_accounts": {
  "params": {
    "controlling_account": "account_name"
  },
  "results": {
    "controlled_accounts": "account_name[]"
  }
}

getKeyAccounts


"get_key_accounts": {
  "params": {
    "public_key": "public_key_type"
  },
  "results": {
    "account_names": "account_name[]"
  }
}

getTransaction


"get_transaction": {
  "brief": "Retrieve a transaction from the blockchain.",
  "params": {
    "id": "transaction_id_type"
  },
  "results": {
    "id": "transaction_id_type",
    "trx": "variant",
    "block_time": "block_timestamp_type",
    "block_num": "uint32",
    "last_irreversible_block": "uint32",
    "traces": "variant[]"
  }
}

bidname


"bidname": {
  "base": "",
  "action": {
    "name": "bidname",
    "account": "eosio"
  },
  "fields": {
    "bidder": "account_name",
    "newname": "account_name",
    "bid": "asset"
  }
}

buyram


"buyram": {
  "base": "",
  "action": {
    "name": "buyram",
    "account": "eosio"
  },
  "fields": {
    "payer": "account_name",
    "receiver": "account_name",
    "quant": "asset"
  }
}

buyrambytes


"buyrambytes": {
  "base": "",
  "action": {
    "name": "buyrambytes",
    "account": "eosio"
  },
  "fields": {
    "payer": "account_name",
    "receiver": "account_name",
    "bytes": "uint32"
  }
}

canceldelay


"canceldelay": {
  "base": "",
  "action": {
    "name": "canceldelay",
    "account": "eosio"
  },
  "fields": {
    "canceling_auth": "permission_level",
    "trx_id": "transaction_id_type"
  }
}

claimrewards


"claimrewards": {
  "base": "",
  "action": {
    "name": "claimrewards",
    "account": "eosio"
  },
  "fields": {
    "owner": "account_name"
  }
}

delegatebw


"delegatebw": {
  "base": "",
  "action": {
    "name": "delegatebw",
    "account": "eosio"
  },
  "fields": {
    "from": "account_name",
    "receiver": "account_name",
    "stake_net_quantity": "asset",
    "stake_cpu_quantity": "asset",
    "transfer": "bool"
  }
}

deleteauth


"deleteauth": {
  "base": "",
  "action": {
    "name": "deleteauth",
    "account": "eosio"
  },
  "fields": {
    "account": "account_name",
    "permission": "permission_name"
  }
}

linkauth


"linkauth": {
  "base": "",
  "action": {
    "name": "linkauth",
    "account": "eosio"
  },
  "fields": {
    "account": "account_name",
    "code": "account_name",
    "type": "action_name",
    "requirement": "permission_name"
  }
}

newaccount


"newaccount": {
  "base": "",
  "action": {
    "name": "newaccount",
    "account": "eosio"
  },
  "fields": {
    "creator": "account_name",
    "name": "account_name",
    "owner": "authority",
    "active": "authority"
  }
}

onerror


"onerror": {
  "base": "",
  "action": {
    "name": "onerror",
    "account": "eosio"
  },
  "fields": {
    "sender_id": "uint128",
    "sent_trx": "bytes"
  }
}

refund


"refund": {
  "base": "",
  "action": {
    "name": "refund",
    "account": "eosio"
  },
  "fields": {
    "owner": "account_name"
  }
}

regproducer


"regproducer": {
  "base": "",
  "action": {
    "name": "regproducer",
    "account": "eosio"
  },
  "fields": {
    "producer": "account_name",
    "producer_key": "public_key",
    "url": "string",
    "location": "uint16"
  }
}

regproxy


"regproxy": {
  "base": "",
  "action": {
    "name": "regproxy",
    "account": "eosio"
  },
  "fields": {
    "proxy": "account_name",
    "isproxy": "bool"
  }
}

reqauth


"require_auth": {
  "base": "",
  "action": {
    "name": "reqauth",
    "account": "eosio"
  },
  "fields": {
    "from": "account_name"
  }
}

sellram


"sellram": {
  "base": "",
  "action": {
    "name": "sellram",
    "account": "eosio"
  },
  "fields": {
    "account": "account_name",
    "bytes": "uint64"
  }
}

setalimits


"set_account_limits": {
  "base": "",
  "action": {
    "name": "setalimits",
    "account": "eosio"
  },
  "fields": {
    "account": "account_name",
    "ram_bytes": "int64",
    "net_weight": "int64",
    "cpu_weight": "int64"
  }
}

setglimits


"set_global_limits": {
  "base": "",
  "action": {
    "name": "setglimits",
    "account": "eosio"
  },
  "fields": {
    "cpu_usec_per_period": "int64"
  }
}

setprods


"set_producers": {
  "base": "",
  "action": {
    "name": "setprods",
    "account": "eosio"
  },
  "fields": {
    "schedule": "producer_key[]"
  }
}

setabi


"setabi": {
  "base": "",
  "action": {
    "name": "setabi",
    "account": "eosio"
  },
  "fields": {
    "account": "account_name",
    "abi": "abi_def"
  }
}

setcode


"setcode": {
  "base": "",
  "action": {
    "name": "setcode",
    "account": "eosio"
  },
  "fields": {
    "account": "account_name",
    "vmtype": "uint8",
    "vmversion": "uint8",
    "code": "bytes"
  }
}

setparams


"setparams": {
  "base": "",
  "action": {
    "name": "setparams",
    "account": "eosio"
  },
  "fields": {
    "params": "eosio_parameters"
  }
}

setpriv


"setpriv": {
  "base": "",
  "action": {
    "name": "setpriv",
    "account": "eosio"
  },
  "fields": {
    "account": "account_name",
    "is_priv": "int8"
  }
}

##setram

"setram": {
"base": "",
"action": {
"name": "setram",
"account": "eosio"
},
"fields": {
"max_ram_size": "uint64"
}
}

undelegatebw


"undelegatebw": {
  "base": "",
  "action": {
    "name": "undelegatebw",
    "account": "eosio"
  },
  "fields": {
    "from": "account_name",
    "receiver": "account_name",
    "unstake_net_quantity": "asset",
    "unstake_cpu_quantity": "asset"
  }
}

unlinkauth


"unlinkauth": {
  "base": "",
  "action": {
    "name": "unlinkauth",
    "account": "eosio"
  },
  "fields": {
    "account": "account_name",
    "code": "account_name",
    "type": "action_name"
  }
}

unregprod


"unregprod": {
  "base": "",
  "action": {
    "name": "unregprod",
    "account": "eosio"
  },
  "fields": {
    "producer": "account_name"
  }
}

updateauth


"updateauth": {
  "base": "",
  "action": {
    "name": "updateauth",
    "account": "eosio"
  },
  "fields": {
    "account": "account_name",
    "permission": "permission_name",
    "parent": "permission_name",
    "auth": "authority"
  }
}

voteproducer


"voteproducer": {
  "base": "",
  "action": {
    "name": "voteproducer",
    "account": "eosio"
  },
  "fields": {
    "voter": "account_name",
    "proxy": "account_name",
    "producers": "account_name[]"
  }
}

create


"create": {
  "base": "",
  "action": {
    "name": "create",
    "account": "eosio.token"
  },
  "fields": {
    "issuer": "account_name",
    "maximum_supply": "asset"
  }
}

issue


"issue": {
  "base": "",
  "action": {
    "name": "issue",
    "account": "eosio.token"
  },
  "fields": {
    "to": "account_name",
    "quantity": "asset",
    "memo": "string"
  }
}

transfer


"transfer": {
  "base": "",
  "action": {
    "name": "transfer",
    "account": "eosio.token"
  },
  "fields": {
    "from": "account_name",
    "to": "account_name",
    "quantity": "asset",
    "memo": "string"
  }
}

createTransaction

transaction

contract

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
  • 序言:七十年代末,一起剥皮案震惊了整个滨河市,随后出现的几起案子,更是在滨河造成了极大的恐慌,老刑警刘岩,带你破解...
    沈念sama阅读 211,348评论 6 491
  • 序言:滨河连续发生了三起死亡事件,死亡现场离奇诡异,居然都是意外死亡,警方通过查阅死者的电脑和手机,发现死者居然都...
    沈念sama阅读 90,122评论 2 385
  • 文/潘晓璐 我一进店门,熙熙楼的掌柜王于贵愁眉苦脸地迎上来,“玉大人,你说我怎么就摊上这事。” “怎么了?”我有些...
    开封第一讲书人阅读 156,936评论 0 347
  • 文/不坏的土叔 我叫张陵,是天一观的道长。 经常有香客问我,道长,这世上最难降的妖魔是什么? 我笑而不...
    开封第一讲书人阅读 56,427评论 1 283
  • 正文 为了忘掉前任,我火速办了婚礼,结果婚礼上,老公的妹妹穿的比我还像新娘。我一直安慰自己,他们只是感情好,可当我...
    茶点故事阅读 65,467评论 6 385
  • 文/花漫 我一把揭开白布。 她就那样静静地躺着,像睡着了一般。 火红的嫁衣衬着肌肤如雪。 梳的纹丝不乱的头发上,一...
    开封第一讲书人阅读 49,785评论 1 290
  • 那天,我揣着相机与录音,去河边找鬼。 笑死,一个胖子当着我的面吹牛,可吹牛的内容都是我干的。 我是一名探鬼主播,决...
    沈念sama阅读 38,931评论 3 406
  • 文/苍兰香墨 我猛地睁开眼,长吁一口气:“原来是场噩梦啊……” “哼!你这毒妇竟也来了?” 一声冷哼从身侧响起,我...
    开封第一讲书人阅读 37,696评论 0 266
  • 序言:老挝万荣一对情侣失踪,失踪者是张志新(化名)和其女友刘颖,没想到半个月后,有当地人在树林里发现了一具尸体,经...
    沈念sama阅读 44,141评论 1 303
  • 正文 独居荒郊野岭守林人离奇死亡,尸身上长有42处带血的脓包…… 初始之章·张勋 以下内容为张勋视角 年9月15日...
    茶点故事阅读 36,483评论 2 327
  • 正文 我和宋清朗相恋三年,在试婚纱的时候发现自己被绿了。 大学时的朋友给我发了我未婚夫和他白月光在一起吃饭的照片。...
    茶点故事阅读 38,625评论 1 340
  • 序言:一个原本活蹦乱跳的男人离奇死亡,死状恐怖,灵堂内的尸体忽然破棺而出,到底是诈尸还是另有隐情,我是刑警宁泽,带...
    沈念sama阅读 34,291评论 4 329
  • 正文 年R本政府宣布,位于F岛的核电站,受9级特大地震影响,放射性物质发生泄漏。R本人自食恶果不足惜,却给世界环境...
    茶点故事阅读 39,892评论 3 312
  • 文/蒙蒙 一、第九天 我趴在偏房一处隐蔽的房顶上张望。 院中可真热闹,春花似锦、人声如沸。这庄子的主人今日做“春日...
    开封第一讲书人阅读 30,741评论 0 21
  • 文/苍兰香墨 我抬头看了看天上的太阳。三九已至,却和暖如春,着一层夹袄步出监牢的瞬间,已是汗流浃背。 一阵脚步声响...
    开封第一讲书人阅读 31,977评论 1 265
  • 我被黑心中介骗来泰国打工, 没想到刚下飞机就差点儿被人妖公主榨干…… 1. 我叫王不留,地道东北人。 一个月前我还...
    沈念sama阅读 46,324评论 2 360
  • 正文 我出身青楼,却偏偏与公主长得像,于是被迫代替她去往敌国和亲。 传闻我的和亲对象是个残疾皇子,可洞房花烛夜当晚...
    茶点故事阅读 43,492评论 2 348

推荐阅读更多精彩内容

  • 序列类型 列表:list 列表的特点: 用方括号[]括起来 内容的元素用逗号”,”间隔开 各元素可以是各种数据类型...
    表表哥阅读 1,332评论 0 0
  • NAOQI OS是软银pepper和nao机器人的核心操作系统,NAOQI API提供了访问机器人的各种传感器设备...
    郭少悲阅读 6,679评论 4 2
  • 数据结构,是指通过某种方式(例如对元素进行编号)组织在一起的数据元素的集合,这些数据元素可以是数字或者字符,甚至可...
    千释炎阅读 765评论 0 0
  • 1.列表数据类型 列表值代表列表本身,而不是列表内包含的值。 列表格式用[]括起来 列表中的值被称为表项,用逗号分...
    qianyewhy阅读 350评论 2 0
  • 19世纪初,建构现代教育系统的重要人物威廉.冯.洪堡曾说,存在的目的就是“在生命最广泛的体验中,提炼出智慧”。他还...
    Jodie啊阅读 484评论 0 1