@airgap/cosmos 0.13.16-beta.2 → 0.13.16-beta.3
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/index.d.ts +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
- package/v1/block-explorer/MintscanBlockExplorer.d.ts +1 -1
- package/v1/block-explorer/MintscanBlockExplorer.js +0 -2
- package/v1/block-explorer/MintscanBlockExplorer.js.map +1 -1
- package/v1/index.d.ts +1 -1
- package/v1/index.js.map +1 -1
- package/v1/module/CosmosModule.d.ts +4 -2
- package/v1/module/CosmosModule.js +6 -6
- package/v1/module/CosmosModule.js.map +1 -1
- package/v1/protocol/CosmosProtocol.d.ts +2 -2
- package/v1/protocol/CosmosProtocol.js +3 -2
- package/v1/protocol/CosmosProtocol.js.map +1 -1
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from './
|
|
1
|
+
export * from './v1';
|
package/index.js
CHANGED
|
@@ -14,5 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./v1"), exports);
|
|
18
18
|
//# sourceMappingURL=index.js.map
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@ import { AirGapBlockExplorer, BlockExplorerMetadata } from '@airgap/module-kit';
|
|
|
2
2
|
export declare class MintscanBlockExplorer implements AirGapBlockExplorer {
|
|
3
3
|
private readonly url;
|
|
4
4
|
private readonly metadata;
|
|
5
|
-
constructor(url
|
|
5
|
+
constructor(url: string);
|
|
6
6
|
getMetadata(): Promise<BlockExplorerMetadata>;
|
|
7
7
|
createAddressUrl(address: string): Promise<string>;
|
|
8
8
|
createTransactionUrl(transactionId: string): Promise<string>;
|
|
@@ -37,10 +37,8 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
37
37
|
};
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.MintscanBlockExplorer = void 0;
|
|
40
|
-
var BLOCK_EXPLORER_URL = 'https://www.mintscan.io';
|
|
41
40
|
var MintscanBlockExplorer = /** @class */ (function () {
|
|
42
41
|
function MintscanBlockExplorer(url) {
|
|
43
|
-
if (url === void 0) { url = BLOCK_EXPLORER_URL; }
|
|
44
42
|
this.url = url;
|
|
45
43
|
this.metadata = {
|
|
46
44
|
name: 'Mintscan',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MintscanBlockExplorer.js","sourceRoot":"","sources":["../../../src/v1/block-explorer/MintscanBlockExplorer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA
|
|
1
|
+
{"version":3,"file":"MintscanBlockExplorer.js","sourceRoot":"","sources":["../../../src/v1/block-explorer/MintscanBlockExplorer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA;IAME,+BAAoC,GAAW;QAAX,QAAG,GAAH,GAAG,CAAQ;QAL9B,aAAQ,GAA0B;YACjD,IAAI,EAAE,UAAU;YAChB,GAAG,EAAE,IAAI,CAAC,GAAG;SACd,CAAA;IAEiD,CAAC;IAEtC,2CAAW,GAAxB;;;gBACE,sBAAO,IAAI,CAAC,QAAQ,EAAA;;;KACrB;IAEY,gDAAgB,GAA7B,UAA8B,OAAe;;;gBAC3C,sBAAO,UAAG,IAAI,CAAC,GAAG,6BAAmB,OAAO,CAAE,EAAA;;;KAC/C;IAEY,oDAAoB,GAAjC,UAAkC,aAAqB;;;gBACrD,sBAAO,UAAG,IAAI,CAAC,GAAG,yBAAe,aAAa,CAAE,EAAA;;;KACjD;IACH,4BAAC;AAAD,CAAC,AAnBD,IAmBC;AAnBY,sDAAqB"}
|
package/v1/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MintscanBlockExplorer } from './block-explorer/MintscanBlockExplorer';
|
|
2
2
|
import { CosmosModule } from './module/CosmosModule';
|
|
3
|
-
import { CosmosProtocol, createCosmosProtocol, createCosmosProtocolOptions
|
|
3
|
+
import { CosmosDenom, CosmosProtocol, createCosmosProtocol, createCosmosProtocolOptions } from './protocol/CosmosProtocol';
|
|
4
4
|
export { CosmosModule };
|
|
5
5
|
export { CosmosProtocol, createCosmosProtocol, createCosmosProtocolOptions, CosmosDenom };
|
|
6
6
|
export { MintscanBlockExplorer };
|
package/v1/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,gFAA8E;AAcrE,sGAdA,6CAAqB,OAcA;AAb9B,sDAAoD;AAK3C,6FALA,2BAAY,OAKA;AAJrB,4DAA0H;AAQjG,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/v1/index.ts"],"names":[],"mappings":";;;AAAA,gFAA8E;AAcrE,sGAdA,6CAAqB,OAcA;AAb9B,sDAAoD;AAK3C,6FALA,2BAAY,OAKA;AAJrB,4DAA0H;AAQjG,qGARa,qCAAoB,OAQb;AAAE,4GARa,4CAA2B,OAQb"}
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
import { MainProtocolSymbols } from '@airgap/coinlib-core';
|
|
2
|
+
import { CosmosProtocolNetwork } from '@airgap/cosmos-core';
|
|
2
3
|
import { AirGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapV3SerializerCompanion, ProtocolConfiguration } from '@airgap/module-kit';
|
|
3
4
|
declare type SupportedProtocols = MainProtocolSymbols.COSMOS;
|
|
4
5
|
export declare class CosmosModule implements AirGapModule<{
|
|
5
6
|
Protocols: SupportedProtocols;
|
|
7
|
+
ProtocolNetwork: CosmosProtocolNetwork;
|
|
6
8
|
}> {
|
|
7
9
|
private readonly networkRegistries;
|
|
8
10
|
readonly supportedProtocols: Record<SupportedProtocols, ProtocolConfiguration>;
|
|
9
11
|
createOfflineProtocol(identifier: SupportedProtocols): Promise<AirGapOfflineProtocol | undefined>;
|
|
10
|
-
createOnlineProtocol(identifier: SupportedProtocols,
|
|
11
|
-
createBlockExplorer(identifier: SupportedProtocols,
|
|
12
|
+
createOnlineProtocol(identifier: SupportedProtocols, networkOrId?: CosmosProtocolNetwork | string): Promise<AirGapOnlineProtocol | undefined>;
|
|
13
|
+
createBlockExplorer(identifier: SupportedProtocols, networkOrId?: CosmosProtocolNetwork | string): Promise<AirGapBlockExplorer | undefined>;
|
|
12
14
|
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
13
15
|
private createProtocol;
|
|
14
16
|
}
|
|
@@ -60,12 +60,12 @@ var CosmosModule = /** @class */ (function () {
|
|
|
60
60
|
});
|
|
61
61
|
});
|
|
62
62
|
};
|
|
63
|
-
CosmosModule.prototype.createOnlineProtocol = function (identifier,
|
|
63
|
+
CosmosModule.prototype.createOnlineProtocol = function (identifier, networkOrId) {
|
|
64
64
|
var _a;
|
|
65
65
|
return __awaiter(this, void 0, void 0, function () {
|
|
66
66
|
var network;
|
|
67
67
|
return __generator(this, function (_b) {
|
|
68
|
-
network = (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(
|
|
68
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
69
69
|
if (network === undefined) {
|
|
70
70
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.COSMOS, 'Protocol network type not supported.');
|
|
71
71
|
}
|
|
@@ -73,16 +73,16 @@ var CosmosModule = /** @class */ (function () {
|
|
|
73
73
|
});
|
|
74
74
|
});
|
|
75
75
|
};
|
|
76
|
-
CosmosModule.prototype.createBlockExplorer = function (identifier,
|
|
76
|
+
CosmosModule.prototype.createBlockExplorer = function (identifier, networkOrId) {
|
|
77
77
|
var _a;
|
|
78
78
|
return __awaiter(this, void 0, void 0, function () {
|
|
79
79
|
var network;
|
|
80
80
|
return __generator(this, function (_b) {
|
|
81
|
-
network = (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(
|
|
82
|
-
if (
|
|
81
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
82
|
+
if (network === undefined) {
|
|
83
83
|
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.COSMOS, 'Block Explorer network type not supported.');
|
|
84
84
|
}
|
|
85
|
-
return [2 /*return*/, new MintscanBlockExplorer_1.MintscanBlockExplorer()];
|
|
85
|
+
return [2 /*return*/, new MintscanBlockExplorer_1.MintscanBlockExplorer(network.blockExplorerUrl)];
|
|
86
86
|
});
|
|
87
87
|
});
|
|
88
88
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CosmosModule.js","sourceRoot":"","sources":["../../../src/v1/module/CosmosModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,sDAAqE;
|
|
1
|
+
{"version":3,"file":"CosmosModule.js","sourceRoot":"","sources":["../../../src/v1/module/CosmosModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAkE;AAClE,sDAAqE;AAErE,iDAW2B;AAE3B,iFAA+E;AAC/E,6DAAkG;AAClG,8EAAmF;AAInF;IAAA;;QACmB,sBAAiB;YAChC,GAAC,kCAAmB,CAAC,MAAM,IAAG,IAAI,kCAAqB,CAAC;gBACtD,iBAAiB,EAAE,CAAC,gDAA+B,CAAC;aACrD,CAAC;gBACH;QACe,uBAAkB,GAAsD,IAAA,qCAAwB,E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AAA,EAAE,CAAC,CAAA;YAC1C;gBACE,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,MAAM,EAAE,mBAAY,UAAU,oBAAiB,CAAC,CAAA;SAC5F;IACH,CAAC;IACH,mBAAC;AAAD,CAAC,AApDD,IAoDC;AApDY,oCAAY"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { FeeDefaults, ProtocolMetadata, PublicKey, RecursivePartial, TransactionDetails } from '@airgap/module-kit';
|
|
1
|
+
import { FeeDefaults, ProtocolMetadata, PublicKey, RecursivePartial, TransactionDetails, TransactionSimpleConfiguration } from '@airgap/module-kit';
|
|
2
2
|
import { CosmosBaseProtocolImpl, CosmosProtocolNetwork, CosmosProtocolOptions, CosmosBaseStakingProtocol } from '@airgap/cosmos-core';
|
|
3
3
|
export declare type CosmosDenom = 'atom' | 'uatom';
|
|
4
4
|
export interface CosmosProtocol extends CosmosBaseStakingProtocol<CosmosDenom> {
|
|
@@ -9,7 +9,7 @@ export declare class CosmosProtocolImpl extends CosmosBaseProtocolImpl<CosmosDen
|
|
|
9
9
|
private readonly feeDefaults;
|
|
10
10
|
private readonly metadata;
|
|
11
11
|
getMetadata(): Promise<ProtocolMetadata<CosmosDenom>>;
|
|
12
|
-
getTransactionFeeWithPublicKey(_publicKey: PublicKey, _details: TransactionDetails<CosmosDenom>[]): Promise<FeeDefaults<CosmosDenom>>;
|
|
12
|
+
getTransactionFeeWithPublicKey(_publicKey: PublicKey, _details: TransactionDetails<CosmosDenom>[], _configuration?: TransactionSimpleConfiguration): Promise<FeeDefaults<CosmosDenom>>;
|
|
13
13
|
}
|
|
14
14
|
export declare function createCosmosProtocol(options?: RecursivePartial<CosmosProtocolOptions<CosmosDenom>>): CosmosProtocol;
|
|
15
15
|
export declare const COSMOS_MAINNET_PROTOCOL_NETWORK: CosmosProtocolNetwork;
|
|
@@ -122,7 +122,7 @@ var CosmosProtocolImpl = /** @class */ (function (_super) {
|
|
|
122
122
|
});
|
|
123
123
|
});
|
|
124
124
|
};
|
|
125
|
-
CosmosProtocolImpl.prototype.getTransactionFeeWithPublicKey = function (_publicKey, _details) {
|
|
125
|
+
CosmosProtocolImpl.prototype.getTransactionFeeWithPublicKey = function (_publicKey, _details, _configuration) {
|
|
126
126
|
return __awaiter(this, void 0, void 0, function () {
|
|
127
127
|
return __generator(this, function (_a) {
|
|
128
128
|
return [2 /*return*/, this.feeDefaults];
|
|
@@ -141,7 +141,8 @@ exports.createCosmosProtocol = createCosmosProtocol;
|
|
|
141
141
|
exports.COSMOS_MAINNET_PROTOCOL_NETWORK = {
|
|
142
142
|
name: 'Mainnet',
|
|
143
143
|
type: 'mainnet',
|
|
144
|
-
rpcUrl: 'https://cosmos-node.prod.gke.papers.tech'
|
|
144
|
+
rpcUrl: 'https://cosmos-node.prod.gke.papers.tech',
|
|
145
|
+
blockExplorerUrl: 'https://www.mintscan.io'
|
|
145
146
|
};
|
|
146
147
|
var DEFAULT_COSMOS_PROTOCOL_NETWORK = exports.COSMOS_MAINNET_PROTOCOL_NETWORK;
|
|
147
148
|
function createCosmosProtocolOptions(partialOptions) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CosmosProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/CosmosProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA0D;AAC1D,
|
|
1
|
+
{"version":3,"file":"CosmosProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/CosmosProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA0D;AAC1D,iDAU2B;AAE3B,mDAAqI;AAIrI,iBAAiB;AACjB,IAAM,WAAW,GAAwB,IAAA,sBAAS,EAAC,QAAQ,EAAE,YAAY,CAAC,CAAA;AAI1E;IAAwC,sCA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