We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e4ef88c commit e121e57Copy full SHA for e121e57
1 file changed
packages/evm-sdk/src/index.ts
@@ -154,11 +154,15 @@ export class EVMSDK {
154
throw new ValidationError("Invalid recipient address", "to", { to });
155
}
156
157
+ // Convert to BigInt for validation
158
+ const value = typeof amount === "bigint" ? amount : BigInt(amount || "0");
159
+
160
if (
161
amount === undefined ||
162
amount === null ||
163
amount === "" ||
- amount === BigInt(0)
164
+ amount === "0" ||
165
+ value === BigInt(0)
166
) {
167
throw new ValidationError(
168
"Amount must be greater than zero",
@@ -181,7 +185,6 @@ export class EVMSDK {
181
185
});
182
186
183
187
const connectedWallet = wallet.connect(this.provider);
184
- const value = typeof amount === "bigint" ? amount : BigInt(amount);
188
189
let txResponse: TransactionResponse;
190
0 commit comments