@noosphere/contracts 0.1.0-alpha.4 → 0.2.0-alpha.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/dist/index.d.mts CHANGED
@@ -1,5 +1,4 @@
1
- import * as ethers from 'ethers';
2
- import { DeferredTopicFilter, EventFragment, EventLog, TransactionRequest, Typed, ContractTransactionResponse, FunctionFragment, ContractTransaction, LogDescription, BaseContract, ContractRunner, Interface, BytesLike, BigNumberish, AddressLike, Result, Listener, ContractMethod, Provider, Signer, Contract } from 'ethers';
1
+ import { DeferredTopicFilter, EventFragment, EventLog, TransactionRequest, Typed, ContractTransactionResponse, FunctionFragment, ContractTransaction, LogDescription, BaseContract, ContractRunner, Interface, BytesLike, BigNumberish, AddressLike, Result, Listener, ContractMethod, Provider, Signer, ethers, Contract } from 'ethers';
3
2
 
4
3
  interface TypedDeferredTopicFilter<_TCEvent extends TypedContractEvent> extends DeferredTopicFilter {
5
4
  }
@@ -103,6 +102,14 @@ type BillingConfigStructOutput = [
103
102
  tickNodeFee: bigint;
104
103
  tickNodeFeeToken: string;
105
104
  };
105
+ type PayloadDataStruct$1 = {
106
+ contentHash: BytesLike;
107
+ uri: BytesLike;
108
+ };
109
+ type PayloadDataStructOutput = [contentHash: string, uri: string] & {
110
+ contentHash: string;
111
+ uri: string;
112
+ };
106
113
  type ProofVerificationRequestStruct$1 = {
107
114
  subscriptionId: BigNumberish;
108
115
  interval: BigNumberish;
@@ -129,9 +136,9 @@ interface CoordinatorAbiInterface extends Interface {
129
136
  encodeFunctionData(functionFragment: "redundancyCount", values: [BytesLike]): string;
130
137
  encodeFunctionData(functionFragment: "reportComputeResult", values: [
131
138
  BigNumberish,
132
- BytesLike,
133
- BytesLike,
134
- BytesLike,
139
+ PayloadDataStruct$1,
140
+ PayloadDataStruct$1,
141
+ PayloadDataStruct$1,
135
142
  BytesLike,
136
143
  AddressLike
137
144
  ]): string;
@@ -177,17 +184,26 @@ declare namespace ComputeDeliveredEvent$1 {
177
184
  type InputTuple = [
178
185
  requestId: BytesLike,
179
186
  nodeWallet: AddressLike,
180
- numRedundantDeliveries: BigNumberish
187
+ numRedundantDeliveries: BigNumberish,
188
+ input: PayloadDataStruct$1,
189
+ output: PayloadDataStruct$1,
190
+ proof: PayloadDataStruct$1
181
191
  ];
182
192
  type OutputTuple = [
183
193
  requestId: string,
184
194
  nodeWallet: string,
185
- numRedundantDeliveries: bigint
195
+ numRedundantDeliveries: bigint,
196
+ input: PayloadDataStructOutput,
197
+ output: PayloadDataStructOutput,
198
+ proof: PayloadDataStructOutput
186
199
  ];
187
200
  interface OutputObject {
188
201
  requestId: string;
189
202
  nodeWallet: string;
190
203
  numRedundantDeliveries: bigint;
204
+ input: PayloadDataStructOutput;
205
+ output: PayloadDataStructOutput;
206
+ proof: PayloadDataStructOutput;
191
207
  }
192
208
  type Event = TypedContractEvent<InputTuple, OutputTuple, OutputObject>;
193
209
  type Filter = TypedDeferredTopicFilter<Event>;
@@ -325,9 +341,9 @@ interface CoordinatorAbi extends BaseContract {
325
341
  redundancyCount: TypedContractMethod<[arg0: BytesLike], [bigint], "view">;
326
342
  reportComputeResult: TypedContractMethod<[
327
343
  deliveryInterval: BigNumberish,
328
- input: BytesLike,
329
- output: BytesLike,
330
- proof: BytesLike,
344
+ input: PayloadDataStruct$1,
345
+ output: PayloadDataStruct$1,
346
+ proof: PayloadDataStruct$1,
331
347
  commitmentData: BytesLike,
332
348
  nodeWallet: AddressLike
333
349
  ], [
@@ -399,9 +415,9 @@ interface CoordinatorAbi extends BaseContract {
399
415
  getFunction(nameOrSignature: "redundancyCount"): TypedContractMethod<[arg0: BytesLike], [bigint], "view">;
400
416
  getFunction(nameOrSignature: "reportComputeResult"): TypedContractMethod<[
401
417
  deliveryInterval: BigNumberish,
402
- input: BytesLike,
403
- output: BytesLike,
404
- proof: BytesLike,
418
+ input: PayloadDataStruct$1,
419
+ output: PayloadDataStruct$1,
420
+ proof: PayloadDataStruct$1,
405
421
  commitmentData: BytesLike,
406
422
  nodeWallet: AddressLike
407
423
  ], [
@@ -439,7 +455,7 @@ interface CoordinatorAbi extends BaseContract {
439
455
  getEvent(key: "RequestCancelled"): TypedContractEvent<RequestCancelledEvent$1.InputTuple, RequestCancelledEvent$1.OutputTuple, RequestCancelledEvent$1.OutputObject>;
440
456
  getEvent(key: "RequestStarted"): TypedContractEvent<RequestStartedEvent$1.InputTuple, RequestStartedEvent$1.OutputTuple, RequestStartedEvent$1.OutputObject>;
441
457
  filters: {
442
- "ComputeDelivered(bytes32,address,uint16)": TypedContractEvent<ComputeDeliveredEvent$1.InputTuple, ComputeDeliveredEvent$1.OutputTuple, ComputeDeliveredEvent$1.OutputObject>;
458
+ "ComputeDelivered(bytes32,address,uint16,tuple,tuple,tuple)": TypedContractEvent<ComputeDeliveredEvent$1.InputTuple, ComputeDeliveredEvent$1.OutputTuple, ComputeDeliveredEvent$1.OutputObject>;
443
459
  ComputeDelivered: TypedContractEvent<ComputeDeliveredEvent$1.InputTuple, ComputeDeliveredEvent$1.OutputTuple, ComputeDeliveredEvent$1.OutputObject>;
444
460
  "OwnershipTransferRequested(address,address)": TypedContractEvent<OwnershipTransferRequestedEvent$1.InputTuple, OwnershipTransferRequestedEvent$1.OutputTuple, OwnershipTransferRequestedEvent$1.OutputObject>;
445
461
  OwnershipTransferRequested: TypedContractEvent<OwnershipTransferRequestedEvent$1.InputTuple, OwnershipTransferRequestedEvent$1.OutputTuple, OwnershipTransferRequestedEvent$1.OutputObject>;
@@ -495,6 +511,10 @@ type ComputeSubscriptionStructOutput$1 = [
495
511
  redundancy: bigint;
496
512
  useDeliveryInbox: boolean;
497
513
  };
514
+ type PayloadDataStruct = {
515
+ contentHash: BytesLike;
516
+ uri: BytesLike;
517
+ };
498
518
  type PaymentStruct$1 = {
499
519
  recipient: AddressLike;
500
520
  feeToken: AddressLike;
@@ -573,9 +593,9 @@ interface RouterAbiInterface extends Interface {
573
593
  encodeFunctionData(functionFragment: "delegateCreatedIds", values: [BytesLike]): string;
574
594
  encodeFunctionData(functionFragment: "eip712Domain", values?: undefined): string;
575
595
  encodeFunctionData(functionFragment: "fulfill", values: [
576
- BytesLike,
577
- BytesLike,
578
- BytesLike,
596
+ PayloadDataStruct,
597
+ PayloadDataStruct,
598
+ PayloadDataStruct,
579
599
  BigNumberish,
580
600
  AddressLike,
581
601
  PaymentStruct$1[],
@@ -1028,9 +1048,9 @@ interface RouterAbi extends BaseContract {
1028
1048
  }
1029
1049
  ], "view">;
1030
1050
  fulfill: TypedContractMethod<[
1031
- input: BytesLike,
1032
- output: BytesLike,
1033
- proof: BytesLike,
1051
+ input: PayloadDataStruct,
1052
+ output: PayloadDataStruct,
1053
+ proof: PayloadDataStruct,
1034
1054
  numRedundantDeliveries: BigNumberish,
1035
1055
  nodeWallet: AddressLike,
1036
1056
  payments: PaymentStruct$1[],
@@ -1212,9 +1232,9 @@ interface RouterAbi extends BaseContract {
1212
1232
  }
1213
1233
  ], "view">;
1214
1234
  getFunction(nameOrSignature: "fulfill"): TypedContractMethod<[
1215
- input: BytesLike,
1216
- output: BytesLike,
1217
- proof: BytesLike,
1235
+ input: PayloadDataStruct,
1236
+ output: PayloadDataStruct,
1237
+ proof: PayloadDataStruct,
1218
1238
  numRedundantDeliveries: BigNumberish,
1219
1239
  nodeWallet: AddressLike,
1220
1240
  payments: PaymentStruct$1[],
@@ -2220,16 +2240,43 @@ declare class CoordinatorAbi__factory {
2220
2240
  readonly internalType: "uint32";
2221
2241
  }, {
2222
2242
  readonly name: "input";
2223
- readonly type: "bytes";
2224
- readonly internalType: "bytes";
2243
+ readonly type: "tuple";
2244
+ readonly internalType: "struct PayloadData";
2245
+ readonly components: readonly [{
2246
+ readonly name: "contentHash";
2247
+ readonly type: "bytes32";
2248
+ readonly internalType: "bytes32";
2249
+ }, {
2250
+ readonly name: "uri";
2251
+ readonly type: "bytes";
2252
+ readonly internalType: "bytes";
2253
+ }];
2225
2254
  }, {
2226
2255
  readonly name: "output";
2227
- readonly type: "bytes";
2228
- readonly internalType: "bytes";
2256
+ readonly type: "tuple";
2257
+ readonly internalType: "struct PayloadData";
2258
+ readonly components: readonly [{
2259
+ readonly name: "contentHash";
2260
+ readonly type: "bytes32";
2261
+ readonly internalType: "bytes32";
2262
+ }, {
2263
+ readonly name: "uri";
2264
+ readonly type: "bytes";
2265
+ readonly internalType: "bytes";
2266
+ }];
2229
2267
  }, {
2230
2268
  readonly name: "proof";
2231
- readonly type: "bytes";
2232
- readonly internalType: "bytes";
2269
+ readonly type: "tuple";
2270
+ readonly internalType: "struct PayloadData";
2271
+ readonly components: readonly [{
2272
+ readonly name: "contentHash";
2273
+ readonly type: "bytes32";
2274
+ readonly internalType: "bytes32";
2275
+ }, {
2276
+ readonly name: "uri";
2277
+ readonly type: "bytes";
2278
+ readonly internalType: "bytes";
2279
+ }];
2233
2280
  }, {
2234
2281
  readonly name: "commitmentData";
2235
2282
  readonly type: "bytes";
@@ -2476,6 +2523,48 @@ declare class CoordinatorAbi__factory {
2476
2523
  readonly type: "uint16";
2477
2524
  readonly indexed: false;
2478
2525
  readonly internalType: "uint16";
2526
+ }, {
2527
+ readonly name: "input";
2528
+ readonly type: "tuple";
2529
+ readonly indexed: false;
2530
+ readonly internalType: "struct PayloadData";
2531
+ readonly components: readonly [{
2532
+ readonly name: "contentHash";
2533
+ readonly type: "bytes32";
2534
+ readonly internalType: "bytes32";
2535
+ }, {
2536
+ readonly name: "uri";
2537
+ readonly type: "bytes";
2538
+ readonly internalType: "bytes";
2539
+ }];
2540
+ }, {
2541
+ readonly name: "output";
2542
+ readonly type: "tuple";
2543
+ readonly indexed: false;
2544
+ readonly internalType: "struct PayloadData";
2545
+ readonly components: readonly [{
2546
+ readonly name: "contentHash";
2547
+ readonly type: "bytes32";
2548
+ readonly internalType: "bytes32";
2549
+ }, {
2550
+ readonly name: "uri";
2551
+ readonly type: "bytes";
2552
+ readonly internalType: "bytes";
2553
+ }];
2554
+ }, {
2555
+ readonly name: "proof";
2556
+ readonly type: "tuple";
2557
+ readonly indexed: false;
2558
+ readonly internalType: "struct PayloadData";
2559
+ readonly components: readonly [{
2560
+ readonly name: "contentHash";
2561
+ readonly type: "bytes32";
2562
+ readonly internalType: "bytes32";
2563
+ }, {
2564
+ readonly name: "uri";
2565
+ readonly type: "bytes";
2566
+ readonly internalType: "bytes";
2567
+ }];
2479
2568
  }];
2480
2569
  readonly anonymous: false;
2481
2570
  }, {
@@ -2999,16 +3088,43 @@ declare class RouterAbi__factory {
2999
3088
  readonly name: "fulfill";
3000
3089
  readonly inputs: readonly [{
3001
3090
  readonly name: "input";
3002
- readonly type: "bytes";
3003
- readonly internalType: "bytes";
3091
+ readonly type: "tuple";
3092
+ readonly internalType: "struct PayloadData";
3093
+ readonly components: readonly [{
3094
+ readonly name: "contentHash";
3095
+ readonly type: "bytes32";
3096
+ readonly internalType: "bytes32";
3097
+ }, {
3098
+ readonly name: "uri";
3099
+ readonly type: "bytes";
3100
+ readonly internalType: "bytes";
3101
+ }];
3004
3102
  }, {
3005
3103
  readonly name: "output";
3006
- readonly type: "bytes";
3007
- readonly internalType: "bytes";
3104
+ readonly type: "tuple";
3105
+ readonly internalType: "struct PayloadData";
3106
+ readonly components: readonly [{
3107
+ readonly name: "contentHash";
3108
+ readonly type: "bytes32";
3109
+ readonly internalType: "bytes32";
3110
+ }, {
3111
+ readonly name: "uri";
3112
+ readonly type: "bytes";
3113
+ readonly internalType: "bytes";
3114
+ }];
3008
3115
  }, {
3009
3116
  readonly name: "proof";
3010
- readonly type: "bytes";
3011
- readonly internalType: "bytes";
3117
+ readonly type: "tuple";
3118
+ readonly internalType: "struct PayloadData";
3119
+ readonly components: readonly [{
3120
+ readonly name: "contentHash";
3121
+ readonly type: "bytes32";
3122
+ readonly internalType: "bytes32";
3123
+ }, {
3124
+ readonly name: "uri";
3125
+ readonly type: "bytes";
3126
+ readonly internalType: "bytes";
3127
+ }];
3012
3128
  }, {
3013
3129
  readonly name: "numRedundantDeliveries";
3014
3130
  readonly type: "uint16";
@@ -5010,6 +5126,22 @@ declare namespace index {
5010
5126
  * Noosphere Contract Types
5011
5127
  * Based on noosphere-evm Solidity types
5012
5128
  */
5129
+ /**
5130
+ * PayloadData struct for gas-optimized payload references
5131
+ * Supports multiple URI schemes: data:, ipfs://, ar://, https://, chain://
5132
+ */
5133
+ interface PayloadData {
5134
+ contentHash: string;
5135
+ uri: string;
5136
+ }
5137
+ /**
5138
+ * Input type for compute requests
5139
+ */
5140
+ declare enum InputType {
5141
+ RAW_DATA = 0,// Raw inline data (<1KB)
5142
+ URI_STRING = 1,// URI string
5143
+ PAYLOAD_DATA = 2
5144
+ }
5013
5145
  interface ComputeSubscription {
5014
5146
  routeId: string;
5015
5147
  containerId: string;
@@ -5078,6 +5210,9 @@ interface ComputeDeliveredEvent {
5078
5210
  requestId: string;
5079
5211
  nodeWallet: string;
5080
5212
  numRedundantDeliveries: number;
5213
+ input: PayloadData;
5214
+ output: PayloadData;
5215
+ proof: PayloadData;
5081
5216
  }
5082
5217
  interface ProofVerifiedEvent {
5083
5218
  subscriptionId: bigint;
@@ -5118,8 +5253,21 @@ declare class RouterContract {
5118
5253
  getComputeSubscription(subscriptionId: bigint): Promise<ComputeSubscription>;
5119
5254
  /**
5120
5255
  * Accept fulfillment results and attempt on-chain settlement
5256
+ * @param input - PayloadData containing contentHash and uri for input
5257
+ * @param output - PayloadData containing contentHash and uri for output
5258
+ * @param proof - PayloadData containing contentHash and uri for proof
5259
+ * @param numRedundantDeliveries - Number of redundant deliveries
5260
+ * @param nodeWallet - Address of the node's payment wallet
5261
+ * @param payments - Array of payment instructions
5262
+ * @param commitment - The commitment data
5121
5263
  */
5122
- fulfill(input: Uint8Array, output: Uint8Array, proof: Uint8Array, numRedundantDeliveries: number, nodeWallet: string, payments: Payment[], commitment: Commitment): Promise<FulfillResult>;
5264
+ fulfill(input: PayloadData, output: PayloadData, proof: PayloadData, numRedundantDeliveries: number, nodeWallet: string, payments: Payment[], commitment: Commitment): Promise<FulfillResult>;
5265
+ /**
5266
+ * Encode PayloadData for contract call
5267
+ * @param payload - PayloadData to encode
5268
+ * @returns Tuple format expected by contract
5269
+ */
5270
+ private encodePayloadData;
5123
5271
  /**
5124
5272
  * Execute coordinator-driven payouts
5125
5273
  */
@@ -5218,8 +5366,26 @@ declare class CoordinatorContract {
5218
5366
  cancelRequest(requestId: string): Promise<ContractTransactionResponse>;
5219
5367
  /**
5220
5368
  * Report compute result for an interval
5369
+ * @param deliveryInterval - The interval number for this delivery
5370
+ * @param input - PayloadData containing contentHash and uri for input
5371
+ * @param output - PayloadData containing contentHash and uri for output
5372
+ * @param proof - PayloadData containing contentHash and uri for proof
5373
+ * @param commitmentData - ABI-encoded commitment data
5374
+ * @param nodeWallet - Address of the node's payment wallet
5375
+ */
5376
+ reportComputeResult(deliveryInterval: number, input: PayloadData, output: PayloadData, proof: PayloadData, commitmentData: Uint8Array, nodeWallet: string): Promise<ContractTransactionResponse>;
5377
+ /**
5378
+ * Encode PayloadData for contract call
5379
+ * @param payload - PayloadData to encode
5380
+ * @returns Tuple format expected by contract
5381
+ */
5382
+ private encodePayloadData;
5383
+ /**
5384
+ * Parse PayloadData from contract response
5385
+ * @param data - Raw tuple from contract
5386
+ * @returns Parsed PayloadData
5221
5387
  */
5222
- reportComputeResult(deliveryInterval: number, input: Uint8Array, output: Uint8Array, proof: Uint8Array, commitmentData: Uint8Array, nodeWallet: string): Promise<ContractTransactionResponse>;
5388
+ private parsePayloadData;
5223
5389
  /**
5224
5390
  * Report verification result
5225
5391
  */
@@ -5447,6 +5613,11 @@ declare const ABIs: {
5447
5613
  type: string;
5448
5614
  name: string;
5449
5615
  inputs: ({
5616
+ name: string;
5617
+ type: string;
5618
+ internalType: string;
5619
+ components?: undefined;
5620
+ } | {
5450
5621
  name: string;
5451
5622
  type: string;
5452
5623
  internalType: string;
@@ -5455,11 +5626,6 @@ declare const ABIs: {
5455
5626
  type: string;
5456
5627
  internalType: string;
5457
5628
  }[];
5458
- } | {
5459
- name: string;
5460
- type: string;
5461
- internalType: string;
5462
- components?: undefined;
5463
5629
  })[];
5464
5630
  outputs: never[];
5465
5631
  stateMutability: string;
@@ -5655,4 +5821,4 @@ declare const ABIs: {
5655
5821
  })[];
5656
5822
  };
5657
5823
 
5658
- export { ABIs, type Commitment, type ComputeDeliveredEvent, type ComputeSubscription, type CoordinatorAbi, CoordinatorAbi__factory, CoordinatorContract, FulfillResult, type IntervalStatus, type Payment, type ProofVerificationRequest, type ProofVerifiedEvent, type RequestCancelledEvent, type RequestStartedEvent, type RouterAbi, RouterAbi__factory, RouterContract, type SubscriptionBatchReaderAbi, SubscriptionBatchReaderAbi__factory, SubscriptionBatchReaderContract, type SubscriptionCreatedEvent, type WalletAbi, WalletAbi__factory, type WalletFactoryAbi, WalletFactoryAbi__factory, index as factories };
5824
+ export { ABIs, type Commitment, type ComputeDeliveredEvent, type ComputeSubscription, type CoordinatorAbi, CoordinatorAbi__factory, CoordinatorContract, FulfillResult, InputType, type IntervalStatus, type PayloadData, type Payment, type ProofVerificationRequest, type ProofVerifiedEvent, type RequestCancelledEvent, type RequestStartedEvent, type RouterAbi, RouterAbi__factory, RouterContract, type SubscriptionBatchReaderAbi, SubscriptionBatchReaderAbi__factory, SubscriptionBatchReaderContract, type SubscriptionCreatedEvent, type WalletAbi, WalletAbi__factory, type WalletFactoryAbi, WalletFactoryAbi__factory, index as factories };