@fangorn-network/sdk 2026.8.12-dev → 2026.9.22-dev

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.
Files changed (40) hide show
  1. package/README.md +175 -62
  2. package/lib/cli/cli.d.ts +0 -0
  3. package/lib/cli/cli.js +348 -17
  4. package/lib/cli/index.d.ts +13 -13
  5. package/lib/config.d.ts +28 -352
  6. package/lib/config.js +11 -20
  7. package/lib/contracts/app-registry/abi.d.ts +509 -0
  8. package/lib/contracts/app-registry/abi.js +575 -0
  9. package/lib/contracts/app-registry/index.d.ts +120 -0
  10. package/lib/contracts/app-registry/index.js +266 -0
  11. package/lib/contracts/data-registry/abi.d.ts +124 -125
  12. package/lib/contracts/data-registry/abi.js +145 -142
  13. package/lib/contracts/data-registry/index.d.ts +20 -27
  14. package/lib/contracts/data-registry/index.js +32 -78
  15. package/lib/contracts/index.d.ts +8 -3
  16. package/lib/contracts/index.js +8 -3
  17. package/lib/contracts/logs.d.ts +18 -0
  18. package/lib/contracts/logs.js +25 -0
  19. package/lib/contracts/settlement-registry/abi.d.ts +430 -11
  20. package/lib/contracts/settlement-registry/abi.js +528 -41
  21. package/lib/contracts/settlement-registry/index.d.ts +148 -10
  22. package/lib/contracts/settlement-registry/index.js +233 -9
  23. package/lib/contracts/subscription-registry/abi.d.ts +179 -0
  24. package/lib/contracts/subscription-registry/abi.js +195 -0
  25. package/lib/contracts/subscription-registry/index.d.ts +59 -0
  26. package/lib/contracts/subscription-registry/index.js +116 -0
  27. package/lib/contracts/types.d.ts +8 -0
  28. package/lib/contracts/types.js +10 -0
  29. package/lib/contracts/write.d.ts +27 -0
  30. package/lib/contracts/write.js +55 -0
  31. package/lib/crypto/encryption.js +4 -4
  32. package/lib/engine/index.d.ts +14 -12
  33. package/lib/engine/index.js +13 -7
  34. package/lib/fangorn.d.ts +71 -6
  35. package/lib/fangorn.js +86 -7
  36. package/lib/index.d.ts +9 -4
  37. package/lib/index.js +9 -4
  38. package/lib/test/testbed.js +9 -3
  39. package/lib/types/index.d.ts +6 -0
  40. package/package.json +73 -85
@@ -1,25 +1,163 @@
1
- import { Address, Hex, PublicClient } from "viem";
1
+ import { Address, Hash, Hex, PublicClient, WalletClient } from "viem";
2
2
 
3
3
  //#region src/contracts/settlement-registry/index.d.ts
4
4
 
5
5
  /**
6
- * Read-only client for the Settlement Registry — the settlement rail behind
7
- * gated reads. A resource is identified by its `resourceId` (bytes32, the same
8
- * value produced by `resourceId(owner, schemaId, name)` in utils/manifest and
9
- * bound into a sealed field's HKDF key).
6
+ * `keccak256(publisher ++ uid)` — the same derivation the registry does in
7
+ * `resource_id_of`, and the same one `resourceIdOf` in `@fangorn-network/fetch`
8
+ * does on the buyer side. Pinned against the deployed contract by an e2e case.
10
9
  *
11
- * `getPrice(resourceId) === 0` means the resource is free (the worker lets any
12
- * signed request through); a non-zero price means the caller must have settled.
13
- * The pay/settle write path is a separate payment rail and is not modeled here.
10
+ * The id is derived rather than chosen, so a uid cannot be squatted or
11
+ * front-run. Deriving it locally means a publisher knows the id before
12
+ * `createResource` lands, and a buyer needs no RPC to name what they are buying;
13
+ * `resourceIdFor` asks the chain the same question and exists for parity checks.
14
+ */
15
+ declare const resourceIdOf: (publisher: Address, uid: Hex) => Hex;
16
+ /**
17
+ * The on-chain `uri` is not free-form: it packs the access worker to fetch from
18
+ * and the sha256 of the plaintext to verify against, as `${workerUrl}#${hash}`.
19
+ *
20
+ * The hash is what makes a read more than a download — without it a worker can
21
+ * serve any bytes that happen to decrypt. `unpackUri` in `@fangorn-network/fetch`
22
+ * is the other side of this, and a publisher who lists a bare URL produces a
23
+ * resource that buyer cannot verify.
24
+ */
25
+ declare const packResourceUri: (workerUrl: string, plaintextHash: Hex) => string;
26
+ /** Everything the registry knows about a priced resource. */
27
+ interface Resource {
28
+ owner: Address;
29
+ /** In the settlement token's smallest unit. Zero means free. */
30
+ price: bigint;
31
+ /** The Semaphore group minted for this resource when it was created. */
32
+ groupId: bigint;
33
+ uri: string;
34
+ disabled: boolean;
35
+ }
36
+ /**
37
+ * An EIP-3009 `transferWithAuthorization` signature: what lets a consumer pay in
38
+ * USDC without ever holding gas, because someone else relays it for them.
39
+ */
40
+ interface TransferAuthorization {
41
+ from: Address;
42
+ amount: bigint;
43
+ validAfter: bigint;
44
+ validBefore: bigint;
45
+ nonce: Hex;
46
+ v: number;
47
+ r: Hex;
48
+ s: Hex;
49
+ }
50
+ /** A Semaphore membership proof, as the contract wants it. */
51
+ interface SemaphoreProof {
52
+ merkleTreeDepth: bigint;
53
+ merkleTreeRoot: bigint;
54
+ nullifier: bigint;
55
+ message: bigint;
56
+ /** The eight field elements of the Groth16 proof. */
57
+ points: readonly [bigint, bigint, bigint, bigint, bigint, bigint, bigint, bigint];
58
+ }
59
+ /**
60
+ * Client for the SettlementRegistry — the pay-then-read rail.
61
+ *
62
+ * The two consumer calls are separate on purpose, and the separation is the whole
63
+ * privacy property:
64
+ *
65
+ * 1. `register` — pay for `resourceId` and join its Semaphore group with an
66
+ * identity commitment. This transaction is linked to the payer.
67
+ * 2. `settle` — prove group membership in zero knowledge from a *fresh stealth
68
+ * address*, which is then the address `isSettled` answers for.
69
+ *
70
+ * Nothing on-chain connects the payer to the reader beyond membership of the same
71
+ * group, so a publisher can verify a reader paid without learning who they are.
72
+ * Both are normally relayed by a facilitator, so the consumer needs no gas at all —
73
+ * which is why `register` takes a signed authorization rather than moving funds
74
+ * from `msg.sender`.
75
+ *
76
+ * Constructing without a wallet client gives a read-only client: that is the access
77
+ * worker's usage, which only ever asks `isSettled` and `getPrice`.
78
+ *
79
+ * The publisher half of the flow is here. The BUYER half — deriving a Semaphore
80
+ * identity, signing the EIP-3009 authorization, rebuilding the resource's group
81
+ * from `MemberRegistered` logs and proving membership — already lives in
82
+ * `@fangorn-network/fetch` (x402f), which relays both writes through a facilitator
83
+ * so the buyer never needs gas. Do not reimplement it here: this SDK deliberately
84
+ * carries no Semaphore proving dependency (see the note in the wiki's gotchas).
14
85
  */
15
86
  declare class SettlementRegistryClient {
16
87
  private contractAddress;
17
88
  private publicClient;
18
- constructor(contractAddress: Address, publicClient: PublicClient);
89
+ private walletClient?;
90
+ constructor(contractAddress: Address, publicClient: PublicClient, walletClient?: WalletClient | undefined);
91
+ getAddress(): Address;
92
+ private executeWrite;
93
+ /**
94
+ * List a resource for sale and mint its Semaphore group in one transaction.
95
+ *
96
+ * `uid` is the publisher's own identifier for the item; the on-chain
97
+ * `resourceId` is `resourceIdFor(owner, uid)`, so two publishers can use the
98
+ * same uid without collision and a publisher can compute the id before the
99
+ * transaction lands. Claiming the same uid twice reverts `AlreadyRegistered`.
100
+ */
101
+ createResource(uid: Hex, price: bigint, uri: string): Promise<Hash>;
102
+ /** Reprice a resource. Does not affect anyone who already settled. */
103
+ updatePrice(resourceId: Hex, price: bigint): Promise<Hash>;
104
+ /**
105
+ * Take a resource off the market. Existing settlements still read — disabling
106
+ * blocks new registrations, it does not revoke access that was paid for.
107
+ */
108
+ setDisabled(resourceId: Hex, disabled: boolean): Promise<Hash>;
109
+ /**
110
+ * Attach a contract called after each successful `settle`.
111
+ *
112
+ * No funds pass through it and it cannot change the payment: it fires after
113
+ * settlement is already recorded, and a revert inside it surfaces as
114
+ * `HookFailed`. It is a notification, not a fee lever.
115
+ */
116
+ registerHook(resourceId: Hex, hook: Address): Promise<Hash>;
117
+ /**
118
+ * Step 1: pay for `resourceId` and join its group.
119
+ *
120
+ * The USDC moves via the caller's EIP-3009 authorization, not from
121
+ * `msg.sender`, so this is safe (and intended) to relay. `amount` must equal
122
+ * the current price exactly, or it reverts `IncorrectPaymentAmount` — quote
123
+ * `getPrice` immediately before signing, since the owner can reprice.
124
+ */
125
+ register(resourceId: Hex, identityCommitment: bigint, auth: TransferAuthorization): Promise<Hash>;
126
+ /**
127
+ * Step 2: prove membership from `stealthAddress`, which is the address
128
+ * `isSettled` will answer for afterwards.
129
+ *
130
+ * The proof's nullifier makes this once-per-identity: a second settle reverts
131
+ * `AlreadySettled`. Send it from an address with no history, or the
132
+ * unlinkability that `register`/`settle` exist to provide is spent for nothing.
133
+ *
134
+ * `hookData` is `uint8[]`, not `bytes` — the contract declares it `Vec<u8>`, and
135
+ * Stylus maps that to a dynamic array of words. Every byte costs a full 32-byte
136
+ * slot in calldata, so keep it empty unless a hook actually reads it.
137
+ */
138
+ settle(resourceId: Hex, stealthAddress: Address, proof: SemaphoreProof, hookData?: readonly number[]): Promise<Hash>;
19
139
  /** True if `stealthAddress` has settled for `resourceId`. */
20
140
  isSettled(stealthAddress: Address, resourceId: Hex): Promise<boolean>;
21
141
  /** Price of `resourceId` in the settlement token's smallest unit; 0 = free. */
22
142
  getPrice(resourceId: Hex): Promise<bigint>;
143
+ /** The id a `uid` will get under `publisher` — computable before listing. */
144
+ resourceIdFor(publisher: Address, uid: Hex): Promise<Hex>;
145
+ /** Whether this identity commitment already joined the resource's group. */
146
+ isRegistered(resourceId: Hex, identityCommitment: bigint): Promise<boolean>;
147
+ getOwner(resourceId: Hex): Promise<Address>;
148
+ getGroupId(resourceId: Hex): Promise<bigint>;
149
+ getUri(resourceId: Hex): Promise<string>;
150
+ isDisabled(resourceId: Hex): Promise<boolean>;
151
+ /**
152
+ * Everything a listing page needs, in one round trip. An unlisted resource
153
+ * comes back with a zero owner rather than throwing — `getPrice` alone cannot
154
+ * tell "free" from "does not exist".
155
+ */
156
+ getResource(resourceId: Hex): Promise<Resource>;
157
+ getUsdc(): Promise<Address>;
158
+ getSemaphore(): Promise<Address>;
159
+ getAdmin(): Promise<Address>;
160
+ setAdmin(admin: Address): Promise<Hash>;
23
161
  }
24
162
  //#endregion
25
- export { SettlementRegistryClient };
163
+ export { Resource, SemaphoreProof, SettlementRegistryClient, TransferAuthorization, packResourceUri, resourceIdOf };
@@ -1,20 +1,149 @@
1
+ import { requireWallet, sendWrite } from "../write.js";
1
2
  import { SETTLEMENT_REGISTRY_ABI } from "./abi.js";
3
+ import { concat, keccak256 } from "viem";
2
4
 
3
5
  //#region src/contracts/settlement-registry/index.ts
4
6
  /**
5
- * Read-only client for the Settlement Registry — the settlement rail behind
6
- * gated reads. A resource is identified by its `resourceId` (bytes32, the same
7
- * value produced by `resourceId(owner, schemaId, name)` in utils/manifest and
8
- * bound into a sealed field's HKDF key).
7
+ * `keccak256(publisher ++ uid)` — the same derivation the registry does in
8
+ * `resource_id_of`, and the same one `resourceIdOf` in `@fangorn-network/fetch`
9
+ * does on the buyer side. Pinned against the deployed contract by an e2e case.
9
10
  *
10
- * `getPrice(resourceId) === 0` means the resource is free (the worker lets any
11
- * signed request through); a non-zero price means the caller must have settled.
12
- * The pay/settle write path is a separate payment rail and is not modeled here.
11
+ * The id is derived rather than chosen, so a uid cannot be squatted or
12
+ * front-run. Deriving it locally means a publisher knows the id before
13
+ * `createResource` lands, and a buyer needs no RPC to name what they are buying;
14
+ * `resourceIdFor` asks the chain the same question and exists for parity checks.
15
+ */
16
+ const resourceIdOf = (publisher, uid) => keccak256(concat([publisher, uid]));
17
+ /**
18
+ * The on-chain `uri` is not free-form: it packs the access worker to fetch from
19
+ * and the sha256 of the plaintext to verify against, as `${workerUrl}#${hash}`.
20
+ *
21
+ * The hash is what makes a read more than a download — without it a worker can
22
+ * serve any bytes that happen to decrypt. `unpackUri` in `@fangorn-network/fetch`
23
+ * is the other side of this, and a publisher who lists a bare URL produces a
24
+ * resource that buyer cannot verify.
25
+ */
26
+ const packResourceUri = (workerUrl, plaintextHash) => `${workerUrl.replace(/\/$/, "")}#${plaintextHash}`;
27
+ /**
28
+ * Client for the SettlementRegistry — the pay-then-read rail.
29
+ *
30
+ * The two consumer calls are separate on purpose, and the separation is the whole
31
+ * privacy property:
32
+ *
33
+ * 1. `register` — pay for `resourceId` and join its Semaphore group with an
34
+ * identity commitment. This transaction is linked to the payer.
35
+ * 2. `settle` — prove group membership in zero knowledge from a *fresh stealth
36
+ * address*, which is then the address `isSettled` answers for.
37
+ *
38
+ * Nothing on-chain connects the payer to the reader beyond membership of the same
39
+ * group, so a publisher can verify a reader paid without learning who they are.
40
+ * Both are normally relayed by a facilitator, so the consumer needs no gas at all —
41
+ * which is why `register` takes a signed authorization rather than moving funds
42
+ * from `msg.sender`.
43
+ *
44
+ * Constructing without a wallet client gives a read-only client: that is the access
45
+ * worker's usage, which only ever asks `isSettled` and `getPrice`.
46
+ *
47
+ * The publisher half of the flow is here. The BUYER half — deriving a Semaphore
48
+ * identity, signing the EIP-3009 authorization, rebuilding the resource's group
49
+ * from `MemberRegistered` logs and proving membership — already lives in
50
+ * `@fangorn-network/fetch` (x402f), which relays both writes through a facilitator
51
+ * so the buyer never needs gas. Do not reimplement it here: this SDK deliberately
52
+ * carries no Semaphore proving dependency (see the note in the wiki's gotchas).
13
53
  */
14
54
  var SettlementRegistryClient = class {
15
- constructor(contractAddress, publicClient) {
55
+ constructor(contractAddress, publicClient, walletClient) {
16
56
  this.contractAddress = contractAddress;
17
57
  this.publicClient = publicClient;
58
+ this.walletClient = walletClient;
59
+ }
60
+ getAddress() {
61
+ return this.contractAddress;
62
+ }
63
+ executeWrite(functionName, args) {
64
+ return sendWrite(this.publicClient, requireWallet(this.walletClient, functionName), this.contractAddress, SETTLEMENT_REGISTRY_ABI, functionName, args);
65
+ }
66
+ /**
67
+ * List a resource for sale and mint its Semaphore group in one transaction.
68
+ *
69
+ * `uid` is the publisher's own identifier for the item; the on-chain
70
+ * `resourceId` is `resourceIdFor(owner, uid)`, so two publishers can use the
71
+ * same uid without collision and a publisher can compute the id before the
72
+ * transaction lands. Claiming the same uid twice reverts `AlreadyRegistered`.
73
+ */
74
+ async createResource(uid, price, uri) {
75
+ return this.executeWrite("createResource", [
76
+ uid,
77
+ price,
78
+ uri
79
+ ]);
80
+ }
81
+ /** Reprice a resource. Does not affect anyone who already settled. */
82
+ async updatePrice(resourceId, price) {
83
+ return this.executeWrite("updatePrice", [resourceId, price]);
84
+ }
85
+ /**
86
+ * Take a resource off the market. Existing settlements still read — disabling
87
+ * blocks new registrations, it does not revoke access that was paid for.
88
+ */
89
+ async setDisabled(resourceId, disabled) {
90
+ return this.executeWrite("setDisabled", [resourceId, disabled]);
91
+ }
92
+ /**
93
+ * Attach a contract called after each successful `settle`.
94
+ *
95
+ * No funds pass through it and it cannot change the payment: it fires after
96
+ * settlement is already recorded, and a revert inside it surfaces as
97
+ * `HookFailed`. It is a notification, not a fee lever.
98
+ */
99
+ async registerHook(resourceId, hook) {
100
+ return this.executeWrite("registerHook", [resourceId, hook]);
101
+ }
102
+ /**
103
+ * Step 1: pay for `resourceId` and join its group.
104
+ *
105
+ * The USDC moves via the caller's EIP-3009 authorization, not from
106
+ * `msg.sender`, so this is safe (and intended) to relay. `amount` must equal
107
+ * the current price exactly, or it reverts `IncorrectPaymentAmount` — quote
108
+ * `getPrice` immediately before signing, since the owner can reprice.
109
+ */
110
+ async register(resourceId, identityCommitment, auth) {
111
+ return this.executeWrite("register", [
112
+ resourceId,
113
+ identityCommitment,
114
+ auth.from,
115
+ auth.amount,
116
+ auth.validAfter,
117
+ auth.validBefore,
118
+ auth.nonce,
119
+ auth.v,
120
+ auth.r,
121
+ auth.s
122
+ ]);
123
+ }
124
+ /**
125
+ * Step 2: prove membership from `stealthAddress`, which is the address
126
+ * `isSettled` will answer for afterwards.
127
+ *
128
+ * The proof's nullifier makes this once-per-identity: a second settle reverts
129
+ * `AlreadySettled`. Send it from an address with no history, or the
130
+ * unlinkability that `register`/`settle` exist to provide is spent for nothing.
131
+ *
132
+ * `hookData` is `uint8[]`, not `bytes` — the contract declares it `Vec<u8>`, and
133
+ * Stylus maps that to a dynamic array of words. Every byte costs a full 32-byte
134
+ * slot in calldata, so keep it empty unless a hook actually reads it.
135
+ */
136
+ async settle(resourceId, stealthAddress, proof, hookData = []) {
137
+ return this.executeWrite("settle", [
138
+ resourceId,
139
+ stealthAddress,
140
+ proof.merkleTreeDepth,
141
+ proof.merkleTreeRoot,
142
+ proof.nullifier,
143
+ proof.message,
144
+ proof.points,
145
+ hookData
146
+ ]);
18
147
  }
19
148
  /** True if `stealthAddress` has settled for `resourceId`. */
20
149
  async isSettled(stealthAddress, resourceId) {
@@ -34,7 +163,102 @@ var SettlementRegistryClient = class {
34
163
  args: [resourceId]
35
164
  });
36
165
  }
166
+ /** The id a `uid` will get under `publisher` — computable before listing. */
167
+ async resourceIdFor(publisher, uid) {
168
+ return this.publicClient.readContract({
169
+ address: this.contractAddress,
170
+ abi: SETTLEMENT_REGISTRY_ABI,
171
+ functionName: "resourceIdFor",
172
+ args: [publisher, uid]
173
+ });
174
+ }
175
+ /** Whether this identity commitment already joined the resource's group. */
176
+ async isRegistered(resourceId, identityCommitment) {
177
+ return this.publicClient.readContract({
178
+ address: this.contractAddress,
179
+ abi: SETTLEMENT_REGISTRY_ABI,
180
+ functionName: "isRegistered",
181
+ args: [resourceId, identityCommitment]
182
+ });
183
+ }
184
+ async getOwner(resourceId) {
185
+ return this.publicClient.readContract({
186
+ address: this.contractAddress,
187
+ abi: SETTLEMENT_REGISTRY_ABI,
188
+ functionName: "getOwner",
189
+ args: [resourceId]
190
+ });
191
+ }
192
+ async getGroupId(resourceId) {
193
+ return this.publicClient.readContract({
194
+ address: this.contractAddress,
195
+ abi: SETTLEMENT_REGISTRY_ABI,
196
+ functionName: "getGroupId",
197
+ args: [resourceId]
198
+ });
199
+ }
200
+ async getUri(resourceId) {
201
+ return this.publicClient.readContract({
202
+ address: this.contractAddress,
203
+ abi: SETTLEMENT_REGISTRY_ABI,
204
+ functionName: "getUri",
205
+ args: [resourceId]
206
+ });
207
+ }
208
+ async isDisabled(resourceId) {
209
+ return this.publicClient.readContract({
210
+ address: this.contractAddress,
211
+ abi: SETTLEMENT_REGISTRY_ABI,
212
+ functionName: "isDisabled",
213
+ args: [resourceId]
214
+ });
215
+ }
216
+ /**
217
+ * Everything a listing page needs, in one round trip. An unlisted resource
218
+ * comes back with a zero owner rather than throwing — `getPrice` alone cannot
219
+ * tell "free" from "does not exist".
220
+ */
221
+ async getResource(resourceId) {
222
+ const [owner, price, groupId, uri, disabled] = await Promise.all([
223
+ this.getOwner(resourceId),
224
+ this.getPrice(resourceId),
225
+ this.getGroupId(resourceId),
226
+ this.getUri(resourceId),
227
+ this.isDisabled(resourceId)
228
+ ]);
229
+ return {
230
+ owner,
231
+ price,
232
+ groupId,
233
+ uri,
234
+ disabled
235
+ };
236
+ }
237
+ async getUsdc() {
238
+ return this.publicClient.readContract({
239
+ address: this.contractAddress,
240
+ abi: SETTLEMENT_REGISTRY_ABI,
241
+ functionName: "getUsdc"
242
+ });
243
+ }
244
+ async getSemaphore() {
245
+ return this.publicClient.readContract({
246
+ address: this.contractAddress,
247
+ abi: SETTLEMENT_REGISTRY_ABI,
248
+ functionName: "getSemaphore"
249
+ });
250
+ }
251
+ async getAdmin() {
252
+ return this.publicClient.readContract({
253
+ address: this.contractAddress,
254
+ abi: SETTLEMENT_REGISTRY_ABI,
255
+ functionName: "getAdmin"
256
+ });
257
+ }
258
+ async setAdmin(admin) {
259
+ return this.executeWrite("setAdmin", [admin]);
260
+ }
37
261
  };
38
262
 
39
263
  //#endregion
40
- export { SettlementRegistryClient };
264
+ export { SettlementRegistryClient, packResourceUri, resourceIdOf };
@@ -0,0 +1,179 @@
1
+ //#region src/contracts/subscription-registry/abi.d.ts
2
+ /**
3
+ * The SubscriptionRegistry: the publisher-side paywall for storage.
4
+ *
5
+ * A publisher pays a USDC fee to open or renew; the off-chain upload gate reads
6
+ * `access(publisher)` — `(registered, paidAt)` — and applies its own free-tier and
7
+ * active-window policy. The contract deliberately stores no expiry: the window is a
8
+ * policy decision the gate owns, so changing it does not need a migration.
9
+ *
10
+ * `registered` is a cross-call to the DataRegistry, so this contract never
11
+ * duplicates publisher registration; it only prices storage on top of it.
12
+ *
13
+ * Generated from `cargo stylus export-abi --json`; the events are appended by hand
14
+ * because export-abi does not emit `sol!` event definitions.
15
+ */
16
+ declare const SUBSCRIPTION_REGISTRY_ABI: readonly [{
17
+ readonly inputs: readonly [{
18
+ readonly internalType: "address";
19
+ readonly name: "publisher";
20
+ readonly type: "address";
21
+ }];
22
+ readonly name: "access";
23
+ readonly outputs: readonly [{
24
+ readonly internalType: "bool";
25
+ readonly name: "";
26
+ readonly type: "bool";
27
+ }, {
28
+ readonly internalType: "uint64";
29
+ readonly name: "";
30
+ readonly type: "uint64";
31
+ }];
32
+ readonly stateMutability: "view";
33
+ readonly type: "function";
34
+ }, {
35
+ readonly inputs: readonly [];
36
+ readonly name: "admin";
37
+ readonly outputs: readonly [{
38
+ readonly internalType: "address";
39
+ readonly name: "";
40
+ readonly type: "address";
41
+ }];
42
+ readonly stateMutability: "view";
43
+ readonly type: "function";
44
+ }, {
45
+ readonly inputs: readonly [];
46
+ readonly name: "dataRegistry";
47
+ readonly outputs: readonly [{
48
+ readonly internalType: "address";
49
+ readonly name: "";
50
+ readonly type: "address";
51
+ }];
52
+ readonly stateMutability: "view";
53
+ readonly type: "function";
54
+ }, {
55
+ readonly inputs: readonly [{
56
+ readonly internalType: "address";
57
+ readonly name: "registry";
58
+ readonly type: "address";
59
+ }];
60
+ readonly name: "setDataRegistry";
61
+ readonly outputs: readonly [];
62
+ readonly stateMutability: "nonpayable";
63
+ readonly type: "function";
64
+ }, {
65
+ readonly inputs: readonly [{
66
+ readonly internalType: "uint256";
67
+ readonly name: "fee";
68
+ readonly type: "uint256";
69
+ }];
70
+ readonly name: "setSubscriptionFee";
71
+ readonly outputs: readonly [];
72
+ readonly stateMutability: "nonpayable";
73
+ readonly type: "function";
74
+ }, {
75
+ readonly inputs: readonly [{
76
+ readonly internalType: "address";
77
+ readonly name: "token";
78
+ readonly type: "address";
79
+ }];
80
+ readonly name: "setUsdc";
81
+ readonly outputs: readonly [];
82
+ readonly stateMutability: "nonpayable";
83
+ readonly type: "function";
84
+ }, {
85
+ readonly inputs: readonly [];
86
+ readonly name: "subscribe";
87
+ readonly outputs: readonly [];
88
+ readonly stateMutability: "nonpayable";
89
+ readonly type: "function";
90
+ }, {
91
+ readonly inputs: readonly [{
92
+ readonly internalType: "address";
93
+ readonly name: "publisher";
94
+ readonly type: "address";
95
+ }];
96
+ readonly name: "subscribedAt";
97
+ readonly outputs: readonly [{
98
+ readonly internalType: "uint64";
99
+ readonly name: "";
100
+ readonly type: "uint64";
101
+ }];
102
+ readonly stateMutability: "view";
103
+ readonly type: "function";
104
+ }, {
105
+ readonly inputs: readonly [];
106
+ readonly name: "subscriptionFee";
107
+ readonly outputs: readonly [{
108
+ readonly internalType: "uint256";
109
+ readonly name: "";
110
+ readonly type: "uint256";
111
+ }];
112
+ readonly stateMutability: "view";
113
+ readonly type: "function";
114
+ }, {
115
+ readonly inputs: readonly [];
116
+ readonly name: "usdc";
117
+ readonly outputs: readonly [{
118
+ readonly internalType: "address";
119
+ readonly name: "";
120
+ readonly type: "address";
121
+ }];
122
+ readonly stateMutability: "view";
123
+ readonly type: "function";
124
+ }, {
125
+ readonly inputs: readonly [{
126
+ readonly internalType: "address";
127
+ readonly name: "to";
128
+ readonly type: "address";
129
+ }, {
130
+ readonly internalType: "uint256";
131
+ readonly name: "amount";
132
+ readonly type: "uint256";
133
+ }];
134
+ readonly name: "withdrawEth";
135
+ readonly outputs: readonly [];
136
+ readonly stateMutability: "nonpayable";
137
+ readonly type: "function";
138
+ }, {
139
+ readonly inputs: readonly [{
140
+ readonly internalType: "address";
141
+ readonly name: "to";
142
+ readonly type: "address";
143
+ }, {
144
+ readonly internalType: "uint256";
145
+ readonly name: "amount";
146
+ readonly type: "uint256";
147
+ }];
148
+ readonly name: "withdrawUsdc";
149
+ readonly outputs: readonly [];
150
+ readonly stateMutability: "nonpayable";
151
+ readonly type: "function";
152
+ }, {
153
+ readonly type: "event";
154
+ readonly name: "Subscribed";
155
+ readonly anonymous: false;
156
+ readonly inputs: readonly [{
157
+ readonly type: "address";
158
+ readonly name: "publisher";
159
+ readonly internalType: "address";
160
+ readonly indexed: true;
161
+ }, {
162
+ readonly type: "uint64";
163
+ readonly name: "paidAt";
164
+ readonly internalType: "uint64";
165
+ readonly indexed: false;
166
+ }];
167
+ }, {
168
+ readonly type: "event";
169
+ readonly name: "SubscriptionFeeChanged";
170
+ readonly anonymous: false;
171
+ readonly inputs: readonly [{
172
+ readonly type: "uint256";
173
+ readonly name: "fee";
174
+ readonly internalType: "uint256";
175
+ readonly indexed: false;
176
+ }];
177
+ }];
178
+ //#endregion
179
+ export { SUBSCRIPTION_REGISTRY_ABI };