@atomiqlabs/base 10.0.0-dev.14 → 10.0.0-dev.16

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.
@@ -4,10 +4,12 @@ export type TransactionConfirmationOptions = {
4
4
  feeRate?: string;
5
5
  };
6
6
  export type AbstractSigner = {
7
+ type: "AtomiqAbstractSigner";
7
8
  getAddress: () => string;
8
9
  init?: () => Promise<void>;
9
10
  stop?: () => Promise<void>;
10
11
  };
12
+ export declare function isAbstractSigner(val: any): val is AbstractSigner;
11
13
  export interface ChainInterface<TX = any, Signer extends AbstractSigner = AbstractSigner, ChainId extends string = string, NativeSigner = any> {
12
14
  readonly chainId: ChainId;
13
15
  /**
@@ -112,5 +114,5 @@ export interface ChainInterface<TX = any, Signer extends AbstractSigner = Abstra
112
114
  /**
113
115
  * Wraps a native chain signer object to an atomiq-understandable AbstractSigner
114
116
  */
115
- wrapSigner(signer: NativeSigner): Signer;
117
+ wrapSigner(signer: NativeSigner): Promise<Signer>;
116
118
  }
@@ -1,2 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.isAbstractSigner = void 0;
4
+ function isAbstractSigner(val) {
5
+ return typeof (val) === "object" && val.type === "AtomiqAbstractSigner" && typeof (val.getAddress) === "function";
6
+ }
7
+ exports.isAbstractSigner = isAbstractSigner;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atomiqlabs/base",
3
- "version": "10.0.0-dev.14",
3
+ "version": "10.0.0-dev.16",
4
4
  "description": "Base classes and interfaces for atomiq protocol",
5
5
  "main": "./dist/index.js",
6
6
  "types:": "./dist/index.d.ts",
@@ -5,11 +5,16 @@ export type TransactionConfirmationOptions = {
5
5
  };
6
6
 
7
7
  export type AbstractSigner = {
8
+ type: "AtomiqAbstractSigner",
8
9
  getAddress: () => string,
9
10
  init?: () => Promise<void>,
10
11
  stop?: () => Promise<void>
11
12
  };
12
13
 
14
+ export function isAbstractSigner(val: any): val is AbstractSigner {
15
+ return typeof(val)==="object" && val.type==="AtomiqAbstractSigner" && typeof(val.getAddress)==="function";
16
+ }
17
+
13
18
  export interface ChainInterface<
14
19
  TX = any,
15
20
  Signer extends AbstractSigner = AbstractSigner,
@@ -136,6 +141,6 @@ export interface ChainInterface<
136
141
  /**
137
142
  * Wraps a native chain signer object to an atomiq-understandable AbstractSigner
138
143
  */
139
- wrapSigner(signer: NativeSigner): Signer;
144
+ wrapSigner(signer: NativeSigner): Promise<Signer>;
140
145
 
141
146
  }