Skip to content

Improve code examples + snippets#81

Open
denalimarsh wants to merge 5 commits intomasterfrom
dm-update-examples
Open

Improve code examples + snippets#81
denalimarsh wants to merge 5 commits intomasterfrom
dm-update-examples

Conversation

@denalimarsh
Copy link
Contributor

Updates transfer example and adds snippets for creating, claiming, and refunding a bep3 swap on Kava.

@denalimarsh denalimarsh added the R4R Request for review label Jan 7, 2022
@denalimarsh denalimarsh requested a review from thomasmost January 7, 2022 13:15
Copy link
Contributor

@thomasmost thomasmost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When I run npx ts-node example/transfer.ts I get

Error: mnemonic cannot be undefined
    at KavaClient.setWallet (/Users/thomas/kava/javascript-sdk/src/client/index.ts:145:13)
    at /Users/thomas/kava/javascript-sdk/example/transfer.ts:14:14
    at step (/Users/thomas/kava/javascript-sdk/example/transfer.ts:33:23)
    at Object.next (/Users/thomas/kava/javascript-sdk/example/transfer.ts:14:53)
    at /Users/thomas/kava/javascript-sdk/example/transfer.ts:8:71
    at new Promise (<anonymous>)
    at __awaiter (/Users/thomas/kava/javascript-sdk/example/transfer.ts:4:12)
    at main (/Users/thomas/kava/javascript-sdk/example/transfer.ts:9:12)
    at Object.<anonymous> (/Users/thomas/kava/javascript-sdk/example/transfer.ts:44:1)

Can you add to the README steps for properly running the examples? I feel like I must be missing something

@fwiessner
Copy link
Contributor

kavaClient.setWallet(Env.KavaDeputy.Local.Mnemonic);

and

let acc = await kavaClient.getAccount(Env.KavaDeputy.Local.Address);

is wrong - must be Env.KavaAccount.Local.Mnemonic and Env.KavaAccount.Local.Address !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

R4R Request for review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants