@wallfree-dev/cosmos 0.13.42
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/LICENSE.md +7 -0
- package/index.d.ts +1 -0
- package/index.js +18 -0
- package/index.js.map +1 -0
- package/package.json +62 -0
- package/readme.md +121 -0
- package/v0/index.d.ts +10 -0
- package/v0/index.js +32 -0
- package/v0/index.js.map +1 -0
- package/v0/protocol/CosmosAddress.d.ts +8 -0
- package/v0/protocol/CosmosAddress.js +28 -0
- package/v0/protocol/CosmosAddress.js.map +1 -0
- package/v0/protocol/CosmosCoin.d.ts +19 -0
- package/v0/protocol/CosmosCoin.js +55 -0
- package/v0/protocol/CosmosCoin.js.map +1 -0
- package/v0/protocol/CosmosCryptoClient.d.ts +8 -0
- package/v0/protocol/CosmosCryptoClient.js +90 -0
- package/v0/protocol/CosmosCryptoClient.js.map +1 -0
- package/v0/protocol/CosmosFee.d.ts +15 -0
- package/v0/protocol/CosmosFee.js +31 -0
- package/v0/protocol/CosmosFee.js.map +1 -0
- package/v0/protocol/CosmosNodeClient.d.ts +25 -0
- package/v0/protocol/CosmosNodeClient.js +382 -0
- package/v0/protocol/CosmosNodeClient.js.map +1 -0
- package/v0/protocol/CosmosProtocol.d.ts +125 -0
- package/v0/protocol/CosmosProtocol.js +1162 -0
- package/v0/protocol/CosmosProtocol.js.map +1 -0
- package/v0/protocol/CosmosProtocolOptions.d.ts +22 -0
- package/v0/protocol/CosmosProtocolOptions.js +116 -0
- package/v0/protocol/CosmosProtocolOptions.js.map +1 -0
- package/v0/protocol/CosmosTransaction.d.ts +37 -0
- package/v0/protocol/CosmosTransaction.js +106 -0
- package/v0/protocol/CosmosTransaction.js.map +1 -0
- package/v0/protocol/CosmosTypes.d.ts +310 -0
- package/v0/protocol/CosmosTypes.js +8 -0
- package/v0/protocol/CosmosTypes.js.map +1 -0
- package/v0/protocol/cosmos-message/CosmosDelegateMessage.d.ts +20 -0
- package/v0/protocol/cosmos-message/CosmosDelegateMessage.js +72 -0
- package/v0/protocol/cosmos-message/CosmosDelegateMessage.js.map +1 -0
- package/v0/protocol/cosmos-message/CosmosMessage.d.ts +39 -0
- package/v0/protocol/cosmos-message/CosmosMessage.js +47 -0
- package/v0/protocol/cosmos-message/CosmosMessage.js.map +1 -0
- package/v0/protocol/cosmos-message/CosmosSendMessage.d.ts +20 -0
- package/v0/protocol/cosmos-message/CosmosSendMessage.js +85 -0
- package/v0/protocol/cosmos-message/CosmosSendMessage.js.map +1 -0
- package/v0/protocol/cosmos-message/CosmosWithdrawDelegationRewardMessage.d.ts +24 -0
- package/v0/protocol/cosmos-message/CosmosWithdrawDelegationRewardMessage.js +61 -0
- package/v0/protocol/cosmos-message/CosmosWithdrawDelegationRewardMessage.js.map +1 -0
- package/v0/serializer/schemas/v2/transaction-sign-request-cosmos.json +100 -0
- package/v0/serializer/schemas/v2/transaction-sign-response-cosmos.json +22 -0
- package/v0/serializer/schemas/v3/transaction-sign-request-cosmos.json +100 -0
- package/v0/serializer/schemas/v3/transaction-sign-response-cosmos.json +23 -0
- package/v0/serializer/validators/transaction-validator.d.ts +15 -0
- package/v0/serializer/validators/transaction-validator.js +112 -0
- package/v0/serializer/validators/transaction-validator.js.map +1 -0
- package/v0/types/signed-transaction-cosmos.d.ts +5 -0
- package/v0/types/signed-transaction-cosmos.js +3 -0
- package/v0/types/signed-transaction-cosmos.js.map +1 -0
- package/v0/types/transaction-cosmos.d.ts +5 -0
- package/v0/types/transaction-cosmos.js +3 -0
- package/v0/types/transaction-cosmos.js.map +1 -0
- package/v0/types/unsigned-transaction-cosmos.d.ts +33 -0
- package/v0/types/unsigned-transaction-cosmos.js +10 -0
- package/v0/types/unsigned-transaction-cosmos.js.map +1 -0
- package/v1/block-explorer/MintscanBlockExplorer.d.ts +9 -0
- package/v1/block-explorer/MintscanBlockExplorer.js +72 -0
- package/v1/block-explorer/MintscanBlockExplorer.js.map +1 -0
- package/v1/index.d.ts +6 -0
- package/v1/index.js +11 -0
- package/v1/index.js.map +1 -0
- package/v1/module/CosmosModule.d.ts +17 -0
- package/v1/module/CosmosModule.js +107 -0
- package/v1/module/CosmosModule.js.map +1 -0
- package/v1/module.d.ts +3 -0
- package/v1/module.js +24 -0
- package/v1/module.js.map +1 -0
- package/v1/protocol/CosmosProtocol.d.ts +16 -0
- package/v1/protocol/CosmosProtocol.js +162 -0
- package/v1/protocol/CosmosProtocol.js.map +1 -0
- package/v1/serializer/v3/serializer-companion.d.ts +12 -0
- package/v1/serializer/v3/serializer-companion.js +142 -0
- package/v1/serializer/v3/serializer-companion.js.map +1 -0
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/SignedCosmosTransaction",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"IAirGapSignedTransaction": {
|
|
6
|
+
"type": "string"
|
|
7
|
+
},
|
|
8
|
+
"SignedCosmosTransaction": {
|
|
9
|
+
"additionalProperties": false,
|
|
10
|
+
"properties": {
|
|
11
|
+
"accountIdentifier": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"transaction": {
|
|
15
|
+
"$ref": "#/definitions/IAirGapSignedTransaction",
|
|
16
|
+
"type": "string"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"required": ["accountIdentifier", "transaction"],
|
|
20
|
+
"type": "object"
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TransactionValidator, TransactionValidatorFactory, TransactionValidatorFactoryV2, TransactionValidatorV2 } from '@wallfree-dev/serializer';
|
|
2
|
+
import { SignedCosmosTransaction } from '../../types/signed-transaction-cosmos';
|
|
3
|
+
import { UnsignedCosmosTransaction } from '../../types/transaction-cosmos';
|
|
4
|
+
export declare class CosmosTransactionValidator implements TransactionValidator, TransactionValidatorV2 {
|
|
5
|
+
private readonly version;
|
|
6
|
+
constructor(version?: 'v2' | 'v3');
|
|
7
|
+
validateUnsignedTransaction(unsignedTx: UnsignedCosmosTransaction): Promise<any>;
|
|
8
|
+
validateSignedTransaction(signedTx: SignedCosmosTransaction): Promise<any>;
|
|
9
|
+
}
|
|
10
|
+
export declare class CosmosTransactionValidatorFactory implements TransactionValidatorFactory<CosmosTransactionValidator> {
|
|
11
|
+
create(): CosmosTransactionValidator;
|
|
12
|
+
}
|
|
13
|
+
export declare class CosmosTransactionValidatorFactoryV2 implements TransactionValidatorFactoryV2<CosmosTransactionValidator> {
|
|
14
|
+
create(): CosmosTransactionValidator;
|
|
15
|
+
}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// tslint:disable: max-classes-per-file
|
|
3
|
+
// import { async } from '../../dependencies/src/validate.js-0.13.1/validate'
|
|
4
|
+
// import { RawTezosTransaction } from '../types'
|
|
5
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
6
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
7
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
8
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
9
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
10
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
11
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
15
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
16
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
18
|
+
function step(op) {
|
|
19
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
20
|
+
while (_) try {
|
|
21
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
22
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
23
|
+
switch (op[0]) {
|
|
24
|
+
case 0: case 1: t = op; break;
|
|
25
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
26
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
27
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
28
|
+
default:
|
|
29
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
30
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
31
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
32
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
33
|
+
if (t[2]) _.ops.pop();
|
|
34
|
+
_.trys.pop(); continue;
|
|
35
|
+
}
|
|
36
|
+
op = body.call(thisArg, _);
|
|
37
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
38
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.CosmosTransactionValidatorFactoryV2 = exports.CosmosTransactionValidatorFactory = exports.CosmosTransactionValidator = void 0;
|
|
43
|
+
var serializer_1 = require("@wallfree-dev/serializer");
|
|
44
|
+
// const unsignedTransactionConstraints = {
|
|
45
|
+
// binaryTransaction: {
|
|
46
|
+
// isValidTezosUnsignedTransaction: true,
|
|
47
|
+
// presence: { allowEmpty: false },
|
|
48
|
+
// type: 'String'
|
|
49
|
+
// }
|
|
50
|
+
// }
|
|
51
|
+
// const success = () => undefined
|
|
52
|
+
// const error = errors => errors
|
|
53
|
+
// const signedTransactionConstraints = {
|
|
54
|
+
// transaction: {
|
|
55
|
+
// isValidTezosSignedTransaction: true,
|
|
56
|
+
// presence: { allowEmpty: false },
|
|
57
|
+
// type: 'String'
|
|
58
|
+
// },
|
|
59
|
+
// accountIdentifier: {
|
|
60
|
+
// presence: { allowEmpty: false },
|
|
61
|
+
// type: 'String'
|
|
62
|
+
// }
|
|
63
|
+
// }
|
|
64
|
+
// TODO implement this
|
|
65
|
+
var CosmosTransactionValidator = /** @class */ (function () {
|
|
66
|
+
function CosmosTransactionValidator(version) {
|
|
67
|
+
if (version === void 0) { version = 'v3'; }
|
|
68
|
+
this.version = version;
|
|
69
|
+
}
|
|
70
|
+
CosmosTransactionValidator.prototype.validateUnsignedTransaction = function (unsignedTx) {
|
|
71
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
72
|
+
return __generator(this, function (_a) {
|
|
73
|
+
// const rawTx: RawTezosTransaction = unsignedTx.transaction
|
|
74
|
+
if (this.version === 'v3') {
|
|
75
|
+
(0, serializer_1.validateSyncScheme)({});
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
(0, serializer_1.validateSyncSchemeV2)({});
|
|
79
|
+
}
|
|
80
|
+
return [2 /*return*/, undefined]; // async(rawTx, unsignedTransactionConstraints).then(success, error)
|
|
81
|
+
});
|
|
82
|
+
});
|
|
83
|
+
};
|
|
84
|
+
CosmosTransactionValidator.prototype.validateSignedTransaction = function (signedTx) {
|
|
85
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
86
|
+
return __generator(this, function (_a) {
|
|
87
|
+
return [2 /*return*/, undefined]; // async(signedTx, signedTransactionConstraints).then(success, error)
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
return CosmosTransactionValidator;
|
|
92
|
+
}());
|
|
93
|
+
exports.CosmosTransactionValidator = CosmosTransactionValidator;
|
|
94
|
+
var CosmosTransactionValidatorFactory = /** @class */ (function () {
|
|
95
|
+
function CosmosTransactionValidatorFactory() {
|
|
96
|
+
}
|
|
97
|
+
CosmosTransactionValidatorFactory.prototype.create = function () {
|
|
98
|
+
return new CosmosTransactionValidator('v3');
|
|
99
|
+
};
|
|
100
|
+
return CosmosTransactionValidatorFactory;
|
|
101
|
+
}());
|
|
102
|
+
exports.CosmosTransactionValidatorFactory = CosmosTransactionValidatorFactory;
|
|
103
|
+
var CosmosTransactionValidatorFactoryV2 = /** @class */ (function () {
|
|
104
|
+
function CosmosTransactionValidatorFactoryV2() {
|
|
105
|
+
}
|
|
106
|
+
CosmosTransactionValidatorFactoryV2.prototype.create = function () {
|
|
107
|
+
return new CosmosTransactionValidator('v2');
|
|
108
|
+
};
|
|
109
|
+
return CosmosTransactionValidatorFactoryV2;
|
|
110
|
+
}());
|
|
111
|
+
exports.CosmosTransactionValidatorFactoryV2 = CosmosTransactionValidatorFactoryV2;
|
|
112
|
+
//# sourceMappingURL=transaction-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../src/v0/serializer/validators/transaction-validator.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,6EAA6E;AAC7E,iDAAiD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEjD,uDAOiC;AAKjC,2CAA2C;AAC3C,yBAAyB;AACzB,6CAA6C;AAC7C,uCAAuC;AACvC,qBAAqB;AACrB,MAAM;AACN,IAAI;AACJ,kCAAkC;AAClC,iCAAiC;AAEjC,yCAAyC;AACzC,mBAAmB;AACnB,2CAA2C;AAC3C,uCAAuC;AACvC,qBAAqB;AACrB,OAAO;AACP,yBAAyB;AACzB,uCAAuC;AACvC,qBAAqB;AACrB,MAAM;AACN,IAAI;AAEJ,sBAAsB;AACtB;IACE,oCAA6B,OAA2B;QAA3B,wBAAA,EAAA,cAA2B;QAA3B,YAAO,GAAP,OAAO,CAAoB;IAAG,CAAC;IAE/C,gEAA2B,GAAxC,UAAyC,UAAqC;;;gBAC5E,4DAA4D;gBAC5D,IAAI,IAAI,CAAC,OAAO,KAAK,IAAI,EAAE;oBACzB,IAAA,+BAAkB,EAAC,EAAE,CAAC,CAAA;iBACvB;qBAAM;oBACL,IAAA,iCAAoB,EAAC,EAAE,CAAC,CAAA;iBACzB;gBAED,sBAAO,SAAS,EAAA,CAAC,oEAAoE;;;KACtF;IACY,8DAAyB,GAAtC,UAAuC,QAAiC;;;gBACtE,sBAAO,SAAS,EAAA,CAAC,qEAAqE;;;KACvF;IACH,iCAAC;AAAD,CAAC,AAhBD,IAgBC;AAhBY,gEAA0B;AAkBvC;IAAA;IAIA,CAAC;IAHQ,kDAAM,GAAb;QACE,OAAO,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAA;IAC7C,CAAC;IACH,wCAAC;AAAD,CAAC,AAJD,IAIC;AAJY,8EAAiC;AAM9C;IAAA;IAIA,CAAC;IAHQ,oDAAM,GAAb;QACE,OAAO,IAAI,0BAA0B,CAAC,IAAI,CAAC,CAAA;IAC7C,CAAC;IACH,0CAAC;AAAD,CAAC,AAJD,IAIC;AAJY,kFAAmC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"signed-transaction-cosmos.js","sourceRoot":"","sources":["../../../src/v0/types/signed-transaction-cosmos.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-cosmos.js","sourceRoot":"","sources":["../../../src/v0/types/transaction-cosmos.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { TransactionSignRequest, TransactionSignRequestV2 } from '@wallfree-dev/serializer';
|
|
2
|
+
interface CosmosCoin {
|
|
3
|
+
denom: string;
|
|
4
|
+
amount: string;
|
|
5
|
+
}
|
|
6
|
+
interface CosmosFee {
|
|
7
|
+
amount: CosmosCoin[];
|
|
8
|
+
gas: string;
|
|
9
|
+
}
|
|
10
|
+
declare enum CosmosMessageTypeIndex {
|
|
11
|
+
SEND = 0,
|
|
12
|
+
DELEGATE = 1,
|
|
13
|
+
UNDELEGATE = 2,
|
|
14
|
+
WITHDRAW_DELEGATION_REWARD = 3
|
|
15
|
+
}
|
|
16
|
+
interface CosmosMessage {
|
|
17
|
+
type: CosmosMessageTypeIndex;
|
|
18
|
+
amount: CosmosCoin[];
|
|
19
|
+
fromAddress: string;
|
|
20
|
+
toAddress: string;
|
|
21
|
+
}
|
|
22
|
+
interface CosmosTransaction {
|
|
23
|
+
messages: CosmosMessage[];
|
|
24
|
+
fee: CosmosFee;
|
|
25
|
+
memo: string;
|
|
26
|
+
chainID: string;
|
|
27
|
+
accountNumber: string;
|
|
28
|
+
sequence: string;
|
|
29
|
+
}
|
|
30
|
+
export interface SerializableUnsignedCosmosTransaction extends TransactionSignRequest, TransactionSignRequestV2 {
|
|
31
|
+
transaction: CosmosTransaction;
|
|
32
|
+
}
|
|
33
|
+
export {};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
var CosmosMessageTypeIndex;
|
|
4
|
+
(function (CosmosMessageTypeIndex) {
|
|
5
|
+
CosmosMessageTypeIndex[CosmosMessageTypeIndex["SEND"] = 0] = "SEND";
|
|
6
|
+
CosmosMessageTypeIndex[CosmosMessageTypeIndex["DELEGATE"] = 1] = "DELEGATE";
|
|
7
|
+
CosmosMessageTypeIndex[CosmosMessageTypeIndex["UNDELEGATE"] = 2] = "UNDELEGATE";
|
|
8
|
+
CosmosMessageTypeIndex[CosmosMessageTypeIndex["WITHDRAW_DELEGATION_REWARD"] = 3] = "WITHDRAW_DELEGATION_REWARD";
|
|
9
|
+
})(CosmosMessageTypeIndex || (CosmosMessageTypeIndex = {}));
|
|
10
|
+
//# sourceMappingURL=unsigned-transaction-cosmos.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unsigned-transaction-cosmos.js","sourceRoot":"","sources":["../../../src/v0/types/unsigned-transaction-cosmos.ts"],"names":[],"mappings":";;AAYA,IAAK,sBAKJ;AALD,WAAK,sBAAsB;IACzB,mEAAQ,CAAA;IACR,2EAAY,CAAA;IACZ,+EAAc,CAAA;IACd,+GAA8B,CAAA;AAChC,CAAC,EALI,sBAAsB,KAAtB,sBAAsB,QAK1B"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { AirGapBlockExplorer, BlockExplorerMetadata } from '@wallfree-dev/module-kit';
|
|
2
|
+
export declare class MintscanBlockExplorer implements AirGapBlockExplorer {
|
|
3
|
+
private readonly url;
|
|
4
|
+
private readonly metadata;
|
|
5
|
+
constructor(url: string);
|
|
6
|
+
getMetadata(): Promise<BlockExplorerMetadata>;
|
|
7
|
+
createAddressUrl(address: string): Promise<string>;
|
|
8
|
+
createTransactionUrl(transactionId: string): Promise<string>;
|
|
9
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.MintscanBlockExplorer = void 0;
|
|
40
|
+
var MintscanBlockExplorer = /** @class */ (function () {
|
|
41
|
+
function MintscanBlockExplorer(url) {
|
|
42
|
+
this.url = url;
|
|
43
|
+
this.metadata = {
|
|
44
|
+
name: 'Mintscan',
|
|
45
|
+
url: this.url
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
MintscanBlockExplorer.prototype.getMetadata = function () {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
50
|
+
return __generator(this, function (_a) {
|
|
51
|
+
return [2 /*return*/, this.metadata];
|
|
52
|
+
});
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
MintscanBlockExplorer.prototype.createAddressUrl = function (address) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
57
|
+
return __generator(this, function (_a) {
|
|
58
|
+
return [2 /*return*/, "".concat(this.url, "/cosmos/account/").concat(address)];
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
};
|
|
62
|
+
MintscanBlockExplorer.prototype.createTransactionUrl = function (transactionId) {
|
|
63
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
64
|
+
return __generator(this, function (_a) {
|
|
65
|
+
return [2 /*return*/, "".concat(this.url, "/cosmos/txs/").concat(transactionId)];
|
|
66
|
+
});
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
return MintscanBlockExplorer;
|
|
70
|
+
}());
|
|
71
|
+
exports.MintscanBlockExplorer = MintscanBlockExplorer;
|
|
72
|
+
//# sourceMappingURL=MintscanBlockExplorer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
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
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { MintscanBlockExplorer } from './block-explorer/MintscanBlockExplorer';
|
|
2
|
+
import { CosmosModule } from './module/CosmosModule';
|
|
3
|
+
import { CosmosDenom, CosmosProtocol, createCosmosProtocol, createCosmosProtocolOptions } from './protocol/CosmosProtocol';
|
|
4
|
+
export { CosmosModule };
|
|
5
|
+
export { CosmosProtocol, createCosmosProtocol, createCosmosProtocolOptions, CosmosDenom };
|
|
6
|
+
export { MintscanBlockExplorer };
|
package/v1/index.js
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MintscanBlockExplorer = exports.createCosmosProtocolOptions = exports.createCosmosProtocol = exports.CosmosModule = void 0;
|
|
4
|
+
var MintscanBlockExplorer_1 = require("./block-explorer/MintscanBlockExplorer");
|
|
5
|
+
Object.defineProperty(exports, "MintscanBlockExplorer", { enumerable: true, get: function () { return MintscanBlockExplorer_1.MintscanBlockExplorer; } });
|
|
6
|
+
var CosmosModule_1 = require("./module/CosmosModule");
|
|
7
|
+
Object.defineProperty(exports, "CosmosModule", { enumerable: true, get: function () { return CosmosModule_1.CosmosModule; } });
|
|
8
|
+
var CosmosProtocol_1 = require("./protocol/CosmosProtocol");
|
|
9
|
+
Object.defineProperty(exports, "createCosmosProtocol", { enumerable: true, get: function () { return CosmosProtocol_1.createCosmosProtocol; } });
|
|
10
|
+
Object.defineProperty(exports, "createCosmosProtocolOptions", { enumerable: true, get: function () { return CosmosProtocol_1.createCosmosProtocolOptions; } });
|
|
11
|
+
//# sourceMappingURL=index.js.map
|
package/v1/index.js.map
ADDED
|
@@ -0,0 +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,qGARa,qCAAoB,OAQb;AAAE,4GARa,4CAA2B,OAQb"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { MainProtocolSymbols } from '@wallfree-dev/coinlib-core';
|
|
2
|
+
import { CosmosProtocolNetwork } from '@wallfree-dev/cosmos-core';
|
|
3
|
+
import { AirGapBlockExplorer, AirGapModule, AirGapOfflineProtocol, AirGapOnlineProtocol, AirGapV3SerializerCompanion, ProtocolConfiguration } from '@wallfree-dev/module-kit';
|
|
4
|
+
declare type SupportedProtocols = MainProtocolSymbols.COSMOS;
|
|
5
|
+
export declare class CosmosModule implements AirGapModule<{
|
|
6
|
+
Protocols: SupportedProtocols;
|
|
7
|
+
ProtocolNetwork: CosmosProtocolNetwork;
|
|
8
|
+
}> {
|
|
9
|
+
private readonly networkRegistries;
|
|
10
|
+
readonly supportedProtocols: Record<SupportedProtocols, ProtocolConfiguration>;
|
|
11
|
+
createOfflineProtocol(identifier: SupportedProtocols): Promise<AirGapOfflineProtocol | undefined>;
|
|
12
|
+
createOnlineProtocol(identifier: SupportedProtocols, networkOrId?: CosmosProtocolNetwork | string): Promise<AirGapOnlineProtocol | undefined>;
|
|
13
|
+
createBlockExplorer(identifier: SupportedProtocols, networkOrId?: CosmosProtocolNetwork | string): Promise<AirGapBlockExplorer | undefined>;
|
|
14
|
+
createV3SerializerCompanion(): Promise<AirGapV3SerializerCompanion>;
|
|
15
|
+
private createProtocol;
|
|
16
|
+
}
|
|
17
|
+
export {};
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.CosmosModule = void 0;
|
|
40
|
+
var coinlib_core_1 = require("@wallfree-dev/coinlib-core");
|
|
41
|
+
var errors_1 = require("@wallfree-dev/coinlib-core/errors");
|
|
42
|
+
var module_kit_1 = require("@wallfree-dev/module-kit");
|
|
43
|
+
var MintscanBlockExplorer_1 = require("../block-explorer/MintscanBlockExplorer");
|
|
44
|
+
var CosmosProtocol_1 = require("../protocol/CosmosProtocol");
|
|
45
|
+
var serializer_companion_1 = require("../serializer/v3/serializer-companion");
|
|
46
|
+
var CosmosModule = /** @class */ (function () {
|
|
47
|
+
function CosmosModule() {
|
|
48
|
+
var _a;
|
|
49
|
+
this.networkRegistries = (_a = {},
|
|
50
|
+
_a[coinlib_core_1.MainProtocolSymbols.COSMOS] = new module_kit_1.ModuleNetworkRegistry({
|
|
51
|
+
supportedNetworks: [CosmosProtocol_1.COSMOS_MAINNET_PROTOCOL_NETWORK]
|
|
52
|
+
}),
|
|
53
|
+
_a);
|
|
54
|
+
this.supportedProtocols = (0, module_kit_1.createSupportedProtocols)(this.networkRegistries);
|
|
55
|
+
}
|
|
56
|
+
CosmosModule.prototype.createOfflineProtocol = function (identifier) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
58
|
+
return __generator(this, function (_a) {
|
|
59
|
+
return [2 /*return*/, this.createProtocol(identifier)];
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
CosmosModule.prototype.createOnlineProtocol = function (identifier, networkOrId) {
|
|
64
|
+
var _a;
|
|
65
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
66
|
+
var network;
|
|
67
|
+
return __generator(this, function (_b) {
|
|
68
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
69
|
+
if (network === undefined) {
|
|
70
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.COSMOS, 'Protocol network type not supported.');
|
|
71
|
+
}
|
|
72
|
+
return [2 /*return*/, this.createProtocol(identifier, network)];
|
|
73
|
+
});
|
|
74
|
+
});
|
|
75
|
+
};
|
|
76
|
+
CosmosModule.prototype.createBlockExplorer = function (identifier, networkOrId) {
|
|
77
|
+
var _a;
|
|
78
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
79
|
+
var network;
|
|
80
|
+
return __generator(this, function (_b) {
|
|
81
|
+
network = typeof networkOrId === 'object' ? networkOrId : (_a = this.networkRegistries[identifier]) === null || _a === void 0 ? void 0 : _a.findNetwork(networkOrId);
|
|
82
|
+
if (network === undefined) {
|
|
83
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.COSMOS, 'Block Explorer network type not supported.');
|
|
84
|
+
}
|
|
85
|
+
return [2 /*return*/, new MintscanBlockExplorer_1.MintscanBlockExplorer(network.blockExplorerUrl)];
|
|
86
|
+
});
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
CosmosModule.prototype.createV3SerializerCompanion = function () {
|
|
90
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
91
|
+
return __generator(this, function (_a) {
|
|
92
|
+
return [2 /*return*/, new serializer_companion_1.CosmosV3SerializerCompanion()];
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
};
|
|
96
|
+
CosmosModule.prototype.createProtocol = function (identifier, network) {
|
|
97
|
+
switch (identifier) {
|
|
98
|
+
case coinlib_core_1.MainProtocolSymbols.COSMOS:
|
|
99
|
+
return (0, CosmosProtocol_1.createCosmosProtocol)({ network: network });
|
|
100
|
+
default:
|
|
101
|
+
throw new errors_1.ConditionViolationError(coinlib_core_1.Domain.COSMOS, "Protocol ".concat(identifier, " not supported."));
|
|
102
|
+
}
|
|
103
|
+
};
|
|
104
|
+
return CosmosModule;
|
|
105
|
+
}());
|
|
106
|
+
exports.CosmosModule = CosmosModule;
|
|
107
|
+
//# sourceMappingURL=CosmosModule.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CosmosModule.js","sourceRoot":"","sources":["../../../src/v1/module/CosmosModule.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2DAAwE;AACxE,4DAA2E;AAE3E,uDAWiC;AAEjC,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,EAAC,IAAI,CAAC,iBAAiB,CAAC,CAAA;IA8C1I,CAAC;IA5Cc,4CAAqB,GAAlC,UAAmC,UAA8B;;;gBAC/D,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,CAAC,EAAA;;;KACvC;IAEY,2CAAoB,GAAjC,UACE,UAA8B,EAC9B,WAA4C;;;;;gBAEtC,OAAO,GACX,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,0CAAE,WAAW,CAAC,WAAW,CAAC,CAAA;gBAE9G,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,MAAM,EAAE,sCAAsC,CAAC,CAAA;iBACzF;gBAED,sBAAO,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,OAAO,CAAC,EAAA;;;KAChD;IAEY,0CAAmB,GAAhC,UACE,UAA8B,EAC9B,WAA4C;;;;;gBAEtC,OAAO,GACX,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,MAAA,IAAI,CAAC,iBAAiB,CAAC,UAAU,CAAC,0CAAE,WAAW,CAAC,WAAW,CAAC,CAAA;gBAE9G,IAAI,OAAO,KAAK,SAAS,EAAE;oBACzB,MAAM,IAAI,gCAAuB,CAAC,qBAAM,CAAC,MAAM,EAAE,4CAA4C,CAAC,CAAA;iBAC/F;gBAED,sBAAO,IAAI,6CAAqB,CAAC,OAAO,CAAC,gBAAgB,CAAC,EAAA;;;KAC3D;IAEY,kDAA2B,GAAxC;;;gBACE,sBAAO,IAAI,kDAA2B,EAAE,EAAA;;;KACzC;IAEO,qCAAc,GAAtB,UAAuB,UAA8B,EAAE,OAAyB;QAC9E,QAAQ,UAAU,EAAE;YAClB,KAAK,kCAAmB,CAAC,MAAM;gBAC7B,OAAO,IAAA,qCAAoB,EAAC,EAAE,OAAO,SAAA,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"}
|
package/v1/module.d.ts
ADDED
package/v1/module.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.create = void 0;
|
|
18
|
+
var CosmosModule_1 = require("./module/CosmosModule");
|
|
19
|
+
__exportStar(require("./index"), exports);
|
|
20
|
+
function create() {
|
|
21
|
+
return new CosmosModule_1.CosmosModule();
|
|
22
|
+
}
|
|
23
|
+
exports.create = create;
|
|
24
|
+
//# sourceMappingURL=module.js.map
|
package/v1/module.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"module.js","sourceRoot":"","sources":["../../src/v1/module.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AACA,sDAAoD;AAEpD,0CAAuB;AAEvB,SAAgB,MAAM;IACpB,OAAO,IAAI,2BAAY,EAAE,CAAA;AAC3B,CAAC;AAFD,wBAEC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { FeeDefaults, ProtocolMetadata, PublicKey, RecursivePartial, TransactionDetails, TransactionSimpleConfiguration } from '@wallfree-dev/module-kit';
|
|
2
|
+
import { CosmosBaseProtocolImpl, CosmosProtocolNetwork, CosmosProtocolOptions, CosmosBaseStakingProtocol } from '@wallfree-dev/cosmos-core';
|
|
3
|
+
export declare type CosmosDenom = 'atom' | 'uatom';
|
|
4
|
+
export interface CosmosProtocol extends CosmosBaseStakingProtocol<CosmosDenom> {
|
|
5
|
+
}
|
|
6
|
+
export declare class CosmosProtocolImpl extends CosmosBaseProtocolImpl<CosmosDenom> implements CosmosProtocol {
|
|
7
|
+
constructor(options?: RecursivePartial<CosmosProtocolOptions<CosmosDenom>>);
|
|
8
|
+
private readonly units;
|
|
9
|
+
private readonly feeDefaults;
|
|
10
|
+
private readonly metadata;
|
|
11
|
+
getMetadata(): Promise<ProtocolMetadata<CosmosDenom>>;
|
|
12
|
+
getTransactionFeeWithPublicKey(_publicKey: PublicKey, _details: TransactionDetails<CosmosDenom>[], _configuration?: TransactionSimpleConfiguration): Promise<FeeDefaults<CosmosDenom>>;
|
|
13
|
+
}
|
|
14
|
+
export declare function createCosmosProtocol(options?: RecursivePartial<CosmosProtocolOptions<CosmosDenom>>): CosmosProtocol;
|
|
15
|
+
export declare const COSMOS_MAINNET_PROTOCOL_NETWORK: CosmosProtocolNetwork;
|
|
16
|
+
export declare function createCosmosProtocolOptions(partialOptions?: RecursivePartial<CosmosProtocolOptions<CosmosDenom>>): CosmosProtocolOptions<CosmosDenom>;
|