From 866efd79295f159ff1206939efa46944b460ecb3 Mon Sep 17 00:00:00 2001 From: skynetcap <100323448+skynetcap@users.noreply.github.com> Date: Wed, 12 Oct 2022 15:31:13 -0700 Subject: [PATCH 1/2] Add `shx` to support Windows builds. Fix build. --- package.json | 8 +++++--- src/utils.ts | 2 +- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/package.json b/package.json index 22bc3ec7f..19609bf81 100644 --- a/package.json +++ b/package.json @@ -8,9 +8,9 @@ "author": "@zetamarkets", "license": "Apache-2.0", "scripts": { - "build": "cp -r ../../target/idl/zeta.json ./src/idl/zeta.json && cp -r ../../target/types/zeta.ts ./src/types/. && ./node_modules/.bin/tsc", - "docs": "typedoc --tsconfig ./tsconfig.json && cp ./logo.png ./docs/logo.png", - "build-no-idl": "./node_modules/.bin/tsc" + "build": "shx cp -r ../../target/idl/zeta.json ./src/idl/zeta.json && shx cp -r ../../target/types/zeta.ts ./src/types/. && tsc", + "docs": "typedoc --tsconfig ./tsconfig.json && shx cp ./logo.png ./docs/logo.png", + "build-no-idl": "tsc" }, "dependencies": { "@project-serum/anchor": "0.24.2", @@ -19,6 +19,7 @@ "@solana/spl-token": "0.1.6", "@solana/web3.js": "1.31.0", "bs58": "^4.0.1", + "buffer-layout": "^1.2.2", "lodash": "^4.17.21", "ts-node": "^10.7.0", "typescript": "^4.4.2" @@ -27,6 +28,7 @@ "@types/mocha": "^9.0.0", "@types/node": "^16.11.12", "mocha": "^9.1.1", + "shx": "^0.3.4", "typedoc": "^0.22.10" }, "resolutions": { diff --git a/src/utils.ts b/src/utils.ts index 4a35cd4c7..77ffa5892 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -585,7 +585,7 @@ export async function getTokenAccountInfo( if (accountInfo.delegateOption === 0) { accountInfo.delegate = null; - accountInfo.delegatedAmount = new u64(0); + accountInfo.delegatedAmount = 0; } else { accountInfo.delegate = new PublicKey(accountInfo.delegate); accountInfo.delegatedAmount = u64.fromBuffer(accountInfo.delegatedAmount); From 2642fb70bf99ad58c0d5300cb4f290aeea4678dd Mon Sep 17 00:00:00 2001 From: skynetcap <100323448+skynetcap@users.noreply.github.com> Date: Wed, 12 Oct 2022 15:52:21 -0700 Subject: [PATCH 2/2] Add compile artifacts to .gitignore. --- .gitignore | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.gitignore b/.gitignore index 5dfdf1cac..210b1a15b 100644 --- a/.gitignore +++ b/.gitignore @@ -4,3 +4,7 @@ dist/* .DS_Store yarn.lock package-lock.json +*.mjs +*.cjs +/.yarn/ +/.vscode/ \ No newline at end of file