EOSIO / eosjs-ecc

Elliptic curve cryptography functions: Private Key, Public Key, Signature, AES, Encryption, Decryption
287 stars 119 forks source link

UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'map' of undefined #71

Open rahul1083 opened 4 years ago

rahul1083 commented 4 years ago

Getting error on account creation :- const defaultPrivateKey = "5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3"; // bob const signatureProvider = new JsSignatureProvider(['5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3']); const api = new Api({ rpc, signatureProvider, textDecoder: new TextDecoder(), textEncoder: new TextEncoder() });

const result = await api.transact( { account: 'eosio', name: 'newaccount', authorization: [{ actor: 'eosio', permission: 'active', }], data: { creator: 'eosio', name: 'mynewaccount', owner: { threshold: 1, keys: [{ key: '6FPFZqw5ahYrR9jD96yDbbDNTdKtNqRbze6oTDLntrsANgQKZu', weight: 1 }], accounts: [], waits: [] }, active: { threshold: 1, keys: [{ key: '6FPFZqw5ahYrR9jD96yDbbDNTdKtNqRbze6oTDLntrsANgQKZu', weight: 1 }], accounts: [], waits: [] }, }, }, { blocksBehind: 3, expireSeconds: 30, } );

jlamarr22 commented 4 years ago

Clarified on https://github.com/EOSIO/eosjs/issues/688