Skip to content

Commit

Permalink
parse types
Browse files Browse the repository at this point in the history
  • Loading branch information
fadeev committed Dec 17, 2024
1 parent 5d2b778 commit 1ec3efc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion packages/tasks/src/solanaDepositAndCall.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,13 @@ export const solanaDepositAndCall = async (
recipient = args.recipient;
}
const { amount, idPath } = args;
const params = [JSON.parse(args.types), args.values];
let paramTypes;
try {
paramTypes = JSON.parse(args.types);
} catch (error: any) {
throw new Error(`Invalid JSON in 'types' parameter: ${error.message}`);
}
const params = [paramTypes, args.values];
await client.solanaDepositAndCall({ amount, params, recipient });
};

Expand Down

0 comments on commit 1ec3efc

Please sign in to comment.