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

use sdk v2 #28

Merged
merged 6 commits into from
Oct 21, 2023
Merged

use sdk v2 #28

merged 6 commits into from
Oct 21, 2023

Conversation

0xaptosj
Copy link
Contributor

@0xaptosj 0xaptosj commented Oct 20, 2023

use sdk v2, most of the things are same as v1, just some function signature got tighten

@@ -9,7 +9,7 @@
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "bundler",
"moduleResolution": "node",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

have to update this to make sdk v2 work normally, otherwise got export error

frontend/src/app/home/Pet/Collection.tsx Outdated Show resolved Hide resolved
@0xZihan 0xZihan requested a review from 0xmaayan October 20, 2023 23:03
Copy link

@0xmaayan 0xmaayan left a comment

Choose a reason for hiding this comment

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

left some comments,
does waitForTransaction(response.hash); really work?

const [name, _, energyPoints, parts] = await aptosClient.view({
payload: {
function: `${NEXT_PUBLIC_CONTRACT_ADDRESS}::main::get_aptogotchi`,
typeArguments: [],

Choose a reason for hiding this comment

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

it is optional so can be removed if not needed

Suggested change
typeArguments: [],

Copy link
Contributor Author

@0xaptosj 0xaptosj Oct 20, 2023

Choose a reason for hiding this comment

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

removed

type_arguments: [],
arguments: [newName, parts],
};

try {
const response = await signAndSubmitTransaction(payload);
await provider.waitForTransaction(response.hash);
await aptosClient.waitForTransaction(response.hash);

Choose a reason for hiding this comment

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

Copy link
Contributor Author

@0xaptosj 0xaptosj Oct 20, 2023

Choose a reason for hiding this comment

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

it throws error, but i didn't get type error from vscode (maybe because response.hash has type any)?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

Choose a reason for hiding this comment

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

hmm dont think so.. it should still tells you that you should be providing an object value. I do get error on my env, maybe something with your vs code configurations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Screenshot 2023-10-20 at 4 50 48 PM yeah i think it's my vscode setting

@0xaptosj 0xaptosj merged commit 0199c7b into main Oct 21, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

3 participants