Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] README : Requesting Transactions Code Error #19

Open
DreamBoysYJ opened this issue Apr 3, 2024 · 0 comments
Open

[BUG] README : Requesting Transactions Code Error #19

DreamBoysYJ opened this issue Apr 3, 2024 · 0 comments

Comments

@DreamBoysYJ
Copy link

Hello, i was studying aleo wallet through aleo-wallet-adapter.
And i found some error on 'Requesting Transactions' Code, which is here.

 // The record here is an output from the Requesting Records above
    const record = `'{"id":"0f27d86a-1026-4980-9816-bcdce7569aa4","program_id":"credits.aleo","microcredits":"200000","spent":false,"data":{}}'`
    // Note that the inputs must be formatted in the same order as the Aleo program function expects, otherwise it will fail
    const inputs = [JSON.parse(record), "aleo1kf3dgrz9...", `${amount}u64`];

the way you write record is javascript string literal because of ' ' , so JSON.Parse() is not working.

So i think it is better to remove ' ' , the result would be

const record2 = {"id":"0f27d86a-1026-4980-9816-bcdce7569aa4","program_id":"credits.aleo","microcredits":"200000","spent":false,"data":{}};

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant