From e04c43baca659a10ef550b89b7dc8f53abbe192c Mon Sep 17 00:00:00 2001 From: Adw8 Date: Thu, 6 Feb 2025 16:13:45 +0530 Subject: [PATCH] Update type for remainingAccountsInfo --- package-lock.json | 12 ++++++++++++ package.json | 1 + src/locker-utils/index.ts | 7 +++---- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index f99badf..fc7c87f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -27,6 +27,7 @@ "devDependencies": { "@types/big.js": "^6.2.2", "@types/bn.js": "^5.1.6", + "@types/bs58": "^4.0.4", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", @@ -954,6 +955,17 @@ "@types/node": "*" } }, + "node_modules/@types/bs58": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/@types/bs58/-/bs58-4.0.4.tgz", + "integrity": "sha512-0IEpMFXXQi2zXaXl9GJ3sRwQo0uEkD+yFOv+FnAU5lkPtcu6h61xb7jc2CFPEZ5BUOaiP13ThuGc9HD4R8lR5g==", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/node": "*", + "base-x": "^3.0.6" + } + }, "node_modules/@types/connect": { "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", diff --git a/package.json b/package.json index 1ed9a37..8a96f4d 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "devDependencies": { "@types/big.js": "^6.2.2", "@types/bn.js": "^5.1.6", + "@types/bs58": "^4.0.4", "@types/node": "^20", "@types/react": "^18", "@types/react-dom": "^18", diff --git a/src/locker-utils/index.ts b/src/locker-utils/index.ts index 29b367f..52c37fe 100644 --- a/src/locker-utils/index.ts +++ b/src/locker-utils/index.ts @@ -116,7 +116,7 @@ export async function createVestingPlanV2(params: CreateVestingPlanParams) { ASSOCIATED_TOKEN_PROGRAM_ID ); - let remainingAccountsInfo; + let remainingAccountsInfo: OptionRemainingAccountsInfoData | null = null; let remainingAccounts: AccountMeta[] = []; if (tokenProgram == TOKEN_2022_PROGRAM_ID) { let inputTransferHookAccounts = @@ -196,8 +196,7 @@ export async function createVestingPlanV2(params: CreateVestingPlanParams) { return escrow; } - - throw new Error; + throw error; } } @@ -227,7 +226,7 @@ export async function claimTokenV2(params: ClaimTokenParamsV2) { ASSOCIATED_TOKEN_PROGRAM_ID ); - let remainingAccountsInfo; + let remainingAccountsInfo: OptionRemainingAccountsInfoData | null = null; let remainingAccounts: AccountMeta[] | undefined = []; if (tokenProgram == TOKEN_2022_PROGRAM_ID) { let claimTransferHookAccounts =