ava-labs / avalanchejs

The Avalanche Platform JavaScript Library
Other
322 stars 164 forks source link

Can you give me more examples such as V3 #894

Open godlovericea opened 1 day ago

godlovericea commented 1 day ago

I want to generate address, and make Tx on mainnet please give me more examples such as V3 thanks

godlovericea commented 1 day ago

I have installed current version, but my terminal console have many error tips:

` Process exited with code 1 C:\Program Files\nodejs\node.exe .\app.js bigint: Failed to load bindings, pure JS will be used (try npm run rebuild?) Could not read source map for file:///D:/cvs_git/kerying_node/node_modules/%40avalabs/avalanchejs/node_modules/%40noble/curves/esm/abstract/utils.js: ENOENT: no such file or directory, open 'd:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@noble\curves\esm\abstract\utils.js.map' Could not read source map for file:///D:/cvs_git/kerying_node/node_modules/%40avalabs/avalanchejs/node_modules/%40noble/curves/esm/abstract/modular.js: ENOENT: no such file or directory, open 'd:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@noble\curves\esm\abstract\modular.js.map' Could not read source map for file:///D:/cvs_git/kerying_node/node_modules/%40avalabs/avalanchejs/node_modules/%40noble/curves/esm/abstract/curve.js: ENOENT: no such file or directory, open 'd:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@noble\curves\esm\abstract\curve.js.map' Could not read source map for file:///D:/cvs_git/kerying_node/node_modules/%40avalabs/avalanchejs/node_modules/%40noble/curves/esm/abstract/weierstrass.js: ENOENT: no such file or directory, open 'd:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@noble\curves\esm\abstract\weierstrass.js.map' Could not read source map for file:///D:/cvs_git/kerying_node/node_modules/%40avalabs/avalanchejs/node_modules/%40noble/curves/esm/abstract/hash-to-curve.js: ENOENT: no such file or directory, open 'd:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@noble\curves\esm\abstract\hash-to-curve.js.map' Could not read source map for file:///D:/cvs_git/kerying_node/node_modules/%40avalabs/avalanchejs/node_modules/%40noble/curves/esm/_shortw_utils.js: ENOENT: no such file or directory, open 'd:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@noble\curves\esm_shortw_utils.js.map' Could not read source map for file:///D:/cvs_git/kerying_node/node_modules/%40avalabs/avalanchejs/node_modules/%40noble/curves/esm/secp256k1.js: ENOENT: no such file or directory, open 'd:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@noble\curves\esm\secp256k1.js.map' Could not read source map for file:///D:/cvs_git/kerying_node/node_modules/%40avalabs/avalanchejs/node_modules/%40ethereumjs/rlp/dist/esm/index.js: ENOENT: no such file or directory, open 'd:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@ethereumjs\rlp\dist\esm\index.js.map' Could not read source map for file:///D:/cvs_git/kerying_node/node_modules/%40avalabs/avalanchejs/node_modules/%40noble/curves/esm/abstract/bls.js: ENOENT: no such file or directory, open 'd:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@noble\curves\esm\abstract\bls.js.map' Could not read source map for file:///D:/cvs_git/kerying_node/node_modules/%40avalabs/avalanchejs/node_modules/%40noble/curves/esm/bls12-381.js: ENOENT: no such file or directory, open 'd:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@noble\curves\esm\bls12-381.js.map' WHITE_ORIGIN: https://www.biyapay.com Server is running on http://localhost:3001 avmapi: Ti {path: '/ext/bc/X', base: 'avm', fetchOptions: undefined, rpcProvider: yi, getMethodName: ƒ, …} context: {xBlockchainID: '2oYMBNV4eNHyqk2fjjV5nVQLDbtmNJzq5s3qs3Lo6ftnC6FByM', pBlockchainID: '11111111111111111111111111111111LpoYY', cBlockchainID: '2q9e4r6Mu3U68nU1fYjgbR6JvwrRx36CohpAX5UQxse55x1Q5', avaxAssetID: 'FvwEAhmxKfeiG8SnEvq42hc6whRyY3EFYAvebMqDNDGCgxN5Z', baseTxFee: 1000000n, …}

Error: radix2.encode input should be Uint8Array at Object.encode [as toWords] (D:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\node_modules\@scure\base\lib\index.js:253:23) at p (D:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\dist\index.cjs:1:939) at ve.toString (D:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\dist\index.cjs:11:4215) at Uint8Array.map () at Br (D:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\dist\index.cjs:11:10358) at xr.fromNative (D:\cvs_git\kerying_node\node_modules\@avalabs\avalanchejs\dist\index.cjs:11:12195) at Create_TX_AVAX (D:\cvs_git\kerying_node\controllers\avax.js:20:26) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async bodyParser (D:\cvs_git\kerying_node\node_modules\koa-bodyparser\index.js:78:5) at async cors (D:\cvs_git\kerying_node\node_modules\@koa\cors\index.js:109:16)

`