EOS开发库收集(持续更新)
开发语言
C Sharp
Eos eos = new Eos(new EosConfigurator()
{
HttpEndpoint = "https://nodes.eos42.io", //Mainnet
ChainId = "aca376f206b8fc25a6ed44dbdc66547c36c6c33e3a119ffbeaef943642f0e906",
ExpireSeconds = 60,
SignProvider = new DefaultSignProvider("myprivatekey")
});
var chainAPI = new ChainAPI("https://api.eosnewyork.io");
string _code = "eosio.token", _action = "transfer", _memo = "";
TransferArgs _args = new TransferArgs(){ from = "account1", to = "account2", quantity = "1.0000 EOS", memo = _memo };
//called asynchronously
var abiJsonToBinAsync = await chainAPI.GetAbiJsonToBinAsync(_code, _action, _args);
//called synchronously
var abiJsonToBinSync = chainAPI.GetAbiJsonToBin(_code, _action, _args);
Go
api := eos.New("http://testnet1.eos.io")
infoResp, _ := api.GetInfo()
accountResp, _ := api.GetAccount("initn")
fmt.Println("Permission for initn:", accountResp.Permissions[0].RequiredAuth.Keys)
Python
from eosjs_python import Eos
eos = Eos({
'http_address': 'http://172.18.0.1:8888',
'key_provider': '5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'
})
eos.newaccount({
'creator': 'eosio',
'name': 'mytestacc13',
'owner_public_key': 'EOS7vTHtMbZ1g9P8BiyAGD7Ni7H6UALVLVCW13xZrXT4heCBke3it',
'active_public_key': 'EOS8KKKYBBdwrmXRRynDXSxTX2qoT9TA4agahXXF4ccUgRCy81RNc',
'buyrambytes_bytes': 8192,
'delegatebw_stake_net_quantity': '100.0000 SYS',
'delegatebw_stake_cpu_quantity': '100.0000 SYS',
'delegatebw_transfer': 0
})
# Get chain information
pycleos --url https://api.eosnewyork.io get info
# get information about a block
pycleos --url https://api.eosnewyork.io get block 447
# Retrieve an account from the blockchain
pycleos --url https://api.eosnewyork.io get account --account eosio
# Retrieve the code and ABI for an account
pycleos --url https://api.eosnewyork.io get code --account eosio
PHP
/* Create the rest client */
EosApiRestClient eosApiRestClient = EosApiClientFactory.newInstance("http://127.0.0.1:8888").newRestClient();
/* Create the json array of arguments */
Map<String, String> args = new HashMap<>(4);
args.put("from", "currency");
args.put("to", "eosio");
args.put("quantity", "44.0000 CUR");
args.put("memo", "My First Transaction");
AbiJsonToBin data = eosApiRestClient.abiJsonToBin("currency", "transfer", args);```
/* Get the head block */
Block block = eosApiRestClient.getBlock(eosApiRestClient.getChainInfo().getHeadBlockId());
Java
Dapp js 相关
持续更新
当前页面是本站的「Google AMP」版。查看和发表评论请点击:完整版 »