@fluent.xyz/connect 0.6.2-rc.1 → 0.6.3

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.ts CHANGED
@@ -178,15 +178,20 @@ declare class FluentSponsorshipFallbackError extends Error {
178
178
  /**
179
179
  * Why a `FluentGasPaymentError` was thrown. `paymaster_unavailable`: the request for the address
180
180
  * of the paymaster that charges Gas tokens on the operation's Network failed, or its answer held
181
- * no address, so the widget has no spender to approve the Gas token to. Keep a `default` branch
182
- * in a `switch` over it: a later release may add a code.
181
+ * no address, so the widget has no spender to approve the Gas token to.
182
+ * `insufficient_gas_token`: the account's balance of the Gas token is below the fee the paymaster
183
+ * quotes for the operation, or the paymaster's simulation could not charge the fee in it.
184
+ * `paymaster_rejected`: the paymaster refused to charge the fee in the Gas token for another
185
+ * reason. Keep a `default` branch in a `switch` over it: a later release may add a code.
183
186
  */
184
- type FluentGasPaymentErrorCode = "paymaster_unavailable";
187
+ type FluentGasPaymentErrorCode = "paymaster_unavailable" | "insufficient_gas_token" | "paymaster_rejected";
185
188
  /**
186
189
  * A Gas token payment the widget could not prepare. Thrown by `execute()` of a Fluent ID's Batch
187
- * operation paid in a Gas token, before any signature is requested and before anything is sent,
188
- * so the operation can be tried again as it is. `code`, a `FluentGasPaymentErrorCode`,
189
- * identifies the failure; `cause` holds the error of the failed request when there was one.
190
+ * operation paid in a Gas token, before any signature is requested and before anything is sent.
191
+ * `code`, a `FluentGasPaymentErrorCode`, identifies the failure, and `message` names the Gas
192
+ * token for `insufficient_gas_token` and `paymaster_rejected`; `cause` holds the error of the
193
+ * failed request when there was one. Paying in ETH (`gasPayment: { symbol: "ETH" }`) avoids every
194
+ * code.
190
195
  */
191
196
  declare class FluentGasPaymentError extends Error {
192
197
  readonly code: FluentGasPaymentErrorCode;
@@ -640,9 +645,13 @@ type FluentBatchOperation = {
640
645
  * the paymaster's authorization of a Gas token payment does not match the fixed gas limits.
641
646
  * Under Sponsorship, a failed check of the paymaster's gas fails the sponsored submission
642
647
  * instead, and the account pays its own gas.
643
- * @throws `FluentGasPaymentError` with `code` `paymaster_unavailable` when a Fluent ID's
644
- * operation is paid in a Gas token and the address of the paymaster to approve it to cannot be
645
- * read; nothing has been signed or sent.
648
+ * @throws `FluentGasPaymentError` when a Fluent ID's operation is paid in a Gas token and
649
+ * cannot be prepared; nothing has been signed or sent. Its `code` is `paymaster_unavailable`
650
+ * when the address of the paymaster to approve the Gas token to cannot be read,
651
+ * `insufficient_gas_token` when the account's balance of the Gas token is below the fee the
652
+ * paymaster quotes for the operation or the paymaster's simulation cannot charge the fee in it,
653
+ * and `paymaster_rejected` when the paymaster refuses to charge the fee in the Gas token for
654
+ * another reason.
646
655
  */
647
656
  execute: (options?: FluentBatchOperationExecuteOptions) => Promise<FluentExecuteResult>;
648
657
  };