@d9-network/spec 0.2.0 → 1.0.0

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
@@ -1,20 +1,16 @@
1
- import * as polkadot_api0 from "polkadot-api";
2
- import { ApisFromDef, Binary, ConstFromPalletsDef, CreateClientOptions, Enum, ErrorsFromPalletsDef, EventsFromPalletsDef, FixedSizeArray, FixedSizeBinary, GetEnum, HexString, HexString as HexString$1, PlainDescriptor, PolkadotClient, PolkadotSigner, PolkadotSigner as PolkadotSigner$1, QueryFromPalletsDef, ResultPayload, SS58String, SS58String as SS58String$1, StorageDescriptor, TxCallData, TxDescriptor, TxFromPalletsDef, ViewFnsFromPalletsDef } from "polkadot-api";
1
+ import { ApisFromDef, Binary, ConstFromPalletsDef, Enum, ErrorsFromPalletsDef, EventsFromPalletsDef, FixedSizeArray, FixedSizeBinary, GetEnum, HexString, HexString as HexString$1, PlainDescriptor, PolkadotSigner, PolkadotSigner as PolkadotSigner$1, QueryFromPalletsDef, ResultPayload, SS58String, SS58String as SS58String$1, StorageDescriptor, TxCallData, TxDescriptor, TxFromPalletsDef, ViewFnsFromPalletsDef } from "polkadot-api";
3
2
  import { InkDescriptors } from "polkadot-api/ink";
4
- import { Event, InkCallableDescriptor, InkDescriptors as InkDescriptors$1, InkMetadata, InkStorageDescriptor } from "@polkadot-api/ink-contracts";
5
- import { Observable } from "rxjs";
6
- import { getWsProvider } from "polkadot-api/ws-provider";
7
3
  import { KeyPair } from "@polkadot-labs/hdkd-helpers";
8
4
 
9
5
  //#region rolldown:runtime
10
6
  //#endregion
11
7
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+ec2463ed5a666297/node_modules/@polkadot-api/descriptors/dist/common-types.d.ts
12
- type AnonymousEnum$9<T$1 extends {}> = T$1 & {
8
+ type AnonymousEnum$9<T extends {}> = T & {
13
9
  __anonymous: true;
14
10
  };
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] }>;
11
+ type MyTuple$9<T> = [T, ...T[]];
12
+ type SeparateUndefined$9<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
13
+ 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] }>;
18
14
  type Ic5m5lp1oioo8r = Array<FixedSizeBinary<32>>;
19
15
  type Ihfphjolmsqq1 = (SS58String$1) | undefined;
20
16
  type Idrurqd6ddlmr3 = {
@@ -3376,12 +3372,12 @@ type I1q6j2f64t5q87 = {
3376
3372
  };
3377
3373
  //#endregion
3378
3374
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+ec2463ed5a666297/node_modules/@polkadot-api/descriptors/dist/d9.d.ts
3379
- type AnonymousEnum$8<T$1 extends {}> = T$1 & {
3375
+ type AnonymousEnum$8<T extends {}> = T & {
3380
3376
  __anonymous: true;
3381
3377
  };
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] }>;
3378
+ type MyTuple$8<T> = [T, ...T[]];
3379
+ type SeparateUndefined$8<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
3380
+ 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] }>;
3385
3381
  type IStorage = {
3386
3382
  Aura: {
3387
3383
  /**
@@ -6713,12 +6709,12 @@ type PalletKey = `*.${({ [K in keyof AllInteractions]: K extends 'apis' ? never
6713
6709
  type NestedKey<D extends Record<string, string[]>> = "*" | { [P in keyof D & string]: `${P}.*` | `${P}.${D[P][number]}` }[keyof D & string];
6714
6710
  //#endregion
6715
6711
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+ec2463ed5a666297/node_modules/@polkadot-api/descriptors/dist/contracts/nodeReward.d.ts
6716
- type AnonymousEnum$7<T$1 extends {}> = T$1 & {
6712
+ type AnonymousEnum$7<T extends {}> = T & {
6717
6713
  __anonymous: true;
6718
6714
  };
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] }>;
6715
+ type MyTuple$7<T> = [T, ...T[]];
6716
+ type SeparateUndefined$7<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
6717
+ 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] }>;
6722
6718
  type T0$7 = ResultPayload<undefined, Anonymize$7<T1$7>>;
6723
6719
  type T1$7 = Enum<{
6724
6720
  "CouldNotReadInput": undefined;
@@ -6880,12 +6876,12 @@ type EventDescriptor$7 = Enum<{
6880
6876
  declare const descriptor$7: InkDescriptors<StorageDescriptor$8, MessagesDescriptor$7, ConstructorsDescriptor$7, EventDescriptor$7>;
6881
6877
  //#endregion
6882
6878
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+ec2463ed5a666297/node_modules/@polkadot-api/descriptors/dist/contracts/merchantMining.d.ts
6883
- type AnonymousEnum$6<T$1 extends {}> = T$1 & {
6879
+ type AnonymousEnum$6<T extends {}> = T & {
6884
6880
  __anonymous: true;
6885
6881
  };
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] }>;
6882
+ type MyTuple$6<T> = [T, ...T[]];
6883
+ type SeparateUndefined$6<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
6884
+ 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] }>;
6889
6885
  type T0$6 = ResultPayload<undefined, Anonymize$6<T1$6>>;
6890
6886
  type T1$6 = Enum<{
6891
6887
  "CouldNotReadInput": undefined;
@@ -7138,12 +7134,12 @@ type EventDescriptor$6 = Enum<{
7138
7134
  declare const descriptor$6: InkDescriptors<StorageDescriptor$7, MessagesDescriptor$6, ConstructorsDescriptor$6, EventDescriptor$6>;
7139
7135
  //#endregion
7140
7136
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+ec2463ed5a666297/node_modules/@polkadot-api/descriptors/dist/contracts/usdt.d.ts
7141
- type AnonymousEnum$5<T$1 extends {}> = T$1 & {
7137
+ type AnonymousEnum$5<T extends {}> = T & {
7142
7138
  __anonymous: true;
7143
7139
  };
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] }>;
7140
+ type MyTuple$5<T> = [T, ...T[]];
7141
+ type SeparateUndefined$5<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
7142
+ 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] }>;
7147
7143
  type T0$5 = Enum<{
7148
7144
  "CouldNotReadInput": undefined;
7149
7145
  }>;
@@ -7278,12 +7274,12 @@ type EventDescriptor$5 = Enum<{
7278
7274
  declare const descriptor$5: InkDescriptors<StorageDescriptor$6, MessagesDescriptor$5, ConstructorsDescriptor$5, EventDescriptor$5>;
7279
7275
  //#endregion
7280
7276
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+ec2463ed5a666297/node_modules/@polkadot-api/descriptors/dist/contracts/burnManager.d.ts
7281
- type AnonymousEnum$4<T$1 extends {}> = T$1 & {
7277
+ type AnonymousEnum$4<T extends {}> = T & {
7282
7278
  __anonymous: true;
7283
7279
  };
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] }>;
7280
+ type MyTuple$4<T> = [T, ...T[]];
7281
+ type SeparateUndefined$4<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
7282
+ 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] }>;
7287
7283
  type T0$4 = Array<SS58String$1>;
7288
7284
  type T1$4 = ResultPayload<undefined, Anonymize$4<T2$4>>;
7289
7285
  type T2$4 = Enum<{
@@ -7456,12 +7452,12 @@ type EventDescriptor$4 = Enum<{
7456
7452
  declare const descriptor$4: InkDescriptors<StorageDescriptor$5, MessagesDescriptor$4, ConstructorsDescriptor$4, EventDescriptor$4>;
7457
7453
  //#endregion
7458
7454
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+ec2463ed5a666297/node_modules/@polkadot-api/descriptors/dist/contracts/crossChainTransfer.d.ts
7459
- type AnonymousEnum$3<T$1 extends {}> = T$1 & {
7455
+ type AnonymousEnum$3<T extends {}> = T & {
7460
7456
  __anonymous: true;
7461
7457
  };
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] }>;
7458
+ type MyTuple$3<T> = [T, ...T[]];
7459
+ type SeparateUndefined$3<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
7460
+ 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] }>;
7465
7461
  type T5$2 = Array<SS58String$1>;
7466
7462
  type T0$3 = ResultPayload<undefined, Anonymize$3<T1$3>>;
7467
7463
  type T1$3 = Enum<{
@@ -7700,12 +7696,12 @@ type EventDescriptor$3 = Enum<{
7700
7696
  declare const descriptor$3: InkDescriptors<StorageDescriptor$4, MessagesDescriptor$3, ConstructorsDescriptor$3, EventDescriptor$3>;
7701
7697
  //#endregion
7702
7698
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+ec2463ed5a666297/node_modules/@polkadot-api/descriptors/dist/contracts/marketMaker.d.ts
7703
- type AnonymousEnum$2<T$1 extends {}> = T$1 & {
7699
+ type AnonymousEnum$2<T extends {}> = T & {
7704
7700
  __anonymous: true;
7705
7701
  };
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] }>;
7702
+ type MyTuple$2<T> = [T, ...T[]];
7703
+ type SeparateUndefined$2<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
7704
+ 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] }>;
7709
7705
  type T0$2 = ResultPayload<undefined, Anonymize$2<T1$2>>;
7710
7706
  type T1$2 = Enum<{
7711
7707
  "CouldNotReadInput": undefined;
@@ -7904,12 +7900,12 @@ type EventDescriptor$2 = Enum<{
7904
7900
  declare const descriptor$2: InkDescriptors<StorageDescriptor$3, MessagesDescriptor$2, ConstructorsDescriptor$2, EventDescriptor$2>;
7905
7901
  //#endregion
7906
7902
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+ec2463ed5a666297/node_modules/@polkadot-api/descriptors/dist/contracts/burnMining.d.ts
7907
- type AnonymousEnum$1<T$1 extends {}> = T$1 & {
7903
+ type AnonymousEnum$1<T extends {}> = T & {
7908
7904
  __anonymous: true;
7909
7905
  };
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] }>;
7906
+ type MyTuple$1<T> = [T, ...T[]];
7907
+ type SeparateUndefined$1<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
7908
+ 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] }>;
7913
7909
  type T0$1 = ResultPayload<undefined, Anonymize$1<T1$1>>;
7914
7910
  type T1$1 = Enum<{
7915
7911
  "CouldNotReadInput": undefined;
@@ -8083,12 +8079,12 @@ type EventDescriptor$1 = Enum<{}>;
8083
8079
  declare const descriptor$1: InkDescriptors<StorageDescriptor$2, MessagesDescriptor$1, ConstructorsDescriptor$1, EventDescriptor$1>;
8084
8080
  //#endregion
8085
8081
  //#region ../../node_modules/.bun/@polkadot-api+descriptors@file+packages+spec+.papi+descriptors+ec2463ed5a666297/node_modules/@polkadot-api/descriptors/dist/contracts/miningPool.d.ts
8086
- type AnonymousEnum<T$1 extends {}> = T$1 & {
8082
+ type AnonymousEnum<T extends {}> = T & {
8087
8083
  __anonymous: true;
8088
8084
  };
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] }>;
8085
+ type MyTuple<T> = [T, ...T[]];
8086
+ type SeparateUndefined<T> = undefined extends T ? undefined | Exclude<T, undefined> : T;
8087
+ 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] }>;
8092
8088
  type T0 = ResultPayload<undefined, Anonymize<T1>>;
8093
8089
  type T1 = Enum<{
8094
8090
  "CouldNotReadInput": undefined;
@@ -8247,7 +8243,35 @@ type WhitelistEntriesByChain = Partial<{
8247
8243
  d9: WhitelistEntry[];
8248
8244
  }>;
8249
8245
  //#endregion
8250
- //#region ../ink/dist/index.d.mts
8246
+ //#region src/constants.d.ts
8247
+ /**
8248
+ * D9 Network constants
8249
+ */
8250
+ /**
8251
+ * D9 SS58 address prefix.
8252
+ *
8253
+ * SS58 is the address format used by Substrate-based chains. Each chain has a unique
8254
+ * prefix that determines the address format and ensures addresses are network-specific.
8255
+ *
8256
+ * D9 uses prefix 9, which produces addresses starting with 'c' or 'd'.
8257
+ *
8258
+ * This prefix is automatically applied to all AccountId encoding/decoding operations
8259
+ * in the SDK, including:
8260
+ * - Contract call parameter encoding
8261
+ * - Result decoding
8262
+ * - Event parsing
8263
+ *
8264
+ * @see https://github.com/paritytech/ss58-registry for the full SS58 registry
8265
+ */
8266
+ declare const D9_SS58_PREFIX = 9;
8267
+ /** D9 token decimals */
8268
+ declare const D9_DECIMALS = 12;
8269
+ /** D9 token symbol */
8270
+ declare const D9_SYMBOL = "D9";
8271
+ /** USDT token decimals */
8272
+ declare const USDT_DECIMALS = 2;
8273
+ /** USDT token symbol */
8274
+ declare const USDT_SYMBOL = "USDT";
8251
8275
  //#endregion
8252
8276
  //#region src/errors.d.ts
8253
8277
  /**
@@ -8280,880 +8304,77 @@ declare class ContractError extends Error {
8280
8304
  /**
8281
8305
  * Error thrown when contract metadata is missing or invalid
8282
8306
  */
8283
-
8284
- //#endregion
8285
- //#region src/event-types.d.ts
8286
- /**
8287
- * Raw event data from chain
8288
- */
8289
- interface RawContractEvent {
8290
- /** Block number where event was emitted */
8291
- blockNumber: number;
8292
- /** Block hash */
8293
- blockHash: string;
8294
- /** Event index in block */
8295
- eventIndex: number;
8296
- /** Contract address that emitted the event */
8297
- contractAddress: SS58String$1;
8298
- /** Event data (SCALE encoded) */
8299
- data: Uint8Array;
8300
- /** Event topics (indexed fields) */
8301
- topics: Uint8Array[];
8302
- }
8303
- /**
8304
- * Extract the definition object from an Enum type or InkEvent type
8305
- * e.g. ExtractEnumDef<Enum<{A: X, B: Y}>> = {A: X, B: Y}
8306
- *
8307
- * For non-Enum types (e.g., InkEvent { type: string; value: unknown }),
8308
- * returns a generic event definition.
8309
- */
8310
-
8311
- /**
8312
- * Type-safe contract event with discriminated union
8313
- * Enables type narrowing: `if (event.type === "Transfer") { event.value.from }`
8314
- */
8315
- type TypedContractEvent<E extends Event> = E extends Enum<infer T> ? { [K in keyof T & string]: {
8316
- /** Event type (discriminant for type narrowing) */
8317
- type: K;
8318
- /** Decoded event data (type-safe based on event type) */
8319
- value: T[K];
8320
- /** Original raw event */
8321
- raw: RawContractEvent;
8322
- } }[keyof T & string] : {
8323
- type: string;
8324
- value: unknown;
8325
- raw: RawContractEvent;
8326
- };
8327
- /**
8328
- * Decoded contract event with generic data type.
8329
- * For full type safety with discriminated unions, use TypedContractEvent instead.
8330
- */
8331
- interface DecodedContractEvent<T$1 = unknown> {
8332
- /** Event label from metadata (e.g., "Transfer", "Approval") */
8333
- label: string;
8334
- /** Decoded event data */
8335
- data: T$1;
8336
- /** Original raw event */
8337
- raw: RawContractEvent;
8338
- }
8339
- /**
8340
- * Event filter options
8341
- */
8342
- interface EventFilterOptions {
8343
- /** Contract address to filter by */
8344
- contractAddress?: SS58String$1;
8345
- /** Event labels to include (e.g., ["Transfer", "Approval"]) */
8346
- eventLabels?: string[];
8347
- /** From block number (inclusive) */
8348
- fromBlock?: number;
8349
- /** To block number (inclusive) */
8350
- toBlock?: number;
8351
- }
8352
- /**
8353
- * Type-safe event filter options with literal event labels
8354
- * Provides compile-time validation of event label names
8355
- *
8356
- * @typeParam E - The event type representing all possible events
8357
- *
8358
- * @example
8359
- * ```ts
8360
- * const options: TypedEventFilterOptions<typeof contracts.usdt.__types.event> = {
8361
- * eventLabels: ["Transfer", "Approval"], // Must be valid event names
8362
- * };
8363
- * ```
8364
- */
8365
-
8366
- /**
8367
- * Event subscription options
8368
- */
8369
- interface EventSubscriptionOptions {
8370
- /** Contract address to subscribe to */
8371
- contractAddress: SS58String$1;
8372
- /** Event labels to subscribe to (undefined = all events) */
8373
- eventLabels?: string[];
8374
- /** Include historical events from this block */
8375
- fromBlock?: number;
8376
- /**
8377
- * Function to fetch System.Events at a given block hash
8378
- * This is required because PolkadotClient doesn't expose typed API directly
8379
- *
8380
- * @example
8381
- * ```ts
8382
- * const options = {
8383
- * contractAddress: usdtAddress,
8384
- * getEvents: async (blockHash) => {
8385
- * return await api.query.System.Events.getValue({ at: blockHash });
8386
- * }
8387
- * };
8388
- * ```
8389
- */
8390
- getEvents: (blockHash: string) => Promise<unknown[]>;
8391
- }
8392
- //#endregion
8393
- //#region src/call-types.d.ts
8394
- /**
8395
- * Raw call data from a transaction
8396
- */
8397
-
8398
- /**
8399
- * Extract message labels as a union type from InkCallableDescriptor
8400
- * e.g. ExtractMessageLabels<Messages> = "PSP22::transfer" | "PSP22::balance_of" | ...
8401
- */
8402
- type ExtractMessageLabels<M$1 extends InkCallableDescriptor> = keyof M$1 & string;
8403
- /**
8404
- * Type-safe parsed contract call with discriminated union
8405
- * Enables type narrowing: `if (call.type === "PSP22::transfer") { call.args.to }`
8406
- */
8407
-
8408
- //#endregion
8409
- //#region src/message-builder.d.ts
8410
- /**
8411
- * Message attributes from metadata
8412
- */
8413
- interface MessageAttributes {
8414
- /** Whether the message mutates state */
8415
- mutates: boolean;
8416
- /** Whether the message is payable */
8417
- payable: boolean;
8418
- /** Whether this is the default message */
8419
- default: boolean;
8420
- }
8421
- /**
8422
- * Type-safe message interface with encode/decode methods
8423
- *
8424
- * @typeParam M - The InkCallableDescriptor type (message definitions)
8425
- * @typeParam L - The specific message label
8426
- */
8427
- interface TypedMessage<M$1 extends InkCallableDescriptor, L$1 extends keyof M$1 & string> {
8428
- /**
8429
- * Encode message arguments to Binary
8430
- *
8431
- * @param args - The message arguments (fully typed)
8432
- * @returns Encoded call data as Binary
8433
- *
8434
- * @example
8435
- * ```ts
8436
- * const transfer = builder.message("PSP22::transfer");
8437
- * const encoded = transfer.encode({
8438
- * to: recipientAddress,
8439
- * value: 1000n,
8440
- * data: new Uint8Array(),
8441
- * });
8442
- * ```
8443
- */
8444
- encode: {} extends M$1[L$1]["message"] ? (args?: M$1[L$1]["message"]) => Binary : (args: M$1[L$1]["message"]) => Binary;
8445
- /**
8446
- * Decode response to typed value
8447
- *
8448
- * @param response - The response data
8449
- * @returns Decoded response value
8450
- */
8451
- decode: (response: Binary | Uint8Array) => M$1[L$1]["response"];
8452
- /** Message attributes (mutates, payable, default) */
8453
- attributes: MessageAttributes;
8454
- /** 4-byte selector */
8455
- selector: Uint8Array;
8456
- /** Message label */
8457
- label: L$1;
8458
- }
8459
- /**
8460
- * Contract message builder interface
8461
- *
8462
- * @typeParam M - The InkCallableDescriptor type (message definitions)
8463
- */
8464
-
8465
- /**
8466
- * Query options for read operations (dry-run)
8467
- */
8468
- interface QueryOptions<Args = unknown> {
8469
- /** The origin account for the call */
8470
- origin: SS58String$1;
8471
- /** Arguments to pass to the contract message */
8472
- args?: Args;
8473
- /** Value to transfer with the call */
8474
- value?: bigint;
8475
- /** AbortSignal for cancellation */
8476
- signal?: AbortSignal;
8477
- /** Timeout in milliseconds */
8478
- timeout?: number;
8479
- /** Block hash to query at (default: finalized) */
8480
- at?: string;
8481
- }
8482
- /**
8483
- * Send options for write operations
8484
- */
8485
- interface SendOptions<Args = unknown> {
8486
- /** The origin account for the call */
8487
- origin: SS58String$1;
8488
- /** Arguments to pass to the contract message */
8489
- args?: Args;
8490
- /** Value to transfer with the call */
8491
- value?: bigint;
8492
- /** Gas limit (optional, will be estimated if not provided) */
8493
- gasLimit?: {
8494
- refTime: bigint;
8495
- proofSize: bigint;
8496
- };
8497
- /** Storage deposit limit */
8498
- storageDepositLimit?: bigint;
8499
- }
8500
- /**
8501
- * Sendable transaction that can be signed and submitted
8502
- */
8503
- interface SendableTransaction<T$1> {
8504
- /** Sign and submit the transaction */
8505
- signAndSubmit(signer: PolkadotSigner$1): Promise<TxResult<T$1>>;
8506
- /** Get the encoded call data */
8507
- getEncodedData(): Uint8Array;
8508
- }
8509
- /**
8510
- * Transaction result
8511
- */
8512
- interface TxResult<T$1> {
8513
- /** Whether the transaction was successful */
8514
- ok: boolean;
8515
- /** Transaction hash */
8516
- txHash: string;
8517
- /** Block information where tx was included */
8518
- block: {
8519
- hash: string;
8520
- number: number;
8521
- };
8522
- /** Decoded return value (if any) */
8523
- result?: T$1;
8524
- /** Events emitted by the transaction */
8525
- events: unknown[];
8526
- /** Dispatch error if failed */
8527
- dispatchError?: unknown;
8528
- }
8529
- /**
8530
- * Successful query result value
8531
- */
8532
- interface QuerySuccessValue<T$1> {
8533
- /** The decoded response from the contract */
8534
- value: T$1;
8535
- /** Events that would be emitted */
8536
- events: unknown[];
8537
- /** Gas consumed during dry-run */
8538
- gasConsumed: {
8539
- refTime: bigint;
8540
- proofSize: bigint;
8541
- };
8542
- /** Gas required for execution */
8543
- gasRequired: {
8544
- refTime: bigint;
8545
- proofSize: bigint;
8546
- };
8547
- /** Storage deposit required */
8548
- storageDeposit: bigint;
8549
- /** Create a sendable transaction from this query result */
8550
- send(): SendableTransaction<T$1>;
8551
- }
8552
- /**
8553
- * Query result - discriminated union for success/failure
8554
- * On success: QuerySuccessValue fields are spread to the same level as success
8555
- * On failure: error field contains the ContractError
8556
- */
8557
- type QueryResult<T$1> = ({
8558
- success: true;
8559
- } & QuerySuccessValue<T$1>) | {
8560
- success: false;
8561
- error: ContractError;
8562
- };
8563
- /**
8564
- * Storage query interface
8565
- */
8566
- interface ContractStorage {
8567
- /** Get the root storage value */
8568
- getRoot(): Promise<{
8569
- success: true;
8570
- value: unknown;
8571
- } | {
8572
- success: false;
8573
- value: ContractError;
8574
- }>;
8575
- /** Get a nested storage value by path */
8576
- getNested(path: string, ...keys: unknown[]): Promise<{
8577
- success: true;
8578
- value: unknown;
8579
- } | {
8580
- success: false;
8581
- value: ContractError;
8582
- }>;
8583
- }
8584
- /**
8585
- * Type helper to extract message args type
8586
- */
8587
- type MessageArgs<M$1 extends InkCallableDescriptor, K$1 extends keyof M$1> = M$1[K$1]["message"];
8588
- /**
8589
- * ink! LangError type pattern
8590
- * papi generates LangError variants with { type: string; value?: unknown }
8591
- */
8592
- type InkLangError = {
8593
- type: string;
8594
- value?: unknown;
8595
- };
8596
- /**
8597
- * ink! MessageResult type pattern (Result<T, LangError>)
8598
- * papi generates this as { success: true; value: T } | { success: false; value: LangError }
8599
- */
8600
- type InkMessageResult<T$1> = {
8601
- success: true;
8602
- value: T$1;
8603
- } | {
8604
- success: false;
8605
- value: unknown;
8606
- };
8607
- /**
8608
- * Type helper to unwrap ink! MessageResult (Result<T, LangError>)
8609
- * 1. Extract T from { success: true; value: T } | { success: false; value: ... }
8610
- * 2. Exclude LangError variants from T
8611
- */
8612
- type UnwrapMessageResult<T$1> = T$1 extends InkMessageResult<infer U> ? Exclude<U, InkLangError> : T$1;
8613
- /**
8614
- * Type helper to extract message response type (with MessageResult unwrapped)
8615
- */
8616
- type MessageResponse<M$1 extends InkCallableDescriptor, K$1 extends keyof M$1> = UnwrapMessageResult<M$1[K$1]["response"]>;
8617
- /**
8618
- * D9 Ink Contract interface
8619
- *
8620
- * @typeParam M - The callable descriptor type (message definitions)
8621
- * @typeParam E - The event type for type-safe event filtering
8622
- */
8623
- interface D9InkContract<M$1 extends InkCallableDescriptor, E extends Event = Event> {
8624
- /** Contract address */
8625
- readonly address: SS58String$1;
8626
- /** Contract metadata */
8627
- readonly metadata: InkMetadata;
8628
- /**
8629
- * Query a contract message (dry-run)
8630
- * @param method - The message label (e.g., "PSP22::balance_of")
8631
- * @param options - Query options including origin and args
8632
- */
8633
- query<K$1 extends keyof M$1 & string>(method: K$1, options: QueryOptions<MessageArgs<M$1, K$1>>): Promise<QueryResult<MessageResponse<M$1, K$1>>>;
8634
- /**
8635
- * Create a sendable transaction for a contract message
8636
- * @param method - The message label (e.g., "PSP22::transfer")
8637
- * @param options - Send options including origin and args
8638
- */
8639
- send<K$1 extends keyof M$1 & string>(method: K$1, options: SendOptions<MessageArgs<M$1, K$1>>): SendableTransaction<MessageResponse<M$1, K$1>>;
8640
- /**
8641
- * Get storage query interface
8642
- */
8643
- getStorage(): ContractStorage;
8644
- /**
8645
- * Filter events from a transaction result to only include this contract's events
8646
- * Returns type-safe events that can be narrowed using `event.type`
8647
- *
8648
- * @example
8649
- * ```ts
8650
- * const events = contract.filterEvents(txResult.events);
8651
- * for (const event of events) {
8652
- * if (event.type === "Transfer") {
8653
- * console.log(event.value.from, event.value.to, event.value.value);
8654
- * }
8655
- * }
8656
- * ```
8657
- */
8658
- filterEvents(events: unknown[]): TypedContractEvent<E>[];
8659
- /**
8660
- * Subscribe to contract events as an RxJS Observable
8661
- * @param options - Event subscription options (event labels to filter, etc.)
8662
- */
8663
- subscribeToEvents(options?: Omit<EventSubscriptionOptions, "contractAddress">): Observable<TypedContractEvent<E>>;
8664
- /**
8665
- * Get a type-safe message builder for a specific message
8666
- *
8667
- * Provides a polkadot-api compatible API for encoding and decoding
8668
- * contract messages with full TypeScript type inference.
8669
- *
8670
- * @param label - The message label (e.g., "PSP22::transfer")
8671
- * @returns Typed message interface with encode/decode methods
8672
- *
8673
- * @example
8674
- * ```ts
8675
- * const transfer = contract.message("PSP22::transfer");
8676
- *
8677
- * // Encode with full type checking on args
8678
- * const encoded = transfer.encode({
8679
- * to: recipientAddress,
8680
- * value: 1000000n,
8681
- * data: new Uint8Array(),
8682
- * });
8683
- *
8684
- * // Decode response with full type inference
8685
- * const decoded = transfer.decode(responseBytes);
8686
- * ```
8687
- */
8688
- message<L$1 extends ExtractMessageLabels<M$1>>(label: L$1): TypedMessage<M$1, L$1>;
8689
- /**
8690
- * Filter events by specific type with proper type narrowing
8691
- *
8692
- * @param events - Array of chain events to filter
8693
- * @param label - The event label to filter by
8694
- * @returns Array of events narrowed to the specific type
8695
- *
8696
- * @example
8697
- * ```ts
8698
- * const transfers = contract.filterEventsByType(txResult.events, "Transfer");
8699
- *
8700
- * for (const t of transfers) {
8701
- * // t.value is fully typed as Transfer event data
8702
- * console.log(t.value.from, "->", t.value.to, ":", t.value.value);
8703
- * }
8704
- * ```
8705
- */
8706
- filterEventsByType<L$1 extends string>(events: unknown[], label: L$1): Array<TypedContractEvent<E> & {
8707
- type: L$1;
8708
- }>;
8709
- }
8710
- /**
8711
- * D9 Ink SDK options
8712
- */
8713
-
8714
- /**
8715
- * D9 Ink SDK interface
8716
- */
8717
- interface D9InkSdk {
8718
- /**
8719
- * Get a contract instance for interacting with a deployed contract
8720
- * @param descriptor - The contract descriptor from @polkadot-api/descriptors
8721
- * @param address - The contract address (SS58 format)
8722
- */
8723
- 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>;
8307
+ declare class MetadataError extends ContractError {
8308
+ constructor(message: string, details?: unknown);
8724
8309
  }
8725
8310
  /**
8726
- * Type helper to extract D9InkContract type from an InkDescriptors
8727
- */
8728
-
8729
- //#endregion
8730
- //#region src/rpc-types.d.ts
8731
- /**
8732
- * Block header structure
8311
+ * Error thrown when encoding call data fails
8733
8312
  */
8734
- interface BlockHeader {
8735
- parentHash: HexString$1;
8736
- number: HexString$1;
8737
- stateRoot: HexString$1;
8738
- extrinsicsRoot: HexString$1;
8739
- digest: {
8740
- logs: HexString$1[];
8741
- };
8313
+ declare class EncodeError extends ContractError {
8314
+ constructor(label: string, message: string, details?: unknown);
8742
8315
  }
8743
8316
  /**
8744
- * System health information
8317
+ * Error thrown when decoding response fails
8745
8318
  */
8746
- interface SystemHealth {
8747
- peers: number;
8748
- isSyncing: boolean;
8749
- shouldHavePeers: boolean;
8319
+ declare class DecodeError extends ContractError {
8320
+ constructor(label: string, message: string, details?: unknown);
8750
8321
  }
8751
8322
  /**
8752
- * Runtime version information
8323
+ * Error thrown for network/RPC errors
8753
8324
  */
8754
- interface RuntimeVersion {
8755
- specName: string;
8756
- implName: string;
8757
- authoringVersion: number;
8758
- specVersion: number;
8759
- implVersion: number;
8760
- apis: [HexString$1, number][];
8761
- transactionVersion: number;
8762
- stateVersion: number;
8325
+ declare class NetworkError extends ContractError {
8326
+ constructor(message: string, cause?: Error, details?: unknown);
8763
8327
  }
8764
8328
  /**
8765
- * Storage change set
8329
+ * Error thrown when contract returns an error result
8766
8330
  */
8767
- interface StorageChangeSet {
8768
- block: HexString$1;
8769
- changes: [HexString$1, HexString$1 | null][];
8331
+ declare class ContractExecutionError extends ContractError {
8332
+ readonly errorValue: unknown;
8333
+ constructor(label: string, errorValue: unknown);
8770
8334
  }
8771
8335
  /**
8772
- * RPC method signatures: method name -> [params tuple, return type]
8773
- *
8774
- * This interface maps known Substrate RPC methods to their parameter and return types.
8775
- * Methods not in this list will fall back to unknown types.
8336
+ * Error thrown for Ink LangError
8776
8337
  */
8777
- interface SubstrateRpcMethods {
8778
- chain_getBlockHash: [[blockNumber?: number], HexString$1 | null];
8779
- chain_getHeader: [[hash?: HexString$1], BlockHeader | null];
8780
- chain_getBlock: [[hash?: HexString$1], {
8781
- block: {
8782
- header: BlockHeader;
8783
- extrinsics: HexString$1[];
8784
- };
8785
- justifications: unknown;
8786
- } | null];
8787
- chain_getFinalizedHead: [[], HexString$1];
8788
- state_call: [[method: string, data: HexString$1, at?: HexString$1], HexString$1];
8789
- state_getStorage: [[key: HexString$1, at?: HexString$1], HexString$1 | null];
8790
- state_getStorageAt: [[key: HexString$1, at: HexString$1], HexString$1 | null];
8791
- state_getStorageHash: [[key: HexString$1, at?: HexString$1], HexString$1 | null];
8792
- state_getStorageSize: [[key: HexString$1, at?: HexString$1], number | null];
8793
- state_getMetadata: [[at?: HexString$1], HexString$1];
8794
- state_getRuntimeVersion: [[at?: HexString$1], RuntimeVersion];
8795
- state_queryStorageAt: [[keys: HexString$1[], at?: HexString$1], StorageChangeSet[]];
8796
- system_chain: [[], string];
8797
- system_name: [[], string];
8798
- system_version: [[], string];
8799
- system_health: [[], SystemHealth];
8800
- system_properties: [[], Record<string, unknown>];
8801
- system_peers: [[], {
8802
- peerId: string;
8803
- roles: string;
8804
- bestHash: HexString$1;
8805
- bestNumber: number;
8806
- }[]];
8807
- system_chainType: [[], string];
8808
- author_submitExtrinsic: [[extrinsic: HexString$1], HexString$1];
8809
- author_pendingExtrinsics: [[], HexString$1[]];
8810
- author_removeExtrinsic: [[bytesOrHash: (HexString$1 | {
8811
- Hash: HexString$1;
8812
- })[]], number];
8813
- payment_queryInfo: [[extrinsic: HexString$1, at?: HexString$1], {
8814
- weight: {
8815
- refTime: number;
8816
- proofSize: number;
8817
- };
8818
- class: string;
8819
- partialFee: string;
8820
- }];
8821
- payment_queryFeeDetails: [[extrinsic: HexString$1, at?: HexString$1], {
8822
- inclusionFee: {
8823
- baseFee: string;
8824
- lenFee: string;
8825
- adjustedWeightFee: string;
8826
- } | null;
8827
- }];
8338
+ declare class LangError extends ContractError {
8339
+ readonly variant: number;
8340
+ constructor(label: string, variant: number);
8828
8341
  }
8829
8342
  /**
8830
- * Known RPC method names (for autocomplete)
8831
- */
8832
- type KnownRpcMethod = keyof SubstrateRpcMethods;
8833
- /**
8834
- * Extract parameter types for a known RPC method
8835
- */
8836
- type RpcParams<M$1 extends KnownRpcMethod> = SubstrateRpcMethods[M$1][0];
8837
- /**
8838
- * Extract return type for a known RPC method
8839
- */
8840
- type RpcReturn<M$1 extends KnownRpcMethod> = SubstrateRpcMethods[M$1][1];
8841
- /**
8842
- * Type-safe RPC request interface
8843
- *
8844
- * Provides full type inference for known RPC methods while allowing
8845
- * arbitrary method calls with explicit type parameters.
8846
- *
8847
- * @example
8848
- * ```ts
8849
- * // Known method: types are inferred
8850
- * const hash = await rpc("chain_getBlockHash", [12345]);
8851
- * // hash: HexString | null
8852
- *
8853
- * // Unknown method: provide explicit types
8854
- * const result = await rpc<MyType>("custom_method", [arg1, arg2]);
8855
- * ```
8343
+ * Error thrown when request times out
8856
8344
  */
8857
- interface TypedRpcRequest {
8858
- /**
8859
- * Call a known RPC method with full type inference
8860
- */
8861
- <M$1 extends KnownRpcMethod>(method: M$1, params: RpcParams<M$1>): Promise<RpcReturn<M$1>>;
8862
- /**
8863
- * Call an unknown RPC method with explicit type parameters
8864
- */
8865
- <Reply = unknown, Params extends unknown[] = unknown[]>(method: string, params: Params): Promise<Reply>;
8345
+ declare class TimeoutError extends ContractError {
8346
+ readonly timeoutMs: number;
8347
+ constructor(label: string, timeoutMs: number);
8866
8348
  }
8867
- //#endregion
8868
- //#region src/sdk.d.ts
8869
8349
  /**
8870
- * Options for creating D9 Ink SDK
8350
+ * Error thrown when request is aborted
8871
8351
  */
8872
-
8873
- /**
8874
- * Extended D9 Ink SDK interface with typed RPC access
8875
- */
8876
- interface D9InkSdkWithRpc extends D9InkSdk {
8877
- /**
8878
- * Type-safe RPC request function
8879
- *
8880
- * Provides autocomplete for known Substrate RPC methods and type inference
8881
- * for parameters and return values.
8882
- *
8883
- * @example
8884
- * ```ts
8885
- * // Known method with full type inference
8886
- * const hash = await sdk.rpc("chain_getBlockHash", [12345]);
8887
- * // hash: HexString | null
8888
- *
8889
- * // Custom method with explicit types
8890
- * const custom = await sdk.rpc<MyType>("custom_method", [arg]);
8891
- * ```
8892
- */
8893
- rpc: TypedRpcRequest;
8352
+ declare class AbortedError extends ContractError {
8353
+ constructor(label: string, reason?: string);
8894
8354
  }
8895
8355
  /**
8896
- * Create a D9 Ink SDK instance.
8897
- *
8898
- * This SDK provides a similar API to the official @polkadot-api/sdk-ink,
8899
- * but uses state_call + ContractsApi_call instead of ReviveApi.
8900
- *
8901
- * @example
8902
- * ```ts
8903
- * import { createD9InkSdk } from "@d9-network/ink";
8904
- * import { contracts } from "@polkadot-api/descriptors";
8905
- *
8906
- * const sdk = createD9InkSdk(client);
8907
- * const usdtContract = sdk.getContract(
8908
- * contracts.d9_usdt,
8909
- * "uLj9DRUujbpCyK7USZY5ebGbxdtKoWvdRvGyyUsoLWDsNng"
8910
- * );
8911
- *
8912
- * // Query balance
8913
- * const result = await usdtContract.query("PSP22::balance_of", {
8914
- * origin: aliceAddress,
8915
- * args: { owner: aliceAddress }
8916
- * });
8917
- *
8918
- * if (result.success) {
8919
- * console.log("Balance:", result.value.response);
8920
- *
8921
- * // Send transaction from the query result
8922
- * const txResult = await result.value.send().signAndSubmit(aliceSigner);
8923
- * }
8924
- *
8925
- * // Or send directly
8926
- * const txResult = await usdtContract
8927
- * .send("PSP22::transfer", {
8928
- * origin: aliceAddress,
8929
- * args: { to: bobAddress, value: 1000n, data: [] }
8930
- * })
8931
- * .signAndSubmit(aliceSigner);
8932
- * ```
8933
- *
8934
- * @param client - The PolkadotClient instance
8935
- * @param options - Optional SDK configuration
8936
- * @returns D9 Ink SDK instance with typed RPC access
8937
- */
8938
-
8939
- //#endregion
8940
- //#region src/events.d.ts
8941
- /**
8942
- * Type-safe event parser for a specific contract
8943
- *
8944
- * @typeParam S - The storage descriptor type
8945
- * @typeParam M - The messages descriptor type
8946
- * @typeParam C - The constructors descriptor type
8947
- * @typeParam E - The event type representing all possible events for this contract
8356
+ * Error thrown for signer-related issues
8948
8357
  */
8949
- declare class ContractEventParser<S extends InkStorageDescriptor = InkStorageDescriptor, M$1 extends InkCallableDescriptor = InkCallableDescriptor, C extends InkCallableDescriptor = InkCallableDescriptor, E extends Event = Event> {
8950
- private eventDecoders;
8951
- private eventSignatures;
8952
- private contractAddressBytes;
8953
- private contractAddress;
8954
- private metadata;
8955
- constructor(descriptor: InkDescriptors$1<S, M$1, C, E>, contractAddress: SS58String$1);
8956
- /**
8957
- * Parse a raw chain event into a type-safe contract event (if it matches)
8958
- * Returns null if the event is not from this contract or cannot be parsed
8959
- *
8960
- * @example
8961
- * ```ts
8962
- * const event = parser.parseEvent(chainEvent);
8963
- * if (event?.type === "Transfer") {
8964
- * // event.value is now typed as { from: SS58String; to: SS58String; value: bigint }
8965
- * console.log(event.value.from);
8966
- * }
8967
- * ```
8968
- */
8969
- parseEvent(chainEvent: unknown): TypedContractEvent<E> | null;
8970
- /**
8971
- * Extract event label from ASCII-encoded topic (D9 chain format)
8972
- *
8973
- * D9 chain uses a format where:
8974
- * - First byte is 0x00 (null)
8975
- * - Remaining 31 bytes are ASCII characters of `ContractName::EventLabel`
8976
- * - Total is exactly 32 bytes (truncated/padded as needed)
8977
- *
8978
- * @param topic - The 32-byte topic from the event
8979
- * @returns The extracted event label, or null if not in ASCII format
8980
- */
8981
- private extractEventLabelFromAsciiTopic;
8982
- /**
8983
- * Filter a batch of events and return type-safe results
8984
- *
8985
- * @param chainEvents - Array of chain events to filter
8986
- * @param options - Optional filter criteria
8987
- * @returns Array of type-safe contract events
8988
- */
8989
- filterEvents(chainEvents: unknown[], options?: EventFilterOptions): TypedContractEvent<E>[];
8990
- /**
8991
- * Filter events by specific type with proper type narrowing
8992
- *
8993
- * This method provides better type safety than filterEvents with eventLabels
8994
- * because TypeScript can narrow the return type to only the specified event type.
8995
- *
8996
- * @param chainEvents - Array of chain events to filter
8997
- * @param label - The event label to filter by
8998
- * @returns Array of events narrowed to the specific type
8999
- *
9000
- * @example
9001
- * ```ts
9002
- * const transfers = parser.filterByType(events, "Transfer");
9003
- *
9004
- * for (const t of transfers) {
9005
- * // t.value is fully typed as Transfer event data
9006
- * console.log(t.value.from, "->", t.value.to, ":", t.value.value);
9007
- * }
9008
- * ```
9009
- */
9010
- filterByType<L$1 extends string>(chainEvents: unknown[], label: L$1): Array<TypedContractEvent<E> & {
9011
- type: L$1;
9012
- }>;
9013
- /**
9014
- * Get the contract address as SS58 string
9015
- */
9016
- private getContractAddress;
9017
- /**
9018
- * Extract ContractEmitted event from chain event structure
9019
- * Based on polkadot-api event format
9020
- */
9021
- private extractContractEmittedEvent;
9022
- /**
9023
- * Compare two Uint8Arrays for equality
9024
- */
9025
- private bytesEqual;
8358
+ declare class SignerError extends ContractError {
8359
+ constructor(message: string, details?: unknown);
9026
8360
  }
9027
8361
  /**
9028
- * Type guard for narrowing event types
9029
- *
9030
- * Use this function when you have a `TypedContractEvent` and need to
9031
- * narrow it to a specific event type. This is useful when the type
9032
- * information is lost (e.g., after serialization or in generic functions).
9033
- *
9034
- * @typeParam E - The Enum type representing all possible events
9035
- * @typeParam L - The specific event label to check
9036
- * @param event - The event to check
9037
- * @param label - The event label to match
9038
- * @returns True if the event type matches the label
9039
- *
9040
- * @example
9041
- * ```ts
9042
- * const event = parser.parseEvent(chainEvent);
9043
- *
9044
- * if (event && isEventType(event, "Transfer")) {
9045
- * // TypeScript knows event.value is Transfer event data
9046
- * console.log(event.value.from);
9047
- * console.log(event.value.to);
9048
- * console.log(event.value.value);
9049
- * }
9050
- * ```
9051
- */
9052
-
9053
- //#endregion
9054
- //#region src/subscriptions.d.ts
9055
- /**
9056
- * Create an observable stream of contract events
9057
- *
9058
- * @param client - Polkadot API client
9059
- * @param descriptor - Contract descriptor
9060
- * @param options - Subscription options
9061
- * @returns Observable stream of type-safe contract events
8362
+ * Error thrown when transaction submission fails
9062
8363
  */
9063
- 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>>;
9064
- /**
9065
- * PSP22 Transfer event type
9066
- */
9067
- interface PSP22TransferEvent {
9068
- type: "Transfer";
9069
- value: {
9070
- from?: SS58String$1 | null;
9071
- to?: SS58String$1 | null;
9072
- value: bigint;
9073
- };
9074
- raw: {
9075
- blockNumber: number;
9076
- blockHash: string;
9077
- eventIndex: number;
9078
- contractAddress: SS58String$1;
9079
- data: Uint8Array;
9080
- topics: Uint8Array[];
9081
- };
8364
+ declare class TransactionError extends ContractError {
8365
+ readonly txHash?: string | undefined;
8366
+ constructor(label: string, message: string, txHash?: string | undefined, details?: unknown);
9082
8367
  }
9083
8368
  /**
9084
- * Convenience helper to create a Transfer event stream for PSP22 tokens
9085
- *
9086
- * @param client - Polkadot API client
9087
- * @param descriptor - PSP22 contract descriptor
9088
- * @param contractAddress - PSP22 contract address
9089
- * @param getEvents - Function to fetch System.Events at a block hash
9090
- * @param watchAddress - Optional address to filter transfers (only events involving this address)
9091
- * @returns Observable stream of Transfer events
9092
- */
9093
- 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>;
9094
- /**
9095
- * Create a native token (D9) transfer event stream
9096
- *
9097
- * This monitors System.Transfer events instead of contract events
9098
- *
9099
- * @param client - Polkadot API client
9100
- * @param getEvents - Function to fetch System.Events at a block hash
9101
- * @param watchAddress - Address to monitor for transfers
9102
- * @returns Observable stream of native transfer events
9103
- */
9104
- declare function createNativeTransferStream(client: PolkadotClient, getEvents: (blockHash: string) => Promise<unknown[]>, watchAddress: SS58String$1): Observable<{
9105
- from: SS58String$1;
9106
- to: SS58String$1;
9107
- amount: bigint;
9108
- blockNumber: number;
9109
- blockHash: string;
9110
- }>;
9111
- //#endregion
9112
- //#region src/calls.d.ts
9113
- /**
9114
- * Type-safe call parser for a specific contract
9115
- *
9116
- * @typeParam S - The storage descriptor type
9117
- * @typeParam M - The InkCallableDescriptor type (message definitions)
9118
- * @typeParam C - The constructors descriptor type
9119
- * @typeParam E - The events Enum type
8369
+ * Type guard to check if an error is a ContractError
9120
8370
  */
9121
- //#endregion
9122
- //#region src/client.d.ts
9123
- type CreateD9SdkClientOptions = {
9124
- endpoint: string;
9125
- wsProvider?: Parameters<typeof getWsProvider>[1];
9126
- metadata?: CreateClientOptions;
9127
- };
8371
+ declare function isContractError(error: unknown): error is ContractError;
9128
8372
  /**
9129
- * Create a D9 SDK client with ink contract support.
9130
- *
9131
- * This client uses state_call + ContractsApi_call for contract interactions
9132
- * instead of ReviveApi, which is not supported on the D9 chain.
9133
- *
9134
- * @example
9135
- * ```ts
9136
- * const d9Client = createD9SdkClient({
9137
- * endpoint: "wss://archiver.d9network.com:40300",
9138
- * });
9139
- *
9140
- * // Query USDT balance
9141
- * const result = await d9Client.contracts.usdt.query("PSP22::balance_of", {
9142
- * origin: aliceAddress,
9143
- * args: { owner: aliceAddress },
9144
- * });
9145
- *
9146
- * if (result.success) {
9147
- * console.log("Balance:", result.value.response);
9148
- * }
9149
- * ```
8373
+ * Type guard to check for specific error types
9150
8374
  */
9151
- declare function createD9SdkClient(options: CreateD9SdkClientOptions): {
9152
- client: polkadot_api0.PolkadotClient;
9153
- api: polkadot_api0.TypedApi<D9>;
9154
- inkSdk: D9InkSdkWithRpc;
8375
+ declare function isErrorType<T extends ContractErrorType>(error: unknown, type: T): error is ContractError & {
8376
+ type: T;
9155
8377
  };
9156
- type D9SdkClientReturn = ReturnType<typeof createD9SdkClient>;
9157
8378
  //#endregion
9158
8379
  //#region src/wallet/hex.d.ts
9159
8380
  declare function isHexString(input: unknown): input is HexString$1;
@@ -9495,5 +8716,5 @@ interface FormatDurationOptions {
9495
8716
  */
9496
8717
  declare function formatBlockDuration(blocks: number, options?: FormatDurationOptions): string;
9497
8718
  //#endregion
9498
- export { ArithmeticError, BLOCKS_PER_DAY, BLOCKS_PER_HOUR, BLOCKS_PER_MINUTE, BLOCKS_PER_WEEK, BalanceStatus, BalancesTypesReasons, ContractEventParser, CreateD9SdkClientOptions, D9, D9Apis, D9CallData, D9Calls, D9Constants, D9DispatchError, D9Errors, D9Events, D9Extensions, D9Queries, D9SdkClientReturn, D9ViewFns, D9WhitelistEntry, D9_BLOCK_TIME_MS, D9_TOKEN, type DecodedContractEvent, DigestItem, DispatchClass, type EventFilterOptions, type EventSubscriptionOptions, FormatBalanceOptions, FormatDurationOptions, GrandpaEquivocation, GrandpaEvent, GrandpaStoredState, type HexString, MultiAddress, Phase, type PolkadotSigner, type RawContractEvent, type SS58String, SessionEvent, Sr25519Keypair, TokenConfig, TransactionPaymentEvent, TransactionPaymentReleases, TransactionalError, USDT_TOKEN, WalletAccount, WhitelistEntriesByChain, WhitelistEntry, addressesEqual, blocksToMs, blocksUntil, bytesToHex, index_d_exports as contracts, createAccountFromMnemonic, createAccountFromPrivateKey, createContractEventStream, createD9SdkClient, createNativeTransferStream, createPSP22TransferStream, createSr25519SignerFromKeypair, _allDescriptors as d9, estimateBlockAtTime, estimateTimeAtBlock, formatBalance, formatBlockDuration, formatTokenAmount, generateMnemonic, getAddressPrefix, getMetadata, hexToBytes, isHexString, isValidAddress, isValidAddressForNetwork, isValidD9Address, mnemonicToMiniSecret, msToBlocks, parseAmount, sr25519AddressFromKeypair, sr25519AddressFromSecretKeyHex, sr25519DeriveFromMiniSecret, sr25519KeypairFromMiniSecret, ss58DecodePublicKey, ss58Reencode, toD9Address, toNetworkAddress, validateMnemonic };
8719
+ export { AbortedError, ArithmeticError, BLOCKS_PER_DAY, BLOCKS_PER_HOUR, BLOCKS_PER_MINUTE, BLOCKS_PER_WEEK, BalanceStatus, BalancesTypesReasons, ContractError, type ContractErrorType, ContractExecutionError, D9, D9Apis, D9CallData, D9Calls, D9Constants, D9DispatchError, D9Errors, D9Events, D9Extensions, D9Queries, D9ViewFns, D9WhitelistEntry, D9_BLOCK_TIME_MS, D9_DECIMALS, D9_SS58_PREFIX, D9_SYMBOL, D9_TOKEN, DecodeError, DigestItem, DispatchClass, EncodeError, FormatBalanceOptions, FormatDurationOptions, GrandpaEquivocation, GrandpaEvent, GrandpaStoredState, type HexString, LangError, MetadataError, MultiAddress, NetworkError, Phase, type PolkadotSigner, type SS58String, SessionEvent, SignerError, Sr25519Keypair, TimeoutError, TokenConfig, TransactionError, TransactionPaymentEvent, TransactionPaymentReleases, TransactionalError, USDT_DECIMALS, USDT_SYMBOL, USDT_TOKEN, WalletAccount, WhitelistEntriesByChain, WhitelistEntry, addressesEqual, blocksToMs, blocksUntil, bytesToHex, index_d_exports as contracts, createAccountFromMnemonic, createAccountFromPrivateKey, createSr25519SignerFromKeypair, _allDescriptors as d9, estimateBlockAtTime, estimateTimeAtBlock, formatBalance, formatBlockDuration, formatTokenAmount, generateMnemonic, getAddressPrefix, getMetadata, hexToBytes, isContractError, isErrorType, isHexString, isValidAddress, isValidAddressForNetwork, isValidD9Address, mnemonicToMiniSecret, msToBlocks, parseAmount, sr25519AddressFromKeypair, sr25519AddressFromSecretKeyHex, sr25519DeriveFromMiniSecret, sr25519KeypairFromMiniSecret, ss58DecodePublicKey, ss58Reencode, toD9Address, toNetworkAddress, validateMnemonic };
9499
8720
  //# sourceMappingURL=index.d.cts.map