Base64 for rpcs

This commit is contained in:
armaniferrante 2021-07-31 17:16:36 -07:00
parent 0de345f1a6
commit df1f23bb72
No known key found for this signature in database
GPG Key ID: 58BEF301E91F7828
2 changed files with 3 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "@project-serum/anchor",
"version": "0.4.4",
"version": "0.4.6",
"description": "Anchor client",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",

View File

@ -548,6 +548,7 @@ export class RpcFactory {
},
},
],
encoding: 'base64',
},
]);
if (resp.error) {
@ -556,9 +557,8 @@ export class RpcFactory {
}
return (
resp.result
// @ts-ignore
.map(({ pubkey, account: { data } }) => {
data = bs58.decode(data);
data = bs58.decode(bs58.encode(Uint8Array.from(atob(data[0]), c => c.charCodeAt(0))));
return {
publicKey: new PublicKey(pubkey),
account: coder.accounts.decode(idlAccount.name, data),