@airgap/module-kit 0.13.12 → 0.13.13-beta.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.
- package/module/module.d.ts +8 -5
- package/package.json +3 -3
- package/types/protocol.d.ts +1 -0
package/module/module.d.ts
CHANGED
|
@@ -4,17 +4,20 @@ import { AirGapV3SerializerCompanion } from '../serializer/serializer';
|
|
|
4
4
|
import { AirGapInterface } from '../types/airgap';
|
|
5
5
|
import { Complement } from '../types/meta/utility-types';
|
|
6
6
|
import { ProtocolConfiguration } from '../types/module';
|
|
7
|
-
|
|
7
|
+
import { ProtocolNetwork } from '../types/protocol';
|
|
8
|
+
interface ModuleGeneric<_Protocols extends string = string, _ProtocolNetwork extends ProtocolNetwork = ProtocolNetwork> {
|
|
8
9
|
Protocols: _Protocols;
|
|
10
|
+
ProtocolNetwork: _ProtocolNetwork;
|
|
9
11
|
}
|
|
10
12
|
declare type TypedProtocols<G extends Partial<ModuleGeneric>> = Complement<ModuleGeneric, G>['Protocols'];
|
|
11
|
-
|
|
13
|
+
declare type TypedProtocolNetwork<G extends Partial<ModuleGeneric>> = Complement<ModuleGeneric, G>['ProtocolNetwork'];
|
|
14
|
+
interface _Module<_Protocols extends ModuleGeneric['Protocols'] = any, _ProtocolNetwork extends ModuleGeneric['ProtocolNetwork'] = any> {
|
|
12
15
|
supportedProtocols: Record<_Protocols, ProtocolConfiguration>;
|
|
13
16
|
createOfflineProtocol(identifier: _Protocols): Promise<AirGapOfflineProtocol | undefined>;
|
|
14
|
-
createOnlineProtocol(identifier: _Protocols,
|
|
15
|
-
createBlockExplorer(identifier: _Protocols,
|
|
17
|
+
createOnlineProtocol(identifier: _Protocols, networkOrId?: _ProtocolNetwork | string): Promise<AirGapOnlineProtocol | undefined>;
|
|
18
|
+
createBlockExplorer(identifier: _Protocols, networkOrId?: _ProtocolNetwork | string): Promise<AirGapBlockExplorer | undefined>;
|
|
16
19
|
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
17
20
|
}
|
|
18
|
-
export declare type Module<G extends Partial<ModuleGeneric> = {}> = _Module<TypedProtocols<G>>;
|
|
21
|
+
export declare type Module<G extends Partial<ModuleGeneric> = {}> = _Module<TypedProtocols<G>, TypedProtocolNetwork<G>>;
|
|
19
22
|
export declare type AirGapModule<G extends Partial<ModuleGeneric> = {}> = AirGapInterface<Module<G>>;
|
|
20
23
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airgap/module-kit",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.13-beta.1",
|
|
4
4
|
"description": "The @airgap/module-kit package provides the common interfaces and functionalities to implement AirGap modules.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"airgap",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
},
|
|
30
30
|
"author": "Papers AG <contact@papers.ch> (https://papers.ch)",
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@airgap/coinlib-core": "
|
|
33
|
-
"@airgap/serializer": "
|
|
32
|
+
"@airgap/coinlib-core": "^0.13.13-beta.1",
|
|
33
|
+
"@airgap/serializer": "^0.13.13-beta.1"
|
|
34
34
|
},
|
|
35
35
|
"nyc": {
|
|
36
36
|
"include": [
|