@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 +18 -9
- package/dist/index.js +476 -221
- package/dist/index.js.map +1 -1
- package/docs/api.md +16 -8
- package/docs/errors.md +10 -4
- package/docs/getting-started.md +9 -0
- package/docs/guides/transactions.md +9 -0
- package/package.json +1 -1
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.
|
|
182
|
-
*
|
|
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
|
-
*
|
|
189
|
-
*
|
|
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`
|
|
644
|
-
*
|
|
645
|
-
*
|
|
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
|
};
|