@verana-labs/verana-types 0.10.0 → 0.10.1-dev.10
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/README.md +1 -1
- package/dist/amino-converter/cs.d.ts +7 -0
- package/dist/amino-converter/cs.js +169 -0
- package/dist/amino-converter/de.d.ts +3 -0
- package/dist/amino-converter/de.js +53 -0
- package/dist/amino-converter/di.d.ts +2 -0
- package/dist/amino-converter/di.js +23 -0
- package/dist/amino-converter/perm.d.ts +12 -0
- package/dist/amino-converter/perm.js +318 -0
- package/dist/amino-converter/td.d.ts +4 -0
- package/dist/amino-converter/td.js +45 -0
- package/dist/amino-converter/tr.d.ts +6 -0
- package/dist/amino-converter/tr.js +107 -0
- package/dist/amino-converter/util/helpers.d.ts +30 -0
- package/dist/amino-converter/util/helpers.js +88 -0
- package/dist/amino-converter/xr.d.ts +4 -0
- package/dist/amino-converter/xr.js +74 -0
- package/dist/codec/cosmos/base/v1beta1/coin.d.ts +1 -1
- package/dist/codec/google/protobuf/descriptor.d.ts +5 -0
- package/dist/codec/google/protobuf/descriptor.js +16 -2
- package/dist/codec/google/protobuf/timestamp.d.ts +3 -3
- package/dist/codec/verana/cs/v1/query.d.ts +4 -3
- package/dist/codec/verana/cs/v1/query.js +36 -19
- package/dist/codec/verana/cs/v1/tx.d.ts +106 -11
- package/dist/codec/verana/cs/v1/tx.js +529 -45
- package/dist/codec/verana/cs/v1/types.d.ts +69 -14
- package/dist/codec/verana/cs/v1/types.js +392 -55
- package/dist/codec/verana/de/v1/genesis.d.ts +9 -0
- package/dist/codec/verana/de/v1/genesis.js +80 -2
- package/dist/codec/verana/de/v1/query.d.ts +41 -3
- package/dist/codec/verana/de/v1/query.js +153 -9
- package/dist/codec/verana/de/v1/tx.d.ts +27 -10
- package/dist/codec/verana/de/v1/tx.js +35 -18
- package/dist/codec/verana/de/v1/types.d.ts +42 -4
- package/dist/codec/verana/de/v1/types.js +113 -17
- package/dist/codec/verana/{dd/module → di/module/v1}/module.d.ts +5 -2
- package/dist/codec/verana/{dd/module → di/module/v1}/module.js +2 -2
- package/dist/codec/verana/{dd → di}/v1/genesis.d.ts +5 -4
- package/dist/codec/verana/{dd → di}/v1/genesis.js +11 -13
- package/dist/codec/verana/di/v1/params.d.ts +24 -0
- package/dist/codec/verana/di/v1/params.js +81 -0
- package/dist/codec/verana/di/v1/query.d.ts +99 -0
- package/dist/codec/verana/{dd → di}/v1/query.js +65 -166
- package/dist/codec/verana/di/v1/tx.d.ts +120 -0
- package/dist/codec/verana/di/v1/tx.js +409 -0
- package/dist/codec/verana/perm/v1/query.d.ts +0 -1
- package/dist/codec/verana/perm/v1/query.js +3 -17
- package/dist/codec/verana/perm/v1/tx.d.ts +111 -59
- package/dist/codec/verana/perm/v1/tx.js +676 -273
- package/dist/codec/verana/perm/v1/types.d.ts +30 -30
- package/dist/codec/verana/perm/v1/types.js +241 -208
- package/dist/codec/verana/td/v1/genesis.d.ts +4 -2
- package/dist/codec/verana/td/v1/genesis.js +31 -17
- package/dist/codec/verana/td/v1/params.d.ts +2 -0
- package/dist/codec/verana/td/v1/params.js +18 -1
- package/dist/codec/verana/td/v1/query.d.ts +1 -1
- package/dist/codec/verana/td/v1/query.js +8 -8
- package/dist/codec/verana/td/v1/tx.d.ts +26 -40
- package/dist/codec/verana/td/v1/tx.js +78 -188
- package/dist/codec/verana/td/v1/types.d.ts +5 -7
- package/dist/codec/verana/td/v1/types.js +32 -47
- package/dist/codec/verana/tr/v1/query.d.ts +1 -2
- package/dist/codec/verana/tr/v1/query.js +8 -8
- package/dist/codec/verana/tr/v1/tx.d.ts +32 -32
- package/dist/codec/verana/tr/v1/tx.js +89 -89
- package/dist/codec/verana/tr/v1/types.d.ts +2 -5
- package/dist/codec/verana/tr/v1/types.js +25 -55
- package/dist/codec/verana/xr/module/v1/module.d.ts +29 -0
- package/dist/codec/verana/xr/module/v1/module.js +98 -0
- package/dist/codec/verana/xr/v1/genesis.d.ts +32 -0
- package/dist/codec/verana/xr/v1/genesis.js +149 -0
- package/dist/codec/verana/{dd → xr}/v1/params.d.ts +4 -3
- package/dist/codec/verana/{dd → xr}/v1/params.js +16 -44
- package/dist/codec/verana/xr/v1/query.d.ts +162 -0
- package/dist/codec/verana/xr/v1/query.js +775 -0
- package/dist/codec/verana/xr/v1/tx.d.ts +195 -0
- package/dist/codec/verana/xr/v1/tx.js +939 -0
- package/dist/helpers/aminoConverters.d.ts +8 -32
- package/dist/helpers/aminoConverters.js +21 -589
- package/dist/index.d.ts +9 -1
- package/dist/index.js +9 -1
- package/dist/signing.d.ts +65 -0
- package/dist/signing.js +121 -0
- package/package.json +31 -5
- package/dist/codec/verana/dd/v1/query.d.ts +0 -108
- package/dist/codec/verana/dd/v1/tx.d.ts +0 -173
- package/dist/codec/verana/dd/v1/tx.js +0 -636
- package/dist/codec/verana/dd/v1/types.d.ts +0 -30
- package/dist/codec/verana/dd/v1/types.js +0 -206
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgSlashTrustDepositAminoConverter = exports.MsgRepaySlashedTrustDepositAminoConverter = exports.MsgReclaimTrustDepositYieldAminoConverter = void 0;
|
|
4
|
+
const tx_1 = require("../codec/verana/td/v1/tx");
|
|
5
|
+
exports.MsgReclaimTrustDepositYieldAminoConverter = {
|
|
6
|
+
aminoType: "verana/x/td/MsgReclaimTrustDepositYield",
|
|
7
|
+
// [MOD-TD-MSG-2-1] Spec v4 draft 13: parameters are corporation + operator only.
|
|
8
|
+
toAmino: ({ corporation, operator }) => ({
|
|
9
|
+
corporation,
|
|
10
|
+
operator,
|
|
11
|
+
}),
|
|
12
|
+
fromAmino: (value) => tx_1.MsgReclaimTrustDepositYield.fromPartial({
|
|
13
|
+
corporation: value.corporation,
|
|
14
|
+
operator: value.operator,
|
|
15
|
+
}),
|
|
16
|
+
};
|
|
17
|
+
exports.MsgRepaySlashedTrustDepositAminoConverter = {
|
|
18
|
+
aminoType: "verana/x/td/MsgRepaySlashedTrustDeposit",
|
|
19
|
+
toAmino: ({ corporation, operator, deposit }) => ({
|
|
20
|
+
corporation,
|
|
21
|
+
operator,
|
|
22
|
+
deposit: deposit != null ? deposit.toString() : undefined,
|
|
23
|
+
}),
|
|
24
|
+
fromAmino: (value) => tx_1.MsgRepaySlashedTrustDeposit.fromPartial({
|
|
25
|
+
corporation: value.corporation,
|
|
26
|
+
operator: value.operator,
|
|
27
|
+
deposit: value.deposit != null ? Number(value.deposit) : 0,
|
|
28
|
+
}),
|
|
29
|
+
};
|
|
30
|
+
exports.MsgSlashTrustDepositAminoConverter = {
|
|
31
|
+
aminoType: "verana/x/td/MsgSlashTrustDeposit",
|
|
32
|
+
// [MOD-TD-MSG-5-1] spec v4 draft 13 adds mandatory reason.
|
|
33
|
+
toAmino: ({ authority, corporation, deposit, reason }) => ({
|
|
34
|
+
authority,
|
|
35
|
+
corporation,
|
|
36
|
+
deposit,
|
|
37
|
+
reason,
|
|
38
|
+
}),
|
|
39
|
+
fromAmino: (value) => tx_1.MsgSlashTrustDeposit.fromPartial({
|
|
40
|
+
authority: value.authority,
|
|
41
|
+
corporation: value.corporation,
|
|
42
|
+
deposit: value.deposit,
|
|
43
|
+
reason: value.reason,
|
|
44
|
+
}),
|
|
45
|
+
};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { AminoConverter } from "@cosmjs/stargate";
|
|
2
|
+
export declare const MsgCreateTrustRegistryAminoConverter: AminoConverter;
|
|
3
|
+
export declare const MsgUpdateTrustRegistryAminoConverter: AminoConverter;
|
|
4
|
+
export declare const MsgArchiveTrustRegistryAminoConverter: AminoConverter;
|
|
5
|
+
export declare const MsgAddGovernanceFrameworkDocumentAminoConverter: AminoConverter;
|
|
6
|
+
export declare const MsgIncreaseActiveGovernanceFrameworkVersionAminoConverter: AminoConverter;
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgIncreaseActiveGovernanceFrameworkVersionAminoConverter = exports.MsgAddGovernanceFrameworkDocumentAminoConverter = exports.MsgArchiveTrustRegistryAminoConverter = exports.MsgUpdateTrustRegistryAminoConverter = exports.MsgCreateTrustRegistryAminoConverter = void 0;
|
|
4
|
+
const tx_1 = require("../codec/verana/tr/v1/tx");
|
|
5
|
+
const helpers_1 = require("./util/helpers");
|
|
6
|
+
exports.MsgCreateTrustRegistryAminoConverter = {
|
|
7
|
+
aminoType: "verana/x/tr/MsgCreateTrustRegistry",
|
|
8
|
+
toAmino: ({ corporation, operator, did, aka, language, docUrl, docDigestSri }) => (0, helpers_1.clean)({
|
|
9
|
+
corporation: corporation || undefined,
|
|
10
|
+
operator: operator || undefined,
|
|
11
|
+
did: did || undefined,
|
|
12
|
+
aka: aka || undefined,
|
|
13
|
+
language: language || undefined,
|
|
14
|
+
doc_url: docUrl || undefined,
|
|
15
|
+
doc_digest_sri: docDigestSri || undefined,
|
|
16
|
+
}),
|
|
17
|
+
fromAmino: (value) => {
|
|
18
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
19
|
+
return tx_1.MsgCreateTrustRegistry.fromPartial({
|
|
20
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
21
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
22
|
+
did: (_c = value.did) !== null && _c !== void 0 ? _c : "",
|
|
23
|
+
aka: (_d = value.aka) !== null && _d !== void 0 ? _d : "",
|
|
24
|
+
language: (_e = value.language) !== null && _e !== void 0 ? _e : "",
|
|
25
|
+
docUrl: (_f = value.doc_url) !== null && _f !== void 0 ? _f : "",
|
|
26
|
+
docDigestSri: (_g = value.doc_digest_sri) !== null && _g !== void 0 ? _g : "",
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
exports.MsgUpdateTrustRegistryAminoConverter = {
|
|
31
|
+
aminoType: "verana/x/tr/MsgUpdateTrustRegistry",
|
|
32
|
+
toAmino: ({ corporation, operator, trId, did, aka }) => (0, helpers_1.clean)({
|
|
33
|
+
corporation: corporation || undefined,
|
|
34
|
+
operator: operator || undefined,
|
|
35
|
+
tr_id: (0, helpers_1.u64ToStr)(trId),
|
|
36
|
+
did: did || undefined,
|
|
37
|
+
aka: aka || undefined,
|
|
38
|
+
}),
|
|
39
|
+
fromAmino: (value) => {
|
|
40
|
+
var _a, _b, _c, _d;
|
|
41
|
+
return tx_1.MsgUpdateTrustRegistry.fromPartial({
|
|
42
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
43
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
44
|
+
trId: value.tr_id != null ? Number(value.tr_id) : 0,
|
|
45
|
+
did: (_c = value.did) !== null && _c !== void 0 ? _c : "",
|
|
46
|
+
aka: (_d = value.aka) !== null && _d !== void 0 ? _d : "",
|
|
47
|
+
});
|
|
48
|
+
},
|
|
49
|
+
};
|
|
50
|
+
exports.MsgArchiveTrustRegistryAminoConverter = {
|
|
51
|
+
aminoType: "verana/x/tr/MsgArchiveTrustRegistry",
|
|
52
|
+
toAmino: ({ corporation, operator, trId, archive }) => (0, helpers_1.clean)({
|
|
53
|
+
corporation: corporation || undefined,
|
|
54
|
+
operator: operator || undefined,
|
|
55
|
+
tr_id: (0, helpers_1.u64ToStr)(trId),
|
|
56
|
+
archive: archive || undefined,
|
|
57
|
+
}),
|
|
58
|
+
fromAmino: (value) => {
|
|
59
|
+
var _a, _b, _c;
|
|
60
|
+
return tx_1.MsgArchiveTrustRegistry.fromPartial({
|
|
61
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
62
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
63
|
+
trId: value.tr_id != null ? Number(value.tr_id) : 0,
|
|
64
|
+
archive: (_c = value.archive) !== null && _c !== void 0 ? _c : false,
|
|
65
|
+
});
|
|
66
|
+
},
|
|
67
|
+
};
|
|
68
|
+
exports.MsgAddGovernanceFrameworkDocumentAminoConverter = {
|
|
69
|
+
aminoType: "verana/x/tr/MsgAddGovFrameworkDoc",
|
|
70
|
+
toAmino: ({ corporation, operator, trId, language, url, digestSri, version, }) => (0, helpers_1.clean)({
|
|
71
|
+
corporation: corporation || undefined,
|
|
72
|
+
operator: operator || undefined,
|
|
73
|
+
tr_id: (0, helpers_1.u64ToStr)(trId),
|
|
74
|
+
language: language || undefined,
|
|
75
|
+
url: url || undefined,
|
|
76
|
+
digest_sri: digestSri || undefined,
|
|
77
|
+
version: version || undefined,
|
|
78
|
+
}),
|
|
79
|
+
fromAmino: (value) => {
|
|
80
|
+
var _a, _b, _c, _d, _e, _f;
|
|
81
|
+
return tx_1.MsgAddGovernanceFrameworkDocument.fromPartial({
|
|
82
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
83
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
84
|
+
trId: value.tr_id != null ? Number(value.tr_id) : 0,
|
|
85
|
+
language: (_c = value.language) !== null && _c !== void 0 ? _c : "",
|
|
86
|
+
url: (_d = value.url) !== null && _d !== void 0 ? _d : "",
|
|
87
|
+
digestSri: (_e = value.digest_sri) !== null && _e !== void 0 ? _e : "",
|
|
88
|
+
version: (_f = value.version) !== null && _f !== void 0 ? _f : 0,
|
|
89
|
+
});
|
|
90
|
+
},
|
|
91
|
+
};
|
|
92
|
+
exports.MsgIncreaseActiveGovernanceFrameworkVersionAminoConverter = {
|
|
93
|
+
aminoType: "verana/x/tr/MsgIncreaseActiveGovFWVer",
|
|
94
|
+
toAmino: ({ corporation, operator, trId }) => (0, helpers_1.clean)({
|
|
95
|
+
corporation: corporation || undefined,
|
|
96
|
+
operator: operator || undefined,
|
|
97
|
+
tr_id: (0, helpers_1.u64ToStr)(trId),
|
|
98
|
+
}),
|
|
99
|
+
fromAmino: (value) => {
|
|
100
|
+
var _a, _b;
|
|
101
|
+
return tx_1.MsgIncreaseActiveGovernanceFrameworkVersion.fromPartial({
|
|
102
|
+
corporation: (_a = value.corporation) !== null && _a !== void 0 ? _a : "",
|
|
103
|
+
operator: (_b = value.operator) !== null && _b !== void 0 ? _b : "",
|
|
104
|
+
trId: value.tr_id != null ? Number(value.tr_id) : 0,
|
|
105
|
+
});
|
|
106
|
+
},
|
|
107
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import Long from "long";
|
|
2
|
+
import type { Duration } from "../../codec/google/protobuf/duration";
|
|
3
|
+
import type { OptionalUInt32 } from "../../codec/verana/cs/v1/tx";
|
|
4
|
+
export declare const clean: <T extends Record<string, any>>(o: T) => T;
|
|
5
|
+
export declare const u64ToStr: (v?: Long | string | number | null) => string | undefined;
|
|
6
|
+
export declare const u64ToStrIfNonZero: (v?: Long | string | number | null) => string | undefined;
|
|
7
|
+
export declare const strToU64: (s?: string | null) => Long | undefined;
|
|
8
|
+
export declare const u32ToAmino: (n?: number | null) => number | undefined;
|
|
9
|
+
export declare const pickOptionalUInt32: (v: any) => OptionalUInt32 | undefined;
|
|
10
|
+
export declare const pickU32: (v: any) => OptionalUInt32 | undefined;
|
|
11
|
+
export declare const toOptU32Amino: (m?: {
|
|
12
|
+
value: number;
|
|
13
|
+
} | undefined) => {
|
|
14
|
+
value?: undefined;
|
|
15
|
+
} | {
|
|
16
|
+
value: number;
|
|
17
|
+
} | undefined;
|
|
18
|
+
export declare const fromOptU32Amino: (x: any) => OptionalUInt32 | undefined;
|
|
19
|
+
export declare const dateToIsoAmino: (d?: Date | null) => string | undefined;
|
|
20
|
+
export declare const isoToDate: (s?: string | null) => Date | undefined;
|
|
21
|
+
export declare const dateToAmino: (d?: Date | null) => string | undefined;
|
|
22
|
+
export declare const dateFromAmino: (s?: string | null) => Date | undefined;
|
|
23
|
+
export declare const durationToAmino: (d?: Duration | null) => {
|
|
24
|
+
seconds: string;
|
|
25
|
+
nanos: number | undefined;
|
|
26
|
+
} | undefined;
|
|
27
|
+
export declare const aminoToDuration: (d?: {
|
|
28
|
+
seconds?: string | number | null;
|
|
29
|
+
nanos?: string | number | null;
|
|
30
|
+
} | null) => Duration | undefined;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.aminoToDuration = exports.durationToAmino = exports.dateFromAmino = exports.dateToAmino = exports.isoToDate = exports.dateToIsoAmino = exports.fromOptU32Amino = exports.toOptU32Amino = exports.pickU32 = exports.pickOptionalUInt32 = exports.u32ToAmino = exports.strToU64 = exports.u64ToStrIfNonZero = exports.u64ToStr = exports.clean = void 0;
|
|
7
|
+
const long_1 = __importDefault(require("long"));
|
|
8
|
+
const clean = (o) => {
|
|
9
|
+
Object.keys(o).forEach((k) => o[k] === undefined && delete o[k]);
|
|
10
|
+
return o;
|
|
11
|
+
};
|
|
12
|
+
exports.clean = clean;
|
|
13
|
+
const u64ToStr = (v) => v != null ? long_1.default.fromValue(v).toString() : undefined;
|
|
14
|
+
exports.u64ToStr = u64ToStr;
|
|
15
|
+
const u64ToStrIfNonZero = (v) => {
|
|
16
|
+
if (v == null)
|
|
17
|
+
return undefined;
|
|
18
|
+
const value = long_1.default.fromValue(v);
|
|
19
|
+
return value.isZero() ? undefined : value.toString();
|
|
20
|
+
};
|
|
21
|
+
exports.u64ToStrIfNonZero = u64ToStrIfNonZero;
|
|
22
|
+
const strToU64 = (s) => s != null ? long_1.default.fromString(s) : undefined;
|
|
23
|
+
exports.strToU64 = strToU64;
|
|
24
|
+
const u32ToAmino = (n) => n == null ? undefined : (((n >>> 0) === 0) ? undefined : (n >>> 0));
|
|
25
|
+
exports.u32ToAmino = u32ToAmino;
|
|
26
|
+
const pickOptionalUInt32 = (v) => {
|
|
27
|
+
if (v === undefined || v === null)
|
|
28
|
+
return undefined;
|
|
29
|
+
if (typeof v === "string" && v.trim() === "")
|
|
30
|
+
return undefined;
|
|
31
|
+
const n = Number(v);
|
|
32
|
+
if (!Number.isFinite(n))
|
|
33
|
+
return undefined;
|
|
34
|
+
return { value: n >>> 0 };
|
|
35
|
+
};
|
|
36
|
+
exports.pickOptionalUInt32 = pickOptionalUInt32;
|
|
37
|
+
exports.pickU32 = exports.pickOptionalUInt32;
|
|
38
|
+
const toOptU32Amino = (m) => {
|
|
39
|
+
if (!m)
|
|
40
|
+
return undefined;
|
|
41
|
+
const value = Number(m.value) >>> 0;
|
|
42
|
+
return value === 0 ? {} : { value };
|
|
43
|
+
};
|
|
44
|
+
exports.toOptU32Amino = toOptU32Amino;
|
|
45
|
+
const fromOptU32Amino = (x) => {
|
|
46
|
+
if (x == null)
|
|
47
|
+
return undefined;
|
|
48
|
+
if (typeof x === "object" && x.value == null)
|
|
49
|
+
return { value: 0 };
|
|
50
|
+
const n = typeof x === "object" ? x.value : x;
|
|
51
|
+
if (n === undefined || n === null)
|
|
52
|
+
return undefined;
|
|
53
|
+
if (typeof n === "string" && n.trim() === "")
|
|
54
|
+
return undefined;
|
|
55
|
+
return { value: Number(n) >>> 0 };
|
|
56
|
+
};
|
|
57
|
+
exports.fromOptU32Amino = fromOptU32Amino;
|
|
58
|
+
const dateToIsoAmino = (d) => {
|
|
59
|
+
if (d == null)
|
|
60
|
+
return undefined;
|
|
61
|
+
return d
|
|
62
|
+
.toISOString()
|
|
63
|
+
.replace(/\.000Z$/, "Z")
|
|
64
|
+
.replace(/(\.\d*?[1-9])0+Z$/, "$1Z");
|
|
65
|
+
};
|
|
66
|
+
exports.dateToIsoAmino = dateToIsoAmino;
|
|
67
|
+
const isoToDate = (s) => s != null ? new Date(s) : undefined;
|
|
68
|
+
exports.isoToDate = isoToDate;
|
|
69
|
+
exports.dateToAmino = exports.dateToIsoAmino;
|
|
70
|
+
exports.dateFromAmino = exports.isoToDate;
|
|
71
|
+
const durationToAmino = (d) => {
|
|
72
|
+
if (!d)
|
|
73
|
+
return undefined;
|
|
74
|
+
return (0, exports.clean)({
|
|
75
|
+
seconds: long_1.default.fromValue(d.seconds).toString(),
|
|
76
|
+
nanos: d.nanos === 0 ? undefined : d.nanos,
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
exports.durationToAmino = durationToAmino;
|
|
80
|
+
const aminoToDuration = (d) => {
|
|
81
|
+
if (!d)
|
|
82
|
+
return undefined;
|
|
83
|
+
return {
|
|
84
|
+
seconds: d.seconds == null ? 0 : Number(d.seconds),
|
|
85
|
+
nanos: d.nanos == null ? 0 : Number(d.nanos),
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
exports.aminoToDuration = aminoToDuration;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import type { AminoConverter } from "@cosmjs/stargate";
|
|
2
|
+
export declare const MsgCreateExchangeRateAminoConverter: AminoConverter;
|
|
3
|
+
export declare const MsgUpdateExchangeRateAminoConverter: AminoConverter;
|
|
4
|
+
export declare const MsgSetExchangeRateStateAminoConverter: AminoConverter;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.MsgSetExchangeRateStateAminoConverter = exports.MsgUpdateExchangeRateAminoConverter = exports.MsgCreateExchangeRateAminoConverter = void 0;
|
|
4
|
+
const tx_1 = require("../codec/verana/xr/v1/tx");
|
|
5
|
+
const helpers_1 = require("./util/helpers");
|
|
6
|
+
exports.MsgCreateExchangeRateAminoConverter = {
|
|
7
|
+
aminoType: "verana/x/xr/MsgCreateExchangeRate",
|
|
8
|
+
toAmino: (m) => {
|
|
9
|
+
var _a, _b;
|
|
10
|
+
return (0, helpers_1.clean)({
|
|
11
|
+
authority: m.authority || undefined,
|
|
12
|
+
base_asset_type: (_a = m.baseAssetType) !== null && _a !== void 0 ? _a : 0,
|
|
13
|
+
base_asset: m.baseAsset || undefined,
|
|
14
|
+
quote_asset_type: (_b = m.quoteAssetType) !== null && _b !== void 0 ? _b : 0,
|
|
15
|
+
quote_asset: m.quoteAsset || undefined,
|
|
16
|
+
rate: m.rate || undefined,
|
|
17
|
+
rate_scale: (0, helpers_1.u32ToAmino)(m.rateScale),
|
|
18
|
+
validity_duration: (0, helpers_1.durationToAmino)(m.validityDuration),
|
|
19
|
+
state: m.state ? true : undefined,
|
|
20
|
+
});
|
|
21
|
+
},
|
|
22
|
+
fromAmino: (a) => {
|
|
23
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
24
|
+
return tx_1.MsgCreateExchangeRate.fromPartial({
|
|
25
|
+
authority: (_a = a.authority) !== null && _a !== void 0 ? _a : "",
|
|
26
|
+
baseAssetType: (_b = a.base_asset_type) !== null && _b !== void 0 ? _b : 0,
|
|
27
|
+
baseAsset: (_c = a.base_asset) !== null && _c !== void 0 ? _c : "",
|
|
28
|
+
quoteAssetType: (_d = a.quote_asset_type) !== null && _d !== void 0 ? _d : 0,
|
|
29
|
+
quoteAsset: (_e = a.quote_asset) !== null && _e !== void 0 ? _e : "",
|
|
30
|
+
rate: (_f = a.rate) !== null && _f !== void 0 ? _f : "",
|
|
31
|
+
rateScale: (_g = a.rate_scale) !== null && _g !== void 0 ? _g : 0,
|
|
32
|
+
validityDuration: (0, helpers_1.aminoToDuration)(a.validity_duration),
|
|
33
|
+
state: (_h = a.state) !== null && _h !== void 0 ? _h : false,
|
|
34
|
+
});
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
exports.MsgUpdateExchangeRateAminoConverter = {
|
|
38
|
+
aminoType: "verana/x/xr/MsgUpdateExchangeRate",
|
|
39
|
+
toAmino: (m) => (0, helpers_1.clean)({
|
|
40
|
+
authority: m.authority || undefined,
|
|
41
|
+
operator: m.operator || undefined,
|
|
42
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
43
|
+
rate: m.rate || undefined,
|
|
44
|
+
rate_scale: m.rateScale ? (0, helpers_1.u32ToAmino)(m.rateScale) : undefined,
|
|
45
|
+
validity_duration: m.validityDuration ? (0, helpers_1.durationToAmino)(m.validityDuration) : undefined,
|
|
46
|
+
}),
|
|
47
|
+
fromAmino: (a) => {
|
|
48
|
+
var _a, _b, _c, _d;
|
|
49
|
+
return tx_1.MsgUpdateExchangeRate.fromPartial({
|
|
50
|
+
authority: (_a = a.authority) !== null && _a !== void 0 ? _a : "",
|
|
51
|
+
operator: (_b = a.operator) !== null && _b !== void 0 ? _b : "",
|
|
52
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
53
|
+
rate: (_c = a.rate) !== null && _c !== void 0 ? _c : "",
|
|
54
|
+
rateScale: (_d = a.rate_scale) !== null && _d !== void 0 ? _d : 0,
|
|
55
|
+
validityDuration: (0, helpers_1.aminoToDuration)(a.validity_duration),
|
|
56
|
+
});
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
exports.MsgSetExchangeRateStateAminoConverter = {
|
|
60
|
+
aminoType: "verana/x/xr/MsgSetExchangeRateState",
|
|
61
|
+
toAmino: (m) => (0, helpers_1.clean)({
|
|
62
|
+
authority: m.authority || undefined,
|
|
63
|
+
id: (0, helpers_1.u64ToStr)(m.id),
|
|
64
|
+
state: m.state ? true : undefined,
|
|
65
|
+
}),
|
|
66
|
+
fromAmino: (a) => {
|
|
67
|
+
var _a, _b;
|
|
68
|
+
return tx_1.MsgSetExchangeRateState.fromPartial({
|
|
69
|
+
authority: (_a = a.authority) !== null && _a !== void 0 ? _a : "",
|
|
70
|
+
id: (0, helpers_1.strToU64)(a.id) != null ? Number((0, helpers_1.strToU64)(a.id).toString()) : 0,
|
|
71
|
+
state: (_b = a.state) !== null && _b !== void 0 ? _b : false,
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
};
|
|
@@ -13,7 +13,7 @@ export interface Coin {
|
|
|
13
13
|
/**
|
|
14
14
|
* DecCoin defines a token with a denomination and a decimal amount.
|
|
15
15
|
*
|
|
16
|
-
* NOTE: The amount field is
|
|
16
|
+
* NOTE: The amount field is a Dec which implements the custom method
|
|
17
17
|
* signatures required by gogoproto.
|
|
18
18
|
*/
|
|
19
19
|
export interface DecCoin {
|
|
@@ -812,6 +812,11 @@ export interface FieldOptions_FeatureSupport {
|
|
|
812
812
|
* not be able to override it.
|
|
813
813
|
*/
|
|
814
814
|
editionRemoved?: Edition | undefined;
|
|
815
|
+
/**
|
|
816
|
+
* The removal error text if this feature is used after the edition it was
|
|
817
|
+
* removed in.
|
|
818
|
+
*/
|
|
819
|
+
removalError?: string | undefined;
|
|
815
820
|
}
|
|
816
821
|
export interface OneofOptions {
|
|
817
822
|
/**
|
|
@@ -3702,7 +3702,7 @@ exports.FieldOptions_EditionDefault = {
|
|
|
3702
3702
|
},
|
|
3703
3703
|
};
|
|
3704
3704
|
function createBaseFieldOptions_FeatureSupport() {
|
|
3705
|
-
return { editionIntroduced: 0, editionDeprecated: 0, deprecationWarning: "", editionRemoved: 0 };
|
|
3705
|
+
return { editionIntroduced: 0, editionDeprecated: 0, deprecationWarning: "", editionRemoved: 0, removalError: "" };
|
|
3706
3706
|
}
|
|
3707
3707
|
exports.FieldOptions_FeatureSupport = {
|
|
3708
3708
|
encode(message, writer = _m0.Writer.create()) {
|
|
@@ -3718,6 +3718,9 @@ exports.FieldOptions_FeatureSupport = {
|
|
|
3718
3718
|
if (message.editionRemoved !== undefined && message.editionRemoved !== 0) {
|
|
3719
3719
|
writer.uint32(32).int32(message.editionRemoved);
|
|
3720
3720
|
}
|
|
3721
|
+
if (message.removalError !== undefined && message.removalError !== "") {
|
|
3722
|
+
writer.uint32(42).string(message.removalError);
|
|
3723
|
+
}
|
|
3721
3724
|
return writer;
|
|
3722
3725
|
},
|
|
3723
3726
|
decode(input, length) {
|
|
@@ -3751,6 +3754,12 @@ exports.FieldOptions_FeatureSupport = {
|
|
|
3751
3754
|
}
|
|
3752
3755
|
message.editionRemoved = reader.int32();
|
|
3753
3756
|
continue;
|
|
3757
|
+
case 5:
|
|
3758
|
+
if (tag !== 42) {
|
|
3759
|
+
break;
|
|
3760
|
+
}
|
|
3761
|
+
message.removalError = reader.string();
|
|
3762
|
+
continue;
|
|
3754
3763
|
}
|
|
3755
3764
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3756
3765
|
break;
|
|
@@ -3765,6 +3774,7 @@ exports.FieldOptions_FeatureSupport = {
|
|
|
3765
3774
|
editionDeprecated: isSet(object.editionDeprecated) ? editionFromJSON(object.editionDeprecated) : 0,
|
|
3766
3775
|
deprecationWarning: isSet(object.deprecationWarning) ? globalThis.String(object.deprecationWarning) : "",
|
|
3767
3776
|
editionRemoved: isSet(object.editionRemoved) ? editionFromJSON(object.editionRemoved) : 0,
|
|
3777
|
+
removalError: isSet(object.removalError) ? globalThis.String(object.removalError) : "",
|
|
3768
3778
|
};
|
|
3769
3779
|
},
|
|
3770
3780
|
toJSON(message) {
|
|
@@ -3781,18 +3791,22 @@ exports.FieldOptions_FeatureSupport = {
|
|
|
3781
3791
|
if (message.editionRemoved !== undefined && message.editionRemoved !== 0) {
|
|
3782
3792
|
obj.editionRemoved = editionToJSON(message.editionRemoved);
|
|
3783
3793
|
}
|
|
3794
|
+
if (message.removalError !== undefined && message.removalError !== "") {
|
|
3795
|
+
obj.removalError = message.removalError;
|
|
3796
|
+
}
|
|
3784
3797
|
return obj;
|
|
3785
3798
|
},
|
|
3786
3799
|
create(base) {
|
|
3787
3800
|
return exports.FieldOptions_FeatureSupport.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
3788
3801
|
},
|
|
3789
3802
|
fromPartial(object) {
|
|
3790
|
-
var _a, _b, _c, _d;
|
|
3803
|
+
var _a, _b, _c, _d, _e;
|
|
3791
3804
|
const message = createBaseFieldOptions_FeatureSupport();
|
|
3792
3805
|
message.editionIntroduced = (_a = object.editionIntroduced) !== null && _a !== void 0 ? _a : 0;
|
|
3793
3806
|
message.editionDeprecated = (_b = object.editionDeprecated) !== null && _b !== void 0 ? _b : 0;
|
|
3794
3807
|
message.deprecationWarning = (_c = object.deprecationWarning) !== null && _c !== void 0 ? _c : "";
|
|
3795
3808
|
message.editionRemoved = (_d = object.editionRemoved) !== null && _d !== void 0 ? _d : 0;
|
|
3809
|
+
message.removalError = (_e = object.removalError) !== null && _e !== void 0 ? _e : "";
|
|
3796
3810
|
return message;
|
|
3797
3811
|
},
|
|
3798
3812
|
};
|
|
@@ -73,8 +73,8 @@ export declare const protobufPackage = "google.protobuf";
|
|
|
73
73
|
* {hour}, {min}, and {sec} are zero-padded to two digits each. The fractional
|
|
74
74
|
* seconds, which can go up to 9 digits (i.e. up to 1 nanosecond resolution),
|
|
75
75
|
* are optional. The "Z" suffix indicates the timezone ("UTC"); the timezone
|
|
76
|
-
* is required. A
|
|
77
|
-
* "Z") when printing the Timestamp type and a
|
|
76
|
+
* is required. A ProtoJSON serializer should always use UTC (as indicated by
|
|
77
|
+
* "Z") when printing the Timestamp type and a ProtoJSON parser should be
|
|
78
78
|
* able to accept both UTC and other timezones (as indicated by an offset).
|
|
79
79
|
*
|
|
80
80
|
* For example, "2017-01-15T01:30:15.01Z" encodes 15.01 seconds past
|
|
@@ -94,7 +94,7 @@ export declare const protobufPackage = "google.protobuf";
|
|
|
94
94
|
export interface Timestamp {
|
|
95
95
|
/**
|
|
96
96
|
* Represents seconds of UTC time since Unix epoch 1970-01-01T00:00:00Z. Must
|
|
97
|
-
* be between -
|
|
97
|
+
* be between -62135596800 and 253402300799 inclusive (which corresponds to
|
|
98
98
|
* 0001-01-01T00:00:00Z to 9999-12-31T23:59:59Z).
|
|
99
99
|
*/
|
|
100
100
|
seconds: number;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as _m0 from "protobufjs/minimal";
|
|
2
2
|
import { Params } from "./params";
|
|
3
|
-
import { CredentialSchema,
|
|
3
|
+
import { CredentialSchema, HolderOnboardingMode, IssuerOnboardingMode, VerifierOnboardingMode } from "./types";
|
|
4
4
|
export declare const protobufPackage = "verana.cs.v1";
|
|
5
5
|
/** QueryParamsRequest is request type for the Query/Params RPC method. */
|
|
6
6
|
export interface QueryParamsRequest {
|
|
@@ -16,8 +16,9 @@ export interface QueryListCredentialSchemasRequest {
|
|
|
16
16
|
modifiedAfter: Date | undefined;
|
|
17
17
|
responseMaxSize: number;
|
|
18
18
|
onlyActive: boolean;
|
|
19
|
-
|
|
20
|
-
|
|
19
|
+
issuerOnboardingMode: IssuerOnboardingMode;
|
|
20
|
+
verifierOnboardingMode: VerifierOnboardingMode;
|
|
21
|
+
holderOnboardingMode: HolderOnboardingMode;
|
|
21
22
|
}
|
|
22
23
|
export interface QueryListCredentialSchemasResponse {
|
|
23
24
|
schemas: CredentialSchema[];
|
|
@@ -141,8 +141,9 @@ function createBaseQueryListCredentialSchemasRequest() {
|
|
|
141
141
|
modifiedAfter: undefined,
|
|
142
142
|
responseMaxSize: 0,
|
|
143
143
|
onlyActive: false,
|
|
144
|
-
|
|
145
|
-
|
|
144
|
+
issuerOnboardingMode: 0,
|
|
145
|
+
verifierOnboardingMode: 0,
|
|
146
|
+
holderOnboardingMode: 0,
|
|
146
147
|
};
|
|
147
148
|
}
|
|
148
149
|
exports.QueryListCredentialSchemasRequest = {
|
|
@@ -159,11 +160,14 @@ exports.QueryListCredentialSchemasRequest = {
|
|
|
159
160
|
if (message.onlyActive !== false) {
|
|
160
161
|
writer.uint32(32).bool(message.onlyActive);
|
|
161
162
|
}
|
|
162
|
-
if (message.
|
|
163
|
-
writer.uint32(40).int32(message.
|
|
163
|
+
if (message.issuerOnboardingMode !== 0) {
|
|
164
|
+
writer.uint32(40).int32(message.issuerOnboardingMode);
|
|
164
165
|
}
|
|
165
|
-
if (message.
|
|
166
|
-
writer.uint32(48).int32(message.
|
|
166
|
+
if (message.verifierOnboardingMode !== 0) {
|
|
167
|
+
writer.uint32(48).int32(message.verifierOnboardingMode);
|
|
168
|
+
}
|
|
169
|
+
if (message.holderOnboardingMode !== 0) {
|
|
170
|
+
writer.uint32(56).int32(message.holderOnboardingMode);
|
|
167
171
|
}
|
|
168
172
|
return writer;
|
|
169
173
|
},
|
|
@@ -202,13 +206,19 @@ exports.QueryListCredentialSchemasRequest = {
|
|
|
202
206
|
if (tag !== 40) {
|
|
203
207
|
break;
|
|
204
208
|
}
|
|
205
|
-
message.
|
|
209
|
+
message.issuerOnboardingMode = reader.int32();
|
|
206
210
|
continue;
|
|
207
211
|
case 6:
|
|
208
212
|
if (tag !== 48) {
|
|
209
213
|
break;
|
|
210
214
|
}
|
|
211
|
-
message.
|
|
215
|
+
message.verifierOnboardingMode = reader.int32();
|
|
216
|
+
continue;
|
|
217
|
+
case 7:
|
|
218
|
+
if (tag !== 56) {
|
|
219
|
+
break;
|
|
220
|
+
}
|
|
221
|
+
message.holderOnboardingMode = reader.int32();
|
|
212
222
|
continue;
|
|
213
223
|
}
|
|
214
224
|
if ((tag & 7) === 4 || tag === 0) {
|
|
@@ -224,11 +234,14 @@ exports.QueryListCredentialSchemasRequest = {
|
|
|
224
234
|
modifiedAfter: isSet(object.modifiedAfter) ? fromJsonTimestamp(object.modifiedAfter) : undefined,
|
|
225
235
|
responseMaxSize: isSet(object.responseMaxSize) ? globalThis.Number(object.responseMaxSize) : 0,
|
|
226
236
|
onlyActive: isSet(object.onlyActive) ? globalThis.Boolean(object.onlyActive) : false,
|
|
227
|
-
|
|
228
|
-
? (0, types_1.
|
|
237
|
+
issuerOnboardingMode: isSet(object.issuerOnboardingMode)
|
|
238
|
+
? (0, types_1.issuerOnboardingModeFromJSON)(object.issuerOnboardingMode)
|
|
239
|
+
: 0,
|
|
240
|
+
verifierOnboardingMode: isSet(object.verifierOnboardingMode)
|
|
241
|
+
? (0, types_1.verifierOnboardingModeFromJSON)(object.verifierOnboardingMode)
|
|
229
242
|
: 0,
|
|
230
|
-
|
|
231
|
-
? (0, types_1.
|
|
243
|
+
holderOnboardingMode: isSet(object.holderOnboardingMode)
|
|
244
|
+
? (0, types_1.holderOnboardingModeFromJSON)(object.holderOnboardingMode)
|
|
232
245
|
: 0,
|
|
233
246
|
};
|
|
234
247
|
},
|
|
@@ -246,11 +259,14 @@ exports.QueryListCredentialSchemasRequest = {
|
|
|
246
259
|
if (message.onlyActive !== false) {
|
|
247
260
|
obj.onlyActive = message.onlyActive;
|
|
248
261
|
}
|
|
249
|
-
if (message.
|
|
250
|
-
obj.
|
|
262
|
+
if (message.issuerOnboardingMode !== 0) {
|
|
263
|
+
obj.issuerOnboardingMode = (0, types_1.issuerOnboardingModeToJSON)(message.issuerOnboardingMode);
|
|
264
|
+
}
|
|
265
|
+
if (message.verifierOnboardingMode !== 0) {
|
|
266
|
+
obj.verifierOnboardingMode = (0, types_1.verifierOnboardingModeToJSON)(message.verifierOnboardingMode);
|
|
251
267
|
}
|
|
252
|
-
if (message.
|
|
253
|
-
obj.
|
|
268
|
+
if (message.holderOnboardingMode !== 0) {
|
|
269
|
+
obj.holderOnboardingMode = (0, types_1.holderOnboardingModeToJSON)(message.holderOnboardingMode);
|
|
254
270
|
}
|
|
255
271
|
return obj;
|
|
256
272
|
},
|
|
@@ -258,14 +274,15 @@ exports.QueryListCredentialSchemasRequest = {
|
|
|
258
274
|
return exports.QueryListCredentialSchemasRequest.fromPartial(base !== null && base !== void 0 ? base : {});
|
|
259
275
|
},
|
|
260
276
|
fromPartial(object) {
|
|
261
|
-
var _a, _b, _c, _d, _e, _f;
|
|
277
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
262
278
|
const message = createBaseQueryListCredentialSchemasRequest();
|
|
263
279
|
message.trId = (_a = object.trId) !== null && _a !== void 0 ? _a : 0;
|
|
264
280
|
message.modifiedAfter = (_b = object.modifiedAfter) !== null && _b !== void 0 ? _b : undefined;
|
|
265
281
|
message.responseMaxSize = (_c = object.responseMaxSize) !== null && _c !== void 0 ? _c : 0;
|
|
266
282
|
message.onlyActive = (_d = object.onlyActive) !== null && _d !== void 0 ? _d : false;
|
|
267
|
-
message.
|
|
268
|
-
message.
|
|
283
|
+
message.issuerOnboardingMode = (_e = object.issuerOnboardingMode) !== null && _e !== void 0 ? _e : 0;
|
|
284
|
+
message.verifierOnboardingMode = (_f = object.verifierOnboardingMode) !== null && _f !== void 0 ? _f : 0;
|
|
285
|
+
message.holderOnboardingMode = (_g = object.holderOnboardingMode) !== null && _g !== void 0 ? _g : 0;
|
|
269
286
|
return message;
|
|
270
287
|
},
|
|
271
288
|
};
|