-
Notifications
You must be signed in to change notification settings - Fork 24
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
docs(client-examples): add transfer to readme #719
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 4 Ignored Deployments
|
### Creating a type definition from a pact file | ||
|
||
```shell | ||
npx pactjs contract-generate --file=./coin.pact --api http://104.248.41.186:8080/chainweb/0.0/development/chain/0/pact |
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.
When I tried this, (with testnet) it gave me an error, the combination of --file
and --api
not sure if it's already fixed though (apha.7)
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.
This error is expected, you don't need an API when you generate from a file. On a related note I'm wondering where the IP address comes from?
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 was the devnet url, I have replaced it with the mainnet url.
I also explained when you need --api and when you don't
const signedTr = await signWithChainweaver(transaction); | ||
|
||
// As the signer function could be an external function, we double-check if the transaction is signed correctly. | ||
if (isSignedCommand(signedTr)) { |
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.
Even though it's example code, I'd still recommend inverting the if statement to get early returns instead.
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.
if (!isSignedCommand(signedTr)) throw new Error('Transaction has not been signed');
... other code ...
if (response.result.status === 'failure) throw response.result.error;
console.log('yaaaaay')
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.
Done!
3ebbaef
to
ba270a1
Compare
I am updating the doc |
No description provided.