@dedot/api 0.7.0 → 0.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,8 +1,7 @@
1
- import { Signer } from '@polkadot/types/types';
2
1
  import { BlockHash, Hash, Metadata, PortableRegistry, RuntimeVersion } from '@dedot/codecs';
3
2
  import type { JsonRpcProvider } from '@dedot/providers';
4
3
  import { type IStorage } from '@dedot/storage';
5
- import { GenericSubstrateApi, RpcVersion, VersionedGenericSubstrateApi } from '@dedot/types';
4
+ import { GenericSubstrateApi, InjectedSigner, RpcVersion, VersionedGenericSubstrateApi } from '@dedot/types';
6
5
  import { Deferred } from '@dedot/utils';
7
6
  import type { SubstrateApi } from '../chaintypes/index.js';
8
7
  import { JsonRpcClient } from '../json-rpc/index.js';
@@ -69,5 +68,5 @@ export declare abstract class BaseSubstrateClient<Rv extends RpcVersion, ChainAp
69
68
  protected callAt(hash?: BlockHash): ChainApi[Rv]['call'];
70
69
  get tx(): ChainApi[Rv]['tx'];
71
70
  at<ChainApiAt extends GenericSubstrateApi = ChainApi[Rv]>(hash: BlockHash): Promise<ISubstrateClientAt<ChainApiAt>>;
72
- setSigner(signer?: Signer): void;
71
+ setSigner(signer?: InjectedSigner): void;
73
72
  }
@@ -1,5 +1,5 @@
1
- import { SignerPayloadJSON, SignerPayloadRaw } from '@polkadot/types/types';
2
1
  import * as $ from '@dedot/shape';
2
+ import { SignerPayloadJSON, SignerPayloadRaw } from '@dedot/types';
3
3
  import { HexString } from '@dedot/utils';
4
4
  import { SignedExtension } from './SignedExtension.js';
5
5
  export declare class ExtraSignedExtension extends SignedExtension<any[], any[]> {
@@ -1,7 +1,6 @@
1
- import { SignerPayloadJSON } from '@polkadot/types/types';
2
1
  import { PortableRegistry, SignedExtensionDefLatest } from '@dedot/codecs';
3
2
  import * as $ from '@dedot/shape';
4
- import { PayloadOptions } from '@dedot/types';
3
+ import { PayloadOptions, SignerPayloadJSON } from '@dedot/types';
5
4
  import { ISubstrateClient } from '../../types.js';
6
5
  export interface ISignedExtension {
7
6
  identifier: string;
@@ -1,4 +1,4 @@
1
- import { SignerPayloadJSON } from '@polkadot/types/types';
1
+ import { SignerPayloadJSON } from '@dedot/types';
2
2
  import { SignedExtension } from '../SignedExtension.js';
3
3
  /**
4
4
  * @name ChargeAssetTxPayment
@@ -1,4 +1,4 @@
1
- import { SignerPayloadJSON } from '@polkadot/types/types';
1
+ import { SignerPayloadJSON } from '@dedot/types';
2
2
  import { SignedExtension } from '../SignedExtension.js';
3
3
  export declare class ChargeTransactionPayment extends SignedExtension<bigint> {
4
4
  init(): Promise<void>;
@@ -1,5 +1,5 @@
1
- import { SignerPayloadJSON } from '@polkadot/types/types';
2
1
  import { Hash } from '@dedot/codecs';
2
+ import { SignerPayloadJSON } from '@dedot/types';
3
3
  import { SignedExtension } from '../SignedExtension.js';
4
4
  /**
5
5
  * @description Genesis hash check to provide replay protection between different networks.
@@ -1,5 +1,5 @@
1
- import { SignerPayloadJSON } from '@polkadot/types/types';
2
1
  import { Hash } from '@dedot/codecs';
2
+ import { SignerPayloadJSON } from '@dedot/types';
3
3
  import { SignedExtension } from '../SignedExtension.js';
4
4
  export type CheckMetadataHashMode = 'Disabled' | 'Enabled';
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { SignerPayloadJSON } from '@polkadot/types/types';
2
1
  import { EraLike, Hash } from '@dedot/codecs';
2
+ import { SignerPayloadJSON } from '@dedot/types';
3
3
  import { SignedExtension } from '../SignedExtension.js';
4
4
  export declare const MAX_FINALITY_LAG: number;
5
5
  export declare const FALLBACK_MAX_HASH_COUNT: number;
@@ -1,4 +1,4 @@
1
- import { SignerPayloadJSON } from '@polkadot/types/types';
1
+ import { SignerPayloadJSON } from '@dedot/types';
2
2
  import { SignedExtension } from '../SignedExtension.js';
3
3
  /**
4
4
  * @description Nonce check and increment to give replay protection for transactions.
@@ -1,4 +1,4 @@
1
- import { SignerPayloadJSON } from '@polkadot/types/types';
1
+ import { SignerPayloadJSON } from '@dedot/types';
2
2
  import { SignedExtension } from '../SignedExtension.js';
3
3
  /**
4
4
  * @description Ensure the runtime version registered in the transaction is the same as at present.
@@ -1,4 +1,4 @@
1
- import { SignerPayloadJSON } from '@polkadot/types/types';
1
+ import { SignerPayloadJSON } from '@dedot/types';
2
2
  import { SignedExtension } from '../SignedExtension.js';
3
3
  /**
4
4
  * @description Ensure the transaction version registered in the transaction is the same as at present.
@@ -1,2 +1,2 @@
1
- import type { Signer } from '@polkadot/types/types';
2
- export declare const fakeSigner: Signer;
1
+ import { InjectedSigner } from '@dedot/types';
2
+ export declare const fakeSigner: InjectedSigner;
@@ -1,6 +1,5 @@
1
- import { IKeyringPair } from '@polkadot/types/types';
2
1
  import { TransactionStatus } from '@dedot/codecs';
3
- import type { AddressOrPair, TxStatus } from '@dedot/types';
2
+ import type { AddressOrPair, IKeyringPair, TxStatus } from '@dedot/types';
4
3
  import { HexString } from '@dedot/utils';
5
4
  export declare function isKeyringPair(account: AddressOrPair): account is IKeyringPair;
6
5
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dedot/api",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "description": "A delightful JavaScript/TypeScript client for Polkadot & Substrate",
5
5
  "author": "Thang X. Vu <thang@coongcrafts.io>",
6
6
  "homepage": "https://github.com/dedotdev/dedot/tree/main/packages/api",
@@ -13,13 +13,13 @@
13
13
  "type": "module",
14
14
  "sideEffects": false,
15
15
  "dependencies": {
16
- "@dedot/codecs": "0.7.0",
17
- "@dedot/providers": "0.7.0",
18
- "@dedot/runtime-specs": "0.7.0",
19
- "@dedot/shape": "0.7.0",
20
- "@dedot/storage": "0.7.0",
21
- "@dedot/types": "0.7.0",
22
- "@dedot/utils": "0.7.0"
16
+ "@dedot/codecs": "0.7.1",
17
+ "@dedot/providers": "0.7.1",
18
+ "@dedot/runtime-specs": "0.7.1",
19
+ "@dedot/shape": "0.7.1",
20
+ "@dedot/storage": "0.7.1",
21
+ "@dedot/types": "0.7.1",
22
+ "@dedot/utils": "0.7.1"
23
23
  },
24
24
  "scripts": {
25
25
  "build": "tsc --project tsconfig.build.json && tsc --project tsconfig.build.cjs.json",
@@ -44,14 +44,11 @@
44
44
  "access": "public",
45
45
  "directory": "dist"
46
46
  },
47
- "devDependencies": {
48
- "@polkadot/types": "^15.5.2"
49
- },
50
47
  "engines": {
51
48
  "node": ">=18"
52
49
  },
53
50
  "license": "Apache-2.0",
54
- "gitHead": "3ffedd102a8cb5d4669fb690a28d8f89d3325ff9",
51
+ "gitHead": "5743229117be17b74d16c35a2862da4c36a24045",
55
52
  "module": "./index.js",
56
53
  "types": "./index.d.ts"
57
54
  }
package/types.d.ts CHANGED
@@ -1,9 +1,8 @@
1
- import { Signer } from '@polkadot/types/types';
2
1
  import { BlockHash, Hash, Metadata, PortableRegistry } from '@dedot/codecs';
3
2
  import type { ConnectionStatus, JsonRpcProvider, ProviderEvent } from '@dedot/providers';
4
3
  import type { AnyShape } from '@dedot/shape';
5
4
  import type { IStorage } from '@dedot/storage';
6
- import type { GenericSubstrateApi, RpcVersion, RuntimeApiName, RuntimeApiSpec, Unsub } from '@dedot/types';
5
+ import type { GenericSubstrateApi, InjectedSigner, RpcVersion, RuntimeApiName, RuntimeApiSpec, Unsub } from '@dedot/types';
7
6
  import type { HashFn, HexString, IEventEmitter } from '@dedot/utils';
8
7
  import type { AnySignedExtension } from './extrinsic/index.js';
9
8
  export type MetadataKey = `RAW_META/${string}`;
@@ -59,7 +58,7 @@ export interface ApiOptions extends JsonRpcClientOptions {
59
58
  /**
60
59
  * A signer instance to use for signing transactions
61
60
  */
62
- signer?: Signer;
61
+ signer?: InjectedSigner;
63
62
  }
64
63
  export type ApiEvent = ProviderEvent | 'ready' | 'runtimeUpgraded';
65
64
  export interface SubstrateRuntimeVersion {
@@ -119,7 +118,7 @@ export interface ISubstrateClient<ChainApi extends GenericSubstrateApi = Generic
119
118
  *
120
119
  * @param signer
121
120
  */
122
- setSigner(signer?: Signer): void;
121
+ setSigner(signer?: InjectedSigner): void;
123
122
  }
124
123
  /**
125
124
  * A generic interface for broadcasting transactions