@midnight-ntwrk/midnight-js-types 4.1.1 → 5.0.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.
@@ -1,4 +1,5 @@
1
1
  import { type ContractExecutable } from '@midnight-ntwrk/midnight-js-protocol/compact-js/effect';
2
+ import type { SigningKey } from '@midnight-ntwrk/midnight-js-protocol/compact-runtime';
2
3
  import { ContractAddress } from '@midnight-ntwrk/midnight-js-protocol/platform-js';
3
4
  import { type ConfigError, Exit, Option } from 'effect';
4
5
  import { type ManagedRuntime } from 'effect/ManagedRuntime';
@@ -10,7 +11,7 @@ export type ContractExecutableRuntimeOptions = {
10
11
  /** The current user's ZSwap public key. */
11
12
  readonly coinPublicKey: string;
12
13
  /** The signing key to add as the to-be-deployed contract's maintenance authority. */
13
- readonly signingKey?: string;
14
+ readonly signingKey?: SigningKey;
14
15
  };
15
16
  /**
16
17
  * Constructs an Effect managed runtime configured to execute contract executables.
@@ -1 +1 @@
1
- {"version":3,"file":"contract.d.ts","sourceRoot":"","sources":["../src/contract.ts"],"names":[],"mappings":"AAeA,OAAO,EAAmC,KAAK,kBAAkB,EACpB,MAAM,wDAAwD,CAAC;AAC5G,OAAO,EAAE,eAAe,EAAE,MAAM,kDAAkD,CAAC;AAEnF,OAAO,EAAS,KAAK,WAAW,EAA0B,IAAI,EAAQ,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC7F,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAAE,KAAK,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAkD7D;;GAEG;AACH,MAAM,MAAM,gCAAgC,GAAG;IAC7C,2CAA2C;IAC3C,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAE/B,qFAAqF;IACrF,QAAQ,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC;CAC9B,CAAA;AAED;;;;;;GAMG;AACH,eAAO,MAAM,6BAA6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,gBAAgB,CAAC,MAAM,CAAC,EAAE,OAAO,EAAE,gCAAgC,KAAK,cAAc,CAAC,kBAAkB,CAAC,kBAAkB,CAAC,OAAO,EAAE,WAAW,CAAC,WAAW,CAU/K,CAAC;AAEJ;;;;;;GAMG;AACH,eAAO,MAAM,iBAAiB,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,CAO7D,CAAC;AAEL;;;;;GAKG;AACH,eAAO,MAAM,cAAc,GAAI,CAAC,EAAE,KAAK,OAAO,KAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAE/D,CAAA;AAED;;;;;GAKG;AACH,eAAO,MAAM,iBAAiB,GAAI,SAAS,MAAM,KAAG,eAAe,CAAC,eAC1B,CAAC"}
package/dist/index.cjs CHANGED
@@ -73,7 +73,10 @@ const makeAdaptedRuntimeLayer = (zkConfigProvider, configMap) => effect$1.Layer.
73
73
  const makeContractExecutableRuntime = (zkConfigProvider, options) => {
74
74
  let config = [['KEYS_COIN_PUBLIC', options.coinPublicKey]];
75
75
  if (options.signingKey) {
76
- config = config.concat([['KEYS_SIGNING', options.signingKey]]);
76
+ config = config.concat([
77
+ ['KEYS_SIGNING', options.signingKey.value],
78
+ ['KEYS_SIGNING_KIND', options.signingKey.tag]
79
+ ]);
77
80
  }
78
81
  return effect.ContractExecutableRuntime.make(makeAdaptedRuntimeLayer(zkConfigProvider, new Map(config)));
79
82
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sources":["../src/contract.ts","../src/errors.ts","../src/logger-provider.ts","../src/midnight-types.ts","../src/private-state-provider.ts","../src/proof-provider.ts","../src/zk-config-provider.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":["Effect","Option","Contract","ZKConfigurationReadError","Layer","ZKConfiguration","Configuration","ConfigProvider","ContractExecutableRuntime","Exit","Cause","ContractAddress","LogLevel","CostModel"],"mappings":";;;;;;;;;;;;;;;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SAAS,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;AAC7C,YAAA,WAAW,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;AACjD,YAAA,IAAI,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS;SACnC;IACH;IAEA,qBAAqB,GAAA;AACnB,QAAA,OAAO,IAA2B;IACpC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs","sources":["../src/contract.ts","../src/errors.ts","../src/logger-provider.ts","../src/midnight-types.ts","../src/private-state-provider.ts","../src/proof-provider.ts","../src/zk-config-provider.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":["Effect","Option","Contract","ZKConfigurationReadError","Layer","ZKConfiguration","Configuration","ConfigProvider","ContractExecutableRuntime","Exit","Cause","ContractAddress","LogLevel","CostModel"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;AAaG;AAYH;;;;;;;;AAQG;AACH,MAAM,iBAAiB,GAAG,CAAsC,gBAA0C,KACxG,CAAC,gBAA0D,KACzDA,eAAM,CAAC,GAAG,CAAC,aAAS;;;IAGlB,MAAM,cAAc,GAAG,CAAC,iBAAgD,KACtEA,eAAM,CAAC,UAAU,CAAC;AAChB,QAAA,GAAG,EAAE,MAAM,gBAAgB,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,KAAKC,eAAM,CAAC,IAAI,CAACC,eAAQ,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;AACnI,QAAA,KAAK,EAAE,CAAC,GAAY,KAAKC,+BAAwB,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG;AACpH,KAAA,CAAC;IACJ,OAAO;QACL,cAAc;QACd,eAAe,EAAE,CAAC,kBAAkB,KAClCH,eAAM,CAAC,OAAO,CACZ,kBAAk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;;;;AAaG;AAwCH;;;;;;;AAOG;AACI,MAAM,mBAAmB,GAAG,CACjC,eAAgC,EAChC,SAAA,GAAuBC,gBAAS,CAAC,gBAAgB,EAAE,MAChC;IACnB,MAAM,OAAO,CAAC,UAA+B,EAAA;QAC3C,OAAO,UAAU,CAAC,KAAK,CAAC,eAAe,EAAE,SAAS,CAAC;IACrD;AACD,CAAA;;ACpED;;;;;;;;;;;;;AAaG;AAaH;;;;;;AAMG;MACmB,gBAAgB,CAAA;AAmBpC;;;AAGG;IACH,MAAM,eAAe,CAAC,UAAe,EAAA;AACnC,QAAA,OAAO,OAAO,CAAC,GAAG,CAChB,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,KAAI;YAC1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;AACzC,YAAA,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC;QAClB,CAAC,CAAC,CACH;IACH;AAEA;;;AAGG;IACH,MAAM,GAAG,CAAC,SAAY,EAAA;QACpB,OAAO;YACL,SAAS;AACT,YAAA,SAAS,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;AAC7C,YAAA,WAAW,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;AACjD,YAAA,IAAI,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS;SACnC;IACH;IAEA,qBAAqB,GAAA;AACnB,QAAA,OAAO,IAA2B;IACpC;AACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ContractExecutable } from '@midnight-ntwrk/midnight-js-protocol/compact-js/effect';
2
+ import { SigningKey, ContractAddress as ContractAddress$2, ContractState } from '@midnight-ntwrk/midnight-js-protocol/compact-runtime';
2
3
  import { ContractAddress as ContractAddress$1 } from '@midnight-ntwrk/midnight-js-protocol/platform-js';
3
4
  import { Option, Exit, ConfigError } from 'effect';
4
5
  import { ManagedRuntime } from 'effect/ManagedRuntime';
@@ -6,7 +7,6 @@ import { Contract } from '@midnight-ntwrk/midnight-js-protocol/compact-js';
6
7
  import { Transaction, SignatureEnabled, Proof, Binding, TransactionId, TransactionHash, ContractAddress, IntentHash, RawTokenType, FinalizedTransaction, UnprovenTransaction, PreBinding, ProvingProvider, CostModel, ZswapChainState, LedgerParameters, CoinPublicKey, EncPublicKey } from '@midnight-ntwrk/midnight-js-protocol/ledger';
7
8
  export { Transaction } from '@midnight-ntwrk/midnight-js-protocol/ledger';
8
9
  import { LogFn } from 'pino';
9
- import { ContractAddress as ContractAddress$2, SigningKey, ContractState } from '@midnight-ntwrk/midnight-js-protocol/compact-runtime';
10
10
  import { Observable } from 'rxjs';
11
11
 
12
12
  type AnyProvableCircuitId = Contract.ProvableCircuitId<Contract.Any>;
@@ -313,7 +313,7 @@ type ContractExecutableRuntimeOptions = {
313
313
  /** The current user's ZSwap public key. */
314
314
  readonly coinPublicKey: string;
315
315
  /** The signing key to add as the to-be-deployed contract's maintenance authority. */
316
- readonly signingKey?: string;
316
+ readonly signingKey?: SigningKey;
317
317
  };
318
318
  /**
319
319
  * Constructs an Effect managed runtime configured to execute contract executables.
@@ -909,6 +909,179 @@ type ContractStateObservableConfig = ((TxIdConfig | BlockHashConfig | BlockHeigh
909
909
  */
910
910
  readonly inclusive?: boolean;
911
911
  }) | Latest | All;
912
+ /**
913
+ * The eleven contract event variants surfaced by the indexer (MIP-0002 public
914
+ * contract log emission). The variant *set* is identical to compact-js's
915
+ * `LogEventType`; only the string casing differs (PascalCase here, kebab-case
916
+ * in compact-js, SCREAMING_SNAKE on the indexer wire). Adding a variant is a
917
+ * breaking change — the mapping, filter translation, and exhaustiveness guards
918
+ * all key off this union.
919
+ */
920
+ type ContractEventType = 'ShieldedSpend' | 'ShieldedReceive' | 'ShieldedMint' | 'ShieldedBurn' | 'UnshieldedSpend' | 'UnshieldedReceive' | 'UnshieldedMint' | 'UnshieldedBurn' | 'Paused' | 'Unpaused' | 'Misc';
921
+ /**
922
+ * A `sender` / `recipient` on an unshielded event. The indexer returns a tagged
923
+ * union (`Either<ZswapCoinPublicKey, ContractAddress>`); this preserves the
924
+ * discriminator so consumers can tell a user address from a contract address
925
+ * rather than receiving a bare, ambiguous string.
926
+ */
927
+ interface ContractEventAddress {
928
+ /** Which kind of address `value` holds. */
929
+ readonly kind: 'user' | 'contract';
930
+ /** The hex-encoded address. */
931
+ readonly value: string;
932
+ }
933
+ /**
934
+ * Fields common to every {@link ContractEvent} variant, regardless of type.
935
+ */
936
+ interface ContractEventBase {
937
+ /**
938
+ * Monotonic indexer cursor for this event. Inclusive resumption point — to
939
+ * resume *after* this event, pass `{ fromId: id + 1 }`.
940
+ */
941
+ readonly id: number;
942
+ /**
943
+ * Highest event id the indexer currently knows (the chain tip for events).
944
+ * Compare against {@link id} to detect catch-up / whether more events exist.
945
+ */
946
+ readonly maxId: number;
947
+ /**
948
+ * Payload schema version — selects the (future) per-event payload decoder.
949
+ * Iteration-1 events are `version: 1`.
950
+ */
951
+ readonly version: number;
952
+ /** Address of the contract that emitted the event. */
953
+ readonly contractAddress: ContractAddress;
954
+ /**
955
+ * Indexer-internal `BIGSERIAL` row id of the emitting transaction — **not**
956
+ * the chain transaction hash. To fetch the chain transaction, issue a
957
+ * separate query. Note the asymmetry with {@link ContractEventFilterBase.transactionHash},
958
+ * which narrows by chain hash.
959
+ */
960
+ readonly transactionId: number;
961
+ /**
962
+ * Opaque hex `VersionedLogItem` bytes, carried verbatim. Never decoded or
963
+ * validated by this provider — the forward bridge to a future compact-js
964
+ * payload decoder.
965
+ */
966
+ readonly raw: string;
967
+ }
968
+ /**
969
+ * A decoded contract event. Discriminated union keyed on `eventType`; narrow on
970
+ * it to access the variant-specific payload fields.
971
+ *
972
+ * `amount` is always a `string` (encodes up to a 16-byte integer) — never round
973
+ * it through `Number()`. Absent nullable fields are normalized to `undefined`
974
+ * (never `null`).
975
+ */
976
+ type ContractEvent = (ContractEventBase & {
977
+ readonly eventType: 'ShieldedSpend';
978
+ readonly nullifier: string;
979
+ }) | (ContractEventBase & {
980
+ readonly eventType: 'ShieldedReceive';
981
+ readonly commitment: string;
982
+ readonly ciphertext?: string;
983
+ readonly receivingContractAddress?: string;
984
+ }) | (ContractEventBase & {
985
+ readonly eventType: 'ShieldedMint';
986
+ readonly commitment: string;
987
+ readonly domainSep: string;
988
+ readonly amount?: string;
989
+ }) | (ContractEventBase & {
990
+ readonly eventType: 'ShieldedBurn';
991
+ readonly nullifier: string;
992
+ readonly amount?: string;
993
+ }) | (ContractEventBase & {
994
+ readonly eventType: 'UnshieldedSpend';
995
+ readonly sender: ContractEventAddress;
996
+ readonly domainSep: string;
997
+ readonly tokenType: string;
998
+ readonly amount: string;
999
+ }) | (ContractEventBase & {
1000
+ readonly eventType: 'UnshieldedReceive';
1001
+ readonly recipient: ContractEventAddress;
1002
+ readonly domainSep: string;
1003
+ readonly tokenType: string;
1004
+ readonly amount: string;
1005
+ }) | (ContractEventBase & {
1006
+ readonly eventType: 'UnshieldedMint';
1007
+ readonly domainSep: string;
1008
+ readonly tokenType: string;
1009
+ readonly amount: string;
1010
+ }) | (ContractEventBase & {
1011
+ readonly eventType: 'UnshieldedBurn';
1012
+ readonly sender: ContractEventAddress;
1013
+ readonly tokenType: string;
1014
+ readonly amount: string;
1015
+ }) | (ContractEventBase & {
1016
+ readonly eventType: 'Paused';
1017
+ }) | (ContractEventBase & {
1018
+ readonly eventType: 'Unpaused';
1019
+ }) | (ContractEventBase & {
1020
+ readonly eventType: 'Misc';
1021
+ readonly name: string;
1022
+ readonly payload: string;
1023
+ });
1024
+ /**
1025
+ * A single prefix filter on an indexed field of a standard event. `prefix` is
1026
+ * hex-encoded; the empty string matches all values.
1027
+ */
1028
+ interface ContractEventFieldPrefix {
1029
+ readonly fieldName: string;
1030
+ readonly prefix: string;
1031
+ }
1032
+ /**
1033
+ * Filter fields shared by the query and the subscription.
1034
+ */
1035
+ interface ContractEventFilterBase {
1036
+ /** Required: the contract whose events to return. */
1037
+ readonly contractAddress: ContractAddress;
1038
+ /**
1039
+ * Optional subset of event types. Omit to mean "all types". An empty array
1040
+ * is rejected (it would silently match nothing).
1041
+ */
1042
+ readonly types?: ContractEventType[];
1043
+ /**
1044
+ * Optional prefix filters on indexed fields. Accepted only when every
1045
+ * filtered type is a standard (non-`Misc`) variant — see method docs.
1046
+ */
1047
+ readonly fieldPrefixes?: ContractEventFieldPrefix[];
1048
+ /** Optional: narrow to events emitted from the transaction with this chain hash. */
1049
+ readonly transactionHash?: string;
1050
+ }
1051
+ /**
1052
+ * Filter for {@link PublicDataProvider.queryContractEvents}. `fromBlock` /
1053
+ * `toBlock` are inclusive block-height bounds for a finite, point-in-time read.
1054
+ */
1055
+ interface ContractEventQueryFilter extends ContractEventFilterBase {
1056
+ readonly fromBlock?: number;
1057
+ readonly toBlock?: number;
1058
+ }
1059
+ /**
1060
+ * Filter for {@link PublicDataProvider.contractEventsObservable}. The stream
1061
+ * start is supplied separately via {@link ContractEventCursor}; `toBlock`
1062
+ * terminates the stream once the chain reaches that height.
1063
+ */
1064
+ interface ContractEventSubscriptionFilter extends ContractEventFilterBase {
1065
+ readonly toBlock?: number;
1066
+ }
1067
+ /**
1068
+ * Where a subscription begins. Exactly one addressing mode per call — two
1069
+ * competing start points are unrepresentable by construction.
1070
+ */
1071
+ type ContractEventCursor = {
1072
+ readonly fromId: number;
1073
+ } | {
1074
+ readonly fromBlock: number;
1075
+ };
1076
+ /**
1077
+ * Pagination window for {@link PublicDataProvider.queryContractEvents}.
1078
+ * `offset` is only stable within a window with a fixed upper bound — pin
1079
+ * `toBlock` for multi-page reads.
1080
+ */
1081
+ interface ContractEventsPage {
1082
+ readonly limit?: number;
1083
+ readonly offset?: number;
1084
+ }
912
1085
  /**
913
1086
  * Interface for a public data service. This service retrieves public data from the blockchain.
914
1087
  * TODO: Add timeouts or retry limits to 'watchFor' queries.
@@ -1010,6 +1183,56 @@ interface PublicDataProvider {
1010
1183
  * @return {Observable<UnshieldedBalances>} An observable that emits the unshielded balances for the provided address.
1011
1184
  */
1012
1185
  unshieldedBalancesObservable(address: ContractAddress, config: ContractStateObservableConfig): Observable<UnshieldedBalances>;
1186
+ /**
1187
+ * Queries contract events for a contract address — a finite, paginated,
1188
+ * point-in-time read.
1189
+ *
1190
+ * Results are returned in ascending `id` order. The result is a plain array
1191
+ * with no total count: detect the end via `result.length < limit`, and read
1192
+ * `maxId` on the last item to see how far the tip is.
1193
+ *
1194
+ * When `page.limit` is omitted an implementation-defined default page size is
1195
+ * applied (never an undocumented server default). `offset` is only stable
1196
+ * within a window with a fixed upper bound — pin `filter.toBlock` for
1197
+ * multi-page reads, or prefer the `getAllContractEvents` helper / the
1198
+ * subscription for tailing.
1199
+ *
1200
+ * Fails fast (synchronously, before any network call) on an invalid
1201
+ * `contractAddress`, an empty `types` array, `fieldPrefixes` combined with
1202
+ * `Misc` (or with `types` omitted), or an unknown `fieldName`. Network /
1203
+ * GraphQL errors reject the promise — an empty array always means "no
1204
+ * matching events", never a swallowed error.
1205
+ *
1206
+ * @param filter The events to return; `contractAddress` is required.
1207
+ * @param page Optional pagination window.
1208
+ */
1209
+ queryContractEvents(filter: ContractEventQueryFilter, page?: ContractEventsPage): Promise<ContractEvent[]>;
1210
+ /**
1211
+ * Streams contract events for a contract address — replay from a cursor, then
1212
+ * live, in one continuous stream.
1213
+ *
1214
+ * The start is supplied via `opts.startAt`: `{ fromId }` resumes inclusively
1215
+ * from a known event id, `{ fromBlock }` starts from a block height. Omitting
1216
+ * `startAt` streams from the start of history. The indexer replays historical
1217
+ * events from that point in monotonic `id` order, then continues live — there
1218
+ * is no separate backfill query and no client-side dedup.
1219
+ *
1220
+ * `{ fromId }` is **inclusive**; to resume *after* the last seen event pass
1221
+ * `{ fromId: lastSeenId + 1 }`.
1222
+ *
1223
+ * `filter.toBlock` completes the stream once the chain reaches that height;
1224
+ * without it the stream runs until unsubscribed or the provider is disposed.
1225
+ * Delivery is **at-least-once** across transport reconnects (the provider
1226
+ * does not advance the cursor) — persisting consumers should dedup by `id`.
1227
+ * Transport failures surface as an observable `error`, never a silent
1228
+ * completion.
1229
+ *
1230
+ * @param filter The events to stream; `contractAddress` is required.
1231
+ * @param opts Optional stream start.
1232
+ */
1233
+ contractEventsObservable(filter: ContractEventSubscriptionFilter, opts?: {
1234
+ startAt?: ContractEventCursor;
1235
+ }): Observable<ContractEvent>;
1013
1236
  }
1014
1237
 
1015
1238
  /**
@@ -1066,4 +1289,4 @@ interface MidnightProviders<PCK extends AnyProvableCircuitId = AnyProvableCircui
1066
1289
  }
1067
1290
 
1068
1291
  export { ExportDecryptionError, FailEntirely, FailFallible, ImportConflictError, InvalidExportFormatError, InvalidProtocolSchemeError, LogLevel, MAX_EXPORT_SIGNING_KEYS, MAX_EXPORT_STATES, PrivateStateExportError, PrivateStateImportError, SegmentFail, SegmentSuccess, SigningKeyExportError, SucceedEntirely, ZKConfigProvider, asContractAddress, asEffectOption, createProofProvider, createProverKey, createVerifierKey, createZKIR, exitResultOrError, makeContractExecutableRuntime, zkConfigToProvingKeyMaterial };
1069
- export type { All, AnyPrivateState, AnyProvableCircuitId, BlockHash, BlockHashConfig, BlockHeightConfig, ContractExecutableRuntimeOptions, ContractStateObservableConfig, ExportPrivateStatesOptions, ExportSigningKeysOptions, Fees, FinalizedTxData, ImportPrivateStatesOptions, ImportPrivateStatesResult, ImportSigningKeysOptions, ImportSigningKeysResult, KeyMaterialProvider, Latest, LoggerProvider, MidnightProvider, MidnightProviders, PrivateStateExport, PrivateStateId, PrivateStateImportErrorCause, PrivateStateProvider, ProofProvider, ProveTxConfig, ProverKey, PublicDataProvider, SegmentStatus, SigningKeyExport, TxIdConfig, TxStatus, UnboundTransaction, UnshieldedBalance, UnshieldedBalances, UnshieldedUtxo, UnshieldedUtxos, VerifierKey, WalletProvider, ZKConfig, ZKIR };
1292
+ export type { All, AnyPrivateState, AnyProvableCircuitId, BlockHash, BlockHashConfig, BlockHeightConfig, ContractEvent, ContractEventAddress, ContractEventBase, ContractEventCursor, ContractEventFieldPrefix, ContractEventFilterBase, ContractEventQueryFilter, ContractEventSubscriptionFilter, ContractEventType, ContractEventsPage, ContractExecutableRuntimeOptions, ContractStateObservableConfig, ExportPrivateStatesOptions, ExportSigningKeysOptions, Fees, FinalizedTxData, ImportPrivateStatesOptions, ImportPrivateStatesResult, ImportSigningKeysOptions, ImportSigningKeysResult, KeyMaterialProvider, Latest, LoggerProvider, MidnightProvider, MidnightProviders, PrivateStateExport, PrivateStateId, PrivateStateImportErrorCause, PrivateStateProvider, ProofProvider, ProveTxConfig, ProverKey, PublicDataProvider, SegmentStatus, SigningKeyExport, TxIdConfig, TxStatus, UnboundTransaction, UnshieldedBalance, UnshieldedBalances, UnshieldedUtxo, UnshieldedUtxos, VerifierKey, WalletProvider, ZKConfig, ZKIR };
package/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ContractExecutable } from '@midnight-ntwrk/midnight-js-protocol/compact-js/effect';
2
+ import { SigningKey, ContractAddress as ContractAddress$2, ContractState } from '@midnight-ntwrk/midnight-js-protocol/compact-runtime';
2
3
  import { ContractAddress as ContractAddress$1 } from '@midnight-ntwrk/midnight-js-protocol/platform-js';
3
4
  import { Option, Exit, ConfigError } from 'effect';
4
5
  import { ManagedRuntime } from 'effect/ManagedRuntime';
@@ -6,7 +7,6 @@ import { Contract } from '@midnight-ntwrk/midnight-js-protocol/compact-js';
6
7
  import { Transaction, SignatureEnabled, Proof, Binding, TransactionId, TransactionHash, ContractAddress, IntentHash, RawTokenType, FinalizedTransaction, UnprovenTransaction, PreBinding, ProvingProvider, CostModel, ZswapChainState, LedgerParameters, CoinPublicKey, EncPublicKey } from '@midnight-ntwrk/midnight-js-protocol/ledger';
7
8
  export { Transaction } from '@midnight-ntwrk/midnight-js-protocol/ledger';
8
9
  import { LogFn } from 'pino';
9
- import { ContractAddress as ContractAddress$2, SigningKey, ContractState } from '@midnight-ntwrk/midnight-js-protocol/compact-runtime';
10
10
  import { Observable } from 'rxjs';
11
11
 
12
12
  type AnyProvableCircuitId = Contract.ProvableCircuitId<Contract.Any>;
@@ -313,7 +313,7 @@ type ContractExecutableRuntimeOptions = {
313
313
  /** The current user's ZSwap public key. */
314
314
  readonly coinPublicKey: string;
315
315
  /** The signing key to add as the to-be-deployed contract's maintenance authority. */
316
- readonly signingKey?: string;
316
+ readonly signingKey?: SigningKey;
317
317
  };
318
318
  /**
319
319
  * Constructs an Effect managed runtime configured to execute contract executables.
@@ -909,6 +909,179 @@ type ContractStateObservableConfig = ((TxIdConfig | BlockHashConfig | BlockHeigh
909
909
  */
910
910
  readonly inclusive?: boolean;
911
911
  }) | Latest | All;
912
+ /**
913
+ * The eleven contract event variants surfaced by the indexer (MIP-0002 public
914
+ * contract log emission). The variant *set* is identical to compact-js's
915
+ * `LogEventType`; only the string casing differs (PascalCase here, kebab-case
916
+ * in compact-js, SCREAMING_SNAKE on the indexer wire). Adding a variant is a
917
+ * breaking change — the mapping, filter translation, and exhaustiveness guards
918
+ * all key off this union.
919
+ */
920
+ type ContractEventType = 'ShieldedSpend' | 'ShieldedReceive' | 'ShieldedMint' | 'ShieldedBurn' | 'UnshieldedSpend' | 'UnshieldedReceive' | 'UnshieldedMint' | 'UnshieldedBurn' | 'Paused' | 'Unpaused' | 'Misc';
921
+ /**
922
+ * A `sender` / `recipient` on an unshielded event. The indexer returns a tagged
923
+ * union (`Either<ZswapCoinPublicKey, ContractAddress>`); this preserves the
924
+ * discriminator so consumers can tell a user address from a contract address
925
+ * rather than receiving a bare, ambiguous string.
926
+ */
927
+ interface ContractEventAddress {
928
+ /** Which kind of address `value` holds. */
929
+ readonly kind: 'user' | 'contract';
930
+ /** The hex-encoded address. */
931
+ readonly value: string;
932
+ }
933
+ /**
934
+ * Fields common to every {@link ContractEvent} variant, regardless of type.
935
+ */
936
+ interface ContractEventBase {
937
+ /**
938
+ * Monotonic indexer cursor for this event. Inclusive resumption point — to
939
+ * resume *after* this event, pass `{ fromId: id + 1 }`.
940
+ */
941
+ readonly id: number;
942
+ /**
943
+ * Highest event id the indexer currently knows (the chain tip for events).
944
+ * Compare against {@link id} to detect catch-up / whether more events exist.
945
+ */
946
+ readonly maxId: number;
947
+ /**
948
+ * Payload schema version — selects the (future) per-event payload decoder.
949
+ * Iteration-1 events are `version: 1`.
950
+ */
951
+ readonly version: number;
952
+ /** Address of the contract that emitted the event. */
953
+ readonly contractAddress: ContractAddress;
954
+ /**
955
+ * Indexer-internal `BIGSERIAL` row id of the emitting transaction — **not**
956
+ * the chain transaction hash. To fetch the chain transaction, issue a
957
+ * separate query. Note the asymmetry with {@link ContractEventFilterBase.transactionHash},
958
+ * which narrows by chain hash.
959
+ */
960
+ readonly transactionId: number;
961
+ /**
962
+ * Opaque hex `VersionedLogItem` bytes, carried verbatim. Never decoded or
963
+ * validated by this provider — the forward bridge to a future compact-js
964
+ * payload decoder.
965
+ */
966
+ readonly raw: string;
967
+ }
968
+ /**
969
+ * A decoded contract event. Discriminated union keyed on `eventType`; narrow on
970
+ * it to access the variant-specific payload fields.
971
+ *
972
+ * `amount` is always a `string` (encodes up to a 16-byte integer) — never round
973
+ * it through `Number()`. Absent nullable fields are normalized to `undefined`
974
+ * (never `null`).
975
+ */
976
+ type ContractEvent = (ContractEventBase & {
977
+ readonly eventType: 'ShieldedSpend';
978
+ readonly nullifier: string;
979
+ }) | (ContractEventBase & {
980
+ readonly eventType: 'ShieldedReceive';
981
+ readonly commitment: string;
982
+ readonly ciphertext?: string;
983
+ readonly receivingContractAddress?: string;
984
+ }) | (ContractEventBase & {
985
+ readonly eventType: 'ShieldedMint';
986
+ readonly commitment: string;
987
+ readonly domainSep: string;
988
+ readonly amount?: string;
989
+ }) | (ContractEventBase & {
990
+ readonly eventType: 'ShieldedBurn';
991
+ readonly nullifier: string;
992
+ readonly amount?: string;
993
+ }) | (ContractEventBase & {
994
+ readonly eventType: 'UnshieldedSpend';
995
+ readonly sender: ContractEventAddress;
996
+ readonly domainSep: string;
997
+ readonly tokenType: string;
998
+ readonly amount: string;
999
+ }) | (ContractEventBase & {
1000
+ readonly eventType: 'UnshieldedReceive';
1001
+ readonly recipient: ContractEventAddress;
1002
+ readonly domainSep: string;
1003
+ readonly tokenType: string;
1004
+ readonly amount: string;
1005
+ }) | (ContractEventBase & {
1006
+ readonly eventType: 'UnshieldedMint';
1007
+ readonly domainSep: string;
1008
+ readonly tokenType: string;
1009
+ readonly amount: string;
1010
+ }) | (ContractEventBase & {
1011
+ readonly eventType: 'UnshieldedBurn';
1012
+ readonly sender: ContractEventAddress;
1013
+ readonly tokenType: string;
1014
+ readonly amount: string;
1015
+ }) | (ContractEventBase & {
1016
+ readonly eventType: 'Paused';
1017
+ }) | (ContractEventBase & {
1018
+ readonly eventType: 'Unpaused';
1019
+ }) | (ContractEventBase & {
1020
+ readonly eventType: 'Misc';
1021
+ readonly name: string;
1022
+ readonly payload: string;
1023
+ });
1024
+ /**
1025
+ * A single prefix filter on an indexed field of a standard event. `prefix` is
1026
+ * hex-encoded; the empty string matches all values.
1027
+ */
1028
+ interface ContractEventFieldPrefix {
1029
+ readonly fieldName: string;
1030
+ readonly prefix: string;
1031
+ }
1032
+ /**
1033
+ * Filter fields shared by the query and the subscription.
1034
+ */
1035
+ interface ContractEventFilterBase {
1036
+ /** Required: the contract whose events to return. */
1037
+ readonly contractAddress: ContractAddress;
1038
+ /**
1039
+ * Optional subset of event types. Omit to mean "all types". An empty array
1040
+ * is rejected (it would silently match nothing).
1041
+ */
1042
+ readonly types?: ContractEventType[];
1043
+ /**
1044
+ * Optional prefix filters on indexed fields. Accepted only when every
1045
+ * filtered type is a standard (non-`Misc`) variant — see method docs.
1046
+ */
1047
+ readonly fieldPrefixes?: ContractEventFieldPrefix[];
1048
+ /** Optional: narrow to events emitted from the transaction with this chain hash. */
1049
+ readonly transactionHash?: string;
1050
+ }
1051
+ /**
1052
+ * Filter for {@link PublicDataProvider.queryContractEvents}. `fromBlock` /
1053
+ * `toBlock` are inclusive block-height bounds for a finite, point-in-time read.
1054
+ */
1055
+ interface ContractEventQueryFilter extends ContractEventFilterBase {
1056
+ readonly fromBlock?: number;
1057
+ readonly toBlock?: number;
1058
+ }
1059
+ /**
1060
+ * Filter for {@link PublicDataProvider.contractEventsObservable}. The stream
1061
+ * start is supplied separately via {@link ContractEventCursor}; `toBlock`
1062
+ * terminates the stream once the chain reaches that height.
1063
+ */
1064
+ interface ContractEventSubscriptionFilter extends ContractEventFilterBase {
1065
+ readonly toBlock?: number;
1066
+ }
1067
+ /**
1068
+ * Where a subscription begins. Exactly one addressing mode per call — two
1069
+ * competing start points are unrepresentable by construction.
1070
+ */
1071
+ type ContractEventCursor = {
1072
+ readonly fromId: number;
1073
+ } | {
1074
+ readonly fromBlock: number;
1075
+ };
1076
+ /**
1077
+ * Pagination window for {@link PublicDataProvider.queryContractEvents}.
1078
+ * `offset` is only stable within a window with a fixed upper bound — pin
1079
+ * `toBlock` for multi-page reads.
1080
+ */
1081
+ interface ContractEventsPage {
1082
+ readonly limit?: number;
1083
+ readonly offset?: number;
1084
+ }
912
1085
  /**
913
1086
  * Interface for a public data service. This service retrieves public data from the blockchain.
914
1087
  * TODO: Add timeouts or retry limits to 'watchFor' queries.
@@ -1010,6 +1183,56 @@ interface PublicDataProvider {
1010
1183
  * @return {Observable<UnshieldedBalances>} An observable that emits the unshielded balances for the provided address.
1011
1184
  */
1012
1185
  unshieldedBalancesObservable(address: ContractAddress, config: ContractStateObservableConfig): Observable<UnshieldedBalances>;
1186
+ /**
1187
+ * Queries contract events for a contract address — a finite, paginated,
1188
+ * point-in-time read.
1189
+ *
1190
+ * Results are returned in ascending `id` order. The result is a plain array
1191
+ * with no total count: detect the end via `result.length < limit`, and read
1192
+ * `maxId` on the last item to see how far the tip is.
1193
+ *
1194
+ * When `page.limit` is omitted an implementation-defined default page size is
1195
+ * applied (never an undocumented server default). `offset` is only stable
1196
+ * within a window with a fixed upper bound — pin `filter.toBlock` for
1197
+ * multi-page reads, or prefer the `getAllContractEvents` helper / the
1198
+ * subscription for tailing.
1199
+ *
1200
+ * Fails fast (synchronously, before any network call) on an invalid
1201
+ * `contractAddress`, an empty `types` array, `fieldPrefixes` combined with
1202
+ * `Misc` (or with `types` omitted), or an unknown `fieldName`. Network /
1203
+ * GraphQL errors reject the promise — an empty array always means "no
1204
+ * matching events", never a swallowed error.
1205
+ *
1206
+ * @param filter The events to return; `contractAddress` is required.
1207
+ * @param page Optional pagination window.
1208
+ */
1209
+ queryContractEvents(filter: ContractEventQueryFilter, page?: ContractEventsPage): Promise<ContractEvent[]>;
1210
+ /**
1211
+ * Streams contract events for a contract address — replay from a cursor, then
1212
+ * live, in one continuous stream.
1213
+ *
1214
+ * The start is supplied via `opts.startAt`: `{ fromId }` resumes inclusively
1215
+ * from a known event id, `{ fromBlock }` starts from a block height. Omitting
1216
+ * `startAt` streams from the start of history. The indexer replays historical
1217
+ * events from that point in monotonic `id` order, then continues live — there
1218
+ * is no separate backfill query and no client-side dedup.
1219
+ *
1220
+ * `{ fromId }` is **inclusive**; to resume *after* the last seen event pass
1221
+ * `{ fromId: lastSeenId + 1 }`.
1222
+ *
1223
+ * `filter.toBlock` completes the stream once the chain reaches that height;
1224
+ * without it the stream runs until unsubscribed or the provider is disposed.
1225
+ * Delivery is **at-least-once** across transport reconnects (the provider
1226
+ * does not advance the cursor) — persisting consumers should dedup by `id`.
1227
+ * Transport failures surface as an observable `error`, never a silent
1228
+ * completion.
1229
+ *
1230
+ * @param filter The events to stream; `contractAddress` is required.
1231
+ * @param opts Optional stream start.
1232
+ */
1233
+ contractEventsObservable(filter: ContractEventSubscriptionFilter, opts?: {
1234
+ startAt?: ContractEventCursor;
1235
+ }): Observable<ContractEvent>;
1013
1236
  }
1014
1237
 
1015
1238
  /**
@@ -1066,4 +1289,4 @@ interface MidnightProviders<PCK extends AnyProvableCircuitId = AnyProvableCircui
1066
1289
  }
1067
1290
 
1068
1291
  export { ExportDecryptionError, FailEntirely, FailFallible, ImportConflictError, InvalidExportFormatError, InvalidProtocolSchemeError, LogLevel, MAX_EXPORT_SIGNING_KEYS, MAX_EXPORT_STATES, PrivateStateExportError, PrivateStateImportError, SegmentFail, SegmentSuccess, SigningKeyExportError, SucceedEntirely, ZKConfigProvider, asContractAddress, asEffectOption, createProofProvider, createProverKey, createVerifierKey, createZKIR, exitResultOrError, makeContractExecutableRuntime, zkConfigToProvingKeyMaterial };
1069
- export type { All, AnyPrivateState, AnyProvableCircuitId, BlockHash, BlockHashConfig, BlockHeightConfig, ContractExecutableRuntimeOptions, ContractStateObservableConfig, ExportPrivateStatesOptions, ExportSigningKeysOptions, Fees, FinalizedTxData, ImportPrivateStatesOptions, ImportPrivateStatesResult, ImportSigningKeysOptions, ImportSigningKeysResult, KeyMaterialProvider, Latest, LoggerProvider, MidnightProvider, MidnightProviders, PrivateStateExport, PrivateStateId, PrivateStateImportErrorCause, PrivateStateProvider, ProofProvider, ProveTxConfig, ProverKey, PublicDataProvider, SegmentStatus, SigningKeyExport, TxIdConfig, TxStatus, UnboundTransaction, UnshieldedBalance, UnshieldedBalances, UnshieldedUtxo, UnshieldedUtxos, VerifierKey, WalletProvider, ZKConfig, ZKIR };
1292
+ export type { All, AnyPrivateState, AnyProvableCircuitId, BlockHash, BlockHashConfig, BlockHeightConfig, ContractEvent, ContractEventAddress, ContractEventBase, ContractEventCursor, ContractEventFieldPrefix, ContractEventFilterBase, ContractEventQueryFilter, ContractEventSubscriptionFilter, ContractEventType, ContractEventsPage, ContractExecutableRuntimeOptions, ContractStateObservableConfig, ExportPrivateStatesOptions, ExportSigningKeysOptions, Fees, FinalizedTxData, ImportPrivateStatesOptions, ImportPrivateStatesResult, ImportSigningKeysOptions, ImportSigningKeysResult, KeyMaterialProvider, Latest, LoggerProvider, MidnightProvider, MidnightProviders, PrivateStateExport, PrivateStateId, PrivateStateImportErrorCause, PrivateStateProvider, ProofProvider, ProveTxConfig, ProverKey, PublicDataProvider, SegmentStatus, SigningKeyExport, TxIdConfig, TxStatus, UnboundTransaction, UnshieldedBalance, UnshieldedBalances, UnshieldedUtxo, UnshieldedUtxos, VerifierKey, WalletProvider, ZKConfig, ZKIR };
package/dist/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  import { ContractExecutable } from '@midnight-ntwrk/midnight-js-protocol/compact-js/effect';
2
+ import { SigningKey, ContractAddress as ContractAddress$2, ContractState } from '@midnight-ntwrk/midnight-js-protocol/compact-runtime';
2
3
  import { ContractAddress as ContractAddress$1 } from '@midnight-ntwrk/midnight-js-protocol/platform-js';
3
4
  import { Option, Exit, ConfigError } from 'effect';
4
5
  import { ManagedRuntime } from 'effect/ManagedRuntime';
@@ -6,7 +7,6 @@ import { Contract } from '@midnight-ntwrk/midnight-js-protocol/compact-js';
6
7
  import { Transaction, SignatureEnabled, Proof, Binding, TransactionId, TransactionHash, ContractAddress, IntentHash, RawTokenType, FinalizedTransaction, UnprovenTransaction, PreBinding, ProvingProvider, CostModel, ZswapChainState, LedgerParameters, CoinPublicKey, EncPublicKey } from '@midnight-ntwrk/midnight-js-protocol/ledger';
7
8
  export { Transaction } from '@midnight-ntwrk/midnight-js-protocol/ledger';
8
9
  import { LogFn } from 'pino';
9
- import { ContractAddress as ContractAddress$2, SigningKey, ContractState } from '@midnight-ntwrk/midnight-js-protocol/compact-runtime';
10
10
  import { Observable } from 'rxjs';
11
11
 
12
12
  type AnyProvableCircuitId = Contract.ProvableCircuitId<Contract.Any>;
@@ -313,7 +313,7 @@ type ContractExecutableRuntimeOptions = {
313
313
  /** The current user's ZSwap public key. */
314
314
  readonly coinPublicKey: string;
315
315
  /** The signing key to add as the to-be-deployed contract's maintenance authority. */
316
- readonly signingKey?: string;
316
+ readonly signingKey?: SigningKey;
317
317
  };
318
318
  /**
319
319
  * Constructs an Effect managed runtime configured to execute contract executables.
@@ -909,6 +909,179 @@ type ContractStateObservableConfig = ((TxIdConfig | BlockHashConfig | BlockHeigh
909
909
  */
910
910
  readonly inclusive?: boolean;
911
911
  }) | Latest | All;
912
+ /**
913
+ * The eleven contract event variants surfaced by the indexer (MIP-0002 public
914
+ * contract log emission). The variant *set* is identical to compact-js's
915
+ * `LogEventType`; only the string casing differs (PascalCase here, kebab-case
916
+ * in compact-js, SCREAMING_SNAKE on the indexer wire). Adding a variant is a
917
+ * breaking change — the mapping, filter translation, and exhaustiveness guards
918
+ * all key off this union.
919
+ */
920
+ type ContractEventType = 'ShieldedSpend' | 'ShieldedReceive' | 'ShieldedMint' | 'ShieldedBurn' | 'UnshieldedSpend' | 'UnshieldedReceive' | 'UnshieldedMint' | 'UnshieldedBurn' | 'Paused' | 'Unpaused' | 'Misc';
921
+ /**
922
+ * A `sender` / `recipient` on an unshielded event. The indexer returns a tagged
923
+ * union (`Either<ZswapCoinPublicKey, ContractAddress>`); this preserves the
924
+ * discriminator so consumers can tell a user address from a contract address
925
+ * rather than receiving a bare, ambiguous string.
926
+ */
927
+ interface ContractEventAddress {
928
+ /** Which kind of address `value` holds. */
929
+ readonly kind: 'user' | 'contract';
930
+ /** The hex-encoded address. */
931
+ readonly value: string;
932
+ }
933
+ /**
934
+ * Fields common to every {@link ContractEvent} variant, regardless of type.
935
+ */
936
+ interface ContractEventBase {
937
+ /**
938
+ * Monotonic indexer cursor for this event. Inclusive resumption point — to
939
+ * resume *after* this event, pass `{ fromId: id + 1 }`.
940
+ */
941
+ readonly id: number;
942
+ /**
943
+ * Highest event id the indexer currently knows (the chain tip for events).
944
+ * Compare against {@link id} to detect catch-up / whether more events exist.
945
+ */
946
+ readonly maxId: number;
947
+ /**
948
+ * Payload schema version — selects the (future) per-event payload decoder.
949
+ * Iteration-1 events are `version: 1`.
950
+ */
951
+ readonly version: number;
952
+ /** Address of the contract that emitted the event. */
953
+ readonly contractAddress: ContractAddress;
954
+ /**
955
+ * Indexer-internal `BIGSERIAL` row id of the emitting transaction — **not**
956
+ * the chain transaction hash. To fetch the chain transaction, issue a
957
+ * separate query. Note the asymmetry with {@link ContractEventFilterBase.transactionHash},
958
+ * which narrows by chain hash.
959
+ */
960
+ readonly transactionId: number;
961
+ /**
962
+ * Opaque hex `VersionedLogItem` bytes, carried verbatim. Never decoded or
963
+ * validated by this provider — the forward bridge to a future compact-js
964
+ * payload decoder.
965
+ */
966
+ readonly raw: string;
967
+ }
968
+ /**
969
+ * A decoded contract event. Discriminated union keyed on `eventType`; narrow on
970
+ * it to access the variant-specific payload fields.
971
+ *
972
+ * `amount` is always a `string` (encodes up to a 16-byte integer) — never round
973
+ * it through `Number()`. Absent nullable fields are normalized to `undefined`
974
+ * (never `null`).
975
+ */
976
+ type ContractEvent = (ContractEventBase & {
977
+ readonly eventType: 'ShieldedSpend';
978
+ readonly nullifier: string;
979
+ }) | (ContractEventBase & {
980
+ readonly eventType: 'ShieldedReceive';
981
+ readonly commitment: string;
982
+ readonly ciphertext?: string;
983
+ readonly receivingContractAddress?: string;
984
+ }) | (ContractEventBase & {
985
+ readonly eventType: 'ShieldedMint';
986
+ readonly commitment: string;
987
+ readonly domainSep: string;
988
+ readonly amount?: string;
989
+ }) | (ContractEventBase & {
990
+ readonly eventType: 'ShieldedBurn';
991
+ readonly nullifier: string;
992
+ readonly amount?: string;
993
+ }) | (ContractEventBase & {
994
+ readonly eventType: 'UnshieldedSpend';
995
+ readonly sender: ContractEventAddress;
996
+ readonly domainSep: string;
997
+ readonly tokenType: string;
998
+ readonly amount: string;
999
+ }) | (ContractEventBase & {
1000
+ readonly eventType: 'UnshieldedReceive';
1001
+ readonly recipient: ContractEventAddress;
1002
+ readonly domainSep: string;
1003
+ readonly tokenType: string;
1004
+ readonly amount: string;
1005
+ }) | (ContractEventBase & {
1006
+ readonly eventType: 'UnshieldedMint';
1007
+ readonly domainSep: string;
1008
+ readonly tokenType: string;
1009
+ readonly amount: string;
1010
+ }) | (ContractEventBase & {
1011
+ readonly eventType: 'UnshieldedBurn';
1012
+ readonly sender: ContractEventAddress;
1013
+ readonly tokenType: string;
1014
+ readonly amount: string;
1015
+ }) | (ContractEventBase & {
1016
+ readonly eventType: 'Paused';
1017
+ }) | (ContractEventBase & {
1018
+ readonly eventType: 'Unpaused';
1019
+ }) | (ContractEventBase & {
1020
+ readonly eventType: 'Misc';
1021
+ readonly name: string;
1022
+ readonly payload: string;
1023
+ });
1024
+ /**
1025
+ * A single prefix filter on an indexed field of a standard event. `prefix` is
1026
+ * hex-encoded; the empty string matches all values.
1027
+ */
1028
+ interface ContractEventFieldPrefix {
1029
+ readonly fieldName: string;
1030
+ readonly prefix: string;
1031
+ }
1032
+ /**
1033
+ * Filter fields shared by the query and the subscription.
1034
+ */
1035
+ interface ContractEventFilterBase {
1036
+ /** Required: the contract whose events to return. */
1037
+ readonly contractAddress: ContractAddress;
1038
+ /**
1039
+ * Optional subset of event types. Omit to mean "all types". An empty array
1040
+ * is rejected (it would silently match nothing).
1041
+ */
1042
+ readonly types?: ContractEventType[];
1043
+ /**
1044
+ * Optional prefix filters on indexed fields. Accepted only when every
1045
+ * filtered type is a standard (non-`Misc`) variant — see method docs.
1046
+ */
1047
+ readonly fieldPrefixes?: ContractEventFieldPrefix[];
1048
+ /** Optional: narrow to events emitted from the transaction with this chain hash. */
1049
+ readonly transactionHash?: string;
1050
+ }
1051
+ /**
1052
+ * Filter for {@link PublicDataProvider.queryContractEvents}. `fromBlock` /
1053
+ * `toBlock` are inclusive block-height bounds for a finite, point-in-time read.
1054
+ */
1055
+ interface ContractEventQueryFilter extends ContractEventFilterBase {
1056
+ readonly fromBlock?: number;
1057
+ readonly toBlock?: number;
1058
+ }
1059
+ /**
1060
+ * Filter for {@link PublicDataProvider.contractEventsObservable}. The stream
1061
+ * start is supplied separately via {@link ContractEventCursor}; `toBlock`
1062
+ * terminates the stream once the chain reaches that height.
1063
+ */
1064
+ interface ContractEventSubscriptionFilter extends ContractEventFilterBase {
1065
+ readonly toBlock?: number;
1066
+ }
1067
+ /**
1068
+ * Where a subscription begins. Exactly one addressing mode per call — two
1069
+ * competing start points are unrepresentable by construction.
1070
+ */
1071
+ type ContractEventCursor = {
1072
+ readonly fromId: number;
1073
+ } | {
1074
+ readonly fromBlock: number;
1075
+ };
1076
+ /**
1077
+ * Pagination window for {@link PublicDataProvider.queryContractEvents}.
1078
+ * `offset` is only stable within a window with a fixed upper bound — pin
1079
+ * `toBlock` for multi-page reads.
1080
+ */
1081
+ interface ContractEventsPage {
1082
+ readonly limit?: number;
1083
+ readonly offset?: number;
1084
+ }
912
1085
  /**
913
1086
  * Interface for a public data service. This service retrieves public data from the blockchain.
914
1087
  * TODO: Add timeouts or retry limits to 'watchFor' queries.
@@ -1010,6 +1183,56 @@ interface PublicDataProvider {
1010
1183
  * @return {Observable<UnshieldedBalances>} An observable that emits the unshielded balances for the provided address.
1011
1184
  */
1012
1185
  unshieldedBalancesObservable(address: ContractAddress, config: ContractStateObservableConfig): Observable<UnshieldedBalances>;
1186
+ /**
1187
+ * Queries contract events for a contract address — a finite, paginated,
1188
+ * point-in-time read.
1189
+ *
1190
+ * Results are returned in ascending `id` order. The result is a plain array
1191
+ * with no total count: detect the end via `result.length < limit`, and read
1192
+ * `maxId` on the last item to see how far the tip is.
1193
+ *
1194
+ * When `page.limit` is omitted an implementation-defined default page size is
1195
+ * applied (never an undocumented server default). `offset` is only stable
1196
+ * within a window with a fixed upper bound — pin `filter.toBlock` for
1197
+ * multi-page reads, or prefer the `getAllContractEvents` helper / the
1198
+ * subscription for tailing.
1199
+ *
1200
+ * Fails fast (synchronously, before any network call) on an invalid
1201
+ * `contractAddress`, an empty `types` array, `fieldPrefixes` combined with
1202
+ * `Misc` (or with `types` omitted), or an unknown `fieldName`. Network /
1203
+ * GraphQL errors reject the promise — an empty array always means "no
1204
+ * matching events", never a swallowed error.
1205
+ *
1206
+ * @param filter The events to return; `contractAddress` is required.
1207
+ * @param page Optional pagination window.
1208
+ */
1209
+ queryContractEvents(filter: ContractEventQueryFilter, page?: ContractEventsPage): Promise<ContractEvent[]>;
1210
+ /**
1211
+ * Streams contract events for a contract address — replay from a cursor, then
1212
+ * live, in one continuous stream.
1213
+ *
1214
+ * The start is supplied via `opts.startAt`: `{ fromId }` resumes inclusively
1215
+ * from a known event id, `{ fromBlock }` starts from a block height. Omitting
1216
+ * `startAt` streams from the start of history. The indexer replays historical
1217
+ * events from that point in monotonic `id` order, then continues live — there
1218
+ * is no separate backfill query and no client-side dedup.
1219
+ *
1220
+ * `{ fromId }` is **inclusive**; to resume *after* the last seen event pass
1221
+ * `{ fromId: lastSeenId + 1 }`.
1222
+ *
1223
+ * `filter.toBlock` completes the stream once the chain reaches that height;
1224
+ * without it the stream runs until unsubscribed or the provider is disposed.
1225
+ * Delivery is **at-least-once** across transport reconnects (the provider
1226
+ * does not advance the cursor) — persisting consumers should dedup by `id`.
1227
+ * Transport failures surface as an observable `error`, never a silent
1228
+ * completion.
1229
+ *
1230
+ * @param filter The events to stream; `contractAddress` is required.
1231
+ * @param opts Optional stream start.
1232
+ */
1233
+ contractEventsObservable(filter: ContractEventSubscriptionFilter, opts?: {
1234
+ startAt?: ContractEventCursor;
1235
+ }): Observable<ContractEvent>;
1013
1236
  }
1014
1237
 
1015
1238
  /**
@@ -1066,4 +1289,4 @@ interface MidnightProviders<PCK extends AnyProvableCircuitId = AnyProvableCircui
1066
1289
  }
1067
1290
 
1068
1291
  export { ExportDecryptionError, FailEntirely, FailFallible, ImportConflictError, InvalidExportFormatError, InvalidProtocolSchemeError, LogLevel, MAX_EXPORT_SIGNING_KEYS, MAX_EXPORT_STATES, PrivateStateExportError, PrivateStateImportError, SegmentFail, SegmentSuccess, SigningKeyExportError, SucceedEntirely, ZKConfigProvider, asContractAddress, asEffectOption, createProofProvider, createProverKey, createVerifierKey, createZKIR, exitResultOrError, makeContractExecutableRuntime, zkConfigToProvingKeyMaterial };
1069
- export type { All, AnyPrivateState, AnyProvableCircuitId, BlockHash, BlockHashConfig, BlockHeightConfig, ContractExecutableRuntimeOptions, ContractStateObservableConfig, ExportPrivateStatesOptions, ExportSigningKeysOptions, Fees, FinalizedTxData, ImportPrivateStatesOptions, ImportPrivateStatesResult, ImportSigningKeysOptions, ImportSigningKeysResult, KeyMaterialProvider, Latest, LoggerProvider, MidnightProvider, MidnightProviders, PrivateStateExport, PrivateStateId, PrivateStateImportErrorCause, PrivateStateProvider, ProofProvider, ProveTxConfig, ProverKey, PublicDataProvider, SegmentStatus, SigningKeyExport, TxIdConfig, TxStatus, UnboundTransaction, UnshieldedBalance, UnshieldedBalances, UnshieldedUtxo, UnshieldedUtxos, VerifierKey, WalletProvider, ZKConfig, ZKIR };
1292
+ export type { All, AnyPrivateState, AnyProvableCircuitId, BlockHash, BlockHashConfig, BlockHeightConfig, ContractEvent, ContractEventAddress, ContractEventBase, ContractEventCursor, ContractEventFieldPrefix, ContractEventFilterBase, ContractEventQueryFilter, ContractEventSubscriptionFilter, ContractEventType, ContractEventsPage, ContractExecutableRuntimeOptions, ContractStateObservableConfig, ExportPrivateStatesOptions, ExportSigningKeysOptions, Fees, FinalizedTxData, ImportPrivateStatesOptions, ImportPrivateStatesResult, ImportSigningKeysOptions, ImportSigningKeysResult, KeyMaterialProvider, Latest, LoggerProvider, MidnightProvider, MidnightProviders, PrivateStateExport, PrivateStateId, PrivateStateImportErrorCause, PrivateStateProvider, ProofProvider, ProveTxConfig, ProverKey, PublicDataProvider, SegmentStatus, SigningKeyExport, TxIdConfig, TxStatus, UnboundTransaction, UnshieldedBalance, UnshieldedBalances, UnshieldedUtxo, UnshieldedUtxos, VerifierKey, WalletProvider, ZKConfig, ZKIR };
package/dist/index.mjs CHANGED
@@ -53,7 +53,10 @@ const makeAdaptedRuntimeLayer = (zkConfigProvider, configMap) => Layer.mergeAll(
53
53
  const makeContractExecutableRuntime = (zkConfigProvider, options) => {
54
54
  let config = [['KEYS_COIN_PUBLIC', options.coinPublicKey]];
55
55
  if (options.signingKey) {
56
- config = config.concat([['KEYS_SIGNING', options.signingKey]]);
56
+ config = config.concat([
57
+ ['KEYS_SIGNING', options.signingKey.value],
58
+ ['KEYS_SIGNING_KIND', options.signingKey.tag]
59
+ ]);
57
60
  }
58
61
  return ContractExecutableRuntime.make(makeAdaptedRuntimeLayer(zkConfigProvider, new Map(config)));
59
62
  };
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../src/contract.ts","../src/errors.ts","../src/logger-provider.ts","../src/midnight-types.ts","../src/private-state-provider.ts","../src/proof-provider.ts","../src/zk-config-provider.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAaG;AAWH;;;;;;;;AAQG;AACH,MAAM,iBAAiB,GAAG,CAAsC,gBAA0C,KACxG,CAAC,gBAA0D,KACzD,MAAM,CAAC,GAAG,CAAC,aAAS;;;IAGlB,MAAM,cAAc,GAAG,CAAC,iBAAgD,KACtE,MAAM,CAAC,UAAU,CAAC;AAChB,QAAA,GAAG,EAAE,MAAM,gBAAgB,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,KAAK,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;AACnI,QAAA,KAAK,EAAE,CAAC,GAAY,KAAK,wBAAwB,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG;AACpH,KAAA,CAAC;IACJ,OAAO;QACL,cAAc;QACd,eAAe,EAAE,CAAC,kBAAkB,KAClC,MAAM,CAAC,OAAO,CACZ,kBAAkB,EAClB,CAAC,iBAAiB,KAChB,cAAc,CAAC,iBAAiB,CAAC,CAAC,IAAI,CACpC,MAAM,CAAC,GAAG,CAAC,CAAC,WAAW,KAAK,CAAC,iBAAiB,EAAE,WAAW,CAAU,CAAC,CACvE,EACH,EAAE,WAAW,EAAE,WAAW,EAAE,OAAO,EAAE,KAAK,EAAE;KAEO;AAC3D,CAAC,CAAC;AAEN,MAAM,uBAAuB,GAAG,CAAC,gBAA0C,EAAE,SAA8B,KACzG,KAAK,CAAC,QAAQ,CACZ,KAAK,CAAC,OAAO,CACX,eAAe,CAAC,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C,cAAc,CAAC,EAAE,CAAC;AACzC,YAAA,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC;QAClB,CAAC,CAAC,CACH;IACH;AAEA;;;AAGG;IACH,MAAM,GAAG,CAAC,SAAY,EAAA;QACpB,OAAO;YACL,SAAS;AACT,YAAA,SAAS,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;AAC7C,YAAA,WAAW,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;AACjD,YAAA,IAAI,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS;SACnC;IACH;IAEA,qBAAqB,GAAA;AACnB,QAAA,OAAO,IAA2B;IACpC;AACD;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../src/contract.ts","../src/errors.ts","../src/logger-provider.ts","../src/midnight-types.ts","../src/private-state-provider.ts","../src/proof-provider.ts","../src/zk-config-provider.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":[],"mappings":";;;;;;;AAAA;;;;;;;;;;;;;AAaG;AAYH;;;;;;;;AAQG;AACH,MAAM,iBAAiB,GAAG,CAAsC,gBAA0C,KACxG,CAAC,gBAA0D,KACzD,MAAM,CAAC,GAAG,CAAC,aAAS;;;IAGlB,MAAM,cAAc,GAAG,CAAC,iBAAgD,KACtE,MAAM,CAAC,UAAU,CAAC;AAChB,QAAA,GAAG,EAAE,MAAM,gBAAgB,CAAC,cAAc,CAAC,iBAAiB,CAAC,CAAC,IAAI,CAAC,CAAC,WAAW,KAAK,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,CAAC;AACnI,QAAA,KAAK,EAAE,CAAC,GAAY,KAAK,wBAAwB,CAAC,IAAI,CAAC,gBAAgB,CAAC,GAAG,EAAE,iBAAiB,EAAE,cAAc,EAAE,GAAG;AACpH,KAAA,CAAC;IACJ,OAAO;QACL,cAAc;QACd,eAAe,EAAE,CAAC,kBAAkB,KAClC,MAAM,CAAC,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G;AAwCH;;;;;;;AAOG;AACI,MAAM,mBAAmB,GAAG,CACjC,eAAgC,EAChC,SAAA,GAAuB,SAAS,CAAC,gBAAgB,EAAE,MAChC;IACnB,MAAM,OAAO,CAAC,UAA+B,EAAA;QAC3C,OAAO,UAAU,CAAC,KAAK,CAAC,eAAe,EAAE,SAAS,CAAC;IACrD;AACD,CAAA;;ACpED;;;;;;;;;;;;;AAaG;AAaH;;;;;;AAMG;MACmB,gBAAgB,CAAA;AAmBpC;;;AAGG;IACH,MAAM,eAAe,CAAC,UAAe,EAAA;AACnC,QAAA,OAAO,OAAO,CAAC,GAAG,CAChB,UAAU,CAAC,GAAG,CAAC,OAAO,EAAE,KAAI;YAC1B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,EAAE,CAAC;AACzC,YAAA,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC;QAClB,CAAC,CAAC,CACH;IACH;AAEA;;;AAGG;IACH,MAAM,GAAG,CAAC,SAAY,EAAA;QACpB,OAAO;YACL,SAAS;AACT,YAAA,SAAS,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,SAAS,CAAC;AAC7C,YAAA,WAAW,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,SAAS,CAAC;AACjD,YAAA,IAAI,EAAE,MAAM,IAAI,CAAC,OAAO,CAAC,SAAS;SACnC;IACH;IAEA,qBAAqB,GAAA;AACnB,QAAA,OAAO,IAA2B;IACpC;AACD;;;;"}
@@ -58,6 +58,179 @@ export type ContractStateObservableConfig = ((TxIdConfig | BlockHashConfig | Blo
58
58
  */
59
59
  readonly inclusive?: boolean;
60
60
  }) | Latest | All;
61
+ /**
62
+ * The eleven contract event variants surfaced by the indexer (MIP-0002 public
63
+ * contract log emission). The variant *set* is identical to compact-js's
64
+ * `LogEventType`; only the string casing differs (PascalCase here, kebab-case
65
+ * in compact-js, SCREAMING_SNAKE on the indexer wire). Adding a variant is a
66
+ * breaking change — the mapping, filter translation, and exhaustiveness guards
67
+ * all key off this union.
68
+ */
69
+ export type ContractEventType = 'ShieldedSpend' | 'ShieldedReceive' | 'ShieldedMint' | 'ShieldedBurn' | 'UnshieldedSpend' | 'UnshieldedReceive' | 'UnshieldedMint' | 'UnshieldedBurn' | 'Paused' | 'Unpaused' | 'Misc';
70
+ /**
71
+ * A `sender` / `recipient` on an unshielded event. The indexer returns a tagged
72
+ * union (`Either<ZswapCoinPublicKey, ContractAddress>`); this preserves the
73
+ * discriminator so consumers can tell a user address from a contract address
74
+ * rather than receiving a bare, ambiguous string.
75
+ */
76
+ export interface ContractEventAddress {
77
+ /** Which kind of address `value` holds. */
78
+ readonly kind: 'user' | 'contract';
79
+ /** The hex-encoded address. */
80
+ readonly value: string;
81
+ }
82
+ /**
83
+ * Fields common to every {@link ContractEvent} variant, regardless of type.
84
+ */
85
+ export interface ContractEventBase {
86
+ /**
87
+ * Monotonic indexer cursor for this event. Inclusive resumption point — to
88
+ * resume *after* this event, pass `{ fromId: id + 1 }`.
89
+ */
90
+ readonly id: number;
91
+ /**
92
+ * Highest event id the indexer currently knows (the chain tip for events).
93
+ * Compare against {@link id} to detect catch-up / whether more events exist.
94
+ */
95
+ readonly maxId: number;
96
+ /**
97
+ * Payload schema version — selects the (future) per-event payload decoder.
98
+ * Iteration-1 events are `version: 1`.
99
+ */
100
+ readonly version: number;
101
+ /** Address of the contract that emitted the event. */
102
+ readonly contractAddress: ContractAddress;
103
+ /**
104
+ * Indexer-internal `BIGSERIAL` row id of the emitting transaction — **not**
105
+ * the chain transaction hash. To fetch the chain transaction, issue a
106
+ * separate query. Note the asymmetry with {@link ContractEventFilterBase.transactionHash},
107
+ * which narrows by chain hash.
108
+ */
109
+ readonly transactionId: number;
110
+ /**
111
+ * Opaque hex `VersionedLogItem` bytes, carried verbatim. Never decoded or
112
+ * validated by this provider — the forward bridge to a future compact-js
113
+ * payload decoder.
114
+ */
115
+ readonly raw: string;
116
+ }
117
+ /**
118
+ * A decoded contract event. Discriminated union keyed on `eventType`; narrow on
119
+ * it to access the variant-specific payload fields.
120
+ *
121
+ * `amount` is always a `string` (encodes up to a 16-byte integer) — never round
122
+ * it through `Number()`. Absent nullable fields are normalized to `undefined`
123
+ * (never `null`).
124
+ */
125
+ export type ContractEvent = (ContractEventBase & {
126
+ readonly eventType: 'ShieldedSpend';
127
+ readonly nullifier: string;
128
+ }) | (ContractEventBase & {
129
+ readonly eventType: 'ShieldedReceive';
130
+ readonly commitment: string;
131
+ readonly ciphertext?: string;
132
+ readonly receivingContractAddress?: string;
133
+ }) | (ContractEventBase & {
134
+ readonly eventType: 'ShieldedMint';
135
+ readonly commitment: string;
136
+ readonly domainSep: string;
137
+ readonly amount?: string;
138
+ }) | (ContractEventBase & {
139
+ readonly eventType: 'ShieldedBurn';
140
+ readonly nullifier: string;
141
+ readonly amount?: string;
142
+ }) | (ContractEventBase & {
143
+ readonly eventType: 'UnshieldedSpend';
144
+ readonly sender: ContractEventAddress;
145
+ readonly domainSep: string;
146
+ readonly tokenType: string;
147
+ readonly amount: string;
148
+ }) | (ContractEventBase & {
149
+ readonly eventType: 'UnshieldedReceive';
150
+ readonly recipient: ContractEventAddress;
151
+ readonly domainSep: string;
152
+ readonly tokenType: string;
153
+ readonly amount: string;
154
+ }) | (ContractEventBase & {
155
+ readonly eventType: 'UnshieldedMint';
156
+ readonly domainSep: string;
157
+ readonly tokenType: string;
158
+ readonly amount: string;
159
+ }) | (ContractEventBase & {
160
+ readonly eventType: 'UnshieldedBurn';
161
+ readonly sender: ContractEventAddress;
162
+ readonly tokenType: string;
163
+ readonly amount: string;
164
+ }) | (ContractEventBase & {
165
+ readonly eventType: 'Paused';
166
+ }) | (ContractEventBase & {
167
+ readonly eventType: 'Unpaused';
168
+ }) | (ContractEventBase & {
169
+ readonly eventType: 'Misc';
170
+ readonly name: string;
171
+ readonly payload: string;
172
+ });
173
+ /**
174
+ * A single prefix filter on an indexed field of a standard event. `prefix` is
175
+ * hex-encoded; the empty string matches all values.
176
+ */
177
+ export interface ContractEventFieldPrefix {
178
+ readonly fieldName: string;
179
+ readonly prefix: string;
180
+ }
181
+ /**
182
+ * Filter fields shared by the query and the subscription.
183
+ */
184
+ export interface ContractEventFilterBase {
185
+ /** Required: the contract whose events to return. */
186
+ readonly contractAddress: ContractAddress;
187
+ /**
188
+ * Optional subset of event types. Omit to mean "all types". An empty array
189
+ * is rejected (it would silently match nothing).
190
+ */
191
+ readonly types?: ContractEventType[];
192
+ /**
193
+ * Optional prefix filters on indexed fields. Accepted only when every
194
+ * filtered type is a standard (non-`Misc`) variant — see method docs.
195
+ */
196
+ readonly fieldPrefixes?: ContractEventFieldPrefix[];
197
+ /** Optional: narrow to events emitted from the transaction with this chain hash. */
198
+ readonly transactionHash?: string;
199
+ }
200
+ /**
201
+ * Filter for {@link PublicDataProvider.queryContractEvents}. `fromBlock` /
202
+ * `toBlock` are inclusive block-height bounds for a finite, point-in-time read.
203
+ */
204
+ export interface ContractEventQueryFilter extends ContractEventFilterBase {
205
+ readonly fromBlock?: number;
206
+ readonly toBlock?: number;
207
+ }
208
+ /**
209
+ * Filter for {@link PublicDataProvider.contractEventsObservable}. The stream
210
+ * start is supplied separately via {@link ContractEventCursor}; `toBlock`
211
+ * terminates the stream once the chain reaches that height.
212
+ */
213
+ export interface ContractEventSubscriptionFilter extends ContractEventFilterBase {
214
+ readonly toBlock?: number;
215
+ }
216
+ /**
217
+ * Where a subscription begins. Exactly one addressing mode per call — two
218
+ * competing start points are unrepresentable by construction.
219
+ */
220
+ export type ContractEventCursor = {
221
+ readonly fromId: number;
222
+ } | {
223
+ readonly fromBlock: number;
224
+ };
225
+ /**
226
+ * Pagination window for {@link PublicDataProvider.queryContractEvents}.
227
+ * `offset` is only stable within a window with a fixed upper bound — pin
228
+ * `toBlock` for multi-page reads.
229
+ */
230
+ export interface ContractEventsPage {
231
+ readonly limit?: number;
232
+ readonly offset?: number;
233
+ }
61
234
  /**
62
235
  * Interface for a public data service. This service retrieves public data from the blockchain.
63
236
  * TODO: Add timeouts or retry limits to 'watchFor' queries.
@@ -159,5 +332,55 @@ export interface PublicDataProvider {
159
332
  * @return {Observable<UnshieldedBalances>} An observable that emits the unshielded balances for the provided address.
160
333
  */
161
334
  unshieldedBalancesObservable(address: ContractAddress, config: ContractStateObservableConfig): Observable<UnshieldedBalances>;
335
+ /**
336
+ * Queries contract events for a contract address — a finite, paginated,
337
+ * point-in-time read.
338
+ *
339
+ * Results are returned in ascending `id` order. The result is a plain array
340
+ * with no total count: detect the end via `result.length < limit`, and read
341
+ * `maxId` on the last item to see how far the tip is.
342
+ *
343
+ * When `page.limit` is omitted an implementation-defined default page size is
344
+ * applied (never an undocumented server default). `offset` is only stable
345
+ * within a window with a fixed upper bound — pin `filter.toBlock` for
346
+ * multi-page reads, or prefer the `getAllContractEvents` helper / the
347
+ * subscription for tailing.
348
+ *
349
+ * Fails fast (synchronously, before any network call) on an invalid
350
+ * `contractAddress`, an empty `types` array, `fieldPrefixes` combined with
351
+ * `Misc` (or with `types` omitted), or an unknown `fieldName`. Network /
352
+ * GraphQL errors reject the promise — an empty array always means "no
353
+ * matching events", never a swallowed error.
354
+ *
355
+ * @param filter The events to return; `contractAddress` is required.
356
+ * @param page Optional pagination window.
357
+ */
358
+ queryContractEvents(filter: ContractEventQueryFilter, page?: ContractEventsPage): Promise<ContractEvent[]>;
359
+ /**
360
+ * Streams contract events for a contract address — replay from a cursor, then
361
+ * live, in one continuous stream.
362
+ *
363
+ * The start is supplied via `opts.startAt`: `{ fromId }` resumes inclusively
364
+ * from a known event id, `{ fromBlock }` starts from a block height. Omitting
365
+ * `startAt` streams from the start of history. The indexer replays historical
366
+ * events from that point in monotonic `id` order, then continues live — there
367
+ * is no separate backfill query and no client-side dedup.
368
+ *
369
+ * `{ fromId }` is **inclusive**; to resume *after* the last seen event pass
370
+ * `{ fromId: lastSeenId + 1 }`.
371
+ *
372
+ * `filter.toBlock` completes the stream once the chain reaches that height;
373
+ * without it the stream runs until unsubscribed or the provider is disposed.
374
+ * Delivery is **at-least-once** across transport reconnects (the provider
375
+ * does not advance the cursor) — persisting consumers should dedup by `id`.
376
+ * Transport failures surface as an observable `error`, never a silent
377
+ * completion.
378
+ *
379
+ * @param filter The events to stream; `contractAddress` is required.
380
+ * @param opts Optional stream start.
381
+ */
382
+ contractEventsObservable(filter: ContractEventSubscriptionFilter, opts?: {
383
+ startAt?: ContractEventCursor;
384
+ }): Observable<ContractEvent>;
162
385
  }
163
386
  //# sourceMappingURL=public-data-provider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"public-data-provider.d.ts","sourceRoot":"","sources":["../src/public-data-provider.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sDAAsD,CAAC;AAC1F,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,aAAa,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AACrI,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,MAAM,CAAC;AAEvC,OAAO,KAAK,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AAE5E;;GAEG;AACH,MAAM,MAAM,GAAG,GAAG;IAChB,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAC;CACtB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,MAAM,GAAG;IACnB,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;CACzB,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB;;OAEG;IACH,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;CAC9B,CAAA;AAED;;;GAGG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,QAAQ,CAAC,IAAI,EAAE,aAAa,CAAC;IAC7B;;OAEG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B,CAAA;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,QAAQ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CAAC;IAEhF;;;;;OAKG;IACH,0BAA0B,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAE1F;;;;;;;;;;;;;OAaG;IACH,oBAAoB,CAAC,eAAe,EAAE,eAAe,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAEjF;;;;;;;;;;;;;;;;;;OAkBG;IACH,cAAc,CAAC,IAAI,EAAE,aAAa,GAAG,OAAO,CAAC,eAAe,CAAC,CAAC;IAE9D;;;;;;OAMG;IACH,uBAAuB,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,6BAA6B,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IAEpH;;;;;;OAMG;IACH,4BAA4B,CAAC,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,6BAA6B,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC;IAE9H;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,mBAAmB,CAAC,MAAM,EAAE,wBAAwB,EAAE,IAAI,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,aAAa,EAAE,CAAC,CAAC;IAE3G;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,wBAAwB,CACtB,MAAM,EAAE,+BAA+B,EACvC,IAAI,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,mBAAmB,CAAA;KAAE,GACvC,UAAU,CAAC,aAAa,CAAC,CAAC;CAC9B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@midnight-ntwrk/midnight-js-types",
3
- "version": "4.1.1",
3
+ "version": "5.0.0-alpha.1",
4
4
  "description": "Shared data types and interfaces for MidnightJS modules",
5
5
  "main": "dist/index.cjs",
6
6
  "module": "dist/index.mjs",
@@ -29,7 +29,7 @@
29
29
  "dist/"
30
30
  ],
31
31
  "dependencies": {
32
- "@midnight-ntwrk/midnight-js-protocol": "4.1.1",
32
+ "@midnight-ntwrk/midnight-js-protocol": "5.0.0-alpha.1",
33
33
  "effect": "^3.20.0",
34
34
  "pino": "^10.3.1",
35
35
  "rxjs": "^7.8.2"