@ensforge/react 0.0.0 → 0.1.1
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 +10 -10
- package/dist/atoms/batch.d.ts +6 -6
- package/dist/atoms/batch.d.ts.map +1 -1
- package/dist/atoms/capabilities.d.ts +20 -20
- package/dist/atoms/capabilities.d.ts.map +1 -1
- package/dist/atoms/dns.d.ts +7 -7
- package/dist/atoms/dns.d.ts.map +1 -1
- package/dist/atoms/events.d.ts +29 -29
- package/dist/atoms/events.d.ts.map +1 -1
- package/dist/atoms/generic.d.ts +5 -4
- package/dist/atoms/generic.d.ts.map +1 -1
- package/dist/atoms/generic.js.map +1 -1
- package/dist/atoms/migration.d.ts +5 -5
- package/dist/atoms/migration.d.ts.map +1 -1
- package/dist/atoms/name.d.ts +23 -23
- package/dist/atoms/name.d.ts.map +1 -1
- package/dist/atoms/ownership.d.ts +2 -2
- package/dist/atoms/ownership.d.ts.map +1 -1
- package/dist/atoms/query.d.ts +6 -11
- package/dist/atoms/query.d.ts.map +1 -1
- package/dist/atoms/query.js +14 -11
- package/dist/atoms/query.js.map +1 -1
- package/dist/atoms/records.d.ts +12 -12
- package/dist/atoms/records.d.ts.map +1 -1
- package/dist/atoms/registration.d.ts +8 -8
- package/dist/atoms/registration.d.ts.map +1 -1
- package/dist/atoms/resolution.d.ts +8 -8
- package/dist/atoms/resolution.d.ts.map +1 -1
- package/dist/atoms/reverse.d.ts +2 -2
- package/dist/atoms/reverse.d.ts.map +1 -1
- package/dist/atoms/stream.d.ts +2 -2
- package/dist/atoms/stream.d.ts.map +1 -1
- package/dist/atoms/stream.js +6 -4
- package/dist/atoms/stream.js.map +1 -1
- package/dist/atoms/wrapping.d.ts +3 -3
- package/dist/atoms/wrapping.d.ts.map +1 -1
- package/dist/atoms.d.ts +3 -2
- package/dist/atoms.js +3 -2
- package/dist/cache/invalidation.d.ts +5 -5
- package/dist/cache/invalidation.d.ts.map +1 -1
- package/dist/cache/invalidation.js +3 -3
- package/dist/cache/invalidation.js.map +1 -1
- package/dist/cache/prefetch.d.ts +5 -4
- package/dist/cache/prefetch.d.ts.map +1 -1
- package/dist/cache/prefetch.js +3 -3
- package/dist/cache/prefetch.js.map +1 -1
- package/dist/cache/registry.d.ts +3 -3
- package/dist/cache/registry.d.ts.map +1 -1
- package/dist/cache/registry.js +2 -2
- package/dist/cache/registry.js.map +1 -1
- package/dist/cache.d.ts +4 -4
- package/dist/cache.js +4 -4
- package/dist/hooks/batch.d.ts +13 -13
- package/dist/hooks/batch.d.ts.map +1 -1
- package/dist/hooks/capabilities.d.ts +107 -107
- package/dist/hooks/capabilities.d.ts.map +1 -1
- package/dist/hooks/dns.d.ts +39 -39
- package/dist/hooks/dns.d.ts.map +1 -1
- package/dist/hooks/events.d.ts +98 -98
- package/dist/hooks/events.d.ts.map +1 -1
- package/dist/hooks/generic.d.ts +5 -5
- package/dist/hooks/generic.d.ts.map +1 -1
- package/dist/hooks/generic.js.map +1 -1
- package/dist/hooks/index.d.ts +4 -4
- package/dist/hooks/migration.d.ts +27 -27
- package/dist/hooks/migration.d.ts.map +1 -1
- package/dist/hooks/name.d.ts +73 -73
- package/dist/hooks/name.d.ts.map +1 -1
- package/dist/hooks/ownership.d.ts +5 -5
- package/dist/hooks/ownership.d.ts.map +1 -1
- package/dist/hooks/records.d.ts +69 -69
- package/dist/hooks/records.d.ts.map +1 -1
- package/dist/hooks/registration.d.ts +45 -45
- package/dist/hooks/registration.d.ts.map +1 -1
- package/dist/hooks/resolution.d.ts +33 -33
- package/dist/hooks/resolution.d.ts.map +1 -1
- package/dist/hooks/reverse.d.ts +9 -9
- package/dist/hooks/reverse.d.ts.map +1 -1
- package/dist/hooks/use-cache.d.ts +6 -6
- package/dist/hooks/use-cache.d.ts.map +1 -1
- package/dist/hooks/use-cache.js +4 -4
- package/dist/hooks/use-cache.js.map +1 -1
- package/dist/hooks/use-mutation.js +16 -31
- package/dist/hooks/use-mutation.js.map +1 -1
- package/dist/hooks/use-query.d.ts +6 -6
- package/dist/hooks/use-query.d.ts.map +1 -1
- package/dist/hooks/use-query.js +24 -52
- package/dist/hooks/use-query.js.map +1 -1
- package/dist/hooks/use-suspense-query.d.ts +9 -8
- package/dist/hooks/use-suspense-query.d.ts.map +1 -1
- package/dist/hooks/use-suspense-query.js +5 -5
- package/dist/hooks/use-suspense-query.js.map +1 -1
- package/dist/hooks/wrapping.d.ts +7 -7
- package/dist/hooks/wrapping.d.ts.map +1 -1
- package/dist/index.d.ts +11 -11
- package/dist/index.js +7 -7
- package/dist/mutation/options.d.ts +9 -7
- package/dist/mutation/options.d.ts.map +1 -1
- package/dist/mutation/result.d.ts +8 -10
- package/dist/mutation/result.d.ts.map +1 -1
- package/dist/provider/context.d.ts +4 -2
- package/dist/provider/context.d.ts.map +1 -1
- package/dist/provider/context.js.map +1 -1
- package/dist/query/options.d.ts +27 -24
- package/dist/query/options.d.ts.map +1 -1
- package/dist/query/options.js +26 -12
- package/dist/query/options.js.map +1 -1
- package/dist/query/result.d.ts +7 -13
- package/dist/query/result.d.ts.map +1 -1
- package/dist/query/result.js.map +1 -1
- package/package.json +2 -2
package/dist/atoms/name.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnsAtomFactory } from "./query.js";
|
|
2
2
|
//#region src/atoms/name.d.ts
|
|
3
|
-
declare const getCanonicalResourceAtom:
|
|
4
|
-
declare const getExpiryAtom:
|
|
3
|
+
declare const getCanonicalResourceAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, bigint | null, import("@ensforge/core").GetCanonicalResourceError>;
|
|
4
|
+
declare const getExpiryAtom: EnsAtomFactory<import("@ensforge/core").GetExpiryParameters, {
|
|
5
5
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
6
6
|
readonly expiry: bigint;
|
|
7
7
|
readonly gracePeriod: bigint;
|
|
@@ -9,14 +9,14 @@ declare const getExpiryAtom: EnsQueryAtomFactory<import("@ensforge/core").GetExp
|
|
|
9
9
|
readonly protocol: "v1" | "v2";
|
|
10
10
|
readonly source: "registry" | "nameWrapper" | "baseRegistrar";
|
|
11
11
|
} | null, import("@ensforge/core").GetExpiryError>;
|
|
12
|
-
declare const getManagerAtom:
|
|
13
|
-
declare const getNameStateAtom:
|
|
12
|
+
declare const getManagerAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, `0x${string}` | null, import("@ensforge/core").GetCanonicalResourceError>;
|
|
13
|
+
declare const getNameStateAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, {
|
|
14
14
|
readonly kind: "available";
|
|
15
15
|
readonly protocol: "v1" | "v2";
|
|
16
16
|
readonly wrapped: false;
|
|
17
17
|
readonly migrated: false;
|
|
18
18
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
19
|
-
readonly status: "available" | "
|
|
19
|
+
readonly status: "available" | "active" | "grace" | "expired" | "reserved";
|
|
20
20
|
readonly owner: `0x${string}` | null;
|
|
21
21
|
readonly manager: `0x${string}` | null;
|
|
22
22
|
readonly registrant: `0x${string}` | null;
|
|
@@ -34,7 +34,7 @@ declare const getNameStateAtom: EnsQueryAtomFactory<import("@ensforge/core").Get
|
|
|
34
34
|
readonly wrapped: false;
|
|
35
35
|
readonly migrated: false;
|
|
36
36
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
37
|
-
readonly status: "available" | "
|
|
37
|
+
readonly status: "available" | "active" | "grace" | "expired" | "reserved";
|
|
38
38
|
readonly owner: `0x${string}` | null;
|
|
39
39
|
readonly manager: `0x${string}` | null;
|
|
40
40
|
readonly registrant: `0x${string}` | null;
|
|
@@ -52,7 +52,7 @@ declare const getNameStateAtom: EnsQueryAtomFactory<import("@ensforge/core").Get
|
|
|
52
52
|
readonly wrapped: true;
|
|
53
53
|
readonly migrated: false;
|
|
54
54
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
55
|
-
readonly status: "available" | "
|
|
55
|
+
readonly status: "available" | "active" | "grace" | "expired" | "reserved";
|
|
56
56
|
readonly owner: `0x${string}` | null;
|
|
57
57
|
readonly manager: `0x${string}` | null;
|
|
58
58
|
readonly registrant: `0x${string}` | null;
|
|
@@ -70,7 +70,7 @@ declare const getNameStateAtom: EnsQueryAtomFactory<import("@ensforge/core").Get
|
|
|
70
70
|
readonly wrapped: boolean;
|
|
71
71
|
readonly migrated: false;
|
|
72
72
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
73
|
-
readonly status: "available" | "
|
|
73
|
+
readonly status: "available" | "active" | "grace" | "expired" | "reserved";
|
|
74
74
|
readonly owner: `0x${string}` | null;
|
|
75
75
|
readonly manager: `0x${string}` | null;
|
|
76
76
|
readonly registrant: `0x${string}` | null;
|
|
@@ -88,7 +88,7 @@ declare const getNameStateAtom: EnsQueryAtomFactory<import("@ensforge/core").Get
|
|
|
88
88
|
readonly wrapped: boolean;
|
|
89
89
|
readonly migrated: true;
|
|
90
90
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
91
|
-
readonly status: "available" | "
|
|
91
|
+
readonly status: "available" | "active" | "grace" | "expired" | "reserved";
|
|
92
92
|
readonly owner: `0x${string}` | null;
|
|
93
93
|
readonly manager: `0x${string}` | null;
|
|
94
94
|
readonly registrant: `0x${string}` | null;
|
|
@@ -106,7 +106,7 @@ declare const getNameStateAtom: EnsQueryAtomFactory<import("@ensforge/core").Get
|
|
|
106
106
|
readonly wrapped: boolean;
|
|
107
107
|
readonly migrated: false;
|
|
108
108
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
109
|
-
readonly status: "available" | "
|
|
109
|
+
readonly status: "available" | "active" | "grace" | "expired" | "reserved";
|
|
110
110
|
readonly owner: `0x${string}` | null;
|
|
111
111
|
readonly manager: `0x${string}` | null;
|
|
112
112
|
readonly registrant: `0x${string}` | null;
|
|
@@ -119,23 +119,23 @@ declare const getNameStateAtom: EnsQueryAtomFactory<import("@ensforge/core").Get
|
|
|
119
119
|
readonly available: boolean;
|
|
120
120
|
readonly renewable: boolean;
|
|
121
121
|
}, import("@ensforge/core").GetCanonicalResourceError>;
|
|
122
|
-
declare const getNameStatusAtom:
|
|
123
|
-
declare const getOwnerAtom:
|
|
122
|
+
declare const getNameStatusAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, "available" | "active" | "grace" | "expired" | "reserved", import("@ensforge/core").GetCanonicalResourceError>;
|
|
123
|
+
declare const getOwnerAtom: EnsAtomFactory<import("@ensforge/core").GetOwnerParameters, {
|
|
124
124
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
125
125
|
readonly owner: `0x${string}` | null;
|
|
126
126
|
readonly registrant: `0x${string}` | null;
|
|
127
127
|
readonly protocol: "v1" | "v2";
|
|
128
|
-
readonly ownershipLevel: "
|
|
128
|
+
readonly ownershipLevel: "registry" | "registrar" | "nameWrapper";
|
|
129
129
|
} | null, import("@ensforge/core").GetOwnerError>;
|
|
130
|
-
declare const getProtocolAtom:
|
|
131
|
-
declare const getRegistrantAtom:
|
|
132
|
-
declare const getRegistryAtom:
|
|
133
|
-
declare const getTokenIdAtom:
|
|
134
|
-
declare const isAvailableAtom:
|
|
135
|
-
declare const isMigratedAtom:
|
|
136
|
-
declare const isRenewableAtom:
|
|
137
|
-
declare const isReservedAtom:
|
|
138
|
-
declare const isWrappedAtom:
|
|
130
|
+
declare const getProtocolAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, "v1" | "v2", import("@ensforge/core").GetCanonicalResourceError>;
|
|
131
|
+
declare const getRegistrantAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, `0x${string}` | null, import("@ensforge/core").GetCanonicalResourceError>;
|
|
132
|
+
declare const getRegistryAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, `0x${string}`, import("@ensforge/core").GetCanonicalResourceError>;
|
|
133
|
+
declare const getTokenIdAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, bigint | null, import("@ensforge/core").GetCanonicalResourceError>;
|
|
134
|
+
declare const isAvailableAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, boolean, import("@ensforge/core").GetCanonicalResourceError>;
|
|
135
|
+
declare const isMigratedAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, boolean, import("@ensforge/core").GetCanonicalResourceError>;
|
|
136
|
+
declare const isRenewableAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, boolean, import("@ensforge/core").GetCanonicalResourceError>;
|
|
137
|
+
declare const isReservedAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, boolean, import("@ensforge/core").GetCanonicalResourceError>;
|
|
138
|
+
declare const isWrappedAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, boolean, import("@ensforge/core").GetCanonicalResourceError>;
|
|
139
139
|
//#endregion
|
|
140
140
|
export { getCanonicalResourceAtom, getExpiryAtom, getManagerAtom, getNameStateAtom, getNameStatusAtom, getOwnerAtom, getProtocolAtom, getRegistrantAtom, getRegistryAtom, getTokenIdAtom, isAvailableAtom, isMigratedAtom, isRenewableAtom, isReservedAtom, isWrappedAtom };
|
|
141
141
|
//# sourceMappingURL=name.d.ts.map
|
package/dist/atoms/name.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"name.d.ts","names":[],"sources":["../../src/atoms/name.ts"],"mappings":";;cAEa,0BAAA,
|
|
1
|
+
{"version":3,"file":"name.d.ts","names":[],"sources":["../../src/atoms/name.ts"],"mappings":";;cAEa,0BAAA,wCAAwB,wEAAA;cAIxB,eAAA,wCAAa;;;;;;;mCAAqD;cAClE,gBAAA,wCAAc,+EAAA;cACd,kBAAA,wCAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAAwD;cACxE,mBAAA,wCAAiB,oHAAA;cACjB,cAAA,wCAAY;;;;;;mCAAoD;cAChE,iBAAA,wCAAe,sEAAA;cACf,mBAAA,wCAAiB,+EAAA;cACjB,iBAAA,wCAAe,wEAAA;cACf,gBAAA,wCAAc,wEAAA;cACd,iBAAA,wCAAe,kEAAA;cACf,gBAAA,wCAAc,kEAAA;cACd,iBAAA,wCAAe,kEAAA;cACf,gBAAA,wCAAc,kEAAA;cACd,eAAA,wCAAa,kEAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnsAtomFactory } from "./query.js";
|
|
2
2
|
import { EnsMutationAtomFactory } from "./mutation.js";
|
|
3
3
|
//#region src/atoms/ownership.d.ts
|
|
4
|
-
declare const getTtlAtom:
|
|
4
|
+
declare const getTtlAtom: EnsAtomFactory<import("@ensforge/core").GetCanonicalResourceParameters, import("@ensforge/core").GetTtlResult, import("@ensforge/core").GetCanonicalResourceError>;
|
|
5
5
|
declare const createReclaimNameMutationAtom: EnsMutationAtomFactory<import("@ensforge/core").ReclaimNameParameters, import("@ensforge/core").CallExecutionResult, import("@ensforge/core").WriteError>;
|
|
6
6
|
declare const createSetManagerMutationAtom: EnsMutationAtomFactory<import("@ensforge/core").SetManagerParameters, import("@ensforge/core").CallExecutionResult, import("@ensforge/core").WriteError>;
|
|
7
7
|
declare const createSetTtlMutationAtom: EnsMutationAtomFactory<import("@ensforge/core").SetTtlParameters, import("@ensforge/core").CallExecutionResult, import("@ensforge/core").WriteError>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ownership.d.ts","names":[],"sources":["../../src/atoms/ownership.ts"],"mappings":";;;cAGa,YAAA,
|
|
1
|
+
{"version":3,"file":"ownership.d.ts","names":[],"sources":["../../src/atoms/ownership.ts"],"mappings":";;;cAGa,YAAA,wCAAU,yDAAA,uCAAA;cAEV,+BAAA,gDAA6B,gDAAA,8CAAA;cAI7B,8BAAA,gDAA4B,+CAAA,8CAAA;cAI5B,0BAAA,gDAAwB,2CAAA,8CAAA;cAIxB,gCAAA,gDAA8B,iDAAA,+CAAA;cAI9B,sCAAA,gDAAoC,uDAAA,8CAAA"}
|
package/dist/atoms/query.d.ts
CHANGED
|
@@ -1,18 +1,13 @@
|
|
|
1
1
|
import { BoundEffectAction } from "../internal/action-types.js";
|
|
2
|
+
import { EnsAtomOptions } from "../query/options.js";
|
|
2
3
|
import { Ensforge } from "@ensforge/sdk";
|
|
3
4
|
import { AsyncResult, Atom } from "effect/unstable/reactivity";
|
|
4
5
|
//#region src/atoms/query.d.ts
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
readonly retry: false | number;
|
|
6
|
+
type EnsAtom<Success, Failure> = Atom.Atom<AsyncResult.AsyncResult<Success, Failure>>;
|
|
7
|
+
interface EnsAtomFactory<Parameters, Success, Failure> {
|
|
8
|
+
(sdk: Ensforge, parameters: Parameters, options?: EnsAtomOptions<Failure>): EnsAtom<Success, Failure>;
|
|
9
9
|
}
|
|
10
|
-
|
|
11
|
-
interface EnsQueryAtomFactory<Parameters, Success, Failure> {
|
|
12
|
-
(sdk: Ensforge, parameters: Parameters, options: QueryAtomOptions): EnsQueryAtom<Success, Failure>;
|
|
13
|
-
}
|
|
14
|
-
declare const defaultQueryAtomOptions: QueryAtomOptions;
|
|
15
|
-
declare const makeQueryAtom: <Parameters, Success, Failure>(group: string, getAction: (sdk: Ensforge) => BoundEffectAction<Parameters, Success, Failure>) => EnsQueryAtomFactory<Parameters, Success, Failure>;
|
|
10
|
+
declare const makeQueryAtom: <Parameters, Success, Failure>(group: string, getAction: (sdk: Ensforge) => BoundEffectAction<Parameters, Success, Failure>) => EnsAtomFactory<Parameters, Success, Failure>;
|
|
16
11
|
//#endregion
|
|
17
|
-
export {
|
|
12
|
+
export { EnsAtom, EnsAtomFactory, makeQueryAtom };
|
|
18
13
|
//# sourceMappingURL=query.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.d.ts","names":[],"sources":["../../src/atoms/query.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"query.d.ts","names":[],"sources":["../../src/atoms/query.ts"],"mappings":";;;;;KAoBY,QAAQ,SAAS,WAAW,KAAK,KAAK,YAAY,YAAY,SAAS;UAElE,eAAe,YAAY,SAAS;GAEjD,KAAK,UACL,YAAY,YACZ,UAAU,eAAe,WACxB,QAAQ,SAAS;;cA0BT,gBAAiB,YAAY,SAAS,SACjD,eACA,YAAY,KAAK,aAAa,kBAAkB,YAAY,SAAS,aACpE,eAAe,YAAY,SAAS"}
|
package/dist/atoms/query.js
CHANGED
|
@@ -1,30 +1,33 @@
|
|
|
1
1
|
import { atomRuntime } from "../internal/runtime.js";
|
|
2
2
|
import { makeReactivityKeys } from "../query/keys.js";
|
|
3
|
+
import { resolveEnsAtomOptions } from "../query/options.js";
|
|
3
4
|
import { Data, Effect } from "effect";
|
|
4
5
|
import { Atom } from "effect/unstable/reactivity";
|
|
5
6
|
|
|
6
7
|
//#region src/atoms/query.ts
|
|
7
8
|
var QueryAtomInput = class extends Data.Class {};
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
9
|
+
const configureAtom = (source, options, reactivityKeys) => {
|
|
10
|
+
let atom = source.pipe(Atom.withReactivity(reactivityKeys), Atom.setIdleTTL(options.idleTTL));
|
|
11
|
+
if (options.swr !== false) atom = atom.pipe(Atom.swr({
|
|
12
|
+
...options.swr,
|
|
13
|
+
focusSignal: Atom.windowFocusSignal
|
|
14
|
+
}));
|
|
15
|
+
if (options.refreshInterval !== false) atom = atom.pipe(Atom.withRefresh(options.refreshInterval));
|
|
16
|
+
return atom;
|
|
17
|
+
};
|
|
13
18
|
const makeQueryAtom = (group, getAction) => {
|
|
14
19
|
const family = Atom.family((input) => {
|
|
15
20
|
const actionEffect = Effect.suspend(() => getAction(input.sdk).effect(input.parameters));
|
|
16
|
-
const effect = input.options.retry === false ? actionEffect : actionEffect.pipe(Effect.retry(
|
|
17
|
-
|
|
18
|
-
if (input.options.refetchOnWindowFocus) atom = atom.pipe(Atom.refreshOnWindowFocus);
|
|
19
|
-
return atom;
|
|
21
|
+
const effect = input.options.retry === false ? actionEffect : actionEffect.pipe(Effect.retry(input.options.retry));
|
|
22
|
+
return configureAtom(atomRuntime.atom(effect), input.options, makeReactivityKeys(input.sdk, group, input.parameters));
|
|
20
23
|
});
|
|
21
24
|
return (sdk, parameters, options) => family(new QueryAtomInput({
|
|
22
|
-
options,
|
|
25
|
+
options: resolveEnsAtomOptions(void 0, options),
|
|
23
26
|
parameters,
|
|
24
27
|
sdk
|
|
25
28
|
}));
|
|
26
29
|
};
|
|
27
30
|
|
|
28
31
|
//#endregion
|
|
29
|
-
export {
|
|
32
|
+
export { configureAtom, makeQueryAtom };
|
|
30
33
|
//# sourceMappingURL=query.js.map
|
package/dist/atoms/query.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"query.js","names":[],"sources":["../../src/atoms/query.ts"],"sourcesContent":["import { Data, Effect } from \"effect\";\nimport { Atom
|
|
1
|
+
{"version":3,"file":"query.js","names":[],"sources":["../../src/atoms/query.ts"],"sourcesContent":["import { Data, Effect } from \"effect\";\nimport { Atom, type AsyncResult } from \"effect/unstable/reactivity\";\n\nimport type { Ensforge } from \"@ensforge/sdk\";\n\nimport type { BoundEffectAction } from \"../internal/action-types.js\";\nimport { atomRuntime } from \"../internal/runtime.js\";\nimport { makeReactivityKeys } from \"../query/keys.js\";\nimport {\n resolveEnsAtomOptions,\n type EnsAtomOptions,\n type ResolvedEnsAtomOptions,\n} from \"../query/options.js\";\n\nclass QueryAtomInput<Parameters, Failure> extends Data.Class<{\n readonly options: ResolvedEnsAtomOptions<Failure>;\n readonly parameters: Parameters;\n readonly sdk: Ensforge;\n}> {}\n\nexport type EnsAtom<Success, Failure> = Atom.Atom<AsyncResult.AsyncResult<Success, Failure>>;\n\nexport interface EnsAtomFactory<Parameters, Success, Failure> {\n (\n sdk: Ensforge,\n parameters: Parameters,\n options?: EnsAtomOptions<Failure>,\n ): EnsAtom<Success, Failure>;\n}\n\nexport const configureAtom = <Success, Failure>(\n source: EnsAtom<Success, Failure>,\n options: ResolvedEnsAtomOptions<Failure>,\n reactivityKeys: Readonly<Record<string, ReadonlyArray<unknown>>>,\n): EnsAtom<Success, Failure> => {\n let atom = source.pipe(Atom.withReactivity(reactivityKeys), Atom.setIdleTTL(options.idleTTL));\n\n if (options.swr !== false) {\n atom = atom.pipe(\n Atom.swr({\n ...options.swr,\n focusSignal: Atom.windowFocusSignal,\n }),\n );\n }\n\n if (options.refreshInterval !== false) {\n atom = atom.pipe(Atom.withRefresh(options.refreshInterval));\n }\n\n return atom;\n};\n\nexport const makeQueryAtom = <Parameters, Success, Failure>(\n group: string,\n getAction: (sdk: Ensforge) => BoundEffectAction<Parameters, Success, Failure>,\n): EnsAtomFactory<Parameters, Success, Failure> => {\n const family = Atom.family((input: QueryAtomInput<Parameters, Failure>) => {\n const actionEffect = Effect.suspend(() => getAction(input.sdk).effect(input.parameters));\n const effect =\n input.options.retry === false\n ? actionEffect\n : actionEffect.pipe(Effect.retry(input.options.retry));\n return configureAtom(\n atomRuntime.atom(effect),\n input.options,\n makeReactivityKeys(input.sdk, group, input.parameters),\n );\n });\n\n return (sdk, parameters, options) =>\n family(\n new QueryAtomInput({\n options: resolveEnsAtomOptions(undefined, options),\n parameters,\n sdk,\n }),\n );\n};\n"],"mappings":";;;;;;;AAcA,IAAM,iBAAN,cAAkD,KAAK,MAIpD,CAAC;AAYJ,MAAa,iBACX,QACA,SACA,mBAC8B;CAC9B,IAAI,OAAO,OAAO,KAAK,KAAK,eAAe,cAAc,GAAG,KAAK,WAAW,QAAQ,OAAO,CAAC;CAE5F,IAAI,QAAQ,QAAQ,OAClB,OAAO,KAAK,KACV,KAAK,IAAI;EACP,GAAG,QAAQ;EACX,aAAa,KAAK;CACpB,CAAC,CACH;CAGF,IAAI,QAAQ,oBAAoB,OAC9B,OAAO,KAAK,KAAK,KAAK,YAAY,QAAQ,eAAe,CAAC;CAG5D,OAAO;AACT;AAEA,MAAa,iBACX,OACA,cACiD;CACjD,MAAM,SAAS,KAAK,QAAQ,UAA+C;EACzE,MAAM,eAAe,OAAO,cAAc,UAAU,MAAM,GAAG,CAAC,CAAC,OAAO,MAAM,UAAU,CAAC;EACvF,MAAM,SACJ,MAAM,QAAQ,UAAU,QACpB,eACA,aAAa,KAAK,OAAO,MAAM,MAAM,QAAQ,KAAK,CAAC;EACzD,OAAO,cACL,YAAY,KAAK,MAAM,GACvB,MAAM,SACN,mBAAmB,MAAM,KAAK,OAAO,MAAM,UAAU,CACvD;CACF,CAAC;CAED,QAAQ,KAAK,YAAY,YACvB,OACE,IAAI,eAAe;EACjB,SAAS,sBAAsB,QAAW,OAAO;EACjD;EACA;CACF,CAAC,CACH;AACJ"}
|
package/dist/atoms/records.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnsAtomFactory } from "./query.js";
|
|
2
2
|
import { EnsMutationAtomFactory } from "./mutation.js";
|
|
3
3
|
//#region src/atoms/records.d.ts
|
|
4
|
-
declare const getAbiAtom:
|
|
4
|
+
declare const getAbiAtom: EnsAtomFactory<import("@ensforge/core").GetAbiParameters, {
|
|
5
5
|
readonly contentType: "json" | "zlib-json" | "cbor";
|
|
6
6
|
readonly value: import("viem").Abi;
|
|
7
7
|
readonly raw: `0x${string}` & import("effect/Brand").Brand<"AbiRecordData">;
|
|
@@ -14,7 +14,7 @@ declare const getAbiAtom: EnsQueryAtomFactory<import("@ensforge/core").GetAbiPar
|
|
|
14
14
|
readonly value: null;
|
|
15
15
|
readonly raw: null;
|
|
16
16
|
}, import("@ensforge/core").GetAbiError>;
|
|
17
|
-
declare const getAddressAtom:
|
|
17
|
+
declare const getAddressAtom: EnsAtomFactory<import("@ensforge/core").GetAddressParameters, {
|
|
18
18
|
readonly coinType: bigint & import("effect/Brand").Brand<"CoinType">;
|
|
19
19
|
readonly address: string;
|
|
20
20
|
readonly raw: `0x${string}` & import("effect/Brand").Brand<"AddressRecordData">;
|
|
@@ -23,7 +23,7 @@ declare const getAddressAtom: EnsQueryAtomFactory<import("@ensforge/core").GetAd
|
|
|
23
23
|
readonly address: null;
|
|
24
24
|
readonly raw: null;
|
|
25
25
|
}, import("@ensforge/core").GetAddressError>;
|
|
26
|
-
declare const getAddressesAtom:
|
|
26
|
+
declare const getAddressesAtom: EnsAtomFactory<import("@ensforge/core").GetAddressesParameters, readonly ({
|
|
27
27
|
readonly coinType: bigint & import("effect/Brand").Brand<"CoinType">;
|
|
28
28
|
readonly address: string;
|
|
29
29
|
readonly raw: `0x${string}` & import("effect/Brand").Brand<"AddressRecordData">;
|
|
@@ -32,7 +32,7 @@ declare const getAddressesAtom: EnsQueryAtomFactory<import("@ensforge/core").Get
|
|
|
32
32
|
readonly address: null;
|
|
33
33
|
readonly raw: null;
|
|
34
34
|
})[], import("@ensforge/core").GetAddressError>;
|
|
35
|
-
declare const getAvatarAtom:
|
|
35
|
+
declare const getAvatarAtom: EnsAtomFactory<import("@ensforge/core").GetAvatarParameters, {
|
|
36
36
|
readonly status: "resolved";
|
|
37
37
|
readonly record: string;
|
|
38
38
|
readonly uri: string;
|
|
@@ -41,7 +41,7 @@ declare const getAvatarAtom: EnsQueryAtomFactory<import("@ensforge/core").GetAva
|
|
|
41
41
|
readonly record: string;
|
|
42
42
|
readonly chainId: number;
|
|
43
43
|
} | null, import("@ensforge/core").GetAvatarError>;
|
|
44
|
-
declare const getContentHashAtom:
|
|
44
|
+
declare const getContentHashAtom: EnsAtomFactory<import("@ensforge/core").GetContentHashParameters, {
|
|
45
45
|
readonly protocol: "ipfs" | "ipns" | "swarm" | "onion" | "onion3" | "skynet" | "arweave" | "adnl";
|
|
46
46
|
readonly value: string;
|
|
47
47
|
readonly raw: `0x${string}` & import("effect/Brand").Brand<"ContentHash">;
|
|
@@ -50,26 +50,26 @@ declare const getContentHashAtom: EnsQueryAtomFactory<import("@ensforge/core").G
|
|
|
50
50
|
readonly value: null;
|
|
51
51
|
readonly raw: null;
|
|
52
52
|
}, import("@ensforge/core").GetContentHashError>;
|
|
53
|
-
declare const getDataAtom:
|
|
53
|
+
declare const getDataAtom: EnsAtomFactory<import("@ensforge/core").GetDataParameters, {
|
|
54
54
|
readonly key: string;
|
|
55
55
|
readonly value: `0x${string}` | null;
|
|
56
56
|
}, import("@ensforge/core").GetDataError>;
|
|
57
|
-
declare const getInterfaceAtom:
|
|
57
|
+
declare const getInterfaceAtom: EnsAtomFactory<import("@ensforge/core").GetInterfaceParameters, {
|
|
58
58
|
readonly interfaceId: `0x${string}` & import("effect/Brand").Brand<"InterfaceId">;
|
|
59
59
|
readonly implementer: `0x${string}` | null;
|
|
60
60
|
}, import("@ensforge/core").GetInterfaceError>;
|
|
61
|
-
declare const getNameAtom:
|
|
61
|
+
declare const getNameAtom: EnsAtomFactory<import("@ensforge/core").GetNameParameters, {
|
|
62
62
|
readonly name: string | null;
|
|
63
63
|
}, import("@ensforge/core").GetNameError>;
|
|
64
|
-
declare const getPubkeyAtom:
|
|
64
|
+
declare const getPubkeyAtom: EnsAtomFactory<import("@ensforge/core").GetPubkeyParameters, {
|
|
65
65
|
readonly x: `0x${string}`;
|
|
66
66
|
readonly y: `0x${string}`;
|
|
67
67
|
} | null, import("@ensforge/core").GetPubkeyError>;
|
|
68
|
-
declare const getTextAtom:
|
|
68
|
+
declare const getTextAtom: EnsAtomFactory<import("@ensforge/core").GetTextParameters, {
|
|
69
69
|
readonly key: string;
|
|
70
70
|
readonly value: string | null;
|
|
71
71
|
}, import("@ensforge/core").GetTextError>;
|
|
72
|
-
declare const getTextsAtom:
|
|
72
|
+
declare const getTextsAtom: EnsAtomFactory<import("@ensforge/core").GetTextsParameters, readonly {
|
|
73
73
|
readonly key: string;
|
|
74
74
|
readonly value: string | null;
|
|
75
75
|
}[], import("@ensforge/core").GetTextError>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"records.d.ts","names":[],"sources":["../../src/atoms/records.ts"],"mappings":";;;cAGa,YAAA,
|
|
1
|
+
{"version":3,"file":"records.d.ts","names":[],"sources":["../../src/atoms/records.ts"],"mappings":";;;cAGa,YAAA,wCAAU;;;;;;;;;;;;4BAAwD;cAClE,gBAAA,wCAAc;;;;;;;;4BAA4D;cAC1E,kBAAA,wCAAgB;;;;;;;;+BAA8D;cAC9E,eAAA,wCAAa;;;;;;;;mCAA2D;cACxE,oBAAA,wCAAkB;;;;;;;;4BAAgE;cAClF,aAAA,wCAAW;;;4BAAyD;cACpE,kBAAA,wCAAgB;;;4BAA8D;cAC9E,aAAA,wCAAW;;4BAAyD;cACpE,eAAA,wCAAa;;;mCAA2D;cACxE,aAAA,wCAAW;;;4BAAyD;cACpE,cAAA,wCAAY;;;8BAA0D;cAEtE,+BAAA,gDAA6B,gDAAA,8CAAA;cAI7B,gCAAA,gDAA8B,iDAAA,8CAAA;cAI9B,0BAAA,gDAAwB,2CAAA,8CAAA;cACxB,8BAAA,gDAA4B,+CAAA,8CAAA;cAI5B,gCAAA,gDAA8B,iDAAA,8CAAA;cAI9B,4BAAA,gDAA0B,6CAAA,8CAAA;cAI1B,6BAAA,gDAA2B,8CAAA,8CAAA;cAI3B,kCAAA,gDAAgC,mDAAA,8CAAA;cAIhC,2BAAA,gDAAyB,4CAAA,8CAAA;cACzB,gCAAA,gDAA8B,iDAAA,8CAAA;cAI9B,2BAAA,gDAAyB,4CAAA,8CAAA;cACzB,6BAAA,gDAA2B,8CAAA,8CAAA;cAI3B,8BAAA,gDAA4B,+CAAA,2CAAA;cAI5B,2BAAA,gDAAyB,4CAAA,8CAAA;cACzB,4BAAA,gDAA0B,6CAAA,8CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnsAtomFactory } from "./query.js";
|
|
2
2
|
import { EnsMutationAtomFactory } from "./mutation.js";
|
|
3
3
|
//#region src/atoms/registration.d.ts
|
|
4
|
-
declare const getCommitmentStatusAtom:
|
|
4
|
+
declare const getCommitmentStatusAtom: EnsAtomFactory<import("@ensforge/core").GetCommitmentStatusParameters, {
|
|
5
5
|
readonly status: "not-found";
|
|
6
6
|
readonly protocol: "v1" | "v2";
|
|
7
7
|
} | {
|
|
@@ -25,7 +25,7 @@ declare const getCommitmentStatusAtom: EnsQueryAtomFactory<import("@ensforge/cor
|
|
|
25
25
|
readonly readyAt: bigint;
|
|
26
26
|
readonly expiresAt: bigint;
|
|
27
27
|
}, import("@ensforge/core").GetCommitmentStatusError>;
|
|
28
|
-
declare const getRegistrationParametersAtom:
|
|
28
|
+
declare const getRegistrationParametersAtom: EnsAtomFactory<import("@ensforge/core").BlockParameters, {
|
|
29
29
|
readonly protocol: "v1";
|
|
30
30
|
readonly registrar: `0x${string}`;
|
|
31
31
|
readonly priceOracle: `0x${string}`;
|
|
@@ -49,7 +49,7 @@ declare const getRegistrationParametersAtom: EnsQueryAtomFactory<import("@ensfor
|
|
|
49
49
|
readonly enumerable: false;
|
|
50
50
|
};
|
|
51
51
|
}, import("@ensforge/core").GetCommitmentStatusError>;
|
|
52
|
-
declare const getRegistrationPlanAtom:
|
|
52
|
+
declare const getRegistrationPlanAtom: EnsAtomFactory<import("@ensforge/core").GetRegistrationPlanParameters, {
|
|
53
53
|
readonly status: "unavailable";
|
|
54
54
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
55
55
|
} | {
|
|
@@ -151,7 +151,7 @@ declare const getRegistrationPlanAtom: EnsQueryAtomFactory<import("@ensforge/cor
|
|
|
151
151
|
readonly expiresAt: bigint;
|
|
152
152
|
};
|
|
153
153
|
}, import("@ensforge/core").GetCommitmentStatusError>;
|
|
154
|
-
declare const getRegistrationPriceAtom:
|
|
154
|
+
declare const getRegistrationPriceAtom: EnsAtomFactory<import("@ensforge/core").GetRegistrationPriceParameters, {
|
|
155
155
|
readonly status: "available";
|
|
156
156
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
157
157
|
readonly protocol: "v1" | "v2";
|
|
@@ -185,7 +185,7 @@ declare const getRegistrationPriceAtom: EnsQueryAtomFactory<import("@ensforge/co
|
|
|
185
185
|
readonly protocol: "v1" | "v2";
|
|
186
186
|
readonly paymentToken: `0x${string}`;
|
|
187
187
|
}, import("@ensforge/core").GetCommitmentStatusError>;
|
|
188
|
-
declare const getRenewalPriceAtom:
|
|
188
|
+
declare const getRenewalPriceAtom: EnsAtomFactory<import("@ensforge/core").GetRegistrationPriceParameters, {
|
|
189
189
|
readonly status: "payment-token-required";
|
|
190
190
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
191
191
|
readonly protocol: "v1" | "v2";
|
|
@@ -218,7 +218,7 @@ declare const getRenewalPriceAtom: EnsQueryAtomFactory<import("@ensforge/core").
|
|
|
218
218
|
readonly protocol: "v1" | "v2";
|
|
219
219
|
readonly reason: "NAME_NOT_RENEWABLE";
|
|
220
220
|
}, import("@ensforge/core").GetCommitmentStatusError>;
|
|
221
|
-
declare const isPaymentTokenSupportedAtom:
|
|
221
|
+
declare const isPaymentTokenSupportedAtom: EnsAtomFactory<import("@ensforge/core").IsPaymentTokenSupportedParameters, {
|
|
222
222
|
readonly protocol: "v1";
|
|
223
223
|
readonly supported: false;
|
|
224
224
|
readonly reason: "NATIVE_PAYMENT_ONLY";
|
|
@@ -234,7 +234,7 @@ declare const isPaymentTokenSupportedAtom: EnsQueryAtomFactory<import("@ensforge
|
|
|
234
234
|
readonly symbol: string;
|
|
235
235
|
readonly decimals: number;
|
|
236
236
|
}, import("@ensforge/core").GetCommitmentStatusError>;
|
|
237
|
-
declare const makeRegistrationCommitmentAtom:
|
|
237
|
+
declare const makeRegistrationCommitmentAtom: EnsAtomFactory<import("@ensforge/core").MakeRegistrationCommitmentParameters, {
|
|
238
238
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
239
239
|
readonly protocol: "v1" | "v2";
|
|
240
240
|
readonly registrar: `0x${string}`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"registration.d.ts","names":[],"sources":["../../src/atoms/registration.ts"],"mappings":";;;cAGa,yBAAA,
|
|
1
|
+
{"version":3,"file":"registration.d.ts","names":[],"sources":["../../src/atoms/registration.ts"],"mappings":";;;cAGa,yBAAA,wCAAuB;;;;;;;;;;;;;;;;;;;;;;;4BAGnC;cACY,+BAAA,wCAA6B;;;;;;;;;;;;;;;;;;;;;;;4BAGzC;cACY,yBAAA,wCAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAGnC;cACY,0BAAA,wCAAwB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAGpC;cACY,qBAAA,wCAAmB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4BAG/B;cACY,6BAAA,wCAA2B;;;;;;;;;;;;;;;4BAGvC;cACY,gCAAA,wCAA8B;;;;;4BAG1C;cAEY,uCAAA,gDAAqC,wDAAA,8CAAA;cAIrC,yCAAA,gDAAuC,0DAAA,8CAAA;cAIvC,8BAAA,gDAA4B,+CAAA,8CAAA;cAI5B,wCAAA,gDAAsC,yDAAA,8CAAA;cAItC,gCAAA,gDAA8B,iDAAA,6CAAA;cAI9B,iCAAA,gDAA+B,kDAAA,8CAAA;cAI/B,6BAAA,gDAA2B,8CAAA,0CAAA;cAI3B,8BAAA,gDAA4B,+CAAA,2CAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnsAtomFactory } from "./query.js";
|
|
2
2
|
import { EnsMutationAtomFactory } from "./mutation.js";
|
|
3
3
|
//#region src/atoms/resolution.d.ts
|
|
4
|
-
declare const getAliasAtom:
|
|
4
|
+
declare const getAliasAtom: EnsAtomFactory<import("@ensforge/core").GetAliasParameters, {
|
|
5
5
|
readonly supported: false;
|
|
6
6
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
7
7
|
readonly resolver: `0x${string}` | null;
|
|
@@ -13,8 +13,8 @@ declare const getAliasAtom: EnsQueryAtomFactory<import("@ensforge/core").GetAlia
|
|
|
13
13
|
readonly target: (string & import("effect/Brand").Brand<"NormalizedName">) | null;
|
|
14
14
|
readonly raw: `0x${string}`;
|
|
15
15
|
}, import("@ensforge/core").GetAliasError>;
|
|
16
|
-
declare const getResolverAtom:
|
|
17
|
-
declare const getResolverVersionAtom:
|
|
16
|
+
declare const getResolverAtom: EnsAtomFactory<import("@ensforge/core").GetResolverParameters, import("@ensforge/core").GetResolverResult, import("@ensforge/core").GetResolverError>;
|
|
17
|
+
declare const getResolverVersionAtom: EnsAtomFactory<import("@ensforge/core").GetResolverVersionParameters, {
|
|
18
18
|
readonly supported: false;
|
|
19
19
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
20
20
|
readonly resolver: `0x${string}` | null;
|
|
@@ -25,13 +25,13 @@ declare const getResolverVersionAtom: EnsQueryAtomFactory<import("@ensforge/core
|
|
|
25
25
|
readonly resolver: `0x${string}`;
|
|
26
26
|
readonly version: bigint;
|
|
27
27
|
}, import("@ensforge/core").GetResolverError>;
|
|
28
|
-
declare const predictResolverAddressAtom:
|
|
29
|
-
declare const resolveAtom:
|
|
28
|
+
declare const predictResolverAddressAtom: EnsAtomFactory<import("@ensforge/core").CreateResolverParameters, `0x${string}`, import("@ensforge/core").WriteError>;
|
|
29
|
+
declare const resolveAtom: EnsAtomFactory<import("@ensforge/core").ResolveParameters, {
|
|
30
30
|
readonly data: `0x${string}`;
|
|
31
31
|
readonly resolverAddress: `0x${string}`;
|
|
32
32
|
} | null, import("@ensforge/core").ResolveError>;
|
|
33
|
-
declare const resolveBatchAtom:
|
|
34
|
-
declare const resolveWithResolverAtom:
|
|
33
|
+
declare const resolveBatchAtom: EnsAtomFactory<import("@ensforge/core").ResolveBatchParameters, import("@ensforge/core").ResolveBatchResult, import("@ensforge/core").ResolveError>;
|
|
34
|
+
declare const resolveWithResolverAtom: EnsAtomFactory<import("@ensforge/core").ResolveWithResolverParameters, {
|
|
35
35
|
readonly data: `0x${string}`;
|
|
36
36
|
readonly resolverAddress: `0x${string}`;
|
|
37
37
|
}, import("@ensforge/core").ResolveError>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolution.d.ts","names":[],"sources":["../../src/atoms/resolution.ts"],"mappings":";;;cAGa,cAAA,
|
|
1
|
+
{"version":3,"file":"resolution.d.ts","names":[],"sources":["../../src/atoms/resolution.ts"],"mappings":";;;cAGa,cAAA,wCAAY;;;;;;;;;;;4BAAgE;cAC5E,iBAAA,wCAAe,gDAAA,4CAAA;cACf,wBAAA,wCAAsB;;;;;;;;;;4BAGlC;cACY,4BAAA,wCAA0B,kEAAA;cAI1B,aAAA,wCAAW;;;mCAA+D;cAC1E,kBAAA,wCAAgB,iDAAA,6CAAA;cAChB,yBAAA,wCAAuB;;;4BAGnC;cAEY,kCAAA,gDAAgC,mDAAA,+CAAA;cAIhC,uCAAA,gDAAqC,wDAAA,oDAAA;cAIrC,+BAAA,gDAA6B,gDAAA,8CAAA;cAI7B,yCAAA,gDAAuC,0DAAA,wDAAA;cAIvC,mCAAA,gDAAiC,oDAAA,gDAAA"}
|
package/dist/atoms/reverse.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnsAtomFactory } from "./query.js";
|
|
2
2
|
import { EnsMutationAtomFactory } from "./mutation.js";
|
|
3
3
|
//#region src/atoms/reverse.d.ts
|
|
4
|
-
declare const getPrimaryNameAtom:
|
|
4
|
+
declare const getPrimaryNameAtom: EnsAtomFactory<import("@ensforge/core").GetPrimaryNameParameters, {
|
|
5
5
|
readonly name: string & import("effect/Brand").Brand<"NormalizedName">;
|
|
6
6
|
readonly match: true;
|
|
7
7
|
} | null, import("@ensforge/core").GetPrimaryNameError>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reverse.d.ts","names":[],"sources":["../../src/atoms/reverse.ts"],"mappings":";;;cAGa,oBAAA,
|
|
1
|
+
{"version":3,"file":"reverse.d.ts","names":[],"sources":["../../src/atoms/reverse.ts"],"mappings":";;;cAGa,oBAAA,wCAAkB;;;mCAAgE;cAElF,oCAAA,gDAAkC,qDAAA,8CAAA;cAIlC,0CAAA,gDAAwC,2DAAA,8CAAA;cAIxC,kCAAA,gDAAgC,mDAAA,8CAAA;cAIhC,4CAAA,gDAA0C,6DAAA,8CAAA"}
|
package/dist/atoms/stream.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnsAtomFactory } from "./query.js";
|
|
2
2
|
import { Ensforge } from "@ensforge/sdk";
|
|
3
3
|
import { Cause, Stream } from "effect";
|
|
4
4
|
//#region src/atoms/stream.d.ts
|
|
5
5
|
interface BoundStreamAction<Parameters, Success, Failure> {
|
|
6
6
|
readonly stream: (parameters: Parameters) => Stream.Stream<Success, Failure>;
|
|
7
7
|
}
|
|
8
|
-
declare const makeStreamAtom: <Parameters, Success, Failure>(group: string, getAction: (sdk: Ensforge) => BoundStreamAction<Parameters, Success, Failure>) =>
|
|
8
|
+
declare const makeStreamAtom: <Parameters, Success, Failure>(group: string, getAction: (sdk: Ensforge) => BoundStreamAction<Parameters, Success, Failure>) => EnsAtomFactory<Parameters, Success, Failure | Cause.NoSuchElementError>;
|
|
9
9
|
//#endregion
|
|
10
10
|
export { makeStreamAtom };
|
|
11
11
|
//# sourceMappingURL=stream.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.d.ts","names":[],"sources":["../../src/atoms/stream.ts"],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"stream.d.ts","names":[],"sources":["../../src/atoms/stream.ts"],"mappings":";;;;UAUU,kBAAkB,YAAY,SAAS;WACtC,SAAS,YAAY,eAAe,OAAO,OAAO,SAAS;;cASzD,iBAAkB,YAAY,SAAS,SAClD,eACA,YAAY,KAAK,aAAa,kBAAkB,YAAY,SAAS,aACpE,eAAe,YAAY,SAAS,UAAU,MAAM"}
|
package/dist/atoms/stream.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { atomRuntime } from "../internal/runtime.js";
|
|
2
2
|
import { makeReactivityKeys } from "../query/keys.js";
|
|
3
|
-
import {
|
|
3
|
+
import { resolveEnsAtomOptions } from "../query/options.js";
|
|
4
|
+
import { configureAtom } from "./query.js";
|
|
5
|
+
import { Data, Stream } from "effect";
|
|
4
6
|
import { Atom } from "effect/unstable/reactivity";
|
|
5
7
|
|
|
6
8
|
//#region src/atoms/stream.ts
|
|
@@ -8,11 +10,11 @@ var StreamAtomInput = class extends Data.Class {};
|
|
|
8
10
|
const makeStreamAtom = (group, getAction) => {
|
|
9
11
|
const family = Atom.family((input) => {
|
|
10
12
|
const actionStream = Stream.suspend(() => getAction(input.sdk).stream(input.parameters));
|
|
11
|
-
const stream = input.options.retry === false ? actionStream : actionStream.pipe(Stream.retry(
|
|
12
|
-
return atomRuntime.atom(stream).
|
|
13
|
+
const stream = input.options.retry === false ? actionStream : actionStream.pipe(Stream.retry(input.options.retry));
|
|
14
|
+
return configureAtom(atomRuntime.atom(stream), input.options, makeReactivityKeys(input.sdk, group, input.parameters));
|
|
13
15
|
});
|
|
14
16
|
return (sdk, parameters, options) => family(new StreamAtomInput({
|
|
15
|
-
options,
|
|
17
|
+
options: resolveEnsAtomOptions(void 0, options),
|
|
16
18
|
parameters,
|
|
17
19
|
sdk
|
|
18
20
|
}));
|
package/dist/atoms/stream.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stream.js","names":[],"sources":["../../src/atoms/stream.ts"],"sourcesContent":["import { Data,
|
|
1
|
+
{"version":3,"file":"stream.js","names":[],"sources":["../../src/atoms/stream.ts"],"sourcesContent":["import { Data, Stream, type Cause } from \"effect\";\nimport { Atom } from \"effect/unstable/reactivity\";\n\nimport type { Ensforge } from \"@ensforge/sdk\";\n\nimport { atomRuntime } from \"../internal/runtime.js\";\nimport { makeReactivityKeys } from \"../query/keys.js\";\nimport { resolveEnsAtomOptions, type ResolvedEnsAtomOptions } from \"../query/options.js\";\nimport { configureAtom, type EnsAtom, type EnsAtomFactory } from \"./query.js\";\n\ninterface BoundStreamAction<Parameters, Success, Failure> {\n readonly stream: (parameters: Parameters) => Stream.Stream<Success, Failure>;\n}\n\nclass StreamAtomInput<Parameters, Failure> extends Data.Class<{\n readonly options: ResolvedEnsAtomOptions<Failure>;\n readonly parameters: Parameters;\n readonly sdk: Ensforge;\n}> {}\n\nexport const makeStreamAtom = <Parameters, Success, Failure>(\n group: string,\n getAction: (sdk: Ensforge) => BoundStreamAction<Parameters, Success, Failure>,\n): EnsAtomFactory<Parameters, Success, Failure | Cause.NoSuchElementError> => {\n const family = Atom.family(\n (input: StreamAtomInput<Parameters, Failure | Cause.NoSuchElementError>) => {\n const actionStream = Stream.suspend(() => getAction(input.sdk).stream(input.parameters));\n const stream =\n input.options.retry === false\n ? actionStream\n : actionStream.pipe(Stream.retry(input.options.retry));\n return configureAtom(\n atomRuntime.atom(stream),\n input.options,\n makeReactivityKeys(input.sdk, group, input.parameters),\n );\n },\n );\n\n return (sdk, parameters, options): EnsAtom<Success, Failure | Cause.NoSuchElementError> =>\n family(\n new StreamAtomInput({\n options: resolveEnsAtomOptions(undefined, options),\n parameters,\n sdk,\n }),\n );\n};\n"],"mappings":";;;;;;;;AAcA,IAAM,kBAAN,cAAmD,KAAK,MAIrD,CAAC;AAEJ,MAAa,kBACX,OACA,cAC4E;CAC5E,MAAM,SAAS,KAAK,QACjB,UAA2E;EAC1E,MAAM,eAAe,OAAO,cAAc,UAAU,MAAM,GAAG,CAAC,CAAC,OAAO,MAAM,UAAU,CAAC;EACvF,MAAM,SACJ,MAAM,QAAQ,UAAU,QACpB,eACA,aAAa,KAAK,OAAO,MAAM,MAAM,QAAQ,KAAK,CAAC;EACzD,OAAO,cACL,YAAY,KAAK,MAAM,GACvB,MAAM,SACN,mBAAmB,MAAM,KAAK,OAAO,MAAM,UAAU,CACvD;CACF,CACF;CAEA,QAAQ,KAAK,YAAY,YACvB,OACE,IAAI,gBAAgB;EAClB,SAAS,sBAAsB,QAAW,OAAO;EACjD;EACA;CACF,CAAC,CACH;AACJ"}
|
package/dist/atoms/wrapping.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnsAtomFactory } from "./query.js";
|
|
2
2
|
import { EnsMutationAtomFactory } from "./mutation.js";
|
|
3
3
|
//#region src/atoms/wrapping.d.ts
|
|
4
|
-
declare const getFusesAtom:
|
|
5
|
-
declare const getWrapperExpiryAtom:
|
|
4
|
+
declare const getFusesAtom: EnsAtomFactory<import("@ensforge/core").WrapperReadParameters, import("@ensforge/core").GetFusesResult, import("@ensforge/core").GetCanonicalResourceError>;
|
|
5
|
+
declare const getWrapperExpiryAtom: EnsAtomFactory<import("@ensforge/core").WrapperReadParameters, import("@ensforge/core").GetWrapperExpiryResult, import("@ensforge/core").GetCanonicalResourceError>;
|
|
6
6
|
declare const createExtendSubnameExpiryMutationAtom: EnsMutationAtomFactory<import("@ensforge/core").ExtendSubnameExpiryParameters, import("@ensforge/core").CallExecutionResult, import("@ensforge/core").WriteError>;
|
|
7
7
|
declare const createSetChildFusesMutationAtom: EnsMutationAtomFactory<import("@ensforge/core").SetChildFusesParameters, import("@ensforge/core").CallExecutionResult, import("@ensforge/core").WriteError>;
|
|
8
8
|
declare const createSetFusesMutationAtom: EnsMutationAtomFactory<import("@ensforge/core").SetFusesParameters, import("@ensforge/core").CallExecutionResult, import("@ensforge/core").WriteError>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wrapping.d.ts","names":[],"sources":["../../src/atoms/wrapping.ts"],"mappings":";;;cAGa,cAAA,
|
|
1
|
+
{"version":3,"file":"wrapping.d.ts","names":[],"sources":["../../src/atoms/wrapping.ts"],"mappings":";;;cAGa,cAAA,wCAAY,gDAAA,yCAAA;cACZ,sBAAA,wCAAoB,gDAAA,iDAAA;cAKpB,uCAAA,gDAAqC,wDAAA,8CAAA;cAIrC,iCAAA,gDAA+B,kDAAA,8CAAA;cAI/B,4BAAA,gDAA0B,6CAAA,8CAAA;cAI1B,8BAAA,gDAA4B,+CAAA,8CAAA;cAI5B,4BAAA,gDAA0B,6CAAA,yCAAA"}
|
package/dist/atoms.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnsAtomOptions, ResolvedEnsAtomOptions, defaultEnsAtomOptions } from "./query/options.js";
|
|
2
|
+
import { EnsAtom, EnsAtomFactory, makeQueryAtom } from "./atoms/query.js";
|
|
2
3
|
import { EnsMutationAtom, EnsMutationAtomFactory, makeMutationAtom } from "./atoms/mutation.js";
|
|
3
4
|
import { createExecuteWritePlanMutationAtom, createResumeCallsMutationAtom, createSendCallsMutationAtom, estimateCallsAtom, getCallsStatusAtom, getWalletCapabilitiesAtom, prepareCallsAtom, simulateCallsAtom } from "./atoms/batch.js";
|
|
4
5
|
import { getNameCapabilitiesAtom, getOperatorApprovalAtom, getRecordPermissionsAtom, getRegistryCapabilitiesAtom, getRegistryRolesAtom, getRequiredAuthorizationAtom, getResolverCapabilitiesAtom, getResolverDelegateApprovalAtom, getResolverRolesAtom, getTokenApprovalAtom, getWrapperPermissionsAtom, getWriteTargetAtom, hasRegistryRolesAtom, hasResolverRolesAtom } from "./atoms/capabilities.js";
|
|
@@ -16,4 +17,4 @@ import { createCreateSubnameMutationAtom, createDeleteSubnameMutationAtom, creat
|
|
|
16
17
|
import { createExtendSubnameExpiryMutationAtom, createSetChildFusesMutationAtom, createSetFusesMutationAtom, createUnwrapNameMutationAtom, createWrapNameMutationAtom, getFusesAtom, getWrapperExpiryAtom } from "./atoms/wrapping.js";
|
|
17
18
|
import { ReadBatchAtomParameters, getRecordsAtom, readBatchAtom, readBatchSettledAtom } from "./atoms/generic.js";
|
|
18
19
|
import { makeStreamAtom } from "./atoms/stream.js";
|
|
19
|
-
export { type
|
|
20
|
+
export { type EnsAtom, type EnsAtomFactory, type EnsAtomOptions, type EnsMutationAtom, type EnsMutationAtomFactory, type ReadBatchAtomParameters, type ResolvedEnsAtomOptions, createApproveMigrationMutationAtom, createApproveNameMutationAtom, createApprovePaymentTokenMutationAtom, createApproveRenewalPaymentMutationAtom, createClaimDnsNameMutationAtom, createClearAvatarMutationAtom, createClearNameApprovalMutationAtom, createClearPrimaryNameMutationAtom, createClearRecordsMutationAtom, createCommitNameMutationAtom, createCompleteRegistrationMutationAtom, createCreateResolverMutationAtom, createCreateSubnameMutationAtom, createDeleteSubnameMutationAtom, createExecuteWritePlanMutationAtom, createExtendSubnameExpiryMutationAtom, createGetOrCreateResolverMutationAtom, createGrantRegistryRolesMutationAtom, createGrantResolverRolesMutationAtom, createGrantResolverRootRolesMutationAtom, createImportDnsNameMutationAtom, createMigrateNameMutationAtom, createMigrateNamesMutationAtom, createReclaimNameMutationAtom, createRegisterNameMutationAtom, createRegisterNamesMutationAtom, createRenewNameMutationAtom, createRenewNamesMutationAtom, createResumeCallsMutationAtom, createRevokeRegistryRolesMutationAtom, createRevokeResolverRolesMutationAtom, createRevokeResolverRootRolesMutationAtom, createSendCallsMutationAtom, createSetAbiMutationAtom, createSetAddressMutationAtom, createSetAddressesMutationAtom, createSetAliasMutationAtom, createSetAvatarMutationAtom, createSetChildFusesMutationAtom, createSetContentHashMutationAtom, createSetContractPrimaryNameMutationAtom, createSetDataMutationAtom, createSetDnsRecordsMutationAtom, createSetFusesMutationAtom, createSetInterfaceMutationAtom, createSetManagerMutationAtom, createSetNameMutationAtom, createSetOperatorApprovalMutationAtom, createSetPrimaryNameForAddressMutationAtom, createSetPrimaryNameMutationAtom, createSetPubkeyMutationAtom, createSetRecordPermissionsMutationAtom, createSetRecordsMutationAtom, createSetResolverAndRecordsMutationAtom, createSetResolverDelegateApprovalMutationAtom, createSetResolverMutationAtom, createSetSubnameExpiryMutationAtom, createSetSubnameManagerMutationAtom, createSetSubnameRecordMutationAtom, createSetSubnameResolverMutationAtom, createSetTextMutationAtom, createSetTextsMutationAtom, createSetTtlMutationAtom, createSetZoneHashMutationAtom, createTransferNameMutationAtom, createTransferRegistrantMutationAtom, createTransferSubnameMutationAtom, createUnwrapNameMutationAtom, createUpgradeResolverMutationAtom, createWrapNameMutationAtom, defaultEnsAtomOptions, estimateCallsAtom, getAbiAtom, getAddressAtom, getAddressesAtom, getAliasAtom, getAvatarAtom, getCallsStatusAtom, getCanonicalResourceAtom, getCommitmentStatusAtom, getContentHashAtom, getDataAtom, getDnsClaimStatusAtom, getDnsImportPlanAtom, getDnsRecordAtom, getDnsRecordsAtom, getEnsEventsAtom, getExpiryAtom, getFusesAtom, getInterfaceAtom, getManagerAtom, getMigrationEligibilityAtom, getMigrationPlanAtom, getMigrationStatusAtom, getMigrationTargetAtom, getNameAtom, getNameCapabilitiesAtom, getNameHistoryAtom, getNameStateAtom, getNameStatusAtom, getOperatorApprovalAtom, getOwnerAtom, getPrimaryNameAtom, getProtocolAtom, getPubkeyAtom, getRecordPermissionsAtom, getRecordsAtom, getRegistrantAtom, getRegistrationParametersAtom, getRegistrationPlanAtom, getRegistrationPriceAtom, getRegistryAtom, getRegistryCapabilitiesAtom, getRegistryRolesAtom, getRenewalPriceAtom, getRequiredAuthorizationAtom, getResolverAtom, getResolverCapabilitiesAtom, getResolverDelegateApprovalAtom, getResolverRolesAtom, getResolverVersionAtom, getTextAtom, getTextsAtom, getTokenApprovalAtom, getTokenIdAtom, getTtlAtom, getWalletCapabilitiesAtom, getWrapperExpiryAtom, getWrapperPermissionsAtom, getWriteTargetAtom, getZoneHashAtom, hasDnsRecordsAtom, hasRegistryRolesAtom, hasResolverRolesAtom, isAvailableAtom, isMigratedAtom, isPaymentTokenSupportedAtom, isRenewableAtom, isReservedAtom, isWrappedAtom, makeMutationAtom, makeQueryAtom, makeRegistrationCommitmentAtom, makeStreamAtom, predictResolverAddressAtom, prepareCallsAtom, readBatchAtom, readBatchSettledAtom, resolveAtom, resolveBatchAtom, resolveWithResolverAtom, simulateCallsAtom, watchEnsEventsAtom };
|