@firmachain/firma-js 0.2.37 → 0.2.38
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/dist/index.d.ts +4 -0
- package/dist/index.js +20 -0
- package/dist/sdk/FirmaAuthzService.d.ts +41 -0
- package/dist/sdk/FirmaAuthzService.js +633 -0
- package/dist/sdk/FirmaBankService.d.ts +17 -0
- package/dist/sdk/FirmaBankService.js +236 -0
- package/dist/sdk/FirmaChainService.d.ts +8 -0
- package/dist/sdk/FirmaChainService.js +86 -0
- package/dist/sdk/FirmaConfig.d.ts +18 -0
- package/dist/sdk/FirmaConfig.js +63 -0
- package/dist/sdk/FirmaContractService.d.ts +32 -0
- package/dist/sdk/FirmaContractService.js +434 -0
- package/dist/sdk/FirmaCosmWasmService.d.ts +38 -0
- package/dist/sdk/FirmaCosmWasmService.js +667 -0
- package/dist/sdk/FirmaDistributionService.d.ts +32 -0
- package/dist/sdk/FirmaDistributionService.js +527 -0
- package/dist/sdk/FirmaFeeGrantService.d.ts +21 -0
- package/dist/sdk/FirmaFeeGrantService.js +341 -0
- package/dist/sdk/FirmaGovService.d.ts +35 -0
- package/dist/sdk/FirmaGovService.js +775 -0
- package/dist/sdk/FirmaIbcService.d.ts +15 -0
- package/dist/sdk/FirmaIbcService.js +144 -0
- package/dist/sdk/FirmaIpfsService.d.ts +12 -0
- package/dist/sdk/FirmaIpfsService.js +185 -0
- package/dist/sdk/FirmaMobileSDK.d.ts +29 -0
- package/dist/sdk/FirmaMobileSDK.js +48 -0
- package/dist/sdk/FirmaNftService.d.ts +31 -0
- package/dist/sdk/FirmaNftService.js +372 -0
- package/dist/sdk/FirmaSDK.d.ts +35 -0
- package/dist/sdk/FirmaSDK.js +57 -0
- package/dist/sdk/FirmaSlashingService.d.ts +9 -0
- package/dist/sdk/FirmaSlashingService.js +105 -0
- package/dist/sdk/FirmaStakingService.d.ts +47 -0
- package/dist/sdk/FirmaStakingService.js +611 -0
- package/dist/sdk/FirmaTokenService.d.ts +26 -0
- package/dist/sdk/FirmaTokenService.js +416 -0
- package/dist/sdk/FirmaUtil.d.ts +56 -0
- package/dist/sdk/FirmaUtil.js +430 -0
- package/dist/sdk/FirmaWalletService.d.ts +39 -0
- package/dist/sdk/FirmaWalletService.js +317 -0
- package/dist/sdk/firmachain/amino/addresses.d.ts +5 -0
- package/dist/sdk/firmachain/amino/addresses.js +46 -0
- package/dist/sdk/firmachain/amino/aminomsgs.d.ts +281 -0
- package/dist/sdk/firmachain/amino/aminomsgs.js +77 -0
- package/dist/sdk/firmachain/amino/aminotypes.d.ts +22 -0
- package/dist/sdk/firmachain/amino/aminotypes.js +525 -0
- package/dist/sdk/firmachain/amino/coins.d.ts +30 -0
- package/dist/sdk/firmachain/amino/coins.js +69 -0
- package/dist/sdk/firmachain/amino/encoding.d.ts +24 -0
- package/dist/sdk/firmachain/amino/encoding.js +238 -0
- package/dist/sdk/firmachain/amino/multisig.d.ts +10 -0
- package/dist/sdk/firmachain/amino/multisig.js +42 -0
- package/dist/sdk/firmachain/amino/paths.d.ts +6 -0
- package/dist/sdk/firmachain/amino/paths.js +18 -0
- package/dist/sdk/firmachain/amino/pubkeys.d.ts +47 -0
- package/dist/sdk/firmachain/amino/pubkeys.js +29 -0
- package/dist/sdk/firmachain/amino/signature.d.ts +16 -0
- package/dist/sdk/firmachain/amino/signature.js +36 -0
- package/dist/sdk/firmachain/amino/signdoc.d.ts +26 -0
- package/dist/sdk/firmachain/amino/signdoc.js +42 -0
- package/dist/sdk/firmachain/amino/signer.d.ts +32 -0
- package/dist/sdk/firmachain/amino/signer.js +2 -0
- package/dist/sdk/firmachain/amino/stdtx.d.ts +15 -0
- package/dist/sdk/firmachain/amino/stdtx.js +17 -0
- package/dist/sdk/firmachain/amino/wallet.d.ts +32 -0
- package/dist/sdk/firmachain/amino/wallet.js +136 -0
- package/dist/sdk/firmachain/authz/AuthzQueryClient.d.ts +48 -0
- package/dist/sdk/firmachain/authz/AuthzQueryClient.js +142 -0
- package/dist/sdk/firmachain/authz/AuthzTxClient.d.ts +23 -0
- package/dist/sdk/firmachain/authz/AuthzTxClient.js +47 -0
- package/dist/sdk/firmachain/authz/AuthzTxTypes.d.ts +147 -0
- package/dist/sdk/firmachain/authz/AuthzTxTypes.js +358 -0
- package/dist/sdk/firmachain/authz/index.d.ts +3 -0
- package/dist/sdk/firmachain/authz/index.js +19 -0
- package/dist/sdk/firmachain/bank/BankQueryClient.d.ts +12 -0
- package/dist/sdk/firmachain/bank/BankQueryClient.js +116 -0
- package/dist/sdk/firmachain/bank/BankTxClient.d.ts +18 -0
- package/dist/sdk/firmachain/bank/BankTxClient.js +43 -0
- package/dist/sdk/firmachain/bank/index.d.ts +3 -0
- package/dist/sdk/firmachain/bank/index.js +19 -0
- package/dist/sdk/firmachain/common/CommonTxClient.d.ts +7 -0
- package/dist/sdk/firmachain/common/CommonTxClient.js +79 -0
- package/dist/sdk/firmachain/common/ITxClient.d.ts +18 -0
- package/dist/sdk/firmachain/common/ITxClient.js +117 -0
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.d.ts +27 -0
- package/dist/sdk/firmachain/common/LedgerSigningStargateClient.js +165 -0
- package/dist/sdk/firmachain/common/LedgerWallet.d.ts +14 -0
- package/dist/sdk/firmachain/common/LedgerWallet.js +151 -0
- package/dist/sdk/firmachain/common/QueryCommon.d.ts +4 -0
- package/dist/sdk/firmachain/common/QueryCommon.js +2 -0
- package/dist/sdk/firmachain/common/TendermintQueryClient.d.ts +42 -0
- package/dist/sdk/firmachain/common/TendermintQueryClient.js +111 -0
- package/dist/sdk/firmachain/common/TxCommon.d.ts +87 -0
- package/dist/sdk/firmachain/common/TxCommon.js +18 -0
- package/dist/sdk/firmachain/common/accounts.d.ts +16 -0
- package/dist/sdk/firmachain/common/accounts.js +64 -0
- package/dist/sdk/firmachain/common/index.d.ts +2 -0
- package/dist/sdk/firmachain/common/index.js +18 -0
- package/dist/sdk/firmachain/common/signing.d.ts +10 -0
- package/dist/sdk/firmachain/common/signing.js +79 -0
- package/dist/sdk/firmachain/common/signingaminostargateclient.d.ts +50 -0
- package/dist/sdk/firmachain/common/signingaminostargateclient.js +267 -0
- package/dist/sdk/firmachain/common/signingstargateclient.d.ts +44 -0
- package/dist/sdk/firmachain/common/signingstargateclient.js +361 -0
- package/dist/sdk/firmachain/common/stargateclient.d.ts +46 -0
- package/dist/sdk/firmachain/common/stargateclient.js +211 -0
- package/dist/sdk/firmachain/contract/ContractQueryClient.d.ts +32 -0
- package/dist/sdk/firmachain/contract/ContractQueryClient.js +156 -0
- package/dist/sdk/firmachain/contract/ContractTxClient.d.ts +18 -0
- package/dist/sdk/firmachain/contract/ContractTxClient.js +43 -0
- package/dist/sdk/firmachain/contract/ContractTxTypes.d.ts +69 -0
- package/dist/sdk/firmachain/contract/ContractTxTypes.js +483 -0
- package/dist/sdk/firmachain/contract/index.d.ts +3 -0
- package/dist/sdk/firmachain/contract/index.js +19 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.d.ts +52 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmQueryClient.js +193 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.d.ts +38 -0
- package/dist/sdk/firmachain/cosmwasm/CosmWasmTxClient.js +59 -0
- package/dist/sdk/firmachain/cosmwasm/index.d.ts +3 -0
- package/dist/sdk/firmachain/cosmwasm/index.js +19 -0
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.d.ts +18 -0
- package/dist/sdk/firmachain/distribution/DistributionQueryClient.js +167 -0
- package/dist/sdk/firmachain/distribution/DistributionTxClient.d.ts +28 -0
- package/dist/sdk/firmachain/distribution/DistributionTxClient.js +51 -0
- package/dist/sdk/firmachain/distribution/index.d.ts +3 -0
- package/dist/sdk/firmachain/distribution/index.js +19 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.d.ts +17 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantQueryClient.js +86 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.d.ts +18 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxClient.js +43 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.d.ts +76 -0
- package/dist/sdk/firmachain/feegrant/FeeGrantTxTypes.js +194 -0
- package/dist/sdk/firmachain/feegrant/index.d.ts +2 -0
- package/dist/sdk/firmachain/feegrant/index.js +19 -0
- package/dist/sdk/firmachain/google/protobuf/any.d.ts +128 -0
- package/dist/sdk/firmachain/google/protobuf/any.js +106 -0
- package/dist/sdk/firmachain/google/protobuf/descriptor.d.ts +996 -0
- package/dist/sdk/firmachain/google/protobuf/descriptor.js +5329 -0
- package/dist/sdk/firmachain/google/protobuf/duration.d.ts +91 -0
- package/dist/sdk/firmachain/google/protobuf/duration.js +107 -0
- package/dist/sdk/firmachain/google/protobuf/timestamp.d.ts +109 -0
- package/dist/sdk/firmachain/google/protobuf/timestamp.js +107 -0
- package/dist/sdk/firmachain/gov/GovQueryClient.d.ts +61 -0
- package/dist/sdk/firmachain/gov/GovQueryClient.js +152 -0
- package/dist/sdk/firmachain/gov/GovTxClient.d.ts +23 -0
- package/dist/sdk/firmachain/gov/GovTxClient.js +47 -0
- package/dist/sdk/firmachain/gov/index.d.ts +3 -0
- package/dist/sdk/firmachain/gov/index.js +19 -0
- package/dist/sdk/firmachain/ibc/IbcQueryClient.d.ts +34 -0
- package/dist/sdk/firmachain/ibc/IbcQueryClient.js +71 -0
- package/dist/sdk/firmachain/ibc/IbcTxClient.d.ts +13 -0
- package/dist/sdk/firmachain/ibc/IbcTxClient.js +39 -0
- package/dist/sdk/firmachain/ibc/index.d.ts +3 -0
- package/dist/sdk/firmachain/ibc/index.js +19 -0
- package/dist/sdk/firmachain/nft/NftQueryClient.d.ts +20 -0
- package/dist/sdk/firmachain/nft/NftQueryClient.js +125 -0
- package/dist/sdk/firmachain/nft/NftTxClient.d.ts +23 -0
- package/dist/sdk/firmachain/nft/NftTxClient.js +47 -0
- package/dist/sdk/firmachain/nft/NftTxTypes.d.ts +86 -0
- package/dist/sdk/firmachain/nft/NftTxTypes.js +424 -0
- package/dist/sdk/firmachain/nft/index.d.ts +3 -0
- package/dist/sdk/firmachain/nft/index.js +19 -0
- package/dist/sdk/firmachain/slashing/SlashingQueryClient.d.ts +22 -0
- package/dist/sdk/firmachain/slashing/SlashingQueryClient.js +101 -0
- package/dist/sdk/firmachain/slashing/index.d.ts +2 -0
- package/dist/sdk/firmachain/slashing/index.js +18 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.d.ts +106 -0
- package/dist/sdk/firmachain/staking/StakingQueryClient.js +243 -0
- package/dist/sdk/firmachain/staking/StakingTxClient.d.ts +33 -0
- package/dist/sdk/firmachain/staking/StakingTxClient.js +55 -0
- package/dist/sdk/firmachain/staking/index.d.ts +3 -0
- package/dist/sdk/firmachain/staking/index.js +19 -0
- package/dist/sdk/firmachain/token/TokenQueryClient.d.ts +24 -0
- package/dist/sdk/firmachain/token/TokenQueryClient.js +106 -0
- package/dist/sdk/firmachain/token/TokenTxClient.d.ts +28 -0
- package/dist/sdk/firmachain/token/TokenTxClient.js +51 -0
- package/dist/sdk/firmachain/token/TokenTxTypes.d.ts +116 -0
- package/dist/sdk/firmachain/token/TokenTxTypes.js +685 -0
- package/dist/sdk/firmachain/token/index.d.ts +3 -0
- package/dist/sdk/firmachain/token/index.js +19 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.makeStdTx = exports.isStdTx = void 0;
|
|
4
|
+
function isStdTx(txValue) {
|
|
5
|
+
var _a = txValue, memo = _a.memo, msg = _a.msg, fee = _a.fee, signatures = _a.signatures;
|
|
6
|
+
return (typeof memo === "string" && Array.isArray(msg) && typeof fee === "object" && Array.isArray(signatures));
|
|
7
|
+
}
|
|
8
|
+
exports.isStdTx = isStdTx;
|
|
9
|
+
function makeStdTx(content, signatures) {
|
|
10
|
+
return {
|
|
11
|
+
msg: content.msgs,
|
|
12
|
+
fee: content.fee,
|
|
13
|
+
memo: content.memo,
|
|
14
|
+
signatures: Array.isArray(signatures) ? signatures : [signatures],
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
exports.makeStdTx = makeStdTx;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A fixed salt is chosen to archive a deterministic password to key derivation.
|
|
3
|
+
* This reduces the scope of a potential rainbow attack to all CosmJS users.
|
|
4
|
+
* Must be 16 bytes due to implementation limitations.
|
|
5
|
+
*/
|
|
6
|
+
export declare const cosmjsSalt: Uint8Array;
|
|
7
|
+
export interface KdfConfiguration {
|
|
8
|
+
/**
|
|
9
|
+
* An algorithm identifier, such as "argon2id" or "scrypt".
|
|
10
|
+
*/
|
|
11
|
+
readonly algorithm: string;
|
|
12
|
+
/** A map of algorithm-specific parameters */
|
|
13
|
+
readonly params: Record<string, unknown>;
|
|
14
|
+
}
|
|
15
|
+
export declare function executeKdf(password: string, configuration: KdfConfiguration): Promise<Uint8Array>;
|
|
16
|
+
/**
|
|
17
|
+
* Configuration how to encrypt data or how data was encrypted.
|
|
18
|
+
* This is stored as part of the wallet serialization and must only contain JSON types.
|
|
19
|
+
*/
|
|
20
|
+
export interface EncryptionConfiguration {
|
|
21
|
+
/**
|
|
22
|
+
* An algorithm identifier, such as "xchacha20poly1305-ietf".
|
|
23
|
+
*/
|
|
24
|
+
readonly algorithm: string;
|
|
25
|
+
/** A map of algorithm-specific parameters */
|
|
26
|
+
readonly params?: Record<string, unknown>;
|
|
27
|
+
}
|
|
28
|
+
export declare const supportedAlgorithms: {
|
|
29
|
+
xchacha20poly1305Ietf: string;
|
|
30
|
+
};
|
|
31
|
+
export declare function encrypt(plaintext: Uint8Array, encryptionKey: Uint8Array, config: EncryptionConfiguration): Promise<Uint8Array>;
|
|
32
|
+
export declare function decrypt(ciphertext: Uint8Array, encryptionKey: Uint8Array, config: EncryptionConfiguration): Promise<Uint8Array>;
|
|
@@ -0,0 +1,136 @@
|
|
|
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
|
+
var __read = (this && this.__read) || function (o, n) {
|
|
39
|
+
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
40
|
+
if (!m) return o;
|
|
41
|
+
var i = m.call(o), r, ar = [], e;
|
|
42
|
+
try {
|
|
43
|
+
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
44
|
+
}
|
|
45
|
+
catch (error) { e = { error: error }; }
|
|
46
|
+
finally {
|
|
47
|
+
try {
|
|
48
|
+
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
49
|
+
}
|
|
50
|
+
finally { if (e) throw e.error; }
|
|
51
|
+
}
|
|
52
|
+
return ar;
|
|
53
|
+
};
|
|
54
|
+
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
55
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
56
|
+
if (ar || !(i in from)) {
|
|
57
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
58
|
+
ar[i] = from[i];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
62
|
+
};
|
|
63
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
64
|
+
exports.decrypt = exports.encrypt = exports.supportedAlgorithms = exports.executeKdf = exports.cosmjsSalt = void 0;
|
|
65
|
+
var crypto_1 = require("@cosmjs/crypto");
|
|
66
|
+
var encoding_1 = require("@cosmjs/encoding");
|
|
67
|
+
/**
|
|
68
|
+
* A fixed salt is chosen to archive a deterministic password to key derivation.
|
|
69
|
+
* This reduces the scope of a potential rainbow attack to all CosmJS users.
|
|
70
|
+
* Must be 16 bytes due to implementation limitations.
|
|
71
|
+
*/
|
|
72
|
+
exports.cosmjsSalt = (0, encoding_1.toAscii)("The CosmJS salt.");
|
|
73
|
+
function executeKdf(password, configuration) {
|
|
74
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
75
|
+
var options;
|
|
76
|
+
return __generator(this, function (_a) {
|
|
77
|
+
switch (configuration.algorithm) {
|
|
78
|
+
case "argon2id": {
|
|
79
|
+
options = configuration.params;
|
|
80
|
+
if (!(0, crypto_1.isArgon2idOptions)(options))
|
|
81
|
+
throw new Error("Invalid format of argon2id params");
|
|
82
|
+
return [2 /*return*/, crypto_1.Argon2id.execute(password, exports.cosmjsSalt, options)];
|
|
83
|
+
}
|
|
84
|
+
default:
|
|
85
|
+
throw new Error("Unsupported KDF algorithm");
|
|
86
|
+
}
|
|
87
|
+
return [2 /*return*/];
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
exports.executeKdf = executeKdf;
|
|
92
|
+
exports.supportedAlgorithms = {
|
|
93
|
+
xchacha20poly1305Ietf: "xchacha20poly1305-ietf",
|
|
94
|
+
};
|
|
95
|
+
function encrypt(plaintext, encryptionKey, config) {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
97
|
+
var _a, nonce, _b, _c;
|
|
98
|
+
return __generator(this, function (_d) {
|
|
99
|
+
switch (_d.label) {
|
|
100
|
+
case 0:
|
|
101
|
+
_a = config.algorithm;
|
|
102
|
+
switch (_a) {
|
|
103
|
+
case exports.supportedAlgorithms.xchacha20poly1305Ietf: return [3 /*break*/, 1];
|
|
104
|
+
}
|
|
105
|
+
return [3 /*break*/, 3];
|
|
106
|
+
case 1:
|
|
107
|
+
nonce = crypto_1.Random.getBytes(crypto_1.xchacha20NonceLength);
|
|
108
|
+
_b = Uint8Array.bind;
|
|
109
|
+
_c = [__spreadArray([], __read(nonce), false)];
|
|
110
|
+
return [4 /*yield*/, crypto_1.Xchacha20poly1305Ietf.encrypt(plaintext, encryptionKey, nonce)];
|
|
111
|
+
case 2:
|
|
112
|
+
// Prepend fixed-length nonce to ciphertext as suggested in the example from https://github.com/jedisct1/libsodium.js#api
|
|
113
|
+
return [2 /*return*/, new (_b.apply(Uint8Array, [void 0, __spreadArray.apply(void 0, _c.concat([__read.apply(void 0, [(_d.sent())]), false]))]))()];
|
|
114
|
+
case 3: throw new Error("Unsupported encryption algorithm: '".concat(config.algorithm, "'"));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
exports.encrypt = encrypt;
|
|
120
|
+
function decrypt(ciphertext, encryptionKey, config) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
122
|
+
var nonce;
|
|
123
|
+
return __generator(this, function (_a) {
|
|
124
|
+
switch (config.algorithm) {
|
|
125
|
+
case exports.supportedAlgorithms.xchacha20poly1305Ietf: {
|
|
126
|
+
nonce = ciphertext.slice(0, crypto_1.xchacha20NonceLength);
|
|
127
|
+
return [2 /*return*/, crypto_1.Xchacha20poly1305Ietf.decrypt(ciphertext.slice(crypto_1.xchacha20NonceLength), encryptionKey, nonce)];
|
|
128
|
+
}
|
|
129
|
+
default:
|
|
130
|
+
throw new Error("Unsupported encryption algorithm: '".concat(config.algorithm, "'"));
|
|
131
|
+
}
|
|
132
|
+
return [2 /*return*/];
|
|
133
|
+
});
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
exports.decrypt = decrypt;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
|
|
2
|
+
import { Pagination } from ".";
|
|
3
|
+
import { AuthorizationType } from "./AuthzTxTypes";
|
|
4
|
+
export interface GrantSendData {
|
|
5
|
+
authorization: authorization_send;
|
|
6
|
+
expiration: string;
|
|
7
|
+
}
|
|
8
|
+
export interface GrantGenericData {
|
|
9
|
+
authorization: authorization_generic;
|
|
10
|
+
expiration: string;
|
|
11
|
+
}
|
|
12
|
+
export interface GrantStakingData {
|
|
13
|
+
authorization: authorization_staking;
|
|
14
|
+
expiration: string;
|
|
15
|
+
}
|
|
16
|
+
export interface authorization_send {
|
|
17
|
+
"@type": string;
|
|
18
|
+
spend_limit: Coin[];
|
|
19
|
+
}
|
|
20
|
+
export interface authorization_generic {
|
|
21
|
+
"@type": string;
|
|
22
|
+
msg: string;
|
|
23
|
+
}
|
|
24
|
+
export interface authorization_staking {
|
|
25
|
+
"@type": string;
|
|
26
|
+
max_tokens: Coin;
|
|
27
|
+
allow_list: allowList;
|
|
28
|
+
authorization_type: string;
|
|
29
|
+
}
|
|
30
|
+
export interface allowList {
|
|
31
|
+
address: string[];
|
|
32
|
+
}
|
|
33
|
+
export declare class AuthzQueryClient {
|
|
34
|
+
private readonly axios;
|
|
35
|
+
constructor(baseUrl: string);
|
|
36
|
+
getSendGrantData(granterAddress: string, granteeAddress: string, paginationKey?: string): Promise<{
|
|
37
|
+
dataList: GrantSendData[];
|
|
38
|
+
pagination: Pagination;
|
|
39
|
+
}>;
|
|
40
|
+
getGenericGrantData(granterAddress: string, granteeAddress: string, msgType: string, paginationKey?: string): Promise<{
|
|
41
|
+
dataList: GrantGenericData[];
|
|
42
|
+
pagination: Pagination;
|
|
43
|
+
}>;
|
|
44
|
+
getStakingGrantData(granterAddress: string, granteeAddress: string, type: AuthorizationType, paginationKey?: string): Promise<{
|
|
45
|
+
dataList: GrantStakingData[];
|
|
46
|
+
pagination: Pagination;
|
|
47
|
+
}>;
|
|
48
|
+
}
|
|
@@ -0,0 +1,142 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
39
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
40
|
+
};
|
|
41
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
+
exports.AuthzQueryClient = void 0;
|
|
43
|
+
var axios_1 = __importDefault(require("axios"));
|
|
44
|
+
var AuthzTxTypes_1 = require("./AuthzTxTypes");
|
|
45
|
+
var AuthzQueryClient = /** @class */ (function () {
|
|
46
|
+
function AuthzQueryClient(baseUrl) {
|
|
47
|
+
this.axios = axios_1.default.create({
|
|
48
|
+
baseURL: baseUrl,
|
|
49
|
+
headers: {
|
|
50
|
+
Accept: "application/json",
|
|
51
|
+
},
|
|
52
|
+
timeout: 15000,
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
AuthzQueryClient.prototype.getSendGrantData = function (granterAddress, granteeAddress, paginationKey) {
|
|
56
|
+
if (paginationKey === void 0) { paginationKey = ""; }
|
|
57
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
58
|
+
var msgType, path, result, convertPagination;
|
|
59
|
+
return __generator(this, function (_a) {
|
|
60
|
+
switch (_a.label) {
|
|
61
|
+
case 0:
|
|
62
|
+
msgType = "/cosmos.bank.v1beta1.MsgSend";
|
|
63
|
+
path = "/cosmos/authz/v1beta1/grants?granter=".concat(granterAddress, "&grantee=").concat(granteeAddress, "&msg_type_url=").concat(msgType);
|
|
64
|
+
return [4 /*yield*/, this.axios.get(path, { params: { "pagination.key": paginationKey } })];
|
|
65
|
+
case 1:
|
|
66
|
+
result = _a.sent();
|
|
67
|
+
convertPagination = {
|
|
68
|
+
next_key: "",
|
|
69
|
+
total: result.data.grants.length
|
|
70
|
+
};
|
|
71
|
+
if (result.data.pagination != null) {
|
|
72
|
+
convertPagination.next_key = result.data.pagination.next_key;
|
|
73
|
+
convertPagination.total = Number.parseInt(result.data.pagination.total);
|
|
74
|
+
}
|
|
75
|
+
return [2 /*return*/, { dataList: result.data.grants, pagination: convertPagination }];
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
AuthzQueryClient.prototype.getGenericGrantData = function (granterAddress, granteeAddress, msgType, paginationKey) {
|
|
81
|
+
if (paginationKey === void 0) { paginationKey = ""; }
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
var path, result, convertPagination;
|
|
84
|
+
return __generator(this, function (_a) {
|
|
85
|
+
switch (_a.label) {
|
|
86
|
+
case 0:
|
|
87
|
+
path = "/cosmos/authz/v1beta1/grants?granter=".concat(granterAddress, "&grantee=").concat(granteeAddress, "&msg_type_url=").concat(msgType);
|
|
88
|
+
return [4 /*yield*/, this.axios.get(path, { params: { "pagination.key": paginationKey } })];
|
|
89
|
+
case 1:
|
|
90
|
+
result = _a.sent();
|
|
91
|
+
convertPagination = {
|
|
92
|
+
next_key: "",
|
|
93
|
+
total: result.data.grants.length
|
|
94
|
+
};
|
|
95
|
+
if (result.data.pagination != null) {
|
|
96
|
+
convertPagination.next_key = result.data.pagination.next_key;
|
|
97
|
+
convertPagination.total = Number.parseInt(result.data.pagination.total);
|
|
98
|
+
}
|
|
99
|
+
return [2 /*return*/, { dataList: result.data.grants, pagination: convertPagination }];
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
AuthzQueryClient.prototype.getStakingGrantData = function (granterAddress, granteeAddress, type, paginationKey) {
|
|
105
|
+
if (paginationKey === void 0) { paginationKey = ""; }
|
|
106
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
107
|
+
var msgType, path, result, convertPagination;
|
|
108
|
+
return __generator(this, function (_a) {
|
|
109
|
+
switch (_a.label) {
|
|
110
|
+
case 0:
|
|
111
|
+
msgType = "none";
|
|
112
|
+
switch (type) {
|
|
113
|
+
case AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_DELEGATE:
|
|
114
|
+
msgType = "/cosmos.staking.v1beta1.MsgDelegate";
|
|
115
|
+
break;
|
|
116
|
+
case AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_UNDELEGATE:
|
|
117
|
+
msgType = "/cosmos.staking.v1beta1.MsgUndelegate";
|
|
118
|
+
break;
|
|
119
|
+
case AuthzTxTypes_1.AuthorizationType.AUTHORIZATION_TYPE_REDELEGATE:
|
|
120
|
+
msgType = "/cosmos.staking.v1beta1.MsgBeginRedelegate";
|
|
121
|
+
break;
|
|
122
|
+
}
|
|
123
|
+
path = "/cosmos/authz/v1beta1/grants?granter=".concat(granterAddress, "&grantee=").concat(granteeAddress, "&msg_type_url=").concat(msgType);
|
|
124
|
+
return [4 /*yield*/, this.axios.get(path, { params: { "pagination.key": paginationKey } })];
|
|
125
|
+
case 1:
|
|
126
|
+
result = _a.sent();
|
|
127
|
+
convertPagination = {
|
|
128
|
+
next_key: "",
|
|
129
|
+
total: result.data.grants.length
|
|
130
|
+
};
|
|
131
|
+
if (result.data.pagination != null) {
|
|
132
|
+
convertPagination.next_key = result.data.pagination.next_key;
|
|
133
|
+
convertPagination.total = Number.parseInt(result.data.pagination.total);
|
|
134
|
+
}
|
|
135
|
+
return [2 /*return*/, { dataList: result.data.grants, pagination: convertPagination }];
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
});
|
|
139
|
+
};
|
|
140
|
+
return AuthzQueryClient;
|
|
141
|
+
}());
|
|
142
|
+
exports.AuthzQueryClient = AuthzQueryClient;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Registry, EncodeObject } from "@cosmjs/proto-signing";
|
|
2
|
+
import { MsgExec, MsgGrant, MsgRevoke } from "./AuthzTxTypes";
|
|
3
|
+
import { ITxClient } from "../common/ITxClient";
|
|
4
|
+
import { FirmaWalletService } from "../../FirmaWalletService";
|
|
5
|
+
export interface MsgExecAllowanceEncodeObject extends EncodeObject {
|
|
6
|
+
readonly typeUrl: "/cosmos.authz.v1beta1.MsgExec";
|
|
7
|
+
readonly value: Partial<MsgExec>;
|
|
8
|
+
}
|
|
9
|
+
export interface MsgGrantAllowanceEncodeObject extends EncodeObject {
|
|
10
|
+
readonly typeUrl: "/cosmos.authz.v1beta1.MsgGrant";
|
|
11
|
+
readonly value: Partial<MsgGrant>;
|
|
12
|
+
}
|
|
13
|
+
export interface MsgRevokeAllowanceEncodeObject extends EncodeObject {
|
|
14
|
+
readonly typeUrl: "/cosmos.authz.v1beta1.MsgRevoke";
|
|
15
|
+
readonly value: Partial<MsgRevoke>;
|
|
16
|
+
}
|
|
17
|
+
export declare class AuthzTxClient extends ITxClient {
|
|
18
|
+
constructor(wallet: FirmaWalletService, serverUrl: string);
|
|
19
|
+
static getRegistry(): Registry;
|
|
20
|
+
static msgExecAllowance(data: MsgExec): MsgExecAllowanceEncodeObject;
|
|
21
|
+
static msgGrantAllowance(data: MsgGrant): MsgGrantAllowanceEncodeObject;
|
|
22
|
+
static msgRevokeAllowance(data: MsgRevoke): MsgRevokeAllowanceEncodeObject;
|
|
23
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.AuthzTxClient = void 0;
|
|
19
|
+
var proto_signing_1 = require("@cosmjs/proto-signing");
|
|
20
|
+
var AuthzTxTypes_1 = require("./AuthzTxTypes");
|
|
21
|
+
var ITxClient_1 = require("../common/ITxClient");
|
|
22
|
+
var types = [
|
|
23
|
+
["/cosmos.authz.v1beta1.MsgExec", AuthzTxTypes_1.MsgExec],
|
|
24
|
+
["/cosmos.authz.v1beta1.MsgGrant", AuthzTxTypes_1.MsgGrant],
|
|
25
|
+
["/cosmos.authz.v1beta1.MsgRevoke", AuthzTxTypes_1.MsgRevoke],
|
|
26
|
+
];
|
|
27
|
+
var registry = new proto_signing_1.Registry(types);
|
|
28
|
+
var AuthzTxClient = /** @class */ (function (_super) {
|
|
29
|
+
__extends(AuthzTxClient, _super);
|
|
30
|
+
function AuthzTxClient(wallet, serverUrl) {
|
|
31
|
+
return _super.call(this, wallet, serverUrl, registry) || this;
|
|
32
|
+
}
|
|
33
|
+
AuthzTxClient.getRegistry = function () {
|
|
34
|
+
return registry;
|
|
35
|
+
};
|
|
36
|
+
AuthzTxClient.msgExecAllowance = function (data) {
|
|
37
|
+
return { typeUrl: "/cosmos.authz.v1beta1.MsgExec", value: data };
|
|
38
|
+
};
|
|
39
|
+
AuthzTxClient.msgGrantAllowance = function (data) {
|
|
40
|
+
return { typeUrl: "/cosmos.authz.v1beta1.MsgGrant", value: data };
|
|
41
|
+
};
|
|
42
|
+
AuthzTxClient.msgRevokeAllowance = function (data) {
|
|
43
|
+
return { typeUrl: "/cosmos.authz.v1beta1.MsgRevoke", value: data };
|
|
44
|
+
};
|
|
45
|
+
return AuthzTxClient;
|
|
46
|
+
}(ITxClient_1.ITxClient));
|
|
47
|
+
exports.AuthzTxClient = AuthzTxClient;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/// <reference types="long" />
|
|
2
|
+
import { Coin } from "cosmjs-types/cosmos/base/v1beta1/coin";
|
|
3
|
+
import _m0 from "protobufjs/minimal";
|
|
4
|
+
import { Writer } from "protobufjs/minimal";
|
|
5
|
+
import { Timestamp } from "../google/protobuf/timestamp";
|
|
6
|
+
import { Any } from "../google/protobuf/any";
|
|
7
|
+
export interface GenericAuthorization {
|
|
8
|
+
/** Msg, identified by it's type URL, to grant unrestricted permissions to execute */
|
|
9
|
+
msg: string;
|
|
10
|
+
}
|
|
11
|
+
export interface Grant {
|
|
12
|
+
authorization?: Any;
|
|
13
|
+
expiration?: Timestamp;
|
|
14
|
+
}
|
|
15
|
+
export interface MsgGrant {
|
|
16
|
+
granter: string;
|
|
17
|
+
grantee: string;
|
|
18
|
+
grant?: Grant;
|
|
19
|
+
}
|
|
20
|
+
/** MsgExecResponse defines the Msg/MsgExecResponse response type. */
|
|
21
|
+
export interface MsgExecResponse {
|
|
22
|
+
results: Uint8Array[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* MsgExec attempts to execute the provided messages using
|
|
26
|
+
* authorizations granted to the grantee. Each message should have only
|
|
27
|
+
* one signer corresponding to the granter of the authorization.
|
|
28
|
+
*/
|
|
29
|
+
export interface MsgExec {
|
|
30
|
+
grantee: string;
|
|
31
|
+
/**
|
|
32
|
+
* Authorization Msg requests to execute. Each msg must implement Authorization interface
|
|
33
|
+
* The x/authz will try to find a grant matching (msg.signers[0], grantee, MsgTypeURL(msg))
|
|
34
|
+
* triple and validate it.
|
|
35
|
+
*/
|
|
36
|
+
msgs: Any[];
|
|
37
|
+
}
|
|
38
|
+
/** MsgGrantResponse defines the Msg/MsgGrant response type. */
|
|
39
|
+
export interface MsgGrantResponse {
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* MsgRevoke revokes any authorization with the provided sdk.Msg type on the
|
|
43
|
+
* granter's account with that has been granted to the grantee.
|
|
44
|
+
*/
|
|
45
|
+
export interface MsgRevoke {
|
|
46
|
+
granter: string;
|
|
47
|
+
grantee: string;
|
|
48
|
+
msgTypeUrl: string;
|
|
49
|
+
}
|
|
50
|
+
/** MsgRevokeResponse defines the Msg/MsgRevokeResponse response type. */
|
|
51
|
+
export interface MsgRevokeResponse {
|
|
52
|
+
}
|
|
53
|
+
export declare const MsgGrant: {
|
|
54
|
+
encode(message: MsgGrant, writer?: _m0.Writer): _m0.Writer;
|
|
55
|
+
fromPartial(object: DeepPartial<MsgGrant>): MsgGrant;
|
|
56
|
+
};
|
|
57
|
+
export declare const MsgExecResponse: {
|
|
58
|
+
encode(message: MsgExecResponse, writer?: _m0.Writer): _m0.Writer;
|
|
59
|
+
fromPartial(object: DeepPartial<MsgExecResponse>): MsgExecResponse;
|
|
60
|
+
};
|
|
61
|
+
export declare const MsgExec: {
|
|
62
|
+
encode(message: MsgExec, writer?: _m0.Writer): _m0.Writer;
|
|
63
|
+
fromPartial(object: DeepPartial<MsgExec>): MsgExec;
|
|
64
|
+
};
|
|
65
|
+
export declare const MsgGrantResponse: {
|
|
66
|
+
encode(_: MsgGrantResponse, writer?: _m0.Writer): _m0.Writer;
|
|
67
|
+
fromPartial(object: DeepPartial<MsgGrantResponse>): MsgGrantResponse;
|
|
68
|
+
};
|
|
69
|
+
export declare const MsgRevoke: {
|
|
70
|
+
encode(message: MsgRevoke, writer?: _m0.Writer): _m0.Writer;
|
|
71
|
+
fromPartial(object: DeepPartial<MsgRevoke>): MsgRevoke;
|
|
72
|
+
};
|
|
73
|
+
export declare const MsgRevokeResponse: {
|
|
74
|
+
encode(_: MsgRevokeResponse, writer?: _m0.Writer): _m0.Writer;
|
|
75
|
+
fromPartial(object: DeepPartial<MsgRevokeResponse>): MsgRevokeResponse;
|
|
76
|
+
};
|
|
77
|
+
export declare const Grant: {
|
|
78
|
+
encode(message: Grant, writer?: _m0.Writer): _m0.Writer;
|
|
79
|
+
fromPartial(object: DeepPartial<Grant>): Grant;
|
|
80
|
+
};
|
|
81
|
+
export declare const GenericAuthorization: {
|
|
82
|
+
encode(message: GenericAuthorization, writer?: _m0.Writer): _m0.Writer;
|
|
83
|
+
fromPartial(object: DeepPartial<GenericAuthorization>): GenericAuthorization;
|
|
84
|
+
};
|
|
85
|
+
/**
|
|
86
|
+
* AuthorizationType defines the type of staking module authorization type
|
|
87
|
+
*
|
|
88
|
+
* Since: cosmos-sdk 0.43
|
|
89
|
+
*/
|
|
90
|
+
export declare enum AuthorizationType {
|
|
91
|
+
/** AUTHORIZATION_TYPE_UNSPECIFIED - AUTHORIZATION_TYPE_UNSPECIFIED specifies an unknown authorization type */
|
|
92
|
+
AUTHORIZATION_TYPE_UNSPECIFIED = 0,
|
|
93
|
+
/** AUTHORIZATION_TYPE_DELEGATE - AUTHORIZATION_TYPE_DELEGATE defines an authorization type for Msg/Delegate */
|
|
94
|
+
AUTHORIZATION_TYPE_DELEGATE = 1,
|
|
95
|
+
/** AUTHORIZATION_TYPE_UNDELEGATE - AUTHORIZATION_TYPE_UNDELEGATE defines an authorization type for Msg/Undelegate */
|
|
96
|
+
AUTHORIZATION_TYPE_UNDELEGATE = 2,
|
|
97
|
+
/** AUTHORIZATION_TYPE_REDELEGATE - AUTHORIZATION_TYPE_REDELEGATE defines an authorization type for Msg/BeginRedelegate */
|
|
98
|
+
AUTHORIZATION_TYPE_REDELEGATE = 3,
|
|
99
|
+
UNRECOGNIZED = -1
|
|
100
|
+
}
|
|
101
|
+
export declare function authorizationTypeFromJSON(object: any): AuthorizationType;
|
|
102
|
+
export declare function authorizationTypeToJSON(object: AuthorizationType): string;
|
|
103
|
+
/**
|
|
104
|
+
* StakeAuthorization defines authorization for delegate/undelegate/redelegate.
|
|
105
|
+
*
|
|
106
|
+
* Since: cosmos-sdk 0.43
|
|
107
|
+
*/
|
|
108
|
+
export interface StakeAuthorization {
|
|
109
|
+
/**
|
|
110
|
+
* max_tokens specifies the maximum amount of tokens can be delegate to a validator. If it is
|
|
111
|
+
* empty, there is no spend limit and any amount of coins can be delegated.
|
|
112
|
+
*/
|
|
113
|
+
maxTokens?: Coin;
|
|
114
|
+
/**
|
|
115
|
+
* allow_list specifies list of validator addresses to whom grantee can delegate tokens on behalf of granter's
|
|
116
|
+
* account.
|
|
117
|
+
*/
|
|
118
|
+
allowList?: StakeAuthorization_Validators | undefined;
|
|
119
|
+
/** deny_list specifies list of validator addresses to whom grantee can not delegate tokens. */
|
|
120
|
+
denyList?: StakeAuthorization_Validators | undefined;
|
|
121
|
+
/** authorization_type defines one of AuthorizationType. */
|
|
122
|
+
authorizationType: AuthorizationType;
|
|
123
|
+
}
|
|
124
|
+
/** Validators defines list of validator addresses. */
|
|
125
|
+
export interface StakeAuthorization_Validators {
|
|
126
|
+
address: string[];
|
|
127
|
+
}
|
|
128
|
+
export declare const StakeAuthorization: {
|
|
129
|
+
encode(message: StakeAuthorization, writer?: _m0.Writer): _m0.Writer;
|
|
130
|
+
fromPartial(object: DeepPartial<StakeAuthorization>): StakeAuthorization;
|
|
131
|
+
};
|
|
132
|
+
export declare const StakeAuthorization_Validators: {
|
|
133
|
+
encode(message: StakeAuthorization_Validators, writer?: _m0.Writer): _m0.Writer;
|
|
134
|
+
fromPartial(object: DeepPartial<StakeAuthorization_Validators>): StakeAuthorization_Validators;
|
|
135
|
+
};
|
|
136
|
+
export interface SendAuthorization {
|
|
137
|
+
spendLimit: Coin[];
|
|
138
|
+
}
|
|
139
|
+
export declare const SendAuthorization: {
|
|
140
|
+
encode(message: SendAuthorization, writer?: _m0.Writer): _m0.Writer;
|
|
141
|
+
fromPartial(object: DeepPartial<SendAuthorization>): SendAuthorization;
|
|
142
|
+
};
|
|
143
|
+
declare type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined | Long;
|
|
144
|
+
export declare type DeepPartial<T> = T extends Builtin ? T : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>> : T extends {} ? {
|
|
145
|
+
[K in keyof T]?: DeepPartial<T[K]>;
|
|
146
|
+
} : Partial<T>;
|
|
147
|
+
export {};
|