@pafi-dev/core 0.6.2 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -396,26 +396,19 @@ function buildPerpDepositViaRelay(params) {
396
396
  throw new Error("buildPerpDepositViaRelay: relayAddress required");
397
397
  }
398
398
  const operations = [];
399
- if (params.gasFeePt && params.gasFeePt > 0n) {
400
- if (!params.pointTokenAddress) {
399
+ if (params.gasFeeUsdc && params.gasFeeUsdc > 0n) {
400
+ if (!params.gasFeeUsdcRecipient) {
401
401
  throw new Error(
402
- "buildPerpDepositViaRelay: pointTokenAddress required when gasFeePt > 0"
402
+ "buildPerpDepositViaRelay: gasFeeUsdcRecipient required when gasFeeUsdc > 0"
403
403
  );
404
404
  }
405
- if (!params.gasFeePtRecipient) {
406
- throw new Error(
407
- "buildPerpDepositViaRelay: gasFeePtRecipient required when gasFeePt > 0"
408
- );
409
- }
410
- operations.push({
411
- target: params.pointTokenAddress,
412
- value: 0n,
413
- data: _viem.encodeFunctionData.call(void 0, {
414
- abi: _viem.erc20Abi,
415
- functionName: "transfer",
416
- args: [params.gasFeePtRecipient, params.gasFeePt]
417
- })
418
- });
405
+ operations.push(
406
+ erc20TransferOp(
407
+ params.request.token,
408
+ params.gasFeeUsdcRecipient,
409
+ params.gasFeeUsdc
410
+ )
411
+ );
419
412
  }
420
413
  operations.push(
421
414
  erc20ApproveOp(