-
Notifications
You must be signed in to change notification settings - Fork 363
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
use sdk v2 #28
Conversation
@@ -9,7 +9,7 @@ | |||
"noEmit": true, | |||
"esModuleInterop": true, | |||
"module": "esnext", | |||
"moduleResolution": "bundler", | |||
"moduleResolution": "node", |
There was a problem hiding this comment.
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
There was a problem hiding this 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?
frontend/src/app/home/Connected.tsx
Outdated
const [name, _, energyPoints, parts] = await aptosClient.view({ | ||
payload: { | ||
function: `${NEXT_PUBLIC_CONTRACT_ADDRESS}::main::get_aptogotchi`, | ||
typeArguments: [], |
There was a problem hiding this comment.
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
typeArguments: [], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed
frontend/src/app/home/Mint/index.tsx
Outdated
type_arguments: [], | ||
arguments: [newName, parts], | ||
}; | ||
|
||
try { | ||
const response = await signAndSubmitTransaction(payload); | ||
await provider.waitForTransaction(response.hash); | ||
await aptosClient.waitForTransaction(response.hash); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's weird, it should accept an object param
https://github.com/aptos-labs/aptos-ts-sdk/blob/main/src/api/transaction.ts#L105
There was a problem hiding this comment.
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
)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use sdk v2, most of the things are same as v1, just some function signature got tighten