Skip to content

Commit

Permalink
Merge pull request #121 from alleslabs/fix/code-snippet
Browse files Browse the repository at this point in the history
feat(components): fix code snippet query axios
  • Loading branch information
tansawit committed Jan 23, 2023
2 parents beec0d4 + ea8dcf4 commit a418297
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased

### Features

- [#121](https://github.com/alleslabs/celatone-frontend/pull/121) Fix code snippet for query axios
- [#76](https://github.com/alleslabs/celatone-frontend/pull/76) Add Public projects page
- [#116](https://github.com/alleslabs/celatone-frontend/pull/116) Support Terra2.0 mainnet and testnet
- [#94](https://github.com/alleslabs/celatone-frontend/pull/94) Add unsupported assets in contract details page
Expand Down
3 changes: 2 additions & 1 deletion src/lib/components/modal/CodeSnippet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,10 @@ queryContract(rpcURL, contractAddress, queryMsg);`,
const lcdURL = '${endpoint}';
const contractAddress =
"${contractAddress}";
const queryMsg = \`${message}\`;\n
const queryMsg = ${message};\n
const queryContract = async () => {
const queryB64Encoded = Buffer.from(JSON.stringify(queryMsg)).toString('base64');
const res = await axios.get(\`$\{lcdURL}/cosmwasm/wasm/v1/contract/$\{contractAddress}/smart/$\{queryB64Encoded}\`);
console.log(res.data);
};\n
queryContract();`,
Expand Down

2 comments on commit a418297

@vercel
Copy link

@vercel vercel bot commented on a418297 Jan 23, 2023

Choose a reason for hiding this comment

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

@vercel
Copy link

@vercel vercel bot commented on a418297 Jan 23, 2023

Choose a reason for hiding this comment

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

Please sign in to comment.