@d9-network/spec 0.0.12 → 0.0.13

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.cts CHANGED
@@ -9,12 +9,12 @@ import { KeyPair } from "@polkadot-labs/hdkd-helpers";
9
9
  //#region rolldown:runtime
10
10
  //#endregion
11
11
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+14313b0e56f5ab4e/node_modules/@polkadot-api/descriptors/dist/common-types.d.ts
12
- type AnonymousEnum$9<T extends {}> = T & {
12
+ type AnonymousEnum$9<T$1 extends {}> = T$1 & {
13
13
  __anonymous: true;
14
14
  };
15
- type MyTuple$9<T> = [T, ...T[]];
16
- type SeparateUndefined$9<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
17
- type Anonymize$9<T> = SeparateUndefined$9<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum$9<infer V> ? Enum<V> : T extends MyTuple$9<any> ? { [K in keyof T]: T[K] } : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : { [K in keyof T & string]: T[K] }>;
15
+ type MyTuple$9<T$1> = [T$1, ...T$1[]];
16
+ type SeparateUndefined$9<T$1> = undefined extends T$1 ? undefined | Exclude<T$1, undefined> : T$1;
17
+ type Anonymize$9<T$1> = SeparateUndefined$9<T$1 extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T$1 extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T$1 : T$1 extends AnonymousEnum$9<infer V> ? Enum<V> : T$1 extends MyTuple$9<any> ? { [K in keyof T$1]: T$1[K] } : T$1 extends [] ? [] : T$1 extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T$1> : FixedSizeArray<L, T$1> : { [K in keyof T$1 & string]: T$1[K] }>;
18
18
  type Ic5m5lp1oioo8r = Array<FixedSizeBinary<32>>;
19
19
  type Ihfphjolmsqq1 = (SS58String$1) | undefined;
20
20
  type Idrurqd6ddlmr3 = {
@@ -3376,12 +3376,12 @@ type I1q6j2f64t5q87 = {
3376
3376
  };
3377
3377
  //#endregion
3378
3378
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+14313b0e56f5ab4e/node_modules/@polkadot-api/descriptors/dist/d9.d.ts
3379
- type AnonymousEnum$8<T extends {}> = T & {
3379
+ type AnonymousEnum$8<T$1 extends {}> = T$1 & {
3380
3380
  __anonymous: true;
3381
3381
  };
3382
- type MyTuple$8<T> = [T, ...T[]];
3383
- type SeparateUndefined$8<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
3384
- type Anonymize$8<T> = SeparateUndefined$8<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum$8<infer V> ? Enum<V> : T extends MyTuple$8<any> ? { [K in keyof T]: T[K] } : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : { [K in keyof T & string]: T[K] }>;
3382
+ type MyTuple$8<T$1> = [T$1, ...T$1[]];
3383
+ type SeparateUndefined$8<T$1> = undefined extends T$1 ? undefined | Exclude<T$1, undefined> : T$1;
3384
+ type Anonymize$8<T$1> = SeparateUndefined$8<T$1 extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T$1 extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T$1 : T$1 extends AnonymousEnum$8<infer V> ? Enum<V> : T$1 extends MyTuple$8<any> ? { [K in keyof T$1]: T$1[K] } : T$1 extends [] ? [] : T$1 extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T$1> : FixedSizeArray<L, T$1> : { [K in keyof T$1 & string]: T$1[K] }>;
3385
3385
  type IStorage = {
3386
3386
  Aura: {
3387
3387
  /**
@@ -6713,12 +6713,12 @@ type PalletKey = `*.${({ [K in keyof AllInteractions]: K extends 'apis' ? never
6713
6713
  type NestedKey<D extends Record<string, string[]>> = "*" | { [P in keyof D & string]: `${P}.*` | `${P}.${D[P][number]}` }[keyof D & string];
6714
6714
  //#endregion
6715
6715
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+14313b0e56f5ab4e/node_modules/@polkadot-api/descriptors/dist/contracts/nodeReward.d.ts
6716
- type AnonymousEnum$7<T extends {}> = T & {
6716
+ type AnonymousEnum$7<T$1 extends {}> = T$1 & {
6717
6717
  __anonymous: true;
6718
6718
  };
6719
- type MyTuple$7<T> = [T, ...T[]];
6720
- type SeparateUndefined$7<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
6721
- type Anonymize$7<T> = SeparateUndefined$7<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum$7<infer V> ? Enum<V> : T extends MyTuple$7<any> ? { [K in keyof T]: T[K] } : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : { [K in keyof T & string]: T[K] }>;
6719
+ type MyTuple$7<T$1> = [T$1, ...T$1[]];
6720
+ type SeparateUndefined$7<T$1> = undefined extends T$1 ? undefined | Exclude<T$1, undefined> : T$1;
6721
+ type Anonymize$7<T$1> = SeparateUndefined$7<T$1 extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T$1 extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T$1 : T$1 extends AnonymousEnum$7<infer V> ? Enum<V> : T$1 extends MyTuple$7<any> ? { [K in keyof T$1]: T$1[K] } : T$1 extends [] ? [] : T$1 extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T$1> : FixedSizeArray<L, T$1> : { [K in keyof T$1 & string]: T$1[K] }>;
6722
6722
  type T0$7 = ResultPayload<undefined, Anonymize$7<T1$7>>;
6723
6723
  type T1$7 = Enum<{
6724
6724
  "CouldNotReadInput": undefined;
@@ -6880,12 +6880,12 @@ type EventDescriptor$7 = Enum<{
6880
6880
  declare const descriptor$7: InkDescriptors<StorageDescriptor$8, MessagesDescriptor$7, ConstructorsDescriptor$7, EventDescriptor$7>;
6881
6881
  //#endregion
6882
6882
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+14313b0e56f5ab4e/node_modules/@polkadot-api/descriptors/dist/contracts/merchantMining.d.ts
6883
- type AnonymousEnum$6<T extends {}> = T & {
6883
+ type AnonymousEnum$6<T$1 extends {}> = T$1 & {
6884
6884
  __anonymous: true;
6885
6885
  };
6886
- type MyTuple$6<T> = [T, ...T[]];
6887
- type SeparateUndefined$6<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
6888
- type Anonymize$6<T> = SeparateUndefined$6<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum$6<infer V> ? Enum<V> : T extends MyTuple$6<any> ? { [K in keyof T]: T[K] } : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : { [K in keyof T & string]: T[K] }>;
6886
+ type MyTuple$6<T$1> = [T$1, ...T$1[]];
6887
+ type SeparateUndefined$6<T$1> = undefined extends T$1 ? undefined | Exclude<T$1, undefined> : T$1;
6888
+ type Anonymize$6<T$1> = SeparateUndefined$6<T$1 extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T$1 extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T$1 : T$1 extends AnonymousEnum$6<infer V> ? Enum<V> : T$1 extends MyTuple$6<any> ? { [K in keyof T$1]: T$1[K] } : T$1 extends [] ? [] : T$1 extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T$1> : FixedSizeArray<L, T$1> : { [K in keyof T$1 & string]: T$1[K] }>;
6889
6889
  type T0$6 = ResultPayload<undefined, Anonymize$6<T1$6>>;
6890
6890
  type T1$6 = Enum<{
6891
6891
  "CouldNotReadInput": undefined;
@@ -7138,12 +7138,12 @@ type EventDescriptor$6 = Enum<{
7138
7138
  declare const descriptor$6: InkDescriptors<StorageDescriptor$7, MessagesDescriptor$6, ConstructorsDescriptor$6, EventDescriptor$6>;
7139
7139
  //#endregion
7140
7140
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+14313b0e56f5ab4e/node_modules/@polkadot-api/descriptors/dist/contracts/usdt.d.ts
7141
- type AnonymousEnum$5<T extends {}> = T & {
7141
+ type AnonymousEnum$5<T$1 extends {}> = T$1 & {
7142
7142
  __anonymous: true;
7143
7143
  };
7144
- type MyTuple$5<T> = [T, ...T[]];
7145
- type SeparateUndefined$5<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
7146
- type Anonymize$5<T> = SeparateUndefined$5<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum$5<infer V> ? Enum<V> : T extends MyTuple$5<any> ? { [K in keyof T]: T[K] } : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : { [K in keyof T & string]: T[K] }>;
7144
+ type MyTuple$5<T$1> = [T$1, ...T$1[]];
7145
+ type SeparateUndefined$5<T$1> = undefined extends T$1 ? undefined | Exclude<T$1, undefined> : T$1;
7146
+ type Anonymize$5<T$1> = SeparateUndefined$5<T$1 extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T$1 extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T$1 : T$1 extends AnonymousEnum$5<infer V> ? Enum<V> : T$1 extends MyTuple$5<any> ? { [K in keyof T$1]: T$1[K] } : T$1 extends [] ? [] : T$1 extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T$1> : FixedSizeArray<L, T$1> : { [K in keyof T$1 & string]: T$1[K] }>;
7147
7147
  type T0$5 = Enum<{
7148
7148
  "CouldNotReadInput": undefined;
7149
7149
  }>;
@@ -7278,12 +7278,12 @@ type EventDescriptor$5 = Enum<{
7278
7278
  declare const descriptor$5: InkDescriptors<StorageDescriptor$6, MessagesDescriptor$5, ConstructorsDescriptor$5, EventDescriptor$5>;
7279
7279
  //#endregion
7280
7280
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+14313b0e56f5ab4e/node_modules/@polkadot-api/descriptors/dist/contracts/burnManager.d.ts
7281
- type AnonymousEnum$4<T extends {}> = T & {
7281
+ type AnonymousEnum$4<T$1 extends {}> = T$1 & {
7282
7282
  __anonymous: true;
7283
7283
  };
7284
- type MyTuple$4<T> = [T, ...T[]];
7285
- type SeparateUndefined$4<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
7286
- type Anonymize$4<T> = SeparateUndefined$4<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum$4<infer V> ? Enum<V> : T extends MyTuple$4<any> ? { [K in keyof T]: T[K] } : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : { [K in keyof T & string]: T[K] }>;
7284
+ type MyTuple$4<T$1> = [T$1, ...T$1[]];
7285
+ type SeparateUndefined$4<T$1> = undefined extends T$1 ? undefined | Exclude<T$1, undefined> : T$1;
7286
+ type Anonymize$4<T$1> = SeparateUndefined$4<T$1 extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T$1 extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T$1 : T$1 extends AnonymousEnum$4<infer V> ? Enum<V> : T$1 extends MyTuple$4<any> ? { [K in keyof T$1]: T$1[K] } : T$1 extends [] ? [] : T$1 extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T$1> : FixedSizeArray<L, T$1> : { [K in keyof T$1 & string]: T$1[K] }>;
7287
7287
  type T0$4 = Array<SS58String$1>;
7288
7288
  type T1$4 = ResultPayload<undefined, Anonymize$4<T2$4>>;
7289
7289
  type T2$4 = Enum<{
@@ -7456,12 +7456,12 @@ type EventDescriptor$4 = Enum<{
7456
7456
  declare const descriptor$4: InkDescriptors<StorageDescriptor$5, MessagesDescriptor$4, ConstructorsDescriptor$4, EventDescriptor$4>;
7457
7457
  //#endregion
7458
7458
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+14313b0e56f5ab4e/node_modules/@polkadot-api/descriptors/dist/contracts/crossChainTransfer.d.ts
7459
- type AnonymousEnum$3<T extends {}> = T & {
7459
+ type AnonymousEnum$3<T$1 extends {}> = T$1 & {
7460
7460
  __anonymous: true;
7461
7461
  };
7462
- type MyTuple$3<T> = [T, ...T[]];
7463
- type SeparateUndefined$3<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
7464
- type Anonymize$3<T> = SeparateUndefined$3<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum$3<infer V> ? Enum<V> : T extends MyTuple$3<any> ? { [K in keyof T]: T[K] } : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : { [K in keyof T & string]: T[K] }>;
7462
+ type MyTuple$3<T$1> = [T$1, ...T$1[]];
7463
+ type SeparateUndefined$3<T$1> = undefined extends T$1 ? undefined | Exclude<T$1, undefined> : T$1;
7464
+ type Anonymize$3<T$1> = SeparateUndefined$3<T$1 extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T$1 extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T$1 : T$1 extends AnonymousEnum$3<infer V> ? Enum<V> : T$1 extends MyTuple$3<any> ? { [K in keyof T$1]: T$1[K] } : T$1 extends [] ? [] : T$1 extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T$1> : FixedSizeArray<L, T$1> : { [K in keyof T$1 & string]: T$1[K] }>;
7465
7465
  type T5$2 = Array<SS58String$1>;
7466
7466
  type T0$3 = ResultPayload<undefined, Anonymize$3<T1$3>>;
7467
7467
  type T1$3 = Enum<{
@@ -7700,12 +7700,12 @@ type EventDescriptor$3 = Enum<{
7700
7700
  declare const descriptor$3: InkDescriptors<StorageDescriptor$4, MessagesDescriptor$3, ConstructorsDescriptor$3, EventDescriptor$3>;
7701
7701
  //#endregion
7702
7702
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+14313b0e56f5ab4e/node_modules/@polkadot-api/descriptors/dist/contracts/marketMaker.d.ts
7703
- type AnonymousEnum$2<T extends {}> = T & {
7703
+ type AnonymousEnum$2<T$1 extends {}> = T$1 & {
7704
7704
  __anonymous: true;
7705
7705
  };
7706
- type MyTuple$2<T> = [T, ...T[]];
7707
- type SeparateUndefined$2<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
7708
- type Anonymize$2<T> = SeparateUndefined$2<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum$2<infer V> ? Enum<V> : T extends MyTuple$2<any> ? { [K in keyof T]: T[K] } : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : { [K in keyof T & string]: T[K] }>;
7706
+ type MyTuple$2<T$1> = [T$1, ...T$1[]];
7707
+ type SeparateUndefined$2<T$1> = undefined extends T$1 ? undefined | Exclude<T$1, undefined> : T$1;
7708
+ type Anonymize$2<T$1> = SeparateUndefined$2<T$1 extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T$1 extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T$1 : T$1 extends AnonymousEnum$2<infer V> ? Enum<V> : T$1 extends MyTuple$2<any> ? { [K in keyof T$1]: T$1[K] } : T$1 extends [] ? [] : T$1 extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T$1> : FixedSizeArray<L, T$1> : { [K in keyof T$1 & string]: T$1[K] }>;
7709
7709
  type T0$2 = ResultPayload<undefined, Anonymize$2<T1$2>>;
7710
7710
  type T1$2 = Enum<{
7711
7711
  "CouldNotReadInput": undefined;
@@ -7904,12 +7904,12 @@ type EventDescriptor$2 = Enum<{
7904
7904
  declare const descriptor$2: InkDescriptors<StorageDescriptor$3, MessagesDescriptor$2, ConstructorsDescriptor$2, EventDescriptor$2>;
7905
7905
  //#endregion
7906
7906
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+14313b0e56f5ab4e/node_modules/@polkadot-api/descriptors/dist/contracts/burnMining.d.ts
7907
- type AnonymousEnum$1<T extends {}> = T & {
7907
+ type AnonymousEnum$1<T$1 extends {}> = T$1 & {
7908
7908
  __anonymous: true;
7909
7909
  };
7910
- type MyTuple$1<T> = [T, ...T[]];
7911
- type SeparateUndefined$1<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
7912
- type Anonymize$1<T> = SeparateUndefined$1<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum$1<infer V> ? Enum<V> : T extends MyTuple$1<any> ? { [K in keyof T]: T[K] } : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : { [K in keyof T & string]: T[K] }>;
7910
+ type MyTuple$1<T$1> = [T$1, ...T$1[]];
7911
+ type SeparateUndefined$1<T$1> = undefined extends T$1 ? undefined | Exclude<T$1, undefined> : T$1;
7912
+ type Anonymize$1<T$1> = SeparateUndefined$1<T$1 extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T$1 extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T$1 : T$1 extends AnonymousEnum$1<infer V> ? Enum<V> : T$1 extends MyTuple$1<any> ? { [K in keyof T$1]: T$1[K] } : T$1 extends [] ? [] : T$1 extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T$1> : FixedSizeArray<L, T$1> : { [K in keyof T$1 & string]: T$1[K] }>;
7913
7913
  type T0$1 = ResultPayload<undefined, Anonymize$1<T1$1>>;
7914
7914
  type T1$1 = Enum<{
7915
7915
  "CouldNotReadInput": undefined;
@@ -8083,12 +8083,12 @@ type EventDescriptor$1 = Enum<{}>;
8083
8083
  declare const descriptor$1: InkDescriptors<StorageDescriptor$2, MessagesDescriptor$1, ConstructorsDescriptor$1, EventDescriptor$1>;
8084
8084
  //#endregion
8085
8085
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+14313b0e56f5ab4e/node_modules/@polkadot-api/descriptors/dist/contracts/miningPool.d.ts
8086
- type AnonymousEnum<T extends {}> = T & {
8086
+ type AnonymousEnum<T$1 extends {}> = T$1 & {
8087
8087
  __anonymous: true;
8088
8088
  };
8089
- type MyTuple<T> = [T, ...T[]];
8090
- type SeparateUndefined<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
8091
- type Anonymize<T> = SeparateUndefined<T extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T : T extends AnonymousEnum<infer V> ? Enum<V> : T extends MyTuple<any> ? { [K in keyof T]: T[K] } : T extends [] ? [] : T extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T> : FixedSizeArray<L, T> : { [K in keyof T & string]: T[K] }>;
8089
+ type MyTuple<T$1> = [T$1, ...T$1[]];
8090
+ type SeparateUndefined<T$1> = undefined extends T$1 ? undefined | Exclude<T$1, undefined> : T$1;
8091
+ type Anonymize<T$1> = SeparateUndefined<T$1 extends FixedSizeBinary<infer L> ? number extends L ? Binary : FixedSizeBinary<L> : T$1 extends string | number | bigint | boolean | void | undefined | null | symbol | Uint8Array | Enum<any> ? T$1 : T$1 extends AnonymousEnum<infer V> ? Enum<V> : T$1 extends MyTuple<any> ? { [K in keyof T$1]: T$1[K] } : T$1 extends [] ? [] : T$1 extends FixedSizeArray<infer L, infer T> ? number extends L ? Array<T$1> : FixedSizeArray<L, T$1> : { [K in keyof T$1 & string]: T$1[K] }>;
8092
8092
  type T0 = ResultPayload<undefined, Anonymize<T1>>;
8093
8093
  type T1 = Enum<{
8094
8094
  "CouldNotReadInput": undefined;
@@ -8300,13 +8300,37 @@ interface RawContractEvent {
8300
8300
  topics: Uint8Array[];
8301
8301
  }
8302
8302
  /**
8303
- * Decoded contract event
8303
+ * Extract the definition object from an Enum type or InkEvent type
8304
+ * e.g. ExtractEnumDef<Enum<{A: X, B: Y}>> = {A: X, B: Y}
8305
+ *
8306
+ * For non-Enum types (e.g., InkEvent { type: string; value: unknown }),
8307
+ * returns a generic event definition.
8308
+ */
8309
+
8310
+ /**
8311
+ * Type-safe contract event with discriminated union
8312
+ * Enables type narrowing: `if (event.type === "Transfer") { event.value.from }`
8313
+ */
8314
+ type TypedContractEvent<E extends Event> = E extends Enum<infer T> ? { [K in keyof T & string]: {
8315
+ /** Event type (discriminant for type narrowing) */
8316
+ type: K;
8317
+ /** Decoded event data (type-safe based on event type) */
8318
+ value: T[K];
8319
+ /** Original raw event */
8320
+ raw: RawContractEvent;
8321
+ } }[keyof T & string] : {
8322
+ type: string;
8323
+ value: unknown;
8324
+ raw: RawContractEvent;
8325
+ };
8326
+ /**
8327
+ * Decoded contract event (legacy, use TypedContractEvent for type safety)
8304
8328
  */
8305
- interface DecodedContractEvent<T = unknown> {
8329
+ interface DecodedContractEvent<T$1 = unknown> {
8306
8330
  /** Event label from metadata (e.g., "Transfer", "Approval") */
8307
8331
  label: string;
8308
8332
  /** Decoded event data */
8309
- data: T;
8333
+ data: T$1;
8310
8334
  /** Original raw event */
8311
8335
  raw: RawContractEvent;
8312
8336
  }
@@ -8323,6 +8347,20 @@ interface EventFilterOptions {
8323
8347
  /** To block number (inclusive) */
8324
8348
  toBlock?: number;
8325
8349
  }
8350
+ /**
8351
+ * Type-safe event filter options with literal event labels
8352
+ * Provides compile-time validation of event label names
8353
+ *
8354
+ * @typeParam E - The event type representing all possible events
8355
+ *
8356
+ * @example
8357
+ * ```ts
8358
+ * const options: TypedEventFilterOptions<typeof contracts.usdt.__types.event> = {
8359
+ * eventLabels: ["Transfer", "Approval"], // Must be valid event names
8360
+ * };
8361
+ * ```
8362
+ */
8363
+
8326
8364
  /**
8327
8365
  * Event subscription options
8328
8366
  */
@@ -8350,9 +8388,76 @@ interface EventSubscriptionOptions {
8350
8388
  getEvents: (blockHash: string) => Promise<unknown[]>;
8351
8389
  }
8352
8390
  //#endregion
8353
- //#region src/types.d.ts
8391
+ //#region src/call-types.d.ts
8392
+ /**
8393
+ * Raw call data from a transaction
8394
+ */
8395
+
8396
+ /**
8397
+ * Extract message labels as a union type from InkCallableDescriptor
8398
+ * e.g. ExtractMessageLabels<Messages> = "PSP22::transfer" | "PSP22::balance_of" | ...
8399
+ */
8400
+ type ExtractMessageLabels<M$1 extends InkCallableDescriptor> = keyof M$1 & string;
8401
+ /**
8402
+ * Type-safe parsed contract call with discriminated union
8403
+ * Enables type narrowing: `if (call.type === "PSP22::transfer") { call.args.to }`
8404
+ */
8405
+
8406
+ //#endregion
8407
+ //#region src/message-builder.d.ts
8408
+ /**
8409
+ * Message attributes from metadata
8410
+ */
8411
+ interface MessageAttributes {
8412
+ /** Whether the message mutates state */
8413
+ mutates: boolean;
8414
+ /** Whether the message is payable */
8415
+ payable: boolean;
8416
+ /** Whether this is the default message */
8417
+ default: boolean;
8418
+ }
8419
+ /**
8420
+ * Type-safe message interface with encode/decode methods
8421
+ *
8422
+ * @typeParam M - The InkCallableDescriptor type (message definitions)
8423
+ * @typeParam L - The specific message label
8424
+ */
8425
+ interface TypedMessage<M$1 extends InkCallableDescriptor, L$1 extends keyof M$1 & string> {
8426
+ /**
8427
+ * Encode message arguments to Binary
8428
+ *
8429
+ * @param args - The message arguments (fully typed)
8430
+ * @returns Encoded call data as Binary
8431
+ *
8432
+ * @example
8433
+ * ```ts
8434
+ * const transfer = builder.message("PSP22::transfer");
8435
+ * const encoded = transfer.encode({
8436
+ * to: recipientAddress,
8437
+ * value: 1000n,
8438
+ * data: new Uint8Array(),
8439
+ * });
8440
+ * ```
8441
+ */
8442
+ encode: {} extends M$1[L$1]["message"] ? (args?: M$1[L$1]["message"]) => Binary : (args: M$1[L$1]["message"]) => Binary;
8443
+ /**
8444
+ * Decode response to typed value
8445
+ *
8446
+ * @param response - The response data
8447
+ * @returns Decoded response value
8448
+ */
8449
+ decode: (response: Binary | Uint8Array) => M$1[L$1]["response"];
8450
+ /** Message attributes (mutates, payable, default) */
8451
+ attributes: MessageAttributes;
8452
+ /** 4-byte selector */
8453
+ selector: Uint8Array;
8454
+ /** Message label */
8455
+ label: L$1;
8456
+ }
8354
8457
  /**
8355
- * Decoder type for response decoding
8458
+ * Contract message builder interface
8459
+ *
8460
+ * @typeParam M - The InkCallableDescriptor type (message definitions)
8356
8461
  */
8357
8462
 
8358
8463
  /**
@@ -8393,16 +8498,16 @@ interface SendOptions<Args = unknown> {
8393
8498
  /**
8394
8499
  * Sendable transaction that can be signed and submitted
8395
8500
  */
8396
- interface SendableTransaction<T> {
8501
+ interface SendableTransaction<T$1> {
8397
8502
  /** Sign and submit the transaction */
8398
- signAndSubmit(signer: PolkadotSigner$1): Promise<TxResult<T>>;
8503
+ signAndSubmit(signer: PolkadotSigner$1): Promise<TxResult<T$1>>;
8399
8504
  /** Get the encoded call data */
8400
8505
  getEncodedData(): Uint8Array;
8401
8506
  }
8402
8507
  /**
8403
8508
  * Transaction result
8404
8509
  */
8405
- interface TxResult<T> {
8510
+ interface TxResult<T$1> {
8406
8511
  /** Whether the transaction was successful */
8407
8512
  ok: boolean;
8408
8513
  /** Transaction hash */
@@ -8413,7 +8518,7 @@ interface TxResult<T> {
8413
8518
  number: number;
8414
8519
  };
8415
8520
  /** Decoded return value (if any) */
8416
- result?: T;
8521
+ result?: T$1;
8417
8522
  /** Events emitted by the transaction */
8418
8523
  events: unknown[];
8419
8524
  /** Dispatch error if failed */
@@ -8422,9 +8527,9 @@ interface TxResult<T> {
8422
8527
  /**
8423
8528
  * Successful query result value
8424
8529
  */
8425
- interface QuerySuccessValue<T> {
8530
+ interface QuerySuccessValue<T$1> {
8426
8531
  /** The decoded response from the contract */
8427
- value: T;
8532
+ value: T$1;
8428
8533
  /** Events that would be emitted */
8429
8534
  events: unknown[];
8430
8535
  /** Gas consumed during dry-run */
@@ -8440,16 +8545,16 @@ interface QuerySuccessValue<T> {
8440
8545
  /** Storage deposit required */
8441
8546
  storageDeposit: bigint;
8442
8547
  /** Create a sendable transaction from this query result */
8443
- send(): SendableTransaction<T>;
8548
+ send(): SendableTransaction<T$1>;
8444
8549
  }
8445
8550
  /**
8446
8551
  * Query result - discriminated union for success/failure
8447
8552
  * On success: QuerySuccessValue fields are spread to the same level as success
8448
8553
  * On failure: error field contains the ContractError
8449
8554
  */
8450
- type QueryResult<T> = ({
8555
+ type QueryResult<T$1> = ({
8451
8556
  success: true;
8452
- } & QuerySuccessValue<T>) | {
8557
+ } & QuerySuccessValue<T$1>) | {
8453
8558
  success: false;
8454
8559
  error: ContractError;
8455
8560
  };
@@ -8490,9 +8595,9 @@ type InkLangError = {
8490
8595
  * ink! MessageResult type pattern (Result<T, LangError>)
8491
8596
  * papi generates this as { success: true; value: T } | { success: false; value: LangError }
8492
8597
  */
8493
- type InkMessageResult<T> = {
8598
+ type InkMessageResult<T$1> = {
8494
8599
  success: true;
8495
- value: T;
8600
+ value: T$1;
8496
8601
  } | {
8497
8602
  success: false;
8498
8603
  value: unknown;
@@ -8502,15 +8607,18 @@ type InkMessageResult<T> = {
8502
8607
  * 1. Extract T from { success: true; value: T } | { success: false; value: ... }
8503
8608
  * 2. Exclude LangError variants from T
8504
8609
  */
8505
- type UnwrapMessageResult<T> = T extends InkMessageResult<infer U> ? Exclude<U, InkLangError> : T;
8610
+ type UnwrapMessageResult<T$1> = T$1 extends InkMessageResult<infer U> ? Exclude<U, InkLangError> : T$1;
8506
8611
  /**
8507
8612
  * Type helper to extract message response type (with MessageResult unwrapped)
8508
8613
  */
8509
8614
  type MessageResponse<M$1 extends InkCallableDescriptor, K$1 extends keyof M$1> = UnwrapMessageResult<M$1[K$1]["response"]>;
8510
8615
  /**
8511
8616
  * D9 Ink Contract interface
8617
+ *
8618
+ * @typeParam M - The callable descriptor type (message definitions)
8619
+ * @typeParam E - The event type for type-safe event filtering
8512
8620
  */
8513
- interface D9InkContract<M$1 extends InkCallableDescriptor> {
8621
+ interface D9InkContract<M$1 extends InkCallableDescriptor, E extends Event = Event> {
8514
8622
  /** Contract address */
8515
8623
  readonly address: SS58String$1;
8516
8624
  /** Contract metadata */
@@ -8533,13 +8641,69 @@ interface D9InkContract<M$1 extends InkCallableDescriptor> {
8533
8641
  getStorage(): ContractStorage;
8534
8642
  /**
8535
8643
  * Filter events from a transaction result to only include this contract's events
8644
+ * Returns type-safe events that can be narrowed using `event.type`
8645
+ *
8646
+ * @example
8647
+ * ```ts
8648
+ * const events = contract.filterEvents(txResult.events);
8649
+ * for (const event of events) {
8650
+ * if (event.type === "Transfer") {
8651
+ * console.log(event.value.from, event.value.to, event.value.value);
8652
+ * }
8653
+ * }
8654
+ * ```
8536
8655
  */
8537
- filterEvents(events: unknown[]): DecodedContractEvent[];
8656
+ filterEvents(events: unknown[]): TypedContractEvent<E>[];
8538
8657
  /**
8539
8658
  * Subscribe to contract events as an RxJS Observable
8540
8659
  * @param options - Event subscription options (event labels to filter, etc.)
8541
8660
  */
8542
- subscribeToEvents(options?: Omit<EventSubscriptionOptions, "contractAddress">): Observable<DecodedContractEvent>;
8661
+ subscribeToEvents(options?: Omit<EventSubscriptionOptions, "contractAddress">): Observable<TypedContractEvent<E>>;
8662
+ /**
8663
+ * Get a type-safe message builder for a specific message
8664
+ *
8665
+ * Provides a polkadot-api compatible API for encoding and decoding
8666
+ * contract messages with full TypeScript type inference.
8667
+ *
8668
+ * @param label - The message label (e.g., "PSP22::transfer")
8669
+ * @returns Typed message interface with encode/decode methods
8670
+ *
8671
+ * @example
8672
+ * ```ts
8673
+ * const transfer = contract.message("PSP22::transfer");
8674
+ *
8675
+ * // Encode with full type checking on args
8676
+ * const encoded = transfer.encode({
8677
+ * to: recipientAddress,
8678
+ * value: 1000000n,
8679
+ * data: new Uint8Array(),
8680
+ * });
8681
+ *
8682
+ * // Decode response with full type inference
8683
+ * const decoded = transfer.decode(responseBytes);
8684
+ * ```
8685
+ */
8686
+ message<L$1 extends ExtractMessageLabels<M$1>>(label: L$1): TypedMessage<M$1, L$1>;
8687
+ /**
8688
+ * Filter events by specific type with proper type narrowing
8689
+ *
8690
+ * @param events - Array of chain events to filter
8691
+ * @param label - The event label to filter by
8692
+ * @returns Array of events narrowed to the specific type
8693
+ *
8694
+ * @example
8695
+ * ```ts
8696
+ * const transfers = contract.filterEventsByType(txResult.events, "Transfer");
8697
+ *
8698
+ * for (const t of transfers) {
8699
+ * // t.value is fully typed as Transfer event data
8700
+ * console.log(t.value.from, "->", t.value.to, ":", t.value.value);
8701
+ * }
8702
+ * ```
8703
+ */
8704
+ filterEventsByType<L$1 extends string>(events: unknown[], label: L$1): Array<TypedContractEvent<E> & {
8705
+ type: L$1;
8706
+ }>;
8543
8707
  }
8544
8708
  /**
8545
8709
  * D9 Ink SDK options
@@ -8554,29 +8718,284 @@ interface D9InkSdk {
8554
8718
  * @param descriptor - The contract descriptor from @polkadot-api/descriptors
8555
8719
  * @param address - The contract address (SS58 format)
8556
8720
  */
8557
- getContract<S extends InkStorageDescriptor, M$1 extends InkCallableDescriptor, C extends InkCallableDescriptor, E extends Event>(descriptor: InkDescriptors$1<S, M$1, C, E>, address: SS58String$1): D9InkContract<M$1>;
8721
+ getContract<S extends InkStorageDescriptor, M$1 extends InkCallableDescriptor, C extends InkCallableDescriptor, E extends Event>(descriptor: InkDescriptors$1<S, M$1, C, E>, address: SS58String$1): D9InkContract<M$1, E>;
8558
8722
  }
8723
+ /**
8724
+ * Type helper to extract D9InkContract type from an InkDescriptors
8725
+ */
8726
+
8727
+ //#endregion
8728
+ //#region src/rpc-types.d.ts
8729
+ /**
8730
+ * Block header structure
8731
+ */
8732
+ interface BlockHeader {
8733
+ parentHash: HexString$1;
8734
+ number: HexString$1;
8735
+ stateRoot: HexString$1;
8736
+ extrinsicsRoot: HexString$1;
8737
+ digest: {
8738
+ logs: HexString$1[];
8739
+ };
8740
+ }
8741
+ /**
8742
+ * System health information
8743
+ */
8744
+ interface SystemHealth {
8745
+ peers: number;
8746
+ isSyncing: boolean;
8747
+ shouldHavePeers: boolean;
8748
+ }
8749
+ /**
8750
+ * Runtime version information
8751
+ */
8752
+ interface RuntimeVersion {
8753
+ specName: string;
8754
+ implName: string;
8755
+ authoringVersion: number;
8756
+ specVersion: number;
8757
+ implVersion: number;
8758
+ apis: [HexString$1, number][];
8759
+ transactionVersion: number;
8760
+ stateVersion: number;
8761
+ }
8762
+ /**
8763
+ * Storage change set
8764
+ */
8765
+ interface StorageChangeSet {
8766
+ block: HexString$1;
8767
+ changes: [HexString$1, HexString$1 | null][];
8768
+ }
8769
+ /**
8770
+ * RPC method signatures: method name -> [params tuple, return type]
8771
+ *
8772
+ * This interface maps known Substrate RPC methods to their parameter and return types.
8773
+ * Methods not in this list will fall back to unknown types.
8774
+ */
8775
+ interface SubstrateRpcMethods {
8776
+ chain_getBlockHash: [[blockNumber?: number], HexString$1 | null];
8777
+ chain_getHeader: [[hash?: HexString$1], BlockHeader | null];
8778
+ chain_getBlock: [[hash?: HexString$1], {
8779
+ block: {
8780
+ header: BlockHeader;
8781
+ extrinsics: HexString$1[];
8782
+ };
8783
+ justifications: unknown;
8784
+ } | null];
8785
+ chain_getFinalizedHead: [[], HexString$1];
8786
+ state_call: [[method: string, data: HexString$1, at?: HexString$1], HexString$1];
8787
+ state_getStorage: [[key: HexString$1, at?: HexString$1], HexString$1 | null];
8788
+ state_getStorageAt: [[key: HexString$1, at: HexString$1], HexString$1 | null];
8789
+ state_getStorageHash: [[key: HexString$1, at?: HexString$1], HexString$1 | null];
8790
+ state_getStorageSize: [[key: HexString$1, at?: HexString$1], number | null];
8791
+ state_getMetadata: [[at?: HexString$1], HexString$1];
8792
+ state_getRuntimeVersion: [[at?: HexString$1], RuntimeVersion];
8793
+ state_queryStorageAt: [[keys: HexString$1[], at?: HexString$1], StorageChangeSet[]];
8794
+ system_chain: [[], string];
8795
+ system_name: [[], string];
8796
+ system_version: [[], string];
8797
+ system_health: [[], SystemHealth];
8798
+ system_properties: [[], Record<string, unknown>];
8799
+ system_peers: [[], {
8800
+ peerId: string;
8801
+ roles: string;
8802
+ bestHash: HexString$1;
8803
+ bestNumber: number;
8804
+ }[]];
8805
+ system_chainType: [[], string];
8806
+ author_submitExtrinsic: [[extrinsic: HexString$1], HexString$1];
8807
+ author_pendingExtrinsics: [[], HexString$1[]];
8808
+ author_removeExtrinsic: [[bytesOrHash: (HexString$1 | {
8809
+ Hash: HexString$1;
8810
+ })[]], number];
8811
+ payment_queryInfo: [[extrinsic: HexString$1, at?: HexString$1], {
8812
+ weight: {
8813
+ refTime: number;
8814
+ proofSize: number;
8815
+ };
8816
+ class: string;
8817
+ partialFee: string;
8818
+ }];
8819
+ payment_queryFeeDetails: [[extrinsic: HexString$1, at?: HexString$1], {
8820
+ inclusionFee: {
8821
+ baseFee: string;
8822
+ lenFee: string;
8823
+ adjustedWeightFee: string;
8824
+ } | null;
8825
+ }];
8826
+ }
8827
+ /**
8828
+ * Known RPC method names (for autocomplete)
8829
+ */
8830
+ type KnownRpcMethod = keyof SubstrateRpcMethods;
8831
+ /**
8832
+ * Extract parameter types for a known RPC method
8833
+ */
8834
+ type RpcParams<M$1 extends KnownRpcMethod> = SubstrateRpcMethods[M$1][0];
8835
+ /**
8836
+ * Extract return type for a known RPC method
8837
+ */
8838
+ type RpcReturn<M$1 extends KnownRpcMethod> = SubstrateRpcMethods[M$1][1];
8839
+ /**
8840
+ * Type-safe RPC request interface
8841
+ *
8842
+ * Provides full type inference for known RPC methods while allowing
8843
+ * arbitrary method calls with explicit type parameters.
8844
+ *
8845
+ * @example
8846
+ * ```ts
8847
+ * // Known method: types are inferred
8848
+ * const hash = await rpc("chain_getBlockHash", [12345]);
8849
+ * // hash: HexString | null
8850
+ *
8851
+ * // Unknown method: provide explicit types
8852
+ * const result = await rpc<MyType>("custom_method", [arg1, arg2]);
8853
+ * ```
8854
+ */
8855
+ interface TypedRpcRequest {
8856
+ /**
8857
+ * Call a known RPC method with full type inference
8858
+ */
8859
+ <M$1 extends KnownRpcMethod>(method: M$1, params: RpcParams<M$1>): Promise<RpcReturn<M$1>>;
8860
+ /**
8861
+ * Call an unknown RPC method with explicit type parameters
8862
+ */
8863
+ <Reply = unknown, Params extends unknown[] = unknown[]>(method: string, params: Params): Promise<Reply>;
8864
+ }
8865
+ //#endregion
8866
+ //#region src/sdk.d.ts
8867
+ /**
8868
+ * Options for creating D9 Ink SDK
8869
+ */
8870
+
8871
+ /**
8872
+ * Extended D9 Ink SDK interface with typed RPC access
8873
+ */
8874
+ interface D9InkSdkWithRpc extends D9InkSdk {
8875
+ /**
8876
+ * Type-safe RPC request function
8877
+ *
8878
+ * Provides autocomplete for known Substrate RPC methods and type inference
8879
+ * for parameters and return values.
8880
+ *
8881
+ * @example
8882
+ * ```ts
8883
+ * // Known method with full type inference
8884
+ * const hash = await sdk.rpc("chain_getBlockHash", [12345]);
8885
+ * // hash: HexString | null
8886
+ *
8887
+ * // Custom method with explicit types
8888
+ * const custom = await sdk.rpc<MyType>("custom_method", [arg]);
8889
+ * ```
8890
+ */
8891
+ rpc: TypedRpcRequest;
8892
+ }
8893
+ /**
8894
+ * Create a D9 Ink SDK instance.
8895
+ *
8896
+ * This SDK provides a similar API to the official @polkadot-api/sdk-ink,
8897
+ * but uses state_call + ContractsApi_call instead of ReviveApi.
8898
+ *
8899
+ * @example
8900
+ * ```ts
8901
+ * import { createD9InkSdk } from "@d9-network/ink";
8902
+ * import { contracts } from "@polkadot-api/descriptors";
8903
+ *
8904
+ * const sdk = createD9InkSdk(client);
8905
+ * const usdtContract = sdk.getContract(
8906
+ * contracts.d9_usdt,
8907
+ * "uLj9DRUujbpCyK7USZY5ebGbxdtKoWvdRvGyyUsoLWDsNng"
8908
+ * );
8909
+ *
8910
+ * // Query balance
8911
+ * const result = await usdtContract.query("PSP22::balance_of", {
8912
+ * origin: aliceAddress,
8913
+ * args: { owner: aliceAddress }
8914
+ * });
8915
+ *
8916
+ * if (result.success) {
8917
+ * console.log("Balance:", result.value.response);
8918
+ *
8919
+ * // Send transaction from the query result
8920
+ * const txResult = await result.value.send().signAndSubmit(aliceSigner);
8921
+ * }
8922
+ *
8923
+ * // Or send directly
8924
+ * const txResult = await usdtContract
8925
+ * .send("PSP22::transfer", {
8926
+ * origin: aliceAddress,
8927
+ * args: { to: bobAddress, value: 1000n, data: [] }
8928
+ * })
8929
+ * .signAndSubmit(aliceSigner);
8930
+ * ```
8931
+ *
8932
+ * @param client - The PolkadotClient instance
8933
+ * @param options - Optional SDK configuration
8934
+ * @returns D9 Ink SDK instance with typed RPC access
8935
+ */
8936
+
8559
8937
  //#endregion
8560
8938
  //#region src/events.d.ts
8561
8939
  /**
8562
- * Event parser for a specific contract
8940
+ * Type-safe event parser for a specific contract
8941
+ *
8942
+ * @typeParam S - The storage descriptor type
8943
+ * @typeParam M - The messages descriptor type
8944
+ * @typeParam C - The constructors descriptor type
8945
+ * @typeParam E - The event type representing all possible events for this contract
8563
8946
  */
8564
- declare class ContractEventParser {
8947
+ declare class ContractEventParser<S extends InkStorageDescriptor = InkStorageDescriptor, M$1 extends InkCallableDescriptor = InkCallableDescriptor, C extends InkCallableDescriptor = InkCallableDescriptor, E extends Event = Event> {
8565
8948
  private eventDecoders;
8566
8949
  private eventSignatures;
8567
8950
  private contractAddressBytes;
8568
8951
  private contractAddress;
8569
8952
  private metadata;
8570
- constructor(metadata: InkMetadata, contractAddress: SS58String$1);
8953
+ constructor(descriptor: InkDescriptors$1<S, M$1, C, E>, contractAddress: SS58String$1);
8571
8954
  /**
8572
- * Parse a raw chain event into a contract event (if it matches)
8955
+ * Parse a raw chain event into a type-safe contract event (if it matches)
8573
8956
  * Returns null if the event is not from this contract or cannot be parsed
8957
+ *
8958
+ * @example
8959
+ * ```ts
8960
+ * const event = parser.parseEvent(chainEvent);
8961
+ * if (event?.type === "Transfer") {
8962
+ * // event.value is now typed as { from: SS58String; to: SS58String; value: bigint }
8963
+ * console.log(event.value.from);
8964
+ * }
8965
+ * ```
8574
8966
  */
8575
- parseEvent(chainEvent: unknown): DecodedContractEvent | null;
8967
+ parseEvent(chainEvent: unknown): TypedContractEvent<E> | null;
8576
8968
  /**
8577
- * Filter a batch of events
8969
+ * Filter a batch of events and return type-safe results
8970
+ *
8971
+ * @param chainEvents - Array of chain events to filter
8972
+ * @param options - Optional filter criteria
8973
+ * @returns Array of type-safe contract events
8578
8974
  */
8579
- filterEvents(chainEvents: unknown[], options?: EventFilterOptions): DecodedContractEvent[];
8975
+ filterEvents(chainEvents: unknown[], options?: EventFilterOptions): TypedContractEvent<E>[];
8976
+ /**
8977
+ * Filter events by specific type with proper type narrowing
8978
+ *
8979
+ * This method provides better type safety than filterEvents with eventLabels
8980
+ * because TypeScript can narrow the return type to only the specified event type.
8981
+ *
8982
+ * @param chainEvents - Array of chain events to filter
8983
+ * @param label - The event label to filter by
8984
+ * @returns Array of events narrowed to the specific type
8985
+ *
8986
+ * @example
8987
+ * ```ts
8988
+ * const transfers = parser.filterByType(events, "Transfer");
8989
+ *
8990
+ * for (const t of transfers) {
8991
+ * // t.value is fully typed as Transfer event data
8992
+ * console.log(t.value.from, "->", t.value.to, ":", t.value.value);
8993
+ * }
8994
+ * ```
8995
+ */
8996
+ filterByType<L$1 extends string>(chainEvents: unknown[], label: L$1): Array<TypedContractEvent<E> & {
8997
+ type: L$1;
8998
+ }>;
8580
8999
  /**
8581
9000
  * Get the contract address as SS58 string
8582
9001
  */
@@ -8595,32 +9014,73 @@ declare class ContractEventParser {
8595
9014
  */
8596
9015
  private static buildEventSignatureMap;
8597
9016
  }
9017
+ /**
9018
+ * Type guard for narrowing event types
9019
+ *
9020
+ * Use this function when you have a `TypedContractEvent` and need to
9021
+ * narrow it to a specific event type. This is useful when the type
9022
+ * information is lost (e.g., after serialization or in generic functions).
9023
+ *
9024
+ * @typeParam E - The Enum type representing all possible events
9025
+ * @typeParam L - The specific event label to check
9026
+ * @param event - The event to check
9027
+ * @param label - The event label to match
9028
+ * @returns True if the event type matches the label
9029
+ *
9030
+ * @example
9031
+ * ```ts
9032
+ * const event = parser.parseEvent(chainEvent);
9033
+ *
9034
+ * if (event && isEventType(event, "Transfer")) {
9035
+ * // TypeScript knows event.value is Transfer event data
9036
+ * console.log(event.value.from);
9037
+ * console.log(event.value.to);
9038
+ * console.log(event.value.value);
9039
+ * }
9040
+ * ```
9041
+ */
9042
+
8598
9043
  //#endregion
8599
9044
  //#region src/subscriptions.d.ts
8600
9045
  /**
8601
9046
  * Create an observable stream of contract events
8602
9047
  *
8603
9048
  * @param client - Polkadot API client
8604
- * @param metadata - Contract metadata
9049
+ * @param descriptor - Contract descriptor
8605
9050
  * @param options - Subscription options
8606
- * @returns Observable stream of decoded contract events
9051
+ * @returns Observable stream of type-safe contract events
8607
9052
  */
8608
- declare function createContractEventStream(client: PolkadotClient, metadata: InkMetadata, options: EventSubscriptionOptions): Observable<DecodedContractEvent>;
9053
+ declare function createContractEventStream<S extends InkStorageDescriptor = InkStorageDescriptor, M$1 extends InkCallableDescriptor = InkCallableDescriptor, C extends InkCallableDescriptor = InkCallableDescriptor, E extends Event = Event>(client: PolkadotClient, descriptor: InkDescriptors$1<S, M$1, C, E>, options: EventSubscriptionOptions): Observable<TypedContractEvent<E>>;
9054
+ /**
9055
+ * PSP22 Transfer event type
9056
+ */
9057
+ interface PSP22TransferEvent {
9058
+ type: "Transfer";
9059
+ value: {
9060
+ from?: SS58String$1 | null;
9061
+ to?: SS58String$1 | null;
9062
+ value: bigint;
9063
+ };
9064
+ raw: {
9065
+ blockNumber: number;
9066
+ blockHash: string;
9067
+ eventIndex: number;
9068
+ contractAddress: SS58String$1;
9069
+ data: Uint8Array;
9070
+ topics: Uint8Array[];
9071
+ };
9072
+ }
8609
9073
  /**
8610
9074
  * Convenience helper to create a Transfer event stream for PSP22 tokens
8611
9075
  *
8612
9076
  * @param client - Polkadot API client
8613
- * @param metadata - PSP22 contract metadata
9077
+ * @param descriptor - PSP22 contract descriptor
8614
9078
  * @param contractAddress - PSP22 contract address
8615
9079
  * @param getEvents - Function to fetch System.Events at a block hash
8616
9080
  * @param watchAddress - Optional address to filter transfers (only events involving this address)
8617
9081
  * @returns Observable stream of Transfer events
8618
9082
  */
8619
- declare function createPSP22TransferStream(client: PolkadotClient, metadata: InkMetadata, contractAddress: SS58String$1, getEvents: (blockHash: string) => Promise<unknown[]>, watchAddress?: SS58String$1): Observable<DecodedContractEvent<{
8620
- from?: SS58String$1 | null;
8621
- to?: SS58String$1 | null;
8622
- value: bigint;
8623
- }>>;
9083
+ declare function createPSP22TransferStream<S extends InkStorageDescriptor = InkStorageDescriptor, M$1 extends InkCallableDescriptor = InkCallableDescriptor, C extends InkCallableDescriptor = InkCallableDescriptor, E extends Event = Event>(client: PolkadotClient, descriptor: InkDescriptors$1<S, M$1, C, E>, contractAddress: SS58String$1, getEvents: (blockHash: string) => Promise<unknown[]>, watchAddress?: SS58String$1): Observable<PSP22TransferEvent>;
8624
9084
  /**
8625
9085
  * Create a native token (D9) transfer event stream
8626
9086
  *
@@ -8639,6 +9099,15 @@ declare function createNativeTransferStream(client: PolkadotClient, getEvents: (
8639
9099
  blockHash: string;
8640
9100
  }>;
8641
9101
  //#endregion
9102
+ //#region src/calls.d.ts
9103
+ /**
9104
+ * Type-safe call parser for a specific contract
9105
+ *
9106
+ * @typeParam S - The storage descriptor type
9107
+ * @typeParam M - The InkCallableDescriptor type (message definitions)
9108
+ * @typeParam C - The constructors descriptor type
9109
+ * @typeParam E - The events Enum type
9110
+ */
8642
9111
  //#endregion
8643
9112
  //#region src/client.d.ts
8644
9113
  type CreateD9SdkClientOptions = {
@@ -8655,7 +9124,7 @@ type CreateD9SdkClientOptions = {
8655
9124
  * @example
8656
9125
  * ```ts
8657
9126
  * const d9Client = createD9SdkClient({
8658
- * endpoint: "wss://mainnet.d9network.com:40300",
9127
+ * endpoint: "wss://archiver.d9network.com:40300",
8659
9128
  * });
8660
9129
  *
8661
9130
  * // Query USDT balance
@@ -8672,7 +9141,7 @@ type CreateD9SdkClientOptions = {
8672
9141
  declare function createD9SdkClient(options: CreateD9SdkClientOptions): {
8673
9142
  client: polkadot_api0.PolkadotClient;
8674
9143
  api: polkadot_api0.TypedApi<D9>;
8675
- inkSdk: D9InkSdk;
9144
+ inkSdk: D9InkSdkWithRpc;
8676
9145
  };
8677
9146
  type D9SdkClientReturn = ReturnType<typeof createD9SdkClient>;
8678
9147
  //#endregion