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 non buffer format of fromXDR #32

Merged
merged 2 commits into from
May 31, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/contracts/src/useContractValue.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,5 @@ async function fetchContractValue({
throw new Error("Invalid response from simulateTransaction");
}
const result = results[0];
return xdr.ScVal.fromXDR(Buffer.from(result.xdr, 'base64'));
return xdr.ScVal.fromXDR(result.xdr, "base64");
}
4 changes: 2 additions & 2 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@
"version": "4.5.2",
"scripts": {
"prebuild": "rm -rf dist",
"build": "tsc",
"build": "yarn prebuild && tsc",
"start": "tsc --watch",
"prepare": "install-peers",
"test": "yarn build && yarn jest"
"test": "yarn prepare && yarn build && yarn jest"
},
"main": "./dist/index.js",
"exports": "./dist/index.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/events/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const crowdfundPledgedEventSubscription: EventSubscription = {
contractId: Constants.CrowdfundId,
topics: ['pledged_amount_changed'],
cb: (event: SorobanClient.SorobanRpc.EventResponse): void => {
let eventTokenBalance = xdr.ScVal.fromXDR(Buffer.from(event.value.xdr, 'base64'))
let eventTokenBalance = xdr.ScVal.fromXDR(event.value.xdr, "base64")
sreuland marked this conversation as resolved.
Show resolved Hide resolved
setTokenBalance(convert.scvalToBigNumber(eventTokenBalance))
},
id: Math.random()}
Expand Down