@pafi-dev/issuer 0.5.26 → 0.5.28

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.d.cts CHANGED
@@ -1555,12 +1555,32 @@ interface SponsorshipResponse {
1555
1555
  callGasLimit?: bigint;
1556
1556
  verificationGasLimit?: bigint;
1557
1557
  preVerificationGas?: bigint;
1558
+ /**
1559
+ * Bundler-required gas price (Pimlico's `pimlico_getUserOperationGasPrice`
1560
+ * fast tier). Pimlico's paymaster signs over these — caller MUST apply
1561
+ * to the userOp before computing the EIP-712 userOpHash. Base RPC's
1562
+ * `eth_feeHistory` underestimates the bundler floor by 10-15 %, so
1563
+ * relying on it produces "maxFeePerGas must be at least ..." rejections.
1564
+ */
1565
+ maxFeePerGas?: bigint;
1566
+ maxPriorityFeePerGas?: bigint;
1558
1567
  expiresAt: number;
1559
1568
  }
1560
1569
  declare class PafiBackendClient {
1561
1570
  private readonly config;
1562
1571
  constructor(config: PafiBackendConfig);
1563
1572
  requestSponsorship(request: SponsorshipRequest): Promise<SponsorshipResponse>;
1573
+ /**
1574
+ * Fetch ERC-4337 UserOp receipt via PAFI's authenticated bundler proxy.
1575
+ * Returns `null` when the bundler hasn't seen the userOp yet — caller
1576
+ * should keep polling. Used by status endpoints to short-circuit the
1577
+ * on-chain indexer when several PENDING locks share the same amount.
1578
+ */
1579
+ getUserOpReceipt(userOpHash: Hex): Promise<{
1580
+ success: boolean;
1581
+ txHash: Hex;
1582
+ blockNumber: string;
1583
+ } | null>;
1564
1584
  relayUserOperation(request: RelayUserOpRequest): Promise<RelayUserOpResponse>;
1565
1585
  private _doRequest;
1566
1586
  }
package/dist/index.d.ts CHANGED
@@ -1555,12 +1555,32 @@ interface SponsorshipResponse {
1555
1555
  callGasLimit?: bigint;
1556
1556
  verificationGasLimit?: bigint;
1557
1557
  preVerificationGas?: bigint;
1558
+ /**
1559
+ * Bundler-required gas price (Pimlico's `pimlico_getUserOperationGasPrice`
1560
+ * fast tier). Pimlico's paymaster signs over these — caller MUST apply
1561
+ * to the userOp before computing the EIP-712 userOpHash. Base RPC's
1562
+ * `eth_feeHistory` underestimates the bundler floor by 10-15 %, so
1563
+ * relying on it produces "maxFeePerGas must be at least ..." rejections.
1564
+ */
1565
+ maxFeePerGas?: bigint;
1566
+ maxPriorityFeePerGas?: bigint;
1558
1567
  expiresAt: number;
1559
1568
  }
1560
1569
  declare class PafiBackendClient {
1561
1570
  private readonly config;
1562
1571
  constructor(config: PafiBackendConfig);
1563
1572
  requestSponsorship(request: SponsorshipRequest): Promise<SponsorshipResponse>;
1573
+ /**
1574
+ * Fetch ERC-4337 UserOp receipt via PAFI's authenticated bundler proxy.
1575
+ * Returns `null` when the bundler hasn't seen the userOp yet — caller
1576
+ * should keep polling. Used by status endpoints to short-circuit the
1577
+ * on-chain indexer when several PENDING locks share the same amount.
1578
+ */
1579
+ getUserOpReceipt(userOpHash: Hex): Promise<{
1580
+ success: boolean;
1581
+ txHash: Hex;
1582
+ blockNumber: string;
1583
+ } | null>;
1564
1584
  relayUserOperation(request: RelayUserOpRequest): Promise<RelayUserOpResponse>;
1565
1585
  private _doRequest;
1566
1586
  }
package/dist/index.js CHANGED
@@ -2028,6 +2028,51 @@ var PafiBackendClient = class {
2028
2028
  }
2029
2029
  throw lastError;
2030
2030
  }
2031
+ /**
2032
+ * Fetch ERC-4337 UserOp receipt via PAFI's authenticated bundler proxy.
2033
+ * Returns `null` when the bundler hasn't seen the userOp yet — caller
2034
+ * should keep polling. Used by status endpoints to short-circuit the
2035
+ * on-chain indexer when several PENDING locks share the same amount.
2036
+ */
2037
+ async getUserOpReceipt(userOpHash) {
2038
+ const fetchFn = this.config.fetchImpl ?? fetch;
2039
+ const url = `${this.config.url}/bundler/receipt`;
2040
+ let response;
2041
+ try {
2042
+ response = await fetchFn(url, {
2043
+ method: "POST",
2044
+ headers: {
2045
+ "Content-Type": "application/json",
2046
+ Authorization: `Bearer ${this.config.apiKey}`,
2047
+ "X-Issuer-Id": this.config.issuerId
2048
+ },
2049
+ body: JSON.stringify({ userOpHash })
2050
+ });
2051
+ } catch (err) {
2052
+ throw new PafiBackendError(
2053
+ "NETWORK_ERROR",
2054
+ `Network error: ${err instanceof Error ? err.message : String(err)}`,
2055
+ 0
2056
+ );
2057
+ }
2058
+ const text = await response.text();
2059
+ let json = {};
2060
+ try {
2061
+ json = JSON.parse(text);
2062
+ } catch {
2063
+ }
2064
+ if (!response.ok) {
2065
+ const code = json.code ?? "INTERNAL_ERROR";
2066
+ const message = json.message ?? `HTTP ${response.status}`;
2067
+ throw new PafiBackendError(code, message, response.status, json);
2068
+ }
2069
+ if (json.pending) return null;
2070
+ return {
2071
+ success: json.success,
2072
+ txHash: json.txHash,
2073
+ blockNumber: json.blockNumber
2074
+ };
2075
+ }
2031
2076
  async relayUserOperation(request) {
2032
2077
  const fetchFn = this.config.fetchImpl ?? fetch;
2033
2078
  const url = `${this.config.url}/bundler/relay`;
@@ -2110,6 +2155,8 @@ var PafiBackendClient = class {
2110
2155
  callGasLimit: json.callGasLimit != null ? BigInt(json.callGasLimit) : void 0,
2111
2156
  verificationGasLimit: json.verificationGasLimit != null ? BigInt(json.verificationGasLimit) : void 0,
2112
2157
  preVerificationGas: json.preVerificationGas != null ? BigInt(json.preVerificationGas) : void 0,
2158
+ maxFeePerGas: json.maxFeePerGas != null ? BigInt(json.maxFeePerGas) : void 0,
2159
+ maxPriorityFeePerGas: json.maxPriorityFeePerGas != null ? BigInt(json.maxPriorityFeePerGas) : void 0,
2113
2160
  expiresAt: json.expiresAt
2114
2161
  };
2115
2162
  }