Bump @solana/web3.js to v1.2.5 (#41)

This commit is contained in:
Justin Starry 2021-04-01 12:14:59 +08:00 committed by GitHub
parent 359b9ed021
commit 5495ab936a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View File

@ -11,7 +11,7 @@
"@solana/spl-token": "0.0.11",
"@solana/spl-token-registry": "^0.2.0",
"@solana/spl-token-swap": "0.0.2",
"@solana/web3.js": "^0.86.2",
"@solana/web3.js": "^1.2.5",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",

View File

@ -435,14 +435,13 @@ export function AccountsProvider({ children = null as any }) {
const tokenSubID = connection.onProgramAccountChange(
programIds().token,
(info) => {
// TODO: fix type in web3.js
const id = (info.accountId as unknown) as string;
const id = info.accountId.toBase58();
// TODO: do we need a better way to identify layout (maybe a enum identifing type?)
if (info.accountInfo.data.length === AccountLayout.span) {
const data = deserializeAccount(info.accountInfo.data);
// TODO: move to web3.js for decoding on the client side... maybe with callback
const details = {
pubkey: new PublicKey((info.accountId as unknown) as string),
pubkey: info.accountId,
account: {
...info.accountInfo,
},