@ensforge/core 0.1.0 → 0.2.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/README.md +6 -4
- package/dist/action/index.d.ts +1 -1
- package/dist/actions/batch/execute-write-plan.d.ts.map +1 -1
- package/dist/actions/batch/execute-write-plan.js +20 -2
- package/dist/actions/batch/execute-write-plan.js.map +1 -1
- package/dist/actions/capabilities/get-name-capabilities/index.d.ts +1 -1
- package/dist/actions/capabilities/get-operator-approval/index.d.ts +1 -1
- package/dist/actions/capabilities/get-record-permissions/index.d.ts.map +1 -1
- package/dist/actions/capabilities/get-record-permissions/index.js +13 -1
- package/dist/actions/capabilities/get-record-permissions/index.js.map +1 -1
- package/dist/actions/capabilities/get-required-authorization/index.d.ts +1 -1
- package/dist/actions/capabilities/get-resolver-capabilities/index.d.ts +1 -1
- package/dist/actions/capabilities/get-write-target/index.d.ts +1 -1
- package/dist/actions/dns/get-dns-claim-status/index.d.ts +1 -1
- package/dist/actions/dns/get-dns-import-plan/index.d.ts +1 -1
- package/dist/actions/dns/get-zone-hash/index.d.ts +1 -1
- package/dist/actions/dns/has-dns-records/index.d.ts +1 -1
- package/dist/actions/dns/types.d.ts +3 -3
- package/dist/actions/dns/types.d.ts.map +1 -1
- package/dist/actions/dns/types.js.map +1 -1
- package/dist/actions/events/get-ens-events/index.d.ts +4 -4
- package/dist/actions/events/get-name-history/index.d.ts +4 -4
- package/dist/actions/events/types.d.ts +1 -1
- package/dist/actions/index.d.ts +25 -25
- package/dist/actions/migration/get-migration-eligibility/index.d.ts +1 -1
- package/dist/actions/migration/get-migration-plan/index.d.ts +2 -2
- package/dist/actions/migration/mutation.js +1 -1
- package/dist/actions/name/get-expiry/types.d.ts +2 -2
- package/dist/actions/name/get-name-state/index.d.ts +6 -6
- package/dist/actions/name/get-name-state/types.d.ts +2 -2
- package/dist/actions/name/get-name-status/index.d.ts +1 -1
- package/dist/actions/name/get-owner/index.d.ts +1 -1
- package/dist/actions/name/get-owner/types.d.ts +2 -2
- package/dist/actions/records/get-abi/types.d.ts +2 -2
- package/dist/actions/records/get-address/types.d.ts +2 -2
- package/dist/actions/records/get-avatar/types.d.ts +2 -2
- package/dist/actions/records/get-content-hash/types.d.ts +2 -2
- package/dist/actions/records/get-data/types.d.ts +2 -2
- package/dist/actions/records/get-interface/types.d.ts +2 -2
- package/dist/actions/records/get-name/types.d.ts +2 -2
- package/dist/actions/records/get-pubkey/types.d.ts +2 -2
- package/dist/actions/records/get-records/types.d.ts +3 -3
- package/dist/actions/records/get-text/types.d.ts +2 -2
- package/dist/actions/records/set-records/index.js +1 -1
- package/dist/actions/registration/get-commitment-status/index.d.ts +1 -1
- package/dist/actions/registration/get-registration-parameters/index.d.ts +1 -1
- package/dist/actions/registration/get-registration-plan/index.d.ts +9 -9
- package/dist/actions/registration/get-registration-price/index.d.ts +9 -9
- package/dist/actions/registration/get-renewal-price/index.d.ts +9 -9
- package/dist/actions/registration/is-payment-token-supported/index.d.ts +1 -1
- package/dist/actions/registration/renew-names/index.js +2 -2
- package/dist/actions/registration/renew-names/index.js.map +1 -1
- package/dist/actions/registration/renewal-mutation.d.ts +0 -1
- package/dist/actions/registration/renewal-mutation.d.ts.map +1 -1
- package/dist/actions/registration/renewal-mutation.js +27 -71
- package/dist/actions/registration/renewal-mutation.js.map +1 -1
- package/dist/actions/registration/types.d.ts +3 -3
- package/dist/actions/registration/types.d.ts.map +1 -1
- package/dist/actions/registration/types.js.map +1 -1
- package/dist/actions/resolution/create-resolver/index.d.ts +2 -0
- package/dist/actions/resolution/create-resolver/index.d.ts.map +1 -1
- package/dist/actions/resolution/create-resolver/index.js +39 -21
- package/dist/actions/resolution/create-resolver/index.js.map +1 -1
- package/dist/actions/resolution/create-resolver/prepare.d.ts.map +1 -1
- package/dist/actions/resolution/create-resolver/prepare.js +7 -5
- package/dist/actions/resolution/create-resolver/prepare.js.map +1 -1
- package/dist/actions/resolution/get-alias/index.d.ts.map +1 -1
- package/dist/actions/resolution/get-alias/index.js.map +1 -1
- package/dist/actions/resolution/get-resolver/types.d.ts +2 -2
- package/dist/actions/resolution/get-resolver-version/index.d.ts +1 -1
- package/dist/actions/resolution/resolve/types.d.ts +2 -2
- package/dist/actions/resolution/resolve-batch/index.d.ts +1 -1
- package/dist/actions/resolution/set-resolver/index.js +1 -1
- package/dist/actions/resolution/upgrade-resolver/index.js +1 -1
- package/dist/actions/reverse/get-primary-name/types.d.ts +2 -2
- package/dist/actions/subnames/intents.js +4 -24
- package/dist/actions/subnames/intents.js.map +1 -1
- package/dist/actions/wrapping/intents.js +1 -1
- package/dist/batch.d.ts +10 -0
- package/dist/batch.js +11 -0
- package/dist/{actions/capabilities/index.d.ts → capabilities.d.ts} +15 -15
- package/dist/capabilities.js +17 -0
- package/dist/config/config.d.ts +3 -10
- package/dist/config/config.d.ts.map +1 -1
- package/dist/config/config.js.map +1 -1
- package/dist/config/create-config.d.ts.map +1 -1
- package/dist/config/create-config.js +4 -56
- package/dist/config/create-config.js.map +1 -1
- package/dist/config/index.d.ts +2 -2
- package/dist/dns.d.ts +14 -0
- package/dist/dns.js +13 -0
- package/dist/errors/index.d.ts +2 -2
- package/dist/{actions/events/index.d.ts → events.d.ts} +4 -4
- package/dist/events.js +6 -0
- package/dist/index.d.ts +16 -16
- package/dist/index.js +3 -2
- package/dist/internal/config/create-config.js +54 -0
- package/dist/internal/config/create-config.js.map +1 -0
- package/dist/internal/errors/viem-error.d.ts +1 -1
- package/dist/internal/errors/write-error.js +6 -2
- package/dist/internal/errors/write-error.js.map +1 -1
- package/dist/internal/gateway/ccip-request.js +5 -1
- package/dist/internal/gateway/ccip-request.js.map +1 -1
- package/dist/internal/read/execution-context.d.ts +1 -1
- package/dist/internal/write/execute-sequential.js +41 -13
- package/dist/internal/write/execute-sequential.js.map +1 -1
- package/dist/internal/write/prepare-write-intents.js +1 -1
- package/dist/internal/write/resolver-write-action.js +1 -1
- package/dist/internal/write/resume-sequential.js +62 -0
- package/dist/internal/write/resume-sequential.js.map +1 -0
- package/dist/internal/write/single-write-action.js +1 -1
- package/dist/{actions/migration/index.d.ts → migration.d.ts} +8 -8
- package/dist/migration.js +10 -0
- package/dist/{actions/name/index.d.ts → name.d.ts} +18 -18
- package/dist/name.js +20 -0
- package/dist/{actions/ownership/index.d.ts → ownership.d.ts} +8 -8
- package/dist/ownership.js +8 -0
- package/dist/{actions/permissions/index.d.ts → permissions.d.ts} +12 -12
- package/dist/permissions.js +8 -0
- package/dist/{actions/records/index.d.ts → records.d.ts} +46 -46
- package/dist/records.js +34 -0
- package/dist/{actions/registration/index.d.ts → registration.d.ts} +15 -15
- package/dist/registration.js +16 -0
- package/dist/{actions/resolution/index.d.ts → resolution.d.ts} +20 -20
- package/dist/resolution.js +15 -0
- package/dist/{actions/reverse/index.d.ts → reverse.d.ts} +7 -7
- package/dist/reverse.js +8 -0
- package/dist/{actions/subnames/index.d.ts → subnames.d.ts} +5 -5
- package/dist/subnames.js +6 -0
- package/dist/testing/create-test-config.js +2 -2
- package/dist/wagmi/config.d.ts +9 -0
- package/dist/wagmi/config.d.ts.map +1 -0
- package/dist/wagmi/create-config.d.ts +7 -0
- package/dist/wagmi/create-config.d.ts.map +1 -0
- package/dist/wagmi/create-config.js +20 -0
- package/dist/wagmi/create-config.js.map +1 -0
- package/dist/wagmi.d.ts +3 -0
- package/dist/wagmi.js +3 -0
- package/dist/{actions/wrapping/index.d.ts → wrapping.d.ts} +10 -10
- package/dist/wrapping.js +7 -0
- package/dist/write/types.d.ts +2 -2
- package/package.json +25 -3
- package/dist/actions/batch/index.d.ts +0 -10
- package/dist/actions/dns/index.d.ts +0 -14
package/dist/errors/index.d.ts
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
+
import { RpcError, RpcErrorCode } from "./rpc-error.js";
|
|
2
|
+
import { ContractError, ContractErrorCode } from "./contract-error.js";
|
|
1
3
|
import { AuthorizationError, AuthorizationErrorCode } from "./authorization-error.js";
|
|
2
4
|
import { CodecError, CodecErrorCode } from "./codec-error.js";
|
|
3
5
|
import { ConfigError, ConfigErrorCode } from "./config-error.js";
|
|
4
|
-
import { ContractError, ContractErrorCode } from "./contract-error.js";
|
|
5
6
|
import { DnsImportError, DnsImportErrorCode } from "./dns-import-error.js";
|
|
6
7
|
import { MigrationError, MigrationErrorCode } from "./migration-error.js";
|
|
7
8
|
import { NameError, NameErrorCode } from "./name-error.js";
|
|
8
9
|
import { RegistrationError, RegistrationErrorCode } from "./registration-error.js";
|
|
9
10
|
import { RenewalError, RenewalErrorCode } from "./renewal-error.js";
|
|
10
11
|
import { ReverseNameError, ReverseNameErrorCode } from "./reverse-name-error.js";
|
|
11
|
-
import { RpcError, RpcErrorCode } from "./rpc-error.js";
|
|
12
12
|
import { TransactionError, TransactionErrorCode } from "./transaction-error.js";
|
|
13
13
|
import { WalletError, WalletErrorCode } from "./wallet-error.js";
|
|
14
14
|
import { WritePlanError, WritePlanErrorCode } from "./write-plan-error.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EnsEvent, EnsEventContractKind, EnsEventError, EnsEventKind, GetEnsEventsParameters, GetNameHistoryParameters, NameHistory, WatchEnsEventsParameters } from "./types.js";
|
|
2
|
-
import { getEnsEvents } from "./get-ens-events/index.js";
|
|
3
|
-
import { getNameHistory } from "./get-name-history/index.js";
|
|
4
|
-
import { WatchEnsEvents, watchEnsEvents } from "./watch-ens-events/index.js";
|
|
1
|
+
import { EnsEvent, EnsEventContractKind, EnsEventError, EnsEventKind, GetEnsEventsParameters, GetNameHistoryParameters, NameHistory, WatchEnsEventsParameters } from "./actions/events/types.js";
|
|
2
|
+
import { getEnsEvents } from "./actions/events/get-ens-events/index.js";
|
|
3
|
+
import { getNameHistory } from "./actions/events/get-name-history/index.js";
|
|
4
|
+
import { WatchEnsEvents, watchEnsEvents } from "./actions/events/watch-ens-events/index.js";
|
|
5
5
|
export { EnsEvent, EnsEventContractKind, type EnsEventError, EnsEventKind, type EnsEventError as GetEnsEventsError, type GetEnsEventsParameters, type EnsEventError as GetNameHistoryError, type GetNameHistoryParameters, NameHistory, type WatchEnsEvents, type EnsEventError as WatchEnsEventsError, type WatchEnsEventsParameters, getEnsEvents, getNameHistory, watchEnsEvents };
|
package/dist/events.js
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { getEnsEvents } from "./actions/events/get-ens-events/index.js";
|
|
2
|
+
import { getNameHistory } from "./actions/events/get-name-history/index.js";
|
|
3
|
+
import { watchEnsEvents } from "./actions/events/watch-ens-events/index.js";
|
|
4
|
+
import { EnsEvent, EnsEventContractKind, EnsEventKind, NameHistory } from "./actions/events/types.js";
|
|
5
|
+
|
|
6
|
+
export { EnsEvent, EnsEventContractKind, EnsEventKind, NameHistory, getEnsEvents, getNameHistory, watchEnsEvents };
|
package/dist/index.d.ts
CHANGED
|
@@ -3,38 +3,30 @@ import { GatewayOptions, ResolvedGatewayOptions, defaultGatewayOptions } from ".
|
|
|
3
3
|
import { EnsChainId, EnsNetwork, ensNetworks } from "./config/network.js";
|
|
4
4
|
import { ReadOptions, ResolvedReadOptions, defaultReadOptions } from "./config/read-options.js";
|
|
5
5
|
import { ConfirmationPolicy, ResolvedWriteOptions, SimulationPolicy, WriteOptions, defaultWriteOptions } from "./config/write-options.js";
|
|
6
|
-
import { CreateConfigParameters, CreateViemConfigParameters,
|
|
6
|
+
import { CreateConfigParameters, CreateViemConfigParameters, EnsDeployment, EnsDeploymentProfile, EnsforgeConfig, EnsforgeConfigTypeId, SharedCreateConfigParameters } from "./config/config.js";
|
|
7
7
|
import { createConfig } from "./config/create-config.js";
|
|
8
8
|
import "./config/index.js";
|
|
9
9
|
import { EnsAction, EnsActionEffect, defineAction } from "./action/action.js";
|
|
10
|
-
import { BlockParameters } from "./action/block.js";
|
|
11
10
|
import { EnsReadAction, EnsReadRequest, defineReadAction } from "./action/read-request.js";
|
|
11
|
+
import { RpcError, RpcErrorCode } from "./errors/rpc-error.js";
|
|
12
|
+
import { BlockParameters } from "./action/block.js";
|
|
13
|
+
import { ContractError, ContractErrorCode } from "./errors/contract-error.js";
|
|
14
|
+
import { ReadBatch, ReadBatchError, ReadBatchOptions, ReadBatchOutcome, ReadBatchResult, ReadBatchSettled, ReadBatchSettledResult, readBatch, readBatchSettled } from "./actions/batch/read-batch.js";
|
|
12
15
|
import { AuthorizationError, AuthorizationErrorCode } from "./errors/authorization-error.js";
|
|
13
16
|
import { CodecError, CodecErrorCode } from "./errors/codec-error.js";
|
|
14
17
|
import { ConfigError, ConfigErrorCode } from "./errors/config-error.js";
|
|
15
|
-
import { ContractError, ContractErrorCode } from "./errors/contract-error.js";
|
|
16
18
|
import { DnsImportError, DnsImportErrorCode } from "./errors/dns-import-error.js";
|
|
17
19
|
import { MigrationError, MigrationErrorCode } from "./errors/migration-error.js";
|
|
18
20
|
import { NameError, NameErrorCode } from "./errors/name-error.js";
|
|
19
21
|
import { RegistrationError, RegistrationErrorCode } from "./errors/registration-error.js";
|
|
20
22
|
import { RenewalError, RenewalErrorCode } from "./errors/renewal-error.js";
|
|
21
23
|
import { ReverseNameError, ReverseNameErrorCode } from "./errors/reverse-name-error.js";
|
|
22
|
-
import { RpcError, RpcErrorCode } from "./errors/rpc-error.js";
|
|
23
24
|
import { TransactionError, TransactionErrorCode } from "./errors/transaction-error.js";
|
|
24
25
|
import { WalletError, WalletErrorCode } from "./errors/wallet-error.js";
|
|
25
26
|
import { WritePlanError, WritePlanErrorCode } from "./errors/write-plan-error.js";
|
|
26
27
|
import { CallEstimate, CallExecutionResult, CallsStatusResult, EstimateCallsParameters, EstimateCallsResult, ExecuteWritePlanParameters, FeeEstimate, GetCallsStatusParameters, GetWalletCapabilitiesParameters, NativeBatchResult, PrepareCallsParameters, PreparedWriteCall, ResumeCallsParameters, SendCallsParameters, SendCallsResult, SequentialCallsResult, SimulateCallsParameters, SimulatedWriteCall, WalletCapabilitiesResult, WalletOverrides, WriteAtomicity, WriteError, WriteMode, WritePlan, WritePlanProgress, WriteReceipt, WriteStage, WriteStageResult, WriteWaitCondition } from "./write/types.js";
|
|
27
28
|
import { EnsWriteAction, EnsWriteIntent, EnsWriteIntentPreparer, PreparedWriteCallDetails, WritePreparationContext, defineWriteAction } from "./action/write-intent.js";
|
|
28
29
|
import "./action/index.js";
|
|
29
|
-
import { ReadBatch, ReadBatchError, ReadBatchOptions, ReadBatchOutcome, ReadBatchResult, ReadBatchSettled, ReadBatchSettledResult, readBatch, readBatchSettled } from "./actions/batch/read-batch.js";
|
|
30
|
-
import { executeWritePlan } from "./actions/batch/execute-write-plan.js";
|
|
31
|
-
import { estimateCalls } from "./actions/batch/estimate-calls.js";
|
|
32
|
-
import { getWalletCapabilities } from "./actions/batch/get-wallet-capabilities.js";
|
|
33
|
-
import { getCallsStatus } from "./actions/batch/get-calls-status.js";
|
|
34
|
-
import { prepareCalls } from "./actions/batch/prepare-calls.js";
|
|
35
|
-
import { sendCalls } from "./actions/batch/send-calls.js";
|
|
36
|
-
import { resumeCalls } from "./actions/batch/resume-calls.js";
|
|
37
|
-
import { simulateCalls } from "./actions/batch/simulate-calls.js";
|
|
38
30
|
import { CanonicalNameIdentity, EthereumAddress, RegistryResource } from "./schemas/identity.js";
|
|
39
31
|
import { AvailableNameState, GetNameStateError, GetNameStateParameters, NameState, NameStatus, V1UnwrappedNameState, V1WrappedNameState, V2MigratedNameState, V2NativeNameState, V2ReservedNameState } from "./actions/name/get-name-state/types.js";
|
|
40
32
|
import { AccountCapabilityParameters, AuthorizationDecision, AuthorizationRequirement, AuthorizationSource, CapabilityError, HasRegistryRolesResult, HasResolverRolesResult, NameCapabilities, NameCapabilityParameters, OperatorApprovalResult, OperatorApprovalTarget, RecordOperation, RecordPermission, RecordPermissionsResult, RegistryCapabilities, RegistryOperation, RegistryRolesResult, RequiredAuthorizationResult, ResolverCapabilities, ResolverDelegateApprovalResult, ResolverProfiles, ResolverRolesResult, TokenApprovalResult, WrapperPermissionsResult, WriteOperation, WriteTarget } from "./actions/capabilities/types.js";
|
|
@@ -54,7 +46,7 @@ import { GetWriteTargetParameters, getWriteTarget } from "./actions/capabilities
|
|
|
54
46
|
import { HasRegistryRolesParameters, hasRegistryRoles } from "./actions/capabilities/has-registry-roles/index.js";
|
|
55
47
|
import { HasResolverRolesParameters, hasResolverRoles } from "./actions/capabilities/has-resolver-roles/index.js";
|
|
56
48
|
import { NormalizedLabel, NormalizedName } from "./schemas/name.js";
|
|
57
|
-
import { ClaimDnsNameError, ClaimDnsNameIntent, ClaimDnsNameParameters, ClaimDnsNameResult, DnsClaimStatus, DnsImportPlan, DnsReadError, DnsRecordQuery, DnsRecordResult, DnsRecordsExistence, DnsRecordsResult, DnsResource, DnssecProof, DnssecProofChain, GetDnsRecordParameters, GetDnsRecordsParameters, ImportDnsNameError, ImportDnsNameParameters, ImportDnsNameResult, ZoneHashResult } from "./actions/dns/types.js";
|
|
49
|
+
import { ClaimDnsNameError, ClaimDnsNameIntent, ClaimDnsNameParameters, ClaimDnsNameResult, DnsClaimStatus, DnsImportPlan, DnsReadError, DnsRecordQuery, DnsRecordResult, DnsRecordsExistence, DnsRecordsResult, DnsResource, DnsWriteWalletParameters, DnssecProof, DnssecProofChain, GetDnsRecordParameters, GetDnsRecordsParameters, ImportDnsNameError, ImportDnsNameParameters, ImportDnsNameResult, ZoneHashResult } from "./actions/dns/types.js";
|
|
58
50
|
import { claimDnsName } from "./actions/dns/claim-dns-name/index.js";
|
|
59
51
|
import { importDnsName } from "./actions/dns/import-dns-name/index.js";
|
|
60
52
|
import { Hex } from "./schemas/hex.js";
|
|
@@ -164,7 +156,7 @@ import { SetNameError, SetNameParameters, SetNameResult } from "./actions/record
|
|
|
164
156
|
import { setName } from "./actions/records/set-name/index.js";
|
|
165
157
|
import { ClearAvatarError, ClearAvatarParameters, ClearAvatarResult, SetAvatarError, SetAvatarParameters, SetAvatarResult } from "./actions/records/set-avatar/types.js";
|
|
166
158
|
import { clearAvatar, setAvatar } from "./actions/records/set-avatar/index.js";
|
|
167
|
-
import { ApprovePaymentTokenParameters, ApproveRenewalPaymentParameters, AvailableRegistrationPrice, CommitNameParameters, CommitmentStatus, CompleteRegistrationParameters, Erc20PaymentCurrency, NativePaymentCurrency, PaymentCurrency, PaymentTokenSupport, RegisterNameParameters, RegisterNameResult, RegisterNamesEntryParameters, RegisterNamesParameters, RegisterNamesResult, RegistrationCommitment, RegistrationCommitmentParameters, RegistrationParameters, RegistrationPlan, RegistrationPriceParameters, RegistrationPriceResult, RegistrationReadError, RegistrationWriteError, RegistrationWriteIntent, RegistrationWriteResult, RenewNameAction, RenewNameCallParameters, RenewNameParameters, RenewNameResult, RenewNamesEntryParameters, RenewNamesParameters, RenewNamesResult, RenewalApproval, RenewalPriceResult, RenewalRoute } from "./actions/registration/types.js";
|
|
159
|
+
import { ApprovePaymentTokenParameters, ApproveRenewalPaymentParameters, AvailableRegistrationPrice, CommitNameParameters, CommitmentStatus, CompleteRegistrationParameters, Erc20PaymentCurrency, NativePaymentCurrency, PaymentCurrency, PaymentTokenSupport, RegisterNameParameters, RegisterNameResult, RegisterNamesEntryParameters, RegisterNamesParameters, RegisterNamesResult, RegistrationCommitment, RegistrationCommitmentParameters, RegistrationParameters, RegistrationPlan, RegistrationPriceParameters, RegistrationPriceResult, RegistrationReadError, RegistrationWalletParameters, RegistrationWriteError, RegistrationWriteIntent, RegistrationWriteResult, RenewNameAction, RenewNameCallParameters, RenewNameParameters, RenewNameResult, RenewNamesEntryParameters, RenewNamesParameters, RenewNamesResult, RenewalApproval, RenewalPriceResult, RenewalRoute } from "./actions/registration/types.js";
|
|
168
160
|
import { GetCommitmentStatusParameters, getCommitmentStatus } from "./actions/registration/get-commitment-status/index.js";
|
|
169
161
|
import { GetRegistrationParametersParameters, getRegistrationParameters } from "./actions/registration/get-registration-parameters/index.js";
|
|
170
162
|
import { GetRegistrationPlanParameters, getRegistrationPlan } from "./actions/registration/get-registration-plan/index.js";
|
|
@@ -230,4 +222,12 @@ import { normalizeLabel, normalizeName } from "./names/normalize.js";
|
|
|
230
222
|
import "./names/index.js";
|
|
231
223
|
import "./schemas/index.js";
|
|
232
224
|
import "./write/index.js";
|
|
233
|
-
export { Abi, AbiContentType, AbiRecordData, AbiResult, AccountCapabilityParameters, AddressRecordData, type AddressRecordInput, AddressResult, AliasResult, type AppliedRecordPermission, type ApproveMigrationParameters, type ApproveMigrationResult, type ApproveNameError, type ApproveNameIntent, type ApproveNameParameters, type ApproveNameResult, type ApprovePaymentTokenParameters, type ApproveRenewalPaymentParameters, AuthorizationDecision, AuthorizationError, AuthorizationErrorCode, AuthorizationRequirement, AuthorizationSource, AvailableNameState, type AvailableRegistrationPrice, AvatarResult, type BlockParameters, Bytes32, type CallEstimate, type CallExecutionResult, type CallsStatusResult, CanonicalNameIdentity, CapabilityError, type ClaimDnsNameError, type ClaimDnsNameIntent, type ClaimDnsNameParameters, type ClaimDnsNameResult, type ClearAvatarError, type ClearAvatarParameters, type ClearAvatarResult, type ClearNameApprovalError, type ClearNameApprovalIntent, type ClearNameApprovalParameters, type ClearNameApprovalResult, type ReverseNameWriteError as ClearPrimaryNameError, type ClearPrimaryNameParameters, type ReverseNameWriteResult as ClearPrimaryNameResult, type ClearRecordsError, type ClearRecordsParameters, type ClearRecordsResult, CodecError, CodecErrorCode, CoinType, type CoinTypeNamespace, type CommitNameParameters, CommitmentStatus, type CompleteRegistrationParameters, ConfigError, ConfigErrorCode, ConfirmationPolicy, ContentHash, ContentHashProtocol, ContentHashResult, ContractError, ContractErrorCode, type CreateConfigParameters, type CreateResolverError, type CreateResolverIntent, type CreateResolverParameters, type CreateResolverResult, type SubnameError as CreateSubnameError, type CreateSubnameParameters, type CreateSubnameResult, type CreateViemConfigParameters, type CreateWagmiConfigParameters, DataResult, type DecodeAddressRecordParameters, type DecodedContentHash, type SubnameError as DeleteSubnameError, type SubnameParameters as DeleteSubnameParameters, type SubnameWriteResult as DeleteSubnameResult, DnsClaimStatus, DnsEncodedName, DnsImportError, DnsImportErrorCode, DnsImportPlan, type DnsReadError, type DnsRecordQuery, DnsRecordResult, DnsRecordsExistence, DnsRecordsResult, DnsResource, DnssecProof, DnssecProofChain, type EncodeAddressRecordParameters, type EncodeContentHashParameters, type EnsAction, type EnsActionEffect, type EnsChainId, type EnsDeployment, type EnsDeploymentProfile, EnsEvent, EnsEventContractKind, type EnsEventError, EnsEventKind, type EnsNetwork, EnsProtocol, type EnsReadAction, type EnsReadRequest, type EnsWriteAction, type EnsWriteIntent, type EnsWriteIntentPreparer, type EnsforgeConfig, Erc20PaymentCurrency, type EstimateCallsParameters, type EstimateCallsResult, EthereumAddress, type ExecuteWritePlanParameters, ExpiryResult, ExpirySource, type WrapperWriteError as ExtendSubnameExpiryError, type WrapperWriteIntent as ExtendSubnameExpiryIntent, type ExtendSubnameExpiryParameters, type WrapperWriteResult as ExtendSubnameExpiryResult, type FeeEstimate, GatewayError, GatewayErrorCode, type GatewayOptions, type GetAbiError, type GetAbiParameters, type GetAddressError, type GetAddressParameters, type GetAddressesError, type GetAddressesParameters, type GetAliasError, type GetAliasParameters, type GetAvatarError, type GetAvatarParameters, type GetCallsStatusParameters, type GetNameStateError as GetCanonicalResourceError, type GetNameStateParameters as GetCanonicalResourceParameters, type GetCanonicalResourceResult, type RegistrationReadError as GetCommitmentStatusError, type GetCommitmentStatusParameters, type GetContentHashError, type GetContentHashParameters, type GetDataError, type GetDataParameters, type DnsReadError as GetDnsClaimStatusError, type GetDnsClaimStatusParameters, type DnsReadError as GetDnsImportPlanError, type GetDnsImportPlanParameters, type DnsReadError as GetDnsRecordError, type GetDnsRecordParameters, type DnsReadError as GetDnsRecordsError, type GetDnsRecordsParameters, type EnsEventError as GetEnsEventsError, type GetEnsEventsParameters, type GetExpiryError, type GetExpiryParameters, type WrapperReadError as GetFusesError, type WrapperReadParameters as GetFusesParameters, type GetFusesResult, type GetInterfaceError, type GetInterfaceParameters, type GetNameStateError as GetManagerError, type GetNameStateParameters as GetManagerParameters, type GetManagerResult, type MigrationReadError as GetMigrationEligibilityError, type GetMigrationEligibilityParameters, type MigrationReadError as GetMigrationPlanError, type GetMigrationPlanParameters, type MigrationReadError as GetMigrationStatusError, type MigrationNameParameters as GetMigrationStatusParameters, type MigrationReadError as GetMigrationTargetError, type MigrationNameParameters as GetMigrationTargetParameters, type CapabilityError as GetNameCapabilitiesError, GetNameCapabilitiesParameters, type GetNameError, type EnsEventError as GetNameHistoryError, type GetNameHistoryParameters, type GetNameParameters, type GetNameStateError, type GetNameStateParameters, type GetNameStateError as GetNameStatusError, type GetNameStateParameters as GetNameStatusParameters, type NameStatus as GetNameStatusResult, type CapabilityError as GetOperatorApprovalError, GetOperatorApprovalParameters, type GetOrCreateResolverError, type GetOrCreateResolverParameters, type GetOrCreateResolverResult, type GetOwnerError, type GetOwnerParameters, type GetPrimaryNameError, type GetPrimaryNameParameters, type GetNameStateError as GetProtocolError, type GetNameStateParameters as GetProtocolParameters, type GetProtocolResult, type GetPubkeyError, type GetPubkeyParameters, type CapabilityError as GetRecordPermissionsError, GetRecordPermissionsParameters, type GetRecordsAction, type GetRecordsError, type GetRecordsParameters, type GetRecordsResult, type GetRecordsSelection, type GetNameStateError as GetRegistrantError, type GetNameStateParameters as GetRegistrantParameters, type GetRegistrantResult, type RegistrationReadError as GetRegistrationParametersError, type GetRegistrationParametersParameters, type RegistrationReadError as GetRegistrationPlanError, type GetRegistrationPlanParameters, type RegistrationReadError as GetRegistrationPriceError, type RegistrationPriceParameters as GetRegistrationPriceParameters, type CapabilityError as GetRegistryCapabilitiesError, type NameCapabilityParameters as GetRegistryCapabilitiesParameters, type GetNameStateError as GetRegistryError, type GetNameStateParameters as GetRegistryParameters, type GetRegistryResult, type CapabilityError as GetRegistryRolesError, type AccountCapabilityParameters as GetRegistryRolesParameters, type RegistrationReadError as GetRenewalPriceError, type RegistrationPriceParameters as GetRenewalPriceParameters, type CapabilityError as GetRequiredAuthorizationError, GetRequiredAuthorizationParameters, type CapabilityError as GetResolverCapabilitiesError, type NameCapabilityParameters as GetResolverCapabilitiesParameters, type CapabilityError as GetResolverDelegateApprovalError, GetResolverDelegateApprovalParameters, type GetResolverError, type GetResolverParameters, type GetResolverResult, type CapabilityError as GetResolverRolesError, GetResolverRolesParameters, type GetResolverVersionError, type GetResolverVersionParameters, type GetTextError, type GetTextParameters, type GetTextsError, type GetTextsParameters, type CapabilityError as GetTokenApprovalError, type NameCapabilityParameters as GetTokenApprovalParameters, type GetNameStateError as GetTokenIdError, type GetNameStateParameters as GetTokenIdParameters, type GetTokenIdResult, type GetNameStateError as GetTtlError, type GetNameStateParameters as GetTtlParameters, type TtlResult as GetTtlResult, type GetWalletCapabilitiesParameters, type WrapperReadError as GetWrapperExpiryError, type WrapperReadParameters as GetWrapperExpiryParameters, type GetWrapperExpiryResult, type CapabilityError as GetWrapperPermissionsError, type AccountCapabilityParameters as GetWrapperPermissionsParameters, type CapabilityError as GetWriteTargetError, GetWriteTargetParameters, type DnsReadError as GetZoneHashError, type GetZoneHashParameters, type GrantRegistryRolesError, type GrantRegistryRolesIntent, type GrantRegistryRolesParameters, type GrantRegistryRolesResult, type GrantResolverRolesError, type GrantResolverRolesIntent, type GrantResolverRolesParameters, type GrantResolverRolesResult, type GrantResolverRootRolesError, type GrantResolverRootRolesIntent, type GrantResolverRootRolesParameters, type GrantResolverRootRolesResult, type DnsReadError as HasDnsRecordsError, type HasDnsRecordsParameters, type CapabilityError as HasRegistryRolesError, HasRegistryRolesParameters, HasRegistryRolesResult, type CapabilityError as HasResolverRolesError, HasResolverRolesParameters, HasResolverRolesResult, Hex, type ImportDnsNameError, type ImportDnsNameParameters, type ImportDnsNameResult, InterfaceId, InterfaceResult, type GetNameStateError as IsAvailableError, type GetNameStateParameters as IsAvailableParameters, type GetNameStateError as IsMigratedError, type GetNameStateParameters as IsMigratedParameters, type RegistrationReadError as IsPaymentTokenSupportedError, type IsPaymentTokenSupportedParameters, type GetNameStateError as IsRenewableError, type GetNameStateParameters as IsRenewableParameters, type GetNameStateError as IsReservedError, type GetNameStateParameters as IsReservedParameters, type GetNameStateError as IsWrappedError, type GetNameStateParameters as IsWrappedParameters, Labelhash, type RegistrationReadError as MakeRegistrationCommitmentError, type RegistrationCommitmentParameters as MakeRegistrationCommitmentParameters, type MigrateNameAction, type MigrateNameCallParameters, type MigrateNameParameters, type MigrateNameResult, type MigrateNamesParameters, type MigrationBatchApproval, type MigrationBatchEntry, type MigrationBatchProgress, MigrationBlocker, MigrationEligibility, MigrationError, MigrationErrorCode, type MigrationNameParameters, type MigrationNameProgress, MigrationPlan, type MigrationReadError, MigrationStatus, MigrationTarget, MigrationUnsupportedReason, type MigrationValues, type MigrationWalletParameters, type MigrationWriteError, type NameAnalysis, NameCapabilities, NameCapabilityParameters, NameError, NameErrorCode, NameHistory, type NameKind, NameResult, NameState, NameStatus, type NameWrapperFuseName, Namehash, type NativeBatchResult, NativePaymentCurrency, NormalizedLabel, NormalizedName, type OperatorApprovalKind, OperatorApprovalResult, OperatorApprovalTarget, OwnerResult, OwnershipLevel, PaymentCurrency, PaymentTokenSupport, type PrepareCallsParameters, type PreparedWriteCall, type PreparedWriteCallDetails, PrimaryNameResult, PubkeyResult, type ReadBatch, type ReadBatchError, type ReadBatchOptions, type ReadBatchOutcome, type ReadBatchResult, type ReadBatchSettled, type ReadBatchSettledResult, type ReadOptions, type OwnershipWriteError as ReclaimNameError, type ReclaimNameParameters, type OwnershipWriteResult as ReclaimNameResult, RecordOperation, RecordPermission, RecordPermissionsResult, type RegisterNameParameters, type RegisterNameResult, type RegisterNamesEntryParameters, type RegisterNamesParameters, type RegisterNamesResult, RegistrationCommitment, RegistrationError, RegistrationErrorCode, RegistrationParameters, RegistrationPlan, RegistrationPriceResult, type RegistrationReadError, type RegistrationWriteError, type RegistrationWriteIntent, type RegistrationWriteResult, RegistryCapabilities, RegistryOperation, RegistryResource, type RegistryRolesMutationParameters, RegistryRolesResult, type RenewNameAction, type RenewNameCallParameters, type RenewNameParameters, type RenewNameResult, type RenewNamesEntryParameters, type RenewNamesParameters, type RenewNamesResult, type RenewalApproval, RenewalError, RenewalErrorCode, RenewalPriceResult, RenewalRoute, RequiredAuthorizationResult, type ResolveBatchCall, type ResolveBatchError, type ResolveBatchParameters, type ResolveBatchResult, type ResolveError, type ResolveParameters, ResolveResult, type ResolveWithResolverError, type ResolveWithResolverParameters, ResolveWithResolverResult, type ResolvedGatewayOptions, type ResolvedReadOptions, type ResolvedWriteOptions, ResolverCapabilities, ResolverDelegateApprovalResult, type ResolverMulticallResult, ResolverProfiles, type ResolverRolesMutationParameters, ResolverRolesResult, type ResolverRootRolesMutationParameters, type ResolverSource, ResolverVersionResult, type ResumeCallsParameters, ReverseNameError, ReverseNameErrorCode, type ReverseNameWriteError, type ReverseNameWriteResult, type RevokeRegistryRolesError, type RevokeRegistryRolesIntent, type RevokeRegistryRolesParameters, type RevokeRegistryRolesResult, type RevokeResolverRolesError, type RevokeResolverRolesIntent, type RevokeResolverRolesParameters, type RevokeResolverRolesResult, type RevokeResolverRootRolesError, type RevokeResolverRootRolesIntent, type RevokeResolverRootRolesParameters, type RevokeResolverRootRolesResult, RpcError, RpcErrorCode, type SendCallsParameters, type SendCallsResult, type SequentialCallsResult, type SetAbiError, type SetAbiParameters, type SetAbiResult, type SetAddressError, type SetAddressParameters, type SetAddressResult, type SetAddressesError, type SetAddressesParameters, type SetAddressesResult, type SetAliasError, type SetAliasParameters, type SetAliasResult, type SetAvatarError, type SetAvatarParameters, type SetAvatarResult, type WrapperWriteError as SetChildFusesError, type WrapperWriteIntent as SetChildFusesIntent, type SetChildFusesParameters, type WrapperWriteResult as SetChildFusesResult, type SetContentHashError, type SetContentHashParameters, type SetContentHashResult, type ReverseNameWriteError as SetContractPrimaryNameError, type SetContractPrimaryNameParameters, type ReverseNameWriteResult as SetContractPrimaryNameResult, type SetDataError, type SetDataParameters, type SetDataResult, type SetDnsRecordsError, type SetDnsRecordsParameters, type SetDnsRecordsResult, type WrapperWriteError as SetFusesError, type WrapperWriteIntent as SetFusesIntent, type SetFusesParameters, type WrapperWriteResult as SetFusesResult, type SetInterfaceError, type SetInterfaceParameters, type SetInterfaceResult, type OwnershipWriteError as SetManagerError, type SetManagerParameters, type OwnershipWriteResult as SetManagerResult, type SetNameError, type SetNameParameters, type SetNameResult, type SetOperatorApprovalError, type SetOperatorApprovalIntent, type SetOperatorApprovalParameters, type SetOperatorApprovalResult, type ReverseNameWriteError as SetPrimaryNameError, type ReverseNameWriteError as SetPrimaryNameForAddressError, type SetPrimaryNameForAddressParameters, type ReverseNameWriteResult as SetPrimaryNameForAddressResult, type SetPrimaryNameParameters, type ReverseNameWriteResult as SetPrimaryNameResult, type SetPubkeyError, type SetPubkeyParameters, type SetPubkeyResult, type SetRecordInput, type SetRecordPermissionsError, type SetRecordPermissionsParameters, type SetRecordPermissionsResult, type SetRecordsAction, type SetRecordsError, type SetRecordsParameters, type SetRecordsResult, type SetResolverAndRecordsError, type SetResolverAndRecordsParameters, type SetResolverAndRecordsProgress, type SetResolverAndRecordsResult, type SetResolverDelegateApprovalError, type SetResolverDelegateApprovalIntent, type SetResolverDelegateApprovalParameters, type SetResolverDelegateApprovalResult, type SetResolverError, type SetResolverParameters, type SetResolverResult, type SubnameError as SetSubnameExpiryError, type SetSubnameExpiryParameters, type SubnameWriteResult as SetSubnameExpiryResult, type SubnameError as SetSubnameManagerError, type SetSubnameManagerParameters, type SubnameWriteResult as SetSubnameManagerResult, type SubnameError as SetSubnameRecordError, type SetSubnameRecordParameters, type SetSubnameRecordResult, type SubnameError as SetSubnameResolverError, type SetSubnameResolverParameters, type SubnameWriteResult as SetSubnameResolverResult, type SetTextError, type SetTextParameters, type SetTextResult, type SetTextsError, type SetTextsParameters, type SetTextsResult, type OwnershipWriteError as SetTtlError, type SetTtlParameters, type OwnershipWriteResult as SetTtlResult, type SetZoneHashError, type SetZoneHashParameters, type SetZoneHashResult, type SimulateCallsParameters, type SimulatedWriteCall, SimulationPolicy, type TextRecordInput, TextResult, TokenApprovalResult, TransactionError, TransactionErrorCode, type TransferNameError, type TransferNameParameters, type TransferNameProgress, type TransferNameResult, type TransferNameStrategy, type OwnershipWriteError as TransferRegistrantError, type TransferRegistrantParameters, type OwnershipWriteResult as TransferRegistrantResult, type SubnameError as TransferSubnameError, type TransferSubnameParameters, type WrapperWriteError as UnwrapNameError, type WrapperWriteIntent as UnwrapNameIntent, type UnwrapNameParameters, type WrapperWriteResult as UnwrapNameResult, type UpgradeResolverError, type UpgradeResolverIntent, type UpgradeResolverParameters, type UpgradeResolverResult, V1UnwrappedNameState, V1WrappedNameState, V2MigratedNameState, V2NativeNameState, V2ReservedNameState, type WalletCapabilitiesResult, WalletError, WalletErrorCode, type WalletOverrides, type WatchEnsEvents, type EnsEventError as WatchEnsEventsError, type WatchEnsEventsParameters, type WrapperWriteError as WrapNameError, type WrapNameParameters, type WrapNameResult, WrapperPermissionsResult, type WrapperReadError, type WrapperReadParameters, type WrapperUnsupportedReason, type WrapperWriteError, type WrapperWriteIntent, type WrapperWriteResult, WriteAtomicity, type WriteError, WriteMode, WriteOperation, type WriteOptions, type WritePlan, WritePlanError, WritePlanErrorCode, type WritePlanProgress, type WritePreparationContext, type WriteReceipt, type WriteStage, type WriteStageResult, WriteTarget, type WriteWaitCondition, ZoneHashResult, analyzeName, approveMigration, approveName, approvePaymentToken, approveRenewalPayment, claimDnsName, clearAvatar, clearNameApproval, clearPrimaryName, clearRecords, commitName, completeRegistration, createConfig, createResolver, createSubname, decodeAddressRecord, decodeContentHash, decodeFuseMask, defaultGatewayOptions, defaultReadOptions, defaultWriteOptions, defineAction, defineReadAction, defineWriteAction, deleteSubname, dnsDecodeName, dnsEncodeName, encodeAddressRecord, encodeContentHash, encodeFuseMask, ensNetworks, estimateCalls, executeWritePlan, extendSubnameExpiry, fromCoinType, getAbi, getAddress, getAddresses, getAlias, getAvatar, getCallsStatus, getCanonicalResource, getCommitmentStatus, getContentHash, getData, getDnsClaimStatus, getDnsImportPlan, getDnsRecord, getDnsRecords, getEnsEvents, getExpiry, getFuses, getInterface, getManager, getMigrationEligibility, getMigrationPlan, getMigrationStatus, getMigrationTarget, getName, getNameCapabilities, getNameHistory, getNameState, getNameStatus, getOperatorApproval, getOrCreateResolver, getOwner, getPrimaryName, getProtocol, getPubkey, getRecordPermissions, getRecords, getRegistrant, getRegistrationParameters, getRegistrationPlan, getRegistrationPrice, getRegistry, getRegistryCapabilities, getRegistryRoles, getRenewalPrice, getRequiredAuthorization, getResolver, getResolverCapabilities, getResolverDelegateApproval, getResolverRoles, getResolverVersion, getText, getTexts, getTokenApproval, getTokenId, getTtl, getWalletCapabilities, getWrapperExpiry, getWrapperPermissions, getWriteTarget, getZoneHash, grantRegistryRoles, grantResolverRoles, grantResolverRootRoles, hasDnsRecords, hasRegistryRoles, hasResolverRoles, importDnsName, isAvailable, isMigrated, isPaymentTokenSupported, isRenewable, isReserved, isWrapped, labelhash, makeRegistrationCommitment, migrateName, migrateNames, nameWrapperFuseNames, namehash, normalizeLabel, normalizeName, predictResolverAddress, prepareCalls, readBatch, readBatchSettled, reclaimName, registerName, registerNames, renewName, renewNames, resolve, resolveBatch, resolveWithResolver, resumeCalls, revokeRegistryRoles, revokeResolverRoles, revokeResolverRootRoles, sendCalls, setAbi, setAddress, setAddresses, setAlias, setAvatar, setChildFuses, setContentHash, setContractPrimaryName, setData, setDnsRecords, setFuses, setInterface, setManager, setName, setOperatorApproval, setPrimaryName, setPrimaryNameForAddress, setPubkey, setRecordPermissions, setRecords, setResolver, setResolverAndRecords, setResolverDelegateApproval, setSubnameExpiry, setSubnameManager, setSubnameRecord, setSubnameResolver, setText, setTexts, setTtl, setZoneHash, simulateCalls, toCoinType, transferName, transferRegistrant, transferSubname, unwrapName, upgradeResolver, watchEnsEvents, wrapName, wrapperFuseMasks };
|
|
225
|
+
import { executeWritePlan } from "./actions/batch/execute-write-plan.js";
|
|
226
|
+
import { estimateCalls } from "./actions/batch/estimate-calls.js";
|
|
227
|
+
import { getWalletCapabilities } from "./actions/batch/get-wallet-capabilities.js";
|
|
228
|
+
import { getCallsStatus } from "./actions/batch/get-calls-status.js";
|
|
229
|
+
import { prepareCalls } from "./actions/batch/prepare-calls.js";
|
|
230
|
+
import { sendCalls } from "./actions/batch/send-calls.js";
|
|
231
|
+
import { resumeCalls } from "./actions/batch/resume-calls.js";
|
|
232
|
+
import { simulateCalls } from "./actions/batch/simulate-calls.js";
|
|
233
|
+
export { Abi, AbiContentType, AbiRecordData, AbiResult, AccountCapabilityParameters, AddressRecordData, type AddressRecordInput, AddressResult, AliasResult, type AppliedRecordPermission, type ApproveMigrationParameters, type ApproveMigrationResult, type ApproveNameError, type ApproveNameIntent, type ApproveNameParameters, type ApproveNameResult, type ApprovePaymentTokenParameters, type ApproveRenewalPaymentParameters, AuthorizationDecision, AuthorizationError, AuthorizationErrorCode, AuthorizationRequirement, AuthorizationSource, AvailableNameState, type AvailableRegistrationPrice, AvatarResult, type BlockParameters, Bytes32, type CallEstimate, type CallExecutionResult, type CallsStatusResult, CanonicalNameIdentity, CapabilityError, type ClaimDnsNameError, type ClaimDnsNameIntent, type ClaimDnsNameParameters, type ClaimDnsNameResult, type ClearAvatarError, type ClearAvatarParameters, type ClearAvatarResult, type ClearNameApprovalError, type ClearNameApprovalIntent, type ClearNameApprovalParameters, type ClearNameApprovalResult, type ReverseNameWriteError as ClearPrimaryNameError, type ClearPrimaryNameParameters, type ReverseNameWriteResult as ClearPrimaryNameResult, type ClearRecordsError, type ClearRecordsParameters, type ClearRecordsResult, CodecError, CodecErrorCode, CoinType, type CoinTypeNamespace, type CommitNameParameters, CommitmentStatus, type CompleteRegistrationParameters, ConfigError, ConfigErrorCode, ConfirmationPolicy, ContentHash, ContentHashProtocol, ContentHashResult, ContractError, ContractErrorCode, type CreateConfigParameters, type CreateResolverError, type CreateResolverIntent, type CreateResolverParameters, type CreateResolverResult, type SubnameError as CreateSubnameError, type CreateSubnameParameters, type CreateSubnameResult, type CreateViemConfigParameters, DataResult, type DecodeAddressRecordParameters, type DecodedContentHash, type SubnameError as DeleteSubnameError, type SubnameParameters as DeleteSubnameParameters, type SubnameWriteResult as DeleteSubnameResult, DnsClaimStatus, DnsEncodedName, DnsImportError, DnsImportErrorCode, DnsImportPlan, type DnsReadError, type DnsRecordQuery, DnsRecordResult, DnsRecordsExistence, DnsRecordsResult, DnsResource, type DnsWriteWalletParameters, DnssecProof, DnssecProofChain, type EncodeAddressRecordParameters, type EncodeContentHashParameters, type EnsAction, type EnsActionEffect, type EnsChainId, type EnsDeployment, type EnsDeploymentProfile, EnsEvent, EnsEventContractKind, type EnsEventError, EnsEventKind, type EnsNetwork, EnsProtocol, type EnsReadAction, type EnsReadRequest, type EnsWriteAction, type EnsWriteIntent, type EnsWriteIntentPreparer, type EnsforgeConfig, EnsforgeConfigTypeId, Erc20PaymentCurrency, type EstimateCallsParameters, type EstimateCallsResult, EthereumAddress, type ExecuteWritePlanParameters, ExpiryResult, ExpirySource, type WrapperWriteError as ExtendSubnameExpiryError, type WrapperWriteIntent as ExtendSubnameExpiryIntent, type ExtendSubnameExpiryParameters, type WrapperWriteResult as ExtendSubnameExpiryResult, type FeeEstimate, GatewayError, GatewayErrorCode, type GatewayOptions, type GetAbiError, type GetAbiParameters, type GetAddressError, type GetAddressParameters, type GetAddressesError, type GetAddressesParameters, type GetAliasError, type GetAliasParameters, type GetAvatarError, type GetAvatarParameters, type GetCallsStatusParameters, type GetNameStateError as GetCanonicalResourceError, type GetNameStateParameters as GetCanonicalResourceParameters, type GetCanonicalResourceResult, type RegistrationReadError as GetCommitmentStatusError, type GetCommitmentStatusParameters, type GetContentHashError, type GetContentHashParameters, type GetDataError, type GetDataParameters, type DnsReadError as GetDnsClaimStatusError, type GetDnsClaimStatusParameters, type DnsReadError as GetDnsImportPlanError, type GetDnsImportPlanParameters, type DnsReadError as GetDnsRecordError, type GetDnsRecordParameters, type DnsReadError as GetDnsRecordsError, type GetDnsRecordsParameters, type EnsEventError as GetEnsEventsError, type GetEnsEventsParameters, type GetExpiryError, type GetExpiryParameters, type WrapperReadError as GetFusesError, type WrapperReadParameters as GetFusesParameters, type GetFusesResult, type GetInterfaceError, type GetInterfaceParameters, type GetNameStateError as GetManagerError, type GetNameStateParameters as GetManagerParameters, type GetManagerResult, type MigrationReadError as GetMigrationEligibilityError, type GetMigrationEligibilityParameters, type MigrationReadError as GetMigrationPlanError, type GetMigrationPlanParameters, type MigrationReadError as GetMigrationStatusError, type MigrationNameParameters as GetMigrationStatusParameters, type MigrationReadError as GetMigrationTargetError, type MigrationNameParameters as GetMigrationTargetParameters, type CapabilityError as GetNameCapabilitiesError, GetNameCapabilitiesParameters, type GetNameError, type EnsEventError as GetNameHistoryError, type GetNameHistoryParameters, type GetNameParameters, type GetNameStateError, type GetNameStateParameters, type GetNameStateError as GetNameStatusError, type GetNameStateParameters as GetNameStatusParameters, type NameStatus as GetNameStatusResult, type CapabilityError as GetOperatorApprovalError, GetOperatorApprovalParameters, type GetOrCreateResolverError, type GetOrCreateResolverParameters, type GetOrCreateResolverResult, type GetOwnerError, type GetOwnerParameters, type GetPrimaryNameError, type GetPrimaryNameParameters, type GetNameStateError as GetProtocolError, type GetNameStateParameters as GetProtocolParameters, type GetProtocolResult, type GetPubkeyError, type GetPubkeyParameters, type CapabilityError as GetRecordPermissionsError, GetRecordPermissionsParameters, type GetRecordsAction, type GetRecordsError, type GetRecordsParameters, type GetRecordsResult, type GetRecordsSelection, type GetNameStateError as GetRegistrantError, type GetNameStateParameters as GetRegistrantParameters, type GetRegistrantResult, type RegistrationReadError as GetRegistrationParametersError, type GetRegistrationParametersParameters, type RegistrationReadError as GetRegistrationPlanError, type GetRegistrationPlanParameters, type RegistrationReadError as GetRegistrationPriceError, type RegistrationPriceParameters as GetRegistrationPriceParameters, type CapabilityError as GetRegistryCapabilitiesError, type NameCapabilityParameters as GetRegistryCapabilitiesParameters, type GetNameStateError as GetRegistryError, type GetNameStateParameters as GetRegistryParameters, type GetRegistryResult, type CapabilityError as GetRegistryRolesError, type AccountCapabilityParameters as GetRegistryRolesParameters, type RegistrationReadError as GetRenewalPriceError, type RegistrationPriceParameters as GetRenewalPriceParameters, type CapabilityError as GetRequiredAuthorizationError, GetRequiredAuthorizationParameters, type CapabilityError as GetResolverCapabilitiesError, type NameCapabilityParameters as GetResolverCapabilitiesParameters, type CapabilityError as GetResolverDelegateApprovalError, GetResolverDelegateApprovalParameters, type GetResolverError, type GetResolverParameters, type GetResolverResult, type CapabilityError as GetResolverRolesError, GetResolverRolesParameters, type GetResolverVersionError, type GetResolverVersionParameters, type GetTextError, type GetTextParameters, type GetTextsError, type GetTextsParameters, type CapabilityError as GetTokenApprovalError, type NameCapabilityParameters as GetTokenApprovalParameters, type GetNameStateError as GetTokenIdError, type GetNameStateParameters as GetTokenIdParameters, type GetTokenIdResult, type GetNameStateError as GetTtlError, type GetNameStateParameters as GetTtlParameters, type TtlResult as GetTtlResult, type GetWalletCapabilitiesParameters, type WrapperReadError as GetWrapperExpiryError, type WrapperReadParameters as GetWrapperExpiryParameters, type GetWrapperExpiryResult, type CapabilityError as GetWrapperPermissionsError, type AccountCapabilityParameters as GetWrapperPermissionsParameters, type CapabilityError as GetWriteTargetError, GetWriteTargetParameters, type DnsReadError as GetZoneHashError, type GetZoneHashParameters, type GrantRegistryRolesError, type GrantRegistryRolesIntent, type GrantRegistryRolesParameters, type GrantRegistryRolesResult, type GrantResolverRolesError, type GrantResolverRolesIntent, type GrantResolverRolesParameters, type GrantResolverRolesResult, type GrantResolverRootRolesError, type GrantResolverRootRolesIntent, type GrantResolverRootRolesParameters, type GrantResolverRootRolesResult, type DnsReadError as HasDnsRecordsError, type HasDnsRecordsParameters, type CapabilityError as HasRegistryRolesError, HasRegistryRolesParameters, HasRegistryRolesResult, type CapabilityError as HasResolverRolesError, HasResolverRolesParameters, HasResolverRolesResult, Hex, type ImportDnsNameError, type ImportDnsNameParameters, type ImportDnsNameResult, InterfaceId, InterfaceResult, type GetNameStateError as IsAvailableError, type GetNameStateParameters as IsAvailableParameters, type GetNameStateError as IsMigratedError, type GetNameStateParameters as IsMigratedParameters, type RegistrationReadError as IsPaymentTokenSupportedError, type IsPaymentTokenSupportedParameters, type GetNameStateError as IsRenewableError, type GetNameStateParameters as IsRenewableParameters, type GetNameStateError as IsReservedError, type GetNameStateParameters as IsReservedParameters, type GetNameStateError as IsWrappedError, type GetNameStateParameters as IsWrappedParameters, Labelhash, type RegistrationReadError as MakeRegistrationCommitmentError, type RegistrationCommitmentParameters as MakeRegistrationCommitmentParameters, type MigrateNameAction, type MigrateNameCallParameters, type MigrateNameParameters, type MigrateNameResult, type MigrateNamesParameters, type MigrationBatchApproval, type MigrationBatchEntry, type MigrationBatchProgress, MigrationBlocker, MigrationEligibility, MigrationError, MigrationErrorCode, type MigrationNameParameters, type MigrationNameProgress, MigrationPlan, type MigrationReadError, MigrationStatus, MigrationTarget, MigrationUnsupportedReason, type MigrationValues, type MigrationWalletParameters, type MigrationWriteError, type NameAnalysis, NameCapabilities, NameCapabilityParameters, NameError, NameErrorCode, NameHistory, type NameKind, NameResult, NameState, NameStatus, type NameWrapperFuseName, Namehash, type NativeBatchResult, NativePaymentCurrency, NormalizedLabel, NormalizedName, type OperatorApprovalKind, OperatorApprovalResult, OperatorApprovalTarget, OwnerResult, OwnershipLevel, PaymentCurrency, PaymentTokenSupport, type PrepareCallsParameters, type PreparedWriteCall, type PreparedWriteCallDetails, PrimaryNameResult, PubkeyResult, type ReadBatch, type ReadBatchError, type ReadBatchOptions, type ReadBatchOutcome, type ReadBatchResult, type ReadBatchSettled, type ReadBatchSettledResult, type ReadOptions, type OwnershipWriteError as ReclaimNameError, type ReclaimNameParameters, type OwnershipWriteResult as ReclaimNameResult, RecordOperation, RecordPermission, RecordPermissionsResult, type RegisterNameParameters, type RegisterNameResult, type RegisterNamesEntryParameters, type RegisterNamesParameters, type RegisterNamesResult, RegistrationCommitment, RegistrationError, RegistrationErrorCode, RegistrationParameters, RegistrationPlan, RegistrationPriceResult, type RegistrationReadError, type RegistrationWalletParameters, type RegistrationWriteError, type RegistrationWriteIntent, type RegistrationWriteResult, RegistryCapabilities, RegistryOperation, RegistryResource, type RegistryRolesMutationParameters, RegistryRolesResult, type RenewNameAction, type RenewNameCallParameters, type RenewNameParameters, type RenewNameResult, type RenewNamesEntryParameters, type RenewNamesParameters, type RenewNamesResult, type RenewalApproval, RenewalError, RenewalErrorCode, RenewalPriceResult, RenewalRoute, RequiredAuthorizationResult, type ResolveBatchCall, type ResolveBatchError, type ResolveBatchParameters, type ResolveBatchResult, type ResolveError, type ResolveParameters, ResolveResult, type ResolveWithResolverError, type ResolveWithResolverParameters, ResolveWithResolverResult, type ResolvedGatewayOptions, type ResolvedReadOptions, type ResolvedWriteOptions, ResolverCapabilities, ResolverDelegateApprovalResult, type ResolverMulticallResult, ResolverProfiles, type ResolverRolesMutationParameters, ResolverRolesResult, type ResolverRootRolesMutationParameters, type ResolverSource, ResolverVersionResult, type ResumeCallsParameters, ReverseNameError, ReverseNameErrorCode, type ReverseNameWriteError, type ReverseNameWriteResult, type RevokeRegistryRolesError, type RevokeRegistryRolesIntent, type RevokeRegistryRolesParameters, type RevokeRegistryRolesResult, type RevokeResolverRolesError, type RevokeResolverRolesIntent, type RevokeResolverRolesParameters, type RevokeResolverRolesResult, type RevokeResolverRootRolesError, type RevokeResolverRootRolesIntent, type RevokeResolverRootRolesParameters, type RevokeResolverRootRolesResult, RpcError, RpcErrorCode, type SendCallsParameters, type SendCallsResult, type SequentialCallsResult, type SetAbiError, type SetAbiParameters, type SetAbiResult, type SetAddressError, type SetAddressParameters, type SetAddressResult, type SetAddressesError, type SetAddressesParameters, type SetAddressesResult, type SetAliasError, type SetAliasParameters, type SetAliasResult, type SetAvatarError, type SetAvatarParameters, type SetAvatarResult, type WrapperWriteError as SetChildFusesError, type WrapperWriteIntent as SetChildFusesIntent, type SetChildFusesParameters, type WrapperWriteResult as SetChildFusesResult, type SetContentHashError, type SetContentHashParameters, type SetContentHashResult, type ReverseNameWriteError as SetContractPrimaryNameError, type SetContractPrimaryNameParameters, type ReverseNameWriteResult as SetContractPrimaryNameResult, type SetDataError, type SetDataParameters, type SetDataResult, type SetDnsRecordsError, type SetDnsRecordsParameters, type SetDnsRecordsResult, type WrapperWriteError as SetFusesError, type WrapperWriteIntent as SetFusesIntent, type SetFusesParameters, type WrapperWriteResult as SetFusesResult, type SetInterfaceError, type SetInterfaceParameters, type SetInterfaceResult, type OwnershipWriteError as SetManagerError, type SetManagerParameters, type OwnershipWriteResult as SetManagerResult, type SetNameError, type SetNameParameters, type SetNameResult, type SetOperatorApprovalError, type SetOperatorApprovalIntent, type SetOperatorApprovalParameters, type SetOperatorApprovalResult, type ReverseNameWriteError as SetPrimaryNameError, type ReverseNameWriteError as SetPrimaryNameForAddressError, type SetPrimaryNameForAddressParameters, type ReverseNameWriteResult as SetPrimaryNameForAddressResult, type SetPrimaryNameParameters, type ReverseNameWriteResult as SetPrimaryNameResult, type SetPubkeyError, type SetPubkeyParameters, type SetPubkeyResult, type SetRecordInput, type SetRecordPermissionsError, type SetRecordPermissionsParameters, type SetRecordPermissionsResult, type SetRecordsAction, type SetRecordsError, type SetRecordsParameters, type SetRecordsResult, type SetResolverAndRecordsError, type SetResolverAndRecordsParameters, type SetResolverAndRecordsProgress, type SetResolverAndRecordsResult, type SetResolverDelegateApprovalError, type SetResolverDelegateApprovalIntent, type SetResolverDelegateApprovalParameters, type SetResolverDelegateApprovalResult, type SetResolverError, type SetResolverParameters, type SetResolverResult, type SubnameError as SetSubnameExpiryError, type SetSubnameExpiryParameters, type SubnameWriteResult as SetSubnameExpiryResult, type SubnameError as SetSubnameManagerError, type SetSubnameManagerParameters, type SubnameWriteResult as SetSubnameManagerResult, type SubnameError as SetSubnameRecordError, type SetSubnameRecordParameters, type SetSubnameRecordResult, type SubnameError as SetSubnameResolverError, type SetSubnameResolverParameters, type SubnameWriteResult as SetSubnameResolverResult, type SetTextError, type SetTextParameters, type SetTextResult, type SetTextsError, type SetTextsParameters, type SetTextsResult, type OwnershipWriteError as SetTtlError, type SetTtlParameters, type OwnershipWriteResult as SetTtlResult, type SetZoneHashError, type SetZoneHashParameters, type SetZoneHashResult, type SharedCreateConfigParameters, type SimulateCallsParameters, type SimulatedWriteCall, SimulationPolicy, type TextRecordInput, TextResult, TokenApprovalResult, TransactionError, TransactionErrorCode, type TransferNameError, type TransferNameParameters, type TransferNameProgress, type TransferNameResult, type TransferNameStrategy, type OwnershipWriteError as TransferRegistrantError, type TransferRegistrantParameters, type OwnershipWriteResult as TransferRegistrantResult, type SubnameError as TransferSubnameError, type TransferSubnameParameters, type WrapperWriteError as UnwrapNameError, type WrapperWriteIntent as UnwrapNameIntent, type UnwrapNameParameters, type WrapperWriteResult as UnwrapNameResult, type UpgradeResolverError, type UpgradeResolverIntent, type UpgradeResolverParameters, type UpgradeResolverResult, V1UnwrappedNameState, V1WrappedNameState, V2MigratedNameState, V2NativeNameState, V2ReservedNameState, type WalletCapabilitiesResult, WalletError, WalletErrorCode, type WalletOverrides, type WatchEnsEvents, type EnsEventError as WatchEnsEventsError, type WatchEnsEventsParameters, type WrapperWriteError as WrapNameError, type WrapNameParameters, type WrapNameResult, WrapperPermissionsResult, type WrapperReadError, type WrapperReadParameters, type WrapperUnsupportedReason, type WrapperWriteError, type WrapperWriteIntent, type WrapperWriteResult, WriteAtomicity, type WriteError, WriteMode, WriteOperation, type WriteOptions, type WritePlan, WritePlanError, WritePlanErrorCode, type WritePlanProgress, type WritePreparationContext, type WriteReceipt, type WriteStage, type WriteStageResult, WriteTarget, type WriteWaitCondition, ZoneHashResult, analyzeName, approveMigration, approveName, approvePaymentToken, approveRenewalPayment, claimDnsName, clearAvatar, clearNameApproval, clearPrimaryName, clearRecords, commitName, completeRegistration, createConfig, createResolver, createSubname, decodeAddressRecord, decodeContentHash, decodeFuseMask, defaultGatewayOptions, defaultReadOptions, defaultWriteOptions, defineAction, defineReadAction, defineWriteAction, deleteSubname, dnsDecodeName, dnsEncodeName, encodeAddressRecord, encodeContentHash, encodeFuseMask, ensNetworks, estimateCalls, executeWritePlan, extendSubnameExpiry, fromCoinType, getAbi, getAddress, getAddresses, getAlias, getAvatar, getCallsStatus, getCanonicalResource, getCommitmentStatus, getContentHash, getData, getDnsClaimStatus, getDnsImportPlan, getDnsRecord, getDnsRecords, getEnsEvents, getExpiry, getFuses, getInterface, getManager, getMigrationEligibility, getMigrationPlan, getMigrationStatus, getMigrationTarget, getName, getNameCapabilities, getNameHistory, getNameState, getNameStatus, getOperatorApproval, getOrCreateResolver, getOwner, getPrimaryName, getProtocol, getPubkey, getRecordPermissions, getRecords, getRegistrant, getRegistrationParameters, getRegistrationPlan, getRegistrationPrice, getRegistry, getRegistryCapabilities, getRegistryRoles, getRenewalPrice, getRequiredAuthorization, getResolver, getResolverCapabilities, getResolverDelegateApproval, getResolverRoles, getResolverVersion, getText, getTexts, getTokenApproval, getTokenId, getTtl, getWalletCapabilities, getWrapperExpiry, getWrapperPermissions, getWriteTarget, getZoneHash, grantRegistryRoles, grantResolverRoles, grantResolverRootRoles, hasDnsRecords, hasRegistryRoles, hasResolverRoles, importDnsName, isAvailable, isMigrated, isPaymentTokenSupported, isRenewable, isReserved, isWrapped, labelhash, makeRegistrationCommitment, migrateName, migrateNames, nameWrapperFuseNames, namehash, normalizeLabel, normalizeName, predictResolverAddress, prepareCalls, readBatch, readBatchSettled, reclaimName, registerName, registerNames, renewName, renewNames, resolve, resolveBatch, resolveWithResolver, resumeCalls, revokeRegistryRoles, revokeResolverRoles, revokeResolverRootRoles, sendCalls, setAbi, setAddress, setAddresses, setAlias, setAvatar, setChildFuses, setContentHash, setContractPrimaryName, setData, setDnsRecords, setFuses, setInterface, setManager, setName, setOperatorApproval, setPrimaryName, setPrimaryNameForAddress, setPubkey, setRecordPermissions, setRecords, setResolver, setResolverAndRecords, setResolverDelegateApproval, setSubnameExpiry, setSubnameManager, setSubnameRecord, setSubnameResolver, setText, setTexts, setTtl, setZoneHash, simulateCalls, toCoinType, transferName, transferRegistrant, transferSubname, unwrapName, upgradeResolver, watchEnsEvents, wrapName, wrapperFuseMasks };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { defineAction } from "./action/action.js";
|
|
2
2
|
import { defineReadAction } from "./action/read-request.js";
|
|
3
|
-
import { defineWriteAction } from "./action/write-intent.js";
|
|
4
3
|
import { ConfigError, ConfigErrorCode } from "./errors/config-error.js";
|
|
5
4
|
import { defaultReadOptions } from "./config/read-options.js";
|
|
6
5
|
import { RpcError, RpcErrorCode } from "./errors/rpc-error.js";
|
|
@@ -8,6 +7,7 @@ import { Hex } from "./schemas/hex.js";
|
|
|
8
7
|
import { ContractError, ContractErrorCode } from "./errors/contract-error.js";
|
|
9
8
|
import { readBatch, readBatchSettled } from "./actions/batch/read-batch.js";
|
|
10
9
|
import { WritePlanError, WritePlanErrorCode } from "./errors/write-plan-error.js";
|
|
10
|
+
import { defineWriteAction } from "./action/write-intent.js";
|
|
11
11
|
import { RegistrationError, RegistrationErrorCode } from "./errors/registration-error.js";
|
|
12
12
|
import { TransactionError, TransactionErrorCode } from "./errors/transaction-error.js";
|
|
13
13
|
import { WalletError, WalletErrorCode } from "./errors/wallet-error.js";
|
|
@@ -183,10 +183,11 @@ import { extendSubnameExpiry, setChildFuses, setFuses, unwrapName } from "./acti
|
|
|
183
183
|
import { getFuses } from "./actions/wrapping/get-fuses/index.js";
|
|
184
184
|
import { getWrapperExpiry } from "./actions/wrapping/get-wrapper-expiry/index.js";
|
|
185
185
|
import { wrapName } from "./actions/wrapping/wrap-name/index.js";
|
|
186
|
+
import { EnsforgeConfigTypeId } from "./config/config.js";
|
|
186
187
|
import { defaultGatewayOptions } from "./config/gateway-options.js";
|
|
187
188
|
import { ensNetworks } from "./config/network.js";
|
|
188
189
|
import { ConfirmationPolicy, SimulationPolicy, defaultWriteOptions } from "./config/write-options.js";
|
|
189
190
|
import { createConfig } from "./config/create-config.js";
|
|
190
191
|
import { WriteAtomicity, WriteMode } from "./write/types.js";
|
|
191
192
|
|
|
192
|
-
export { Abi, AbiContentType, AbiRecordData, AbiResult, AddressRecordData, AddressResult, AliasResult, AuthorizationDecision, AuthorizationError, AuthorizationErrorCode, AuthorizationRequirement, AuthorizationSource, AvailableNameState, AvatarResult, Bytes32, CanonicalNameIdentity, CodecError, CodecErrorCode, CoinType, CommitmentStatus, ConfigError, ConfigErrorCode, ConfirmationPolicy, ContentHash, ContentHashProtocol, ContentHashResult, ContractError, ContractErrorCode, DataResult, DnsClaimStatus, DnsEncodedName, DnsImportError, DnsImportErrorCode, DnsImportPlan, DnsRecordResult, DnsRecordsExistence, DnsRecordsResult, DnsResource, DnssecProof, DnssecProofChain, EnsEvent, EnsEventContractKind, EnsEventKind, EnsProtocol, Erc20PaymentCurrency, EthereumAddress, ExpiryResult, ExpirySource, GatewayError, GatewayErrorCode, HasRegistryRolesResult, HasResolverRolesResult, Hex, InterfaceId, InterfaceResult, Labelhash, MigrationBlocker, MigrationEligibility, MigrationError, MigrationErrorCode, MigrationPlan, MigrationStatus, MigrationTarget, MigrationUnsupportedReason, NameCapabilities, NameError, NameErrorCode, NameHistory, NameResult, NameState, NameStatus, Namehash, NativePaymentCurrency, NormalizedLabel, NormalizedName, OperatorApprovalResult, OperatorApprovalTarget, OwnerResult, OwnershipLevel, PaymentCurrency, PaymentTokenSupport, PrimaryNameResult, PubkeyResult, RecordOperation, RecordPermission, RecordPermissionsResult, RegistrationCommitment, RegistrationError, RegistrationErrorCode, RegistrationParameters, RegistrationPlan, RegistrationPriceResult, RegistryCapabilities, RegistryOperation, RegistryResource, RegistryRolesResult, RenewalError, RenewalErrorCode, RenewalPriceResult, RenewalRoute, RequiredAuthorizationResult, ResolveResult, ResolveWithResolverResult, ResolverCapabilities, ResolverDelegateApprovalResult, ResolverProfiles, ResolverRolesResult, ResolverVersionResult, ReverseNameError, ReverseNameErrorCode, RpcError, RpcErrorCode, SimulationPolicy, TextResult, TokenApprovalResult, TransactionError, TransactionErrorCode, V1UnwrappedNameState, V1WrappedNameState, V2MigratedNameState, V2NativeNameState, V2ReservedNameState, WalletError, WalletErrorCode, WrapperPermissionsResult, WriteAtomicity, WriteMode, WriteOperation, WritePlanError, WritePlanErrorCode, WriteTarget, ZoneHashResult, analyzeName, approveMigration, approveName, approvePaymentToken, approveRenewalPayment, claimDnsName, clearAvatar, clearNameApproval, clearPrimaryName, clearRecords, commitName, completeRegistration, createConfig, createResolver, createSubname, decodeAddressRecord, decodeContentHash, decodeFuseMask, defaultGatewayOptions, defaultReadOptions, defaultWriteOptions, defineAction, defineReadAction, defineWriteAction, deleteSubname, dnsDecodeName, dnsEncodeName, encodeAddressRecord, encodeContentHash, encodeFuseMask, ensNetworks, estimateCalls, executeWritePlan, extendSubnameExpiry, fromCoinType, getAbi, getAddress, getAddresses, getAlias, getAvatar, getCallsStatus, getCanonicalResource, getCommitmentStatus, getContentHash, getData, getDnsClaimStatus, getDnsImportPlan, getDnsRecord, getDnsRecords, getEnsEvents, getExpiry, getFuses, getInterface, getManager, getMigrationEligibility, getMigrationPlan, getMigrationStatus, getMigrationTarget, getName, getNameCapabilities, getNameHistory, getNameState, getNameStatus, getOperatorApproval, getOrCreateResolver, getOwner, getPrimaryName, getProtocol, getPubkey, getRecordPermissions, getRecords, getRegistrant, getRegistrationParameters, getRegistrationPlan, getRegistrationPrice, getRegistry, getRegistryCapabilities, getRegistryRoles, getRenewalPrice, getRequiredAuthorization, getResolver, getResolverCapabilities, getResolverDelegateApproval, getResolverRoles, getResolverVersion, getText, getTexts, getTokenApproval, getTokenId, getTtl, getWalletCapabilities, getWrapperExpiry, getWrapperPermissions, getWriteTarget, getZoneHash, grantRegistryRoles, grantResolverRoles, grantResolverRootRoles, hasDnsRecords, hasRegistryRoles, hasResolverRoles, importDnsName, isAvailable, isMigrated, isPaymentTokenSupported, isRenewable, isReserved, isWrapped, labelhash, makeRegistrationCommitment, migrateName, migrateNames, nameWrapperFuseNames, namehash, normalizeLabel, normalizeName, predictResolverAddress, prepareCalls, readBatch, readBatchSettled, reclaimName, registerName, registerNames, renewName, renewNames, resolve, resolveBatch, resolveWithResolver, resumeCalls, revokeRegistryRoles, revokeResolverRoles, revokeResolverRootRoles, sendCalls, setAbi, setAddress, setAddresses, setAlias, setAvatar, setChildFuses, setContentHash, setContractPrimaryName, setData, setDnsRecords, setFuses, setInterface, setManager, setName, setOperatorApproval, setPrimaryName, setPrimaryNameForAddress, setPubkey, setRecordPermissions, setRecords, setResolver, setResolverAndRecords, setResolverDelegateApproval, setSubnameExpiry, setSubnameManager, setSubnameRecord, setSubnameResolver, setText, setTexts, setTtl, setZoneHash, simulateCalls, toCoinType, transferName, transferRegistrant, transferSubname, unwrapName, upgradeResolver, watchEnsEvents, wrapName, wrapperFuseMasks };
|
|
193
|
+
export { Abi, AbiContentType, AbiRecordData, AbiResult, AddressRecordData, AddressResult, AliasResult, AuthorizationDecision, AuthorizationError, AuthorizationErrorCode, AuthorizationRequirement, AuthorizationSource, AvailableNameState, AvatarResult, Bytes32, CanonicalNameIdentity, CodecError, CodecErrorCode, CoinType, CommitmentStatus, ConfigError, ConfigErrorCode, ConfirmationPolicy, ContentHash, ContentHashProtocol, ContentHashResult, ContractError, ContractErrorCode, DataResult, DnsClaimStatus, DnsEncodedName, DnsImportError, DnsImportErrorCode, DnsImportPlan, DnsRecordResult, DnsRecordsExistence, DnsRecordsResult, DnsResource, DnssecProof, DnssecProofChain, EnsEvent, EnsEventContractKind, EnsEventKind, EnsProtocol, EnsforgeConfigTypeId, Erc20PaymentCurrency, EthereumAddress, ExpiryResult, ExpirySource, GatewayError, GatewayErrorCode, HasRegistryRolesResult, HasResolverRolesResult, Hex, InterfaceId, InterfaceResult, Labelhash, MigrationBlocker, MigrationEligibility, MigrationError, MigrationErrorCode, MigrationPlan, MigrationStatus, MigrationTarget, MigrationUnsupportedReason, NameCapabilities, NameError, NameErrorCode, NameHistory, NameResult, NameState, NameStatus, Namehash, NativePaymentCurrency, NormalizedLabel, NormalizedName, OperatorApprovalResult, OperatorApprovalTarget, OwnerResult, OwnershipLevel, PaymentCurrency, PaymentTokenSupport, PrimaryNameResult, PubkeyResult, RecordOperation, RecordPermission, RecordPermissionsResult, RegistrationCommitment, RegistrationError, RegistrationErrorCode, RegistrationParameters, RegistrationPlan, RegistrationPriceResult, RegistryCapabilities, RegistryOperation, RegistryResource, RegistryRolesResult, RenewalError, RenewalErrorCode, RenewalPriceResult, RenewalRoute, RequiredAuthorizationResult, ResolveResult, ResolveWithResolverResult, ResolverCapabilities, ResolverDelegateApprovalResult, ResolverProfiles, ResolverRolesResult, ResolverVersionResult, ReverseNameError, ReverseNameErrorCode, RpcError, RpcErrorCode, SimulationPolicy, TextResult, TokenApprovalResult, TransactionError, TransactionErrorCode, V1UnwrappedNameState, V1WrappedNameState, V2MigratedNameState, V2NativeNameState, V2ReservedNameState, WalletError, WalletErrorCode, WrapperPermissionsResult, WriteAtomicity, WriteMode, WriteOperation, WritePlanError, WritePlanErrorCode, WriteTarget, ZoneHashResult, analyzeName, approveMigration, approveName, approvePaymentToken, approveRenewalPayment, claimDnsName, clearAvatar, clearNameApproval, clearPrimaryName, clearRecords, commitName, completeRegistration, createConfig, createResolver, createSubname, decodeAddressRecord, decodeContentHash, decodeFuseMask, defaultGatewayOptions, defaultReadOptions, defaultWriteOptions, defineAction, defineReadAction, defineWriteAction, deleteSubname, dnsDecodeName, dnsEncodeName, encodeAddressRecord, encodeContentHash, encodeFuseMask, ensNetworks, estimateCalls, executeWritePlan, extendSubnameExpiry, fromCoinType, getAbi, getAddress, getAddresses, getAlias, getAvatar, getCallsStatus, getCanonicalResource, getCommitmentStatus, getContentHash, getData, getDnsClaimStatus, getDnsImportPlan, getDnsRecord, getDnsRecords, getEnsEvents, getExpiry, getFuses, getInterface, getManager, getMigrationEligibility, getMigrationPlan, getMigrationStatus, getMigrationTarget, getName, getNameCapabilities, getNameHistory, getNameState, getNameStatus, getOperatorApproval, getOrCreateResolver, getOwner, getPrimaryName, getProtocol, getPubkey, getRecordPermissions, getRecords, getRegistrant, getRegistrationParameters, getRegistrationPlan, getRegistrationPrice, getRegistry, getRegistryCapabilities, getRegistryRoles, getRenewalPrice, getRequiredAuthorization, getResolver, getResolverCapabilities, getResolverDelegateApproval, getResolverRoles, getResolverVersion, getText, getTexts, getTokenApproval, getTokenId, getTtl, getWalletCapabilities, getWrapperExpiry, getWrapperPermissions, getWriteTarget, getZoneHash, grantRegistryRoles, grantResolverRoles, grantResolverRootRoles, hasDnsRecords, hasRegistryRoles, hasResolverRoles, importDnsName, isAvailable, isMigrated, isPaymentTokenSupported, isRenewable, isReserved, isWrapped, labelhash, makeRegistrationCommitment, migrateName, migrateNames, nameWrapperFuseNames, namehash, normalizeLabel, normalizeName, predictResolverAddress, prepareCalls, readBatch, readBatchSettled, reclaimName, registerName, registerNames, renewName, renewNames, resolve, resolveBatch, resolveWithResolver, resumeCalls, revokeRegistryRoles, revokeResolverRoles, revokeResolverRootRoles, sendCalls, setAbi, setAddress, setAddresses, setAlias, setAvatar, setChildFuses, setContentHash, setContractPrimaryName, setData, setDnsRecords, setFuses, setInterface, setManager, setName, setOperatorApproval, setPrimaryName, setPrimaryNameForAddress, setPubkey, setRecordPermissions, setRecords, setResolver, setResolverAndRecords, setResolverDelegateApproval, setSubnameExpiry, setSubnameManager, setSubnameRecord, setSubnameResolver, setText, setTexts, setTtl, setZoneHash, simulateCalls, toCoinType, transferName, transferRegistrant, transferSubname, unwrapName, upgradeResolver, watchEnsEvents, wrapName, wrapperFuseMasks };
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { attachConfigContext } from "./context.js";
|
|
2
|
+
import { ConfigError } from "../../errors/config-error.js";
|
|
3
|
+
import { resolveReadOptions } from "../../config/read-options.js";
|
|
4
|
+
import { EnsforgeConfigTypeId } from "../../config/config.js";
|
|
5
|
+
import { resolveGatewayOptions } from "../../config/gateway-options.js";
|
|
6
|
+
import { EnsNetworkSchema, ensChainIds } from "../../config/network.js";
|
|
7
|
+
import { resolveWriteOptions } from "../../config/write-options.js";
|
|
8
|
+
import { makeServicesContext } from "../services/context.js";
|
|
9
|
+
import { getNetworkProfile } from "./network-profile.js";
|
|
10
|
+
import { validateClientChain, validateDeployments } from "./validation.js";
|
|
11
|
+
import { Schema } from "effect";
|
|
12
|
+
|
|
13
|
+
//#region src/internal/config/create-config.ts
|
|
14
|
+
const createConfigFromClients = (parameters, publicClient, clients = {}) => {
|
|
15
|
+
if (!Schema.is(EnsNetworkSchema)(parameters.network)) throw new ConfigError({
|
|
16
|
+
code: "UNSUPPORTED_NETWORK",
|
|
17
|
+
message: `Unsupported ENS network: ${parameters.network}`
|
|
18
|
+
});
|
|
19
|
+
const network = parameters.network;
|
|
20
|
+
const chainId = ensChainIds[network];
|
|
21
|
+
const deployments = getNetworkProfile(network);
|
|
22
|
+
const reads = resolveReadOptions(parameters.reads);
|
|
23
|
+
const writes = resolveWriteOptions(parameters.writes);
|
|
24
|
+
const gateways = resolveGatewayOptions(parameters.gateways);
|
|
25
|
+
validateClientChain(publicClient, "public", network, chainId);
|
|
26
|
+
if (clients.walletClient !== void 0) validateClientChain(clients.walletClient, "wallet", network, chainId);
|
|
27
|
+
validateDeployments(deployments, chainId);
|
|
28
|
+
const serviceValues = {
|
|
29
|
+
network,
|
|
30
|
+
chainId,
|
|
31
|
+
publicClient,
|
|
32
|
+
reads,
|
|
33
|
+
gateways,
|
|
34
|
+
deployments,
|
|
35
|
+
...clients.walletClient === void 0 ? {} : { walletClient: clients.walletClient },
|
|
36
|
+
...clients.walletClientResolver === void 0 ? {} : { walletClientResolver: clients.walletClientResolver }
|
|
37
|
+
};
|
|
38
|
+
const config = attachConfigContext({
|
|
39
|
+
[EnsforgeConfigTypeId]: EnsforgeConfigTypeId,
|
|
40
|
+
network,
|
|
41
|
+
chainId,
|
|
42
|
+
publicClient,
|
|
43
|
+
reads,
|
|
44
|
+
writes,
|
|
45
|
+
gateways,
|
|
46
|
+
deployments,
|
|
47
|
+
...clients.walletClient === void 0 ? {} : { walletClient: clients.walletClient }
|
|
48
|
+
}, makeServicesContext(serviceValues));
|
|
49
|
+
return Object.freeze(config);
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
//#endregion
|
|
53
|
+
export { createConfigFromClients };
|
|
54
|
+
//# sourceMappingURL=create-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create-config.js","names":[],"sources":["../../../src/internal/config/create-config.ts"],"sourcesContent":["import { Schema } from \"effect\";\n\nimport type { PublicClient, WalletClient } from \"viem\";\n\nimport type { SharedCreateConfigParameters, EnsforgeConfig } from \"../../config/config.js\";\nimport { EnsforgeConfigTypeId } from \"../../config/config.js\";\nimport { resolveGatewayOptions } from \"../../config/gateway-options.js\";\nimport { ensChainIds, EnsNetworkSchema } from \"../../config/network.js\";\nimport { resolveReadOptions } from \"../../config/read-options.js\";\nimport { resolveWriteOptions } from \"../../config/write-options.js\";\nimport { ConfigError } from \"../../errors/config-error.js\";\nimport type { EnsforgeServiceValues } from \"../services/context.js\";\nimport { makeServicesContext } from \"../services/context.js\";\nimport type { WalletClientResolver } from \"../services/wallet-client.js\";\nimport { attachConfigContext } from \"./context.js\";\nimport { getNetworkProfile } from \"./network-profile.js\";\nimport { validateClientChain, validateDeployments } from \"./validation.js\";\n\ninterface ConfigClients {\n readonly walletClient?: WalletClient;\n readonly walletClientResolver?: WalletClientResolver;\n}\n\nexport const createConfigFromClients = (\n parameters: SharedCreateConfigParameters,\n publicClient: PublicClient,\n clients: ConfigClients = {},\n): EnsforgeConfig => {\n if (!Schema.is(EnsNetworkSchema)(parameters.network)) {\n throw new ConfigError({\n code: \"UNSUPPORTED_NETWORK\",\n message: `Unsupported ENS network: ${parameters.network}`,\n });\n }\n\n const network = parameters.network;\n const chainId = ensChainIds[network];\n const deployments = getNetworkProfile(network);\n const reads = resolveReadOptions(parameters.reads);\n const writes = resolveWriteOptions(parameters.writes);\n const gateways = resolveGatewayOptions(parameters.gateways);\n\n validateClientChain(publicClient, \"public\", network, chainId);\n if (clients.walletClient !== undefined) {\n validateClientChain(clients.walletClient, \"wallet\", network, chainId);\n }\n validateDeployments(deployments, chainId);\n\n const serviceValues: EnsforgeServiceValues = {\n network,\n chainId,\n publicClient,\n reads,\n gateways,\n deployments,\n ...(clients.walletClient === undefined ? {} : { walletClient: clients.walletClient }),\n ...(clients.walletClientResolver === undefined\n ? {}\n : { walletClientResolver: clients.walletClientResolver }),\n };\n const config = attachConfigContext(\n {\n [EnsforgeConfigTypeId]: EnsforgeConfigTypeId,\n network,\n chainId,\n publicClient,\n reads,\n writes,\n gateways,\n deployments,\n ...(clients.walletClient === undefined ? {} : { walletClient: clients.walletClient }),\n },\n makeServicesContext(serviceValues),\n );\n\n return Object.freeze(config);\n};\n"],"mappings":";;;;;;;;;;;;;AAuBA,MAAa,2BACX,YACA,cACA,UAAyB,CAAC,MACP;CACnB,IAAI,CAAC,OAAO,GAAG,gBAAgB,CAAC,CAAC,WAAW,OAAO,GACjD,MAAM,IAAI,YAAY;EACpB,MAAM;EACN,SAAS,4BAA4B,WAAW;CAClD,CAAC;CAGH,MAAM,UAAU,WAAW;CAC3B,MAAM,UAAU,YAAY;CAC5B,MAAM,cAAc,kBAAkB,OAAO;CAC7C,MAAM,QAAQ,mBAAmB,WAAW,KAAK;CACjD,MAAM,SAAS,oBAAoB,WAAW,MAAM;CACpD,MAAM,WAAW,sBAAsB,WAAW,QAAQ;CAE1D,oBAAoB,cAAc,UAAU,SAAS,OAAO;CAC5D,IAAI,QAAQ,iBAAiB,QAC3B,oBAAoB,QAAQ,cAAc,UAAU,SAAS,OAAO;CAEtE,oBAAoB,aAAa,OAAO;CAExC,MAAM,gBAAuC;EAC3C;EACA;EACA;EACA;EACA;EACA;EACA,GAAI,QAAQ,iBAAiB,SAAY,CAAC,IAAI,EAAE,cAAc,QAAQ,aAAa;EACnF,GAAI,QAAQ,yBAAyB,SACjC,CAAC,IACD,EAAE,sBAAsB,QAAQ,qBAAqB;CAC3D;CACA,MAAM,SAAS,oBACb;GACG,uBAAuB;EACxB;EACA;EACA;EACA;EACA;EACA;EACA;EACA,GAAI,QAAQ,iBAAiB,SAAY,CAAC,IAAI,EAAE,cAAc,QAAQ,aAAa;CACrF,GACA,oBAAoB,aAAa,CACnC;CAEA,OAAO,OAAO,OAAO,MAAM;AAC7B"}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { findViemErrorCause, viemErrorToEffectError } from "./viem-error.js";
|
|
2
2
|
import { TransactionError } from "../../errors/transaction-error.js";
|
|
3
3
|
import { WalletError } from "../../errors/wallet-error.js";
|
|
4
|
-
import { AtomicityNotSupportedError, BaseError, MethodNotFoundRpcError, MethodNotSupportedRpcError, TimeoutError, UnauthorizedProviderError, UnsupportedChainIdError, UserRejectedRequestError } from "viem";
|
|
4
|
+
import { AtomicityNotSupportedError, BaseError, InvalidRequestRpcError, MethodNotFoundRpcError, MethodNotSupportedRpcError, TimeoutError, UnauthorizedProviderError, UnsupportedChainIdError, UserRejectedRequestError } from "viem";
|
|
5
5
|
|
|
6
6
|
//#region src/internal/errors/write-error.ts
|
|
7
7
|
const messageFromCause = (cause) => cause instanceof BaseError ? cause.shortMessage : "The wallet request failed";
|
|
8
|
-
const isWalletCallBundleUnsupported = (cause) =>
|
|
8
|
+
const isWalletCallBundleUnsupported = (cause) => {
|
|
9
|
+
if (findViemErrorCause(cause, MethodNotFoundRpcError) !== void 0 || findViemErrorCause(cause, MethodNotSupportedRpcError) !== void 0) return true;
|
|
10
|
+
const invalidRequest = findViemErrorCause(cause, InvalidRequestRpcError);
|
|
11
|
+
return invalidRequest !== void 0 && /unsupported method.*wallet_(?:getCapabilities|sendCalls)/i.test(invalidRequest.details);
|
|
12
|
+
};
|
|
9
13
|
function walletRequestError(cause, operation) {
|
|
10
14
|
if (findViemErrorCause(cause, UserRejectedRequestError) !== void 0) return new WalletError({
|
|
11
15
|
code: "USER_REJECTED",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"write-error.js","names":[],"sources":["../../../src/internal/errors/write-error.ts"],"sourcesContent":["import {\n AtomicityNotSupportedError,\n BaseError,\n MethodNotFoundRpcError,\n MethodNotSupportedRpcError,\n UnauthorizedProviderError,\n UnsupportedChainIdError,\n TimeoutError,\n UserRejectedRequestError,\n} from \"viem\";\n\nimport { TransactionError } from \"../../errors/transaction-error.js\";\nimport { WalletError } from \"../../errors/wallet-error.js\";\nimport { findViemErrorCause, viemErrorToEffectError, type ViemError } from \"./viem-error.js\";\n\nconst messageFromCause = (cause: unknown): string =>\n cause instanceof BaseError ? cause.shortMessage : \"The wallet request failed\";\n\nexport const isWalletCallBundleUnsupported = (cause: unknown): boolean
|
|
1
|
+
{"version":3,"file":"write-error.js","names":[],"sources":["../../../src/internal/errors/write-error.ts"],"sourcesContent":["import {\n AtomicityNotSupportedError,\n BaseError,\n InvalidRequestRpcError,\n MethodNotFoundRpcError,\n MethodNotSupportedRpcError,\n UnauthorizedProviderError,\n UnsupportedChainIdError,\n TimeoutError,\n UserRejectedRequestError,\n} from \"viem\";\n\nimport { TransactionError } from \"../../errors/transaction-error.js\";\nimport { WalletError } from \"../../errors/wallet-error.js\";\nimport { findViemErrorCause, viemErrorToEffectError, type ViemError } from \"./viem-error.js\";\n\nconst messageFromCause = (cause: unknown): string =>\n cause instanceof BaseError ? cause.shortMessage : \"The wallet request failed\";\n\nexport const isWalletCallBundleUnsupported = (cause: unknown): boolean => {\n if (\n findViemErrorCause(cause, MethodNotFoundRpcError) !== undefined ||\n findViemErrorCause(cause, MethodNotSupportedRpcError) !== undefined\n ) {\n return true;\n }\n const invalidRequest = findViemErrorCause(cause, InvalidRequestRpcError);\n return (\n invalidRequest !== undefined &&\n /unsupported method.*wallet_(?:getCapabilities|sendCalls)/i.test(invalidRequest.details)\n );\n};\n\nexport function walletRequestError(\n cause: unknown,\n operation: \"capabilities\" | \"sendCalls\",\n): WalletError;\nexport function walletRequestError(\n cause: unknown,\n operation: \"sendTransaction\",\n): ViemError | WalletError;\nexport function walletRequestError(\n cause: unknown,\n operation: \"capabilities\" | \"sendCalls\" | \"sendTransaction\",\n): ViemError | WalletError {\n if (findViemErrorCause(cause, UserRejectedRequestError) !== undefined) {\n return new WalletError({\n code: \"USER_REJECTED\",\n message: \"The wallet request was rejected by the user\",\n cause,\n });\n }\n if (\n findViemErrorCause(cause, UnauthorizedProviderError) !== undefined ||\n findViemErrorCause(cause, UnsupportedChainIdError) !== undefined\n ) {\n return new WalletError({\n code: \"UNAUTHORIZED_ACCOUNT\",\n message: messageFromCause(cause),\n cause,\n });\n }\n if (findViemErrorCause(cause, AtomicityNotSupportedError) !== undefined) {\n return new WalletError({\n code: \"ATOMICITY_UNAVAILABLE\",\n message: \"The wallet cannot execute this call group atomically\",\n cause,\n });\n }\n if (operation === \"capabilities\") {\n return new WalletError({\n code: \"CAPABILITY_REQUEST_FAILED\",\n message: messageFromCause(cause),\n cause,\n });\n }\n if (operation === \"sendCalls\") {\n return new WalletError({\n code: \"BATCH_SUBMISSION_FAILED\",\n message: messageFromCause(cause),\n cause,\n });\n }\n return viemErrorToEffectError(cause, \"writeContract\");\n}\n\nexport const batchStatusError = (cause: unknown, batchId: string) =>\n new TransactionError({\n code:\n findViemErrorCause(cause, TimeoutError) === undefined\n ? \"BATCH_STATUS_FAILED\"\n : \"CONFIRMATION_TIMEOUT\",\n message:\n findViemErrorCause(cause, TimeoutError) === undefined\n ? \"Unable to read the wallet call-batch status\"\n : \"Timed out while waiting for the wallet call batch\",\n cause,\n batchId,\n });\n\nexport const receiptWaitError = (cause: unknown, transactionHash: `0x${string}`) =>\n findViemErrorCause(cause, TimeoutError) === undefined\n ? viemErrorToEffectError(cause, \"getBlock\")\n : new TransactionError({\n code: \"CONFIRMATION_TIMEOUT\",\n message: `Timed out while waiting for transaction ${transactionHash}`,\n cause,\n transactionHash,\n });\n"],"mappings":";;;;;;AAgBA,MAAM,oBAAoB,UACxB,iBAAiB,YAAY,MAAM,eAAe;AAEpD,MAAa,iCAAiC,UAA4B;CACxE,IACE,mBAAmB,OAAO,sBAAsB,MAAM,UACtD,mBAAmB,OAAO,0BAA0B,MAAM,QAE1D,OAAO;CAET,MAAM,iBAAiB,mBAAmB,OAAO,sBAAsB;CACvE,OACE,mBAAmB,UACnB,4DAA4D,KAAK,eAAe,OAAO;AAE3F;AAUA,SAAgB,mBACd,OACA,WACyB;CACzB,IAAI,mBAAmB,OAAO,wBAAwB,MAAM,QAC1D,OAAO,IAAI,YAAY;EACrB,MAAM;EACN,SAAS;EACT;CACF,CAAC;CAEH,IACE,mBAAmB,OAAO,yBAAyB,MAAM,UACzD,mBAAmB,OAAO,uBAAuB,MAAM,QAEvD,OAAO,IAAI,YAAY;EACrB,MAAM;EACN,SAAS,iBAAiB,KAAK;EAC/B;CACF,CAAC;CAEH,IAAI,mBAAmB,OAAO,0BAA0B,MAAM,QAC5D,OAAO,IAAI,YAAY;EACrB,MAAM;EACN,SAAS;EACT;CACF,CAAC;CAEH,IAAI,cAAc,gBAChB,OAAO,IAAI,YAAY;EACrB,MAAM;EACN,SAAS,iBAAiB,KAAK;EAC/B;CACF,CAAC;CAEH,IAAI,cAAc,aAChB,OAAO,IAAI,YAAY;EACrB,MAAM;EACN,SAAS,iBAAiB,KAAK;EAC/B;CACF,CAAC;CAEH,OAAO,uBAAuB,OAAO,eAAe;AACtD;AAEA,MAAa,oBAAoB,OAAgB,YAC/C,IAAI,iBAAiB;CACnB,MACE,mBAAmB,OAAO,YAAY,MAAM,SACxC,wBACA;CACN,SACE,mBAAmB,OAAO,YAAY,MAAM,SACxC,gDACA;CACN;CACA;AACF,CAAC;AAEH,MAAa,oBAAoB,OAAgB,oBAC/C,mBAAmB,OAAO,YAAY,MAAM,SACxC,uBAAuB,OAAO,UAAU,IACxC,IAAI,iBAAiB;CACnB,MAAM;CACN,SAAS,2CAA2C;CACpD;CACA;AACF,CAAC"}
|
|
@@ -85,7 +85,11 @@ const makeCcipRequest = (policy, fetcher = globalThis.fetch) => async ({ data, r
|
|
|
85
85
|
return result;
|
|
86
86
|
} catch (cause) {
|
|
87
87
|
if (requestOptions?.signal?.aborted === true) throw cause;
|
|
88
|
-
lastError =
|
|
88
|
+
lastError = timeout.aborted ? new GatewayError({
|
|
89
|
+
code: "GATEWAY_TIMEOUT",
|
|
90
|
+
message: `Gateway request exceeded the configured ${policy.timeout}ms timeout`,
|
|
91
|
+
cause
|
|
92
|
+
}) : cause;
|
|
89
93
|
}
|
|
90
94
|
}
|
|
91
95
|
throw lastError;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ccip-request.js","names":[],"sources":["../../../src/internal/gateway/ccip-request.ts"],"sourcesContent":["import { isHex, type CcipRequestParameters, type Hex, type PublicClient } from \"viem\";\n\nimport type { ResolvedGatewayOptions } from \"../../config/gateway-options.js\";\nimport { GatewayError } from \"../../errors/gateway-error.js\";\n\ntype GatewayFetch = typeof globalThis.fetch;\n\nexport const assertAllowedGatewayUrl = (value: string, policy: ResolvedGatewayOptions): URL => {\n let url: URL;\n try {\n url = new URL(value);\n } catch (cause) {\n throw new GatewayError({\n code: \"GATEWAY_NOT_ALLOWED\",\n message: \"Gateway URL is invalid\",\n cause,\n });\n }\n const host = url.hostname.toLowerCase();\n if (\n policy.deniedHosts.some((denied) => denied.toLowerCase() === host) ||\n (policy.allowedHosts !== null &&\n !policy.allowedHosts.some((allowed) => allowed.toLowerCase() === host))\n ) {\n throw new GatewayError({\n code: \"GATEWAY_NOT_ALLOWED\",\n message: `Gateway host ${host} is not allowed`,\n cause: { host },\n });\n }\n return url;\n};\n\nconst fetchWithRedirects = async (\n fetcher: GatewayFetch,\n initialUrl: string,\n init: RequestInit,\n policy: ResolvedGatewayOptions,\n): Promise<Response> => {\n let url = assertAllowedGatewayUrl(initialUrl, policy);\n for (let redirects = 0; ; redirects += 1) {\n // Redirect policy must validate each destination before the next request is made.\n // oxlint-disable-next-line no-await-in-loop\n const response = await fetcher(url, { ...init, redirect: \"manual\" });\n if (response.status < 300 || response.status >= 400) return response;\n const location = response.headers.get(\"location\");\n if (location === null || redirects >= policy.maxRedirects) {\n throw new GatewayError({\n code: \"GATEWAY_NOT_ALLOWED\",\n message: \"Gateway exceeded the configured redirect limit\",\n cause: { url: url.toString(), redirects },\n });\n }\n url = assertAllowedGatewayUrl(new URL(location, url).toString(), policy);\n }\n};\n\nexport const makeCcipRequest =\n (policy: ResolvedGatewayOptions, fetcher: GatewayFetch = globalThis.fetch) =>\n async ({ data, requestOptions, sender, urls }: CcipRequestParameters) => {\n let lastError: unknown = new Error(\"No CCIP gateway returned a valid response\");\n for (const template of urls) {\n const url = template.replace(\"{sender}\", sender.toLowerCase()).replace(\"{data}\", data);\n const method = template.includes(\"{data}\") ? \"GET\" : \"POST\";\n const timeout = AbortSignal.timeout(policy.timeout);\n const signal =\n requestOptions?.signal === undefined\n ? timeout\n : AbortSignal.any([requestOptions.signal, timeout]);\n try {\n // CCIP gateway URLs are ordered fallbacks and must not be raced.\n // oxlint-disable-next-line no-await-in-loop\n const response = await fetchWithRedirects(\n fetcher,\n url,\n {\n method,\n signal,\n ...(method === \"POST\"\n ? {\n body: JSON.stringify({ data, sender }),\n headers: { \"content-type\": \"application/json\" },\n }\n : {}),\n },\n policy,\n );\n const declaredSize = Number(response.headers.get(\"content-length\") ?? 0);\n if (declaredSize > policy.maxResponseSize) {\n throw new GatewayError({\n code: \"GATEWAY_NOT_ALLOWED\",\n message: \"Gateway response exceeds the configured size limit\",\n cause: { declaredSize, maxResponseSize: policy.maxResponseSize },\n });\n }\n // The body is consumed only after its declared size has passed validation.\n // oxlint-disable-next-line no-await-in-loop\n const body = await response.text();\n const actualSize = new TextEncoder().encode(body).byteLength;\n if (actualSize > policy.maxResponseSize) {\n throw new GatewayError({\n code: \"GATEWAY_NOT_ALLOWED\",\n message: \"Gateway response exceeds the configured size limit\",\n cause: { actualSize, maxResponseSize: policy.maxResponseSize },\n });\n }\n if (!response.ok) throw new Error(`Gateway returned HTTP ${response.status}`);\n const result = response.headers.get(\"content-type\")?.startsWith(\"application/json\")\n ? (JSON.parse(body) as { readonly data?: unknown }).data\n : body;\n if (!isHex(result)) throw new Error(\"Gateway returned malformed CCIP data\");\n return result satisfies Hex;\n } catch (cause) {\n if (requestOptions?.signal?.aborted === true) throw cause;\n lastError = cause;\n }\n }\n throw lastError;\n };\n\nexport const withGatewayPolicy = (\n client: PublicClient,\n policy: ResolvedGatewayOptions,\n): PublicClient => {\n if (client.ccipRead === false || client.ccipRead?.request !== undefined) return client;\n return { ...client, ccipRead: { request: makeCcipRequest(policy) } } as PublicClient;\n};\n"],"mappings":"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
|
|
1
|
+
{"version":3,"file":"ccip-request.js","names":[],"sources":["../../../src/internal/gateway/ccip-request.ts"],"sourcesContent":["import { isHex, type CcipRequestParameters, type Hex, type PublicClient } from \"viem\";\n\nimport type { ResolvedGatewayOptions } from \"../../config/gateway-options.js\";\nimport { GatewayError } from \"../../errors/gateway-error.js\";\n\ntype GatewayFetch = typeof globalThis.fetch;\n\nexport const assertAllowedGatewayUrl = (value: string, policy: ResolvedGatewayOptions): URL => {\n let url: URL;\n try {\n url = new URL(value);\n } catch (cause) {\n throw new GatewayError({\n code: \"GATEWAY_NOT_ALLOWED\",\n message: \"Gateway URL is invalid\",\n cause,\n });\n }\n const host = url.hostname.toLowerCase();\n if (\n policy.deniedHosts.some((denied) => denied.toLowerCase() === host) ||\n (policy.allowedHosts !== null &&\n !policy.allowedHosts.some((allowed) => allowed.toLowerCase() === host))\n ) {\n throw new GatewayError({\n code: \"GATEWAY_NOT_ALLOWED\",\n message: `Gateway host ${host} is not allowed`,\n cause: { host },\n });\n }\n return url;\n};\n\nconst fetchWithRedirects = async (\n fetcher: GatewayFetch,\n initialUrl: string,\n init: RequestInit,\n policy: ResolvedGatewayOptions,\n): Promise<Response> => {\n let url = assertAllowedGatewayUrl(initialUrl, policy);\n for (let redirects = 0; ; redirects += 1) {\n // Redirect policy must validate each destination before the next request is made.\n // oxlint-disable-next-line no-await-in-loop\n const response = await fetcher(url, { ...init, redirect: \"manual\" });\n if (response.status < 300 || response.status >= 400) return response;\n const location = response.headers.get(\"location\");\n if (location === null || redirects >= policy.maxRedirects) {\n throw new GatewayError({\n code: \"GATEWAY_NOT_ALLOWED\",\n message: \"Gateway exceeded the configured redirect limit\",\n cause: { url: url.toString(), redirects },\n });\n }\n url = assertAllowedGatewayUrl(new URL(location, url).toString(), policy);\n }\n};\n\nexport const makeCcipRequest =\n (policy: ResolvedGatewayOptions, fetcher: GatewayFetch = globalThis.fetch) =>\n async ({ data, requestOptions, sender, urls }: CcipRequestParameters) => {\n let lastError: unknown = new Error(\"No CCIP gateway returned a valid response\");\n for (const template of urls) {\n const url = template.replace(\"{sender}\", sender.toLowerCase()).replace(\"{data}\", data);\n const method = template.includes(\"{data}\") ? \"GET\" : \"POST\";\n const timeout = AbortSignal.timeout(policy.timeout);\n const signal =\n requestOptions?.signal === undefined\n ? timeout\n : AbortSignal.any([requestOptions.signal, timeout]);\n try {\n // CCIP gateway URLs are ordered fallbacks and must not be raced.\n // oxlint-disable-next-line no-await-in-loop\n const response = await fetchWithRedirects(\n fetcher,\n url,\n {\n method,\n signal,\n ...(method === \"POST\"\n ? {\n body: JSON.stringify({ data, sender }),\n headers: { \"content-type\": \"application/json\" },\n }\n : {}),\n },\n policy,\n );\n const declaredSize = Number(response.headers.get(\"content-length\") ?? 0);\n if (declaredSize > policy.maxResponseSize) {\n throw new GatewayError({\n code: \"GATEWAY_NOT_ALLOWED\",\n message: \"Gateway response exceeds the configured size limit\",\n cause: { declaredSize, maxResponseSize: policy.maxResponseSize },\n });\n }\n // The body is consumed only after its declared size has passed validation.\n // oxlint-disable-next-line no-await-in-loop\n const body = await response.text();\n const actualSize = new TextEncoder().encode(body).byteLength;\n if (actualSize > policy.maxResponseSize) {\n throw new GatewayError({\n code: \"GATEWAY_NOT_ALLOWED\",\n message: \"Gateway response exceeds the configured size limit\",\n cause: { actualSize, maxResponseSize: policy.maxResponseSize },\n });\n }\n if (!response.ok) throw new Error(`Gateway returned HTTP ${response.status}`);\n const result = response.headers.get(\"content-type\")?.startsWith(\"application/json\")\n ? (JSON.parse(body) as { readonly data?: unknown }).data\n : body;\n if (!isHex(result)) throw new Error(\"Gateway returned malformed CCIP data\");\n return result satisfies Hex;\n } catch (cause) {\n if (requestOptions?.signal?.aborted === true) throw cause;\n lastError = timeout.aborted\n ? new GatewayError({\n code: \"GATEWAY_TIMEOUT\",\n message: `Gateway request exceeded the configured ${policy.timeout}ms timeout`,\n cause,\n })\n : cause;\n }\n }\n throw lastError;\n };\n\nexport const withGatewayPolicy = (\n client: PublicClient,\n policy: ResolvedGatewayOptions,\n): PublicClient => {\n if (client.ccipRead === false || client.ccipRead?.request !== undefined) return client;\n return { ...client, ccipRead: { request: makeCcipRequest(policy) } } as PublicClient;\n};\n"],"mappings":"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"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { BlockParameters } from "../../action/block.js";
|
|
2
1
|
import "../../errors/rpc-error.js";
|
|
2
|
+
import { BlockParameters } from "../../action/block.js";
|
|
3
3
|
import "./contract-read-resolver.js";
|
|
4
4
|
import { Context, Effect, Semaphore } from "effect";
|
|
5
5
|
import { PublicClient } from "viem";
|
|
@@ -39,25 +39,42 @@ const executeSequential = Effect.fn("executeSequential")(function* (config, para
|
|
|
39
39
|
const client = yield* provideConfig(config, WriteClient);
|
|
40
40
|
const hash = yield* client.sendTransaction(walletClient, call);
|
|
41
41
|
if (confirmation.type === "submitted") return {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
42
|
+
call: {
|
|
43
|
+
id: call.id,
|
|
44
|
+
operation: call.operation,
|
|
45
|
+
status: "submitted",
|
|
46
|
+
hash,
|
|
47
|
+
receipt: null
|
|
48
|
+
},
|
|
49
|
+
failure: null
|
|
47
50
|
};
|
|
48
|
-
const
|
|
51
|
+
const confirmationResult = yield* Effect.result(client.waitForReceipt(hash, {
|
|
49
52
|
...confirmation.confirmations === void 0 ? {} : { confirmations: confirmation.confirmations },
|
|
50
53
|
...confirmation.timeout === void 0 ? {} : { timeout: confirmation.timeout }
|
|
51
54
|
}).pipe(Effect.retry({
|
|
52
55
|
times: config.writes.statusRetries,
|
|
53
56
|
while: (error) => error instanceof RpcError
|
|
54
|
-
}));
|
|
57
|
+
})));
|
|
58
|
+
if (Result.isFailure(confirmationResult)) return {
|
|
59
|
+
call: {
|
|
60
|
+
id: call.id,
|
|
61
|
+
operation: call.operation,
|
|
62
|
+
status: "submitted",
|
|
63
|
+
hash,
|
|
64
|
+
receipt: null
|
|
65
|
+
},
|
|
66
|
+
failure: confirmationResult.failure
|
|
67
|
+
};
|
|
68
|
+
const receipt = confirmationResult.success;
|
|
55
69
|
return {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
70
|
+
call: {
|
|
71
|
+
id: call.id,
|
|
72
|
+
operation: call.operation,
|
|
73
|
+
status: "confirmed",
|
|
74
|
+
hash: receipt.transactionHash,
|
|
75
|
+
receipt
|
|
76
|
+
},
|
|
77
|
+
failure: null
|
|
61
78
|
};
|
|
62
79
|
}).pipe(Effect.mapError((error) => redactSensitiveWriteError([intent], error))));
|
|
63
80
|
if (Result.isFailure(execution)) {
|
|
@@ -72,7 +89,18 @@ const executeSequential = Effect.fn("executeSequential")(function* (config, para
|
|
|
72
89
|
failure
|
|
73
90
|
};
|
|
74
91
|
}
|
|
75
|
-
|
|
92
|
+
const success = execution.success;
|
|
93
|
+
completed.push(success.call);
|
|
94
|
+
if (success.failure !== null) {
|
|
95
|
+
const remaining = parameters.calls.slice(localIndex + 1).map((remainingIntent, offset) => notStarted(`call-${index + offset + 1}`, remainingIntent.operation));
|
|
96
|
+
return {
|
|
97
|
+
mode: "sequential",
|
|
98
|
+
atomic: false,
|
|
99
|
+
status: "partial",
|
|
100
|
+
calls: [...completed, ...remaining],
|
|
101
|
+
failure: success.failure
|
|
102
|
+
};
|
|
103
|
+
}
|
|
76
104
|
}
|
|
77
105
|
return {
|
|
78
106
|
mode: "sequential",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"execute-sequential.js","names":[],"sources":["../../../src/internal/write/execute-sequential.ts"],"sourcesContent":["import { Effect, Result } from \"effect\";\n\nimport type { EnsforgeConfig } from \"../../config/config.js\";\nimport { RpcError } from \"../../errors/rpc-error.js\";\nimport { WritePlanError } from \"../../errors/write-plan-error.js\";\nimport type {\n CallExecutionResult,\n ConfirmationPolicy,\n SendCallsParameters,\n SequentialCallsResult,\n WriteError,\n} from \"../../write/types.js\";\nimport { provideConfig } from \"../config/context.js\";\nimport { resolveWalletContext } from \"../services/wallet-client.js\";\nimport { prepareWriteIntents } from \"./prepare-write-intents.js\";\nimport { redactSensitiveWriteError } from \"./redact-sensitive-error.js\";\nimport { simulatePreparedCalls } from \"./simulate-prepared-calls.js\";\nimport { WriteClient } from \"./write-client.js\";\n\nconst notStarted = (id: string, operation: string): CallExecutionResult => ({\n id,\n operation,\n status: \"not-started\",\n hash: null,\n receipt: null,\n});\n\nexport const executeSequential = Effect.fn(\"executeSequential\")(function* (\n config: EnsforgeConfig,\n parameters: SendCallsParameters,\n startIndex = 0,\n): Effect.fn.Return<SequentialCallsResult, WriteError> {\n const confirmation: ConfirmationPolicy = parameters.confirmation ?? config.writes.confirmation;\n const simulation = parameters.simulation ?? config.writes.simulation;\n const completed: Array<CallExecutionResult> = [];\n\n for (const [localIndex, intent] of parameters.calls.entries()) {\n const index = startIndex + localIndex;\n const execution = yield* Effect.result(\n Effect.gen(function* () {\n const singleCallParameters = {\n calls: [intent],\n ...(parameters.walletClient === undefined\n ? {}\n : { walletClient: parameters.walletClient }),\n ...(parameters.account === undefined ? {} : { account: parameters.account }),\n };\n const prepared = yield* prepareWriteIntents(config, singleCallParameters, \"call\", index);\n const call = prepared[0];\n if (call === undefined) {\n return yield* new WritePlanError({\n code: \"INVALID_CALL_PLAN\",\n message: \"A single write intent did not produce a prepared call\",\n cause: intent,\n });\n }\n if (simulation === \"required\") {\n yield* provideConfig(config, simulatePreparedCalls([call], 1));\n }\n const { walletClient } = yield* provideConfig(config, resolveWalletContext(parameters));\n const client = yield* provideConfig(config, WriteClient);\n const hash = yield* client.sendTransaction(walletClient, call);\n if (confirmation.type === \"submitted\") {\n return {\n id: call.id,\n
|
|
1
|
+
{"version":3,"file":"execute-sequential.js","names":[],"sources":["../../../src/internal/write/execute-sequential.ts"],"sourcesContent":["import { Effect, Result } from \"effect\";\n\nimport type { EnsforgeConfig } from \"../../config/config.js\";\nimport { RpcError } from \"../../errors/rpc-error.js\";\nimport { WritePlanError } from \"../../errors/write-plan-error.js\";\nimport type {\n CallExecutionResult,\n ConfirmationPolicy,\n SendCallsParameters,\n SequentialCallsResult,\n WriteError,\n} from \"../../write/types.js\";\nimport { provideConfig } from \"../config/context.js\";\nimport { resolveWalletContext } from \"../services/wallet-client.js\";\nimport { prepareWriteIntents } from \"./prepare-write-intents.js\";\nimport { redactSensitiveWriteError } from \"./redact-sensitive-error.js\";\nimport { simulatePreparedCalls } from \"./simulate-prepared-calls.js\";\nimport { WriteClient } from \"./write-client.js\";\n\nconst notStarted = (id: string, operation: string): CallExecutionResult => ({\n id,\n operation,\n status: \"not-started\",\n hash: null,\n receipt: null,\n});\n\nexport const executeSequential = Effect.fn(\"executeSequential\")(function* (\n config: EnsforgeConfig,\n parameters: SendCallsParameters,\n startIndex = 0,\n): Effect.fn.Return<SequentialCallsResult, WriteError> {\n const confirmation: ConfirmationPolicy = parameters.confirmation ?? config.writes.confirmation;\n const simulation = parameters.simulation ?? config.writes.simulation;\n const completed: Array<CallExecutionResult> = [];\n\n for (const [localIndex, intent] of parameters.calls.entries()) {\n const index = startIndex + localIndex;\n const execution = yield* Effect.result(\n Effect.gen(function* () {\n const singleCallParameters = {\n calls: [intent],\n ...(parameters.walletClient === undefined\n ? {}\n : { walletClient: parameters.walletClient }),\n ...(parameters.account === undefined ? {} : { account: parameters.account }),\n };\n const prepared = yield* prepareWriteIntents(config, singleCallParameters, \"call\", index);\n const call = prepared[0];\n if (call === undefined) {\n return yield* new WritePlanError({\n code: \"INVALID_CALL_PLAN\",\n message: \"A single write intent did not produce a prepared call\",\n cause: intent,\n });\n }\n if (simulation === \"required\") {\n yield* provideConfig(config, simulatePreparedCalls([call], 1));\n }\n const { walletClient } = yield* provideConfig(config, resolveWalletContext(parameters));\n const client = yield* provideConfig(config, WriteClient);\n const hash = yield* client.sendTransaction(walletClient, call);\n if (confirmation.type === \"submitted\") {\n return {\n call: {\n id: call.id,\n operation: call.operation,\n status: \"submitted\",\n hash,\n receipt: null,\n } satisfies CallExecutionResult,\n failure: null,\n } as const;\n }\n const confirmationResult = yield* Effect.result(\n client\n .waitForReceipt(hash, {\n ...(confirmation.confirmations === undefined\n ? {}\n : { confirmations: confirmation.confirmations }),\n ...(confirmation.timeout === undefined ? {} : { timeout: confirmation.timeout }),\n })\n .pipe(\n Effect.retry({\n times: config.writes.statusRetries,\n while: (error) => error instanceof RpcError,\n }),\n ),\n );\n if (Result.isFailure(confirmationResult)) {\n return {\n call: {\n id: call.id,\n operation: call.operation,\n status: \"submitted\",\n hash,\n receipt: null,\n } satisfies CallExecutionResult,\n failure: confirmationResult.failure,\n } as const;\n }\n const receipt = confirmationResult.success;\n return {\n call: {\n id: call.id,\n operation: call.operation,\n status: \"confirmed\",\n hash: receipt.transactionHash,\n receipt,\n } satisfies CallExecutionResult,\n failure: null,\n } as const;\n }).pipe(Effect.mapError((error) => redactSensitiveWriteError([intent], error))),\n );\n\n if (Result.isFailure(execution)) {\n const failure = execution.failure;\n if (completed.length === 0) return yield* failure;\n const remaining = parameters.calls\n .slice(localIndex)\n .map((remainingIntent, offset) =>\n notStarted(`call-${index + offset}`, remainingIntent.operation),\n );\n return {\n mode: \"sequential\",\n atomic: false,\n status: \"partial\",\n calls: [...completed, ...remaining],\n failure,\n };\n }\n const success = execution.success;\n completed.push(success.call);\n if (success.failure !== null) {\n const remaining = parameters.calls\n .slice(localIndex + 1)\n .map((remainingIntent, offset) =>\n notStarted(`call-${index + offset + 1}`, remainingIntent.operation),\n );\n return {\n mode: \"sequential\",\n atomic: false,\n status: \"partial\",\n calls: [...completed, ...remaining],\n failure: success.failure,\n };\n }\n }\n\n return {\n mode: \"sequential\",\n atomic: false,\n status: \"completed\",\n calls: completed,\n failure: null,\n };\n});\n"],"mappings":"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"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getWriteIntentPreparer } from "../../action/write-intent.js";
|
|
2
1
|
import { executeRead } from "../read/execute-read.js";
|
|
3
2
|
import { WritePlanError } from "../../errors/write-plan-error.js";
|
|
4
3
|
import { resolveWalletContext } from "../services/wallet-client.js";
|
|
4
|
+
import { getWriteIntentPreparer } from "../../action/write-intent.js";
|
|
5
5
|
import { redactSensitiveWriteError } from "./redact-sensitive-error.js";
|
|
6
6
|
import { Effect } from "effect";
|
|
7
7
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { defineWriteAction, makeWriteIntent } from "../../action/write-intent.js";
|
|
2
1
|
import { WritePlanError } from "../../errors/write-plan-error.js";
|
|
2
|
+
import { defineWriteAction, makeWriteIntent } from "../../action/write-intent.js";
|
|
3
3
|
import { executeSequential } from "./execute-sequential.js";
|
|
4
4
|
import { prepareResolverWrite } from "./prepare-resolver-write.js";
|
|
5
5
|
import { Effect } from "effect";
|