Base64 for rpcs
This commit is contained in:
parent
0de345f1a6
commit
df1f23bb72
|
@ -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",
|
||||
|
|
|
@ -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),
|
||||
|
|
Loading…
Reference in New Issue