diff --git a/ts/package.json b/ts/package.json index b0c1e7f3..6015e22a 100644 --- a/ts/package.json +++ b/ts/package.json @@ -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", diff --git a/ts/src/rpc.ts b/ts/src/rpc.ts index 91c3188a..13d856b2 100644 --- a/ts/src/rpc.ts +++ b/ts/src/rpc.ts @@ -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),