Comments (18)
published [email protected]
from eosjs.
@jcalfee I follow you steps, now can transfer without errors, and can query the transfer transaction, but the user balance no change. any idea ?
function testEos() {
config = {
keyProvider: ['5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3'], // WIF string or array of keys..
httpEndpoint: 'http://127.0.0.1:8888',
expireInSeconds: 60,
broadcast: true,
debug: false,
sign: true
}
var eos = Eos.Localnet(config);
eos.transfer('eosio', 'inita', '10 EOS', '', (err, res)=>{console.log(err,res)});
{transaction_id: "863d91727faf34f46399e93a293a21be2799535c513ad5a62875026c0b8dba41", broadcast: true, transaction: {…}}
cleos get transaction 863d91727faf34f46399e93a293a21be2799535c513ad5a62875026c0b8dba41
{
"transaction_id": "863d91727faf34f46399e93a293a21be2799535c513ad5a62875026c0b8dba41",
"transaction": {
"signatures": [
"EOSKBH73cAmQoPufAbuoQSYV6US4Pk6JVCLHHUmkGHjVaDgivuvd9L9wgc5jmAWP4hhwiMLQmd8syZpXZ4PjwHZaxNwqiAB8o"
],
"compression": "none",
"packed_context_free_data": "",
"context_free_data": [],
"packed_trx": "2048e15a00008744acd59d4100000000010000000000ea3055000000572d3ccdcd010000000000ea305500000000a8ed3232210000000000ea3055000000000093dd74a08601000000000004454f530000000000",
"transaction": {
"expiration": "2018-04-26T03:31:44",
"region": 0,
"ref_block_num": 17543,
"ref_block_prefix": 1100862892,
"max_net_usage_words": 0,
"max_kcpu_usage": 0,
"delay_sec": 0,
"context_free_actions": [],
"actions": [{
"account": "eosio",
"name": "transfer",
"authorization": [{
"actor": "eosio",
"permission": "active"
}
],
"data": {
"from": "eosio",
"to": "inita",
"quantity": "10.0000 EOS",
"memo": ""
},
"hex_data": "0000000000ea3055000000000093dd74a08601000000000004454f530000000000"
}
]
}
}
}
But query the inita balance, will return empty.
cleos get currency balance eosio.token inita
from eosjs.
+1 having the same error.
from eosjs.
I indeed ran into this as well. It looks like transfer
is pointing at the eosio
account which is bios now.
from eosjs.
Found the solution, you need to specify the currency contract and initiate a transaction from there.
eos.transaction('currency', currency => {
currency.transfer('inita', 'initb', '1 CUR', '')
})
from eosjs.
I think you have a version mis-match between eosjs and Localnet.. The unit tests in the eosjs/docker folder are passing. There is a simple version chart with links at the top of the README.md..
from eosjs.
If your building yourself from eosio master it can of course break on you at anytime. The keep tags and branches though. I prefer docker, so much easier..
from eosjs.
@jcalfee I run eos with version dawn-3.0, and eosjs with master branch(I cannot find dawn-3.0 eosjs).
from eosjs.
Ok, let me try the docker, Thanks
from eosjs.
@jcalfee I run lastest version eos(master) or run Docker with ./up.sh, same error occured.
But ./run_test.sh can pass.
at process._tickCallback (internal/process/next_tick.js:188:7) status: 500, statusText: 'Internal Server Error' }
[push_transaction error] '{"code":500,"message":"Internal Service Error","error":{"code":10,"name":"assert_exception","what":"Assert Exception","details":[{"message":"itr != structs.end(): Unknown struct ","file":"abi_serializer.cpp","line_number":184,"method":"get_struct"},{"message":"Failed to serialize type","file":"abi_serializer.hpp","line_number":439,"method":"to_variant"}]}}', transaction '10e6de5a0000be0394d91c1f00000000010000000000ea3055000000572d3ccdcd010000000000ea305500000000a8ed3232210000000000ea30550000000080ab20ad102700000000000004454f530000000000'
{"code":500,"message":"Internal Service Error","error":{"code":10,"name":"assert_exception","what":"Assert Exception","details":[{"message":"itr != structs.end(): Unknown struct ","file":"abi_serializer.cpp","line_number":184,"method":"get_struct"},{"message":"Failed to serialize type","file":"abi_serializer.hpp","line_number":439,"method":"to_variant"}]}}
(node:24471) UnhandledPromiseRejectionWarning: {"code":500,"message":"Internal Service Error","error":{"code":10,"name":"assert_exception","what":"Assert Exception","details":[{"message":"itr != structs.end(): Unknown struct ","file":"abi_serializer.cpp","line_number":184,"method":"get_struct"},{"message":"Failed to serialize type","file":"abi_serializer.hpp","line_number":439,"method":"to_variant"}]}}
Any idea ?
from eosjs.
More information:
eos@master, eosjs@dawn3
from eosjs.
This might help (for testing only):
<script src="https://unpkg.com/[email protected]/dist/eos.js" />
Use ./up.sh
in eosjs [master] and make sure the docker image eosio/eos:dawn3x is used.
from eosjs.
I'll test eosio.token now.. I'll look at that now. They add new structs to nodeos that I need to sync with.
from eosjs.
Looks like it is a version problem. I was able to deploy eosio.token using cleos then make a transfer like your example. I did upgrade some functions, lets go with [email protected] (i'll deploy shortly) ..
setup:
cleos create account eosio eosio.token EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV
cleos set contract eosio.token contracts/eosio.token -p eosio.token@active
cleos push action eosio issue '{"to":"eosio.token", "quantity": "1000000000.0000 EOS", "memo": ""}' -p eosio@active
<script src="https://unpkg.com/[email protected]/dist/eos.js" />
> eos.transfer('eosio.token', 'inita', '1.0000 EOS', '', (err, res)=>{console.log(err,res)})
undefined
> null { transaction_id: '68dc224bc0b34500968148f13f1d49a1fd358e154885aed45f4498a145d3b35b',
broadcast: true,
transaction:
{ compression: 'none',
transaction:
{ expiration: '2018-04-24T17:15:25',
region: 0,
ref_block_num: 383,
ref_block_prefix: 160059228,
max_net_usage_words: 0,
max_kcpu_usage: 0,
delay_sec: 0,
context_free_actions: [],
actions: [Array] },
signatures: [ 'EOSK1eYuAbLz1pY4J1JKCB8dGrXPeaxP7wiVNhypoAJCXBUPNj28Xcts6ruqsdNWkaGQeNNZyhDKdchXouYKdQGo7aifhtVN6' ] } }
from eosjs.
@jcalfee Thanks, I will try asap.
from eosjs.
@jcalfee did you submit last source code? I pull lastest source, still have same error.
and https://unpkg.com/[email protected]/dist/eos.js cannot be access.
from eosjs.
DAWN-2018-04-23-ALPHA (docker eosio/eos:DAWN-2018-04-23-ALPHA
) fixes the get currency command. Eosjs 8.0.1 is compatible unless you get into the eosio.system calls.
I'll have a eosjs release for DAWN-2018-04-23-ALPHA today.
# eosio/eos:DAWN-2018-04-23-ALPHA
cleos get currency balance currency inita
982.0000 CUR
from eosjs.
OK, let me try again, Thanks
from eosjs.
Related Issues (20)
- How to generate eos address from xpub HOT 1
- How to set the blockBehind when sending transaction HOT 4
- about the return value of get_currency_balance
- reversible_guard_exception: Reversible block log usage is at unsafe levels reversible free: 2097120, guard size: 2097152 HOT 3
- Can i use eosjs on Google App Scripts platform? HOT 2
- How "data" should look in NFT transaction? HOT 1
- How to get a list of my assets (NFTs)? HOT 3
- When i run the yarn build-web not working? HOT 2
- I am having issues while playing the FW game as the account type is changed from Active to Owner HOT 1
- TypeError in eosjs-jsonrpc.js HOT 1
- claim_signature
- Can't find variable: Buffer
- A RpcError when trying to add a new permission to an existing account
- JsSignatureProvider error when create new JsSignatureProvider
- Please help with errors - Modul type for ES and cannot use import statement outside a module
- Check for irreversibality once the transaction has been sent through api.transact? HOT 1
- Unrecognized signature format for WebAuthn signature HOT 1
- Integration Test failing due to new field in `get_info` (first_block_num)
- Getting error : -Missing ATOMIC_ATTRIBUTE in pair_string_ATOMIC_ATTRIBUTE when using basic-usage/00_browser.md HOT 1
- Circular dependency issues HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eosjs.