@bitgo/public-types 5.28.1 → 5.29.0
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/src/schema/enterprise/enterpriseIdString.d.ts +3 -0
- package/dist/src/schema/enterprise/enterpriseIdString.js +29 -0
- package/dist/src/schema/enterprise/enterpriseIdString.js.map +1 -0
- package/dist/src/schema/enterprise/index.d.ts +1 -0
- package/dist/src/schema/enterprise/index.js +18 -0
- package/dist/src/schema/enterprise/index.js.map +1 -0
- package/dist/src/schema/index.d.ts +1 -0
- package/dist/src/schema/index.js +1 -0
- package/dist/src/schema/index.js.map +1 -1
- package/dist/src/schema/transactionRequest/baseShare.d.ts +14 -0
- package/dist/src/schema/transactionRequest/baseShare.js +34 -0
- package/dist/src/schema/transactionRequest/baseShare.js.map +1 -0
- package/dist/src/schema/transactionRequest/commitmentShare.d.ts +17 -0
- package/dist/src/schema/transactionRequest/commitmentShare.js +35 -0
- package/dist/src/schema/transactionRequest/commitmentShare.js.map +1 -0
- package/dist/src/schema/transactionRequest/encryptedShare.d.ts +20 -0
- package/dist/src/schema/transactionRequest/encryptedShare.js +34 -0
- package/dist/src/schema/transactionRequest/encryptedShare.js.map +1 -0
- package/dist/src/schema/transactionRequest/index.d.ts +7 -0
- package/dist/src/schema/transactionRequest/index.js +7 -0
- package/dist/src/schema/transactionRequest/index.js.map +1 -1
- package/dist/src/schema/transactionRequest/message.d.ts +100 -0
- package/dist/src/schema/transactionRequest/message.js +56 -0
- package/dist/src/schema/transactionRequest/message.js.map +1 -0
- package/dist/src/schema/transactionRequest/shareType.d.ts +6 -0
- package/dist/src/schema/transactionRequest/shareType.js +32 -0
- package/dist/src/schema/transactionRequest/shareType.js.map +1 -0
- package/dist/src/schema/transactionRequest/signatureShare.d.ts +33 -0
- package/dist/src/schema/transactionRequest/signatureShare.js +42 -0
- package/dist/src/schema/transactionRequest/signatureShare.js.map +1 -0
- package/dist/src/schema/transactionRequest/signatureShareType.d.ts +7 -0
- package/dist/src/schema/transactionRequest/signatureShareType.js +33 -0
- package/dist/src/schema/transactionRequest/signatureShareType.js.map +1 -0
- package/dist/src/schema/transactionRequest/transaction.d.ts +105 -0
- package/dist/src/schema/transactionRequest/transaction.js +46 -0
- package/dist/src/schema/transactionRequest/transaction.js.map +1 -0
- package/dist/src/schema/transactionRequest/transactionRequest.d.ts +13532 -0
- package/dist/src/schema/transactionRequest/transactionRequest.js +87 -0
- package/dist/src/schema/transactionRequest/transactionRequest.js.map +1 -0
- package/dist/src/schema/transactionRequest/transactionRequestApiVersion.d.ts +6 -0
- package/dist/src/schema/transactionRequest/transactionRequestApiVersion.js +32 -0
- package/dist/src/schema/transactionRequest/transactionRequestApiVersion.js.map +1 -0
- package/dist/src/schema/transactionRequest/unsignedTransaction.d.ts +51 -0
- package/dist/src/schema/transactionRequest/unsignedTransaction.js +95 -0
- package/dist/src/schema/transactionRequest/unsignedTransaction.js.map +1 -0
- package/dist/src/schema/wallet/index.d.ts +1 -0
- package/dist/src/schema/wallet/index.js +1 -0
- package/dist/src/schema/wallet/index.js.map +1 -1
- package/dist/src/schema/wallet/wallet.d.ts +2 -0
- package/dist/src/schema/wallet/wallet.js +2 -1
- package/dist/src/schema/wallet/wallet.js.map +1 -1
- package/dist/src/schema/wallet/walletTypes.d.ts +11 -0
- package/dist/src/schema/wallet/walletTypes.js +37 -0
- package/dist/src/schema/wallet/walletTypes.js.map +1 -0
- package/package.json +1 -1
- package/src/schema/enterprise/enterpriseIdString.ts +9 -0
- package/src/schema/enterprise/index.ts +1 -0
- package/src/schema/index.ts +1 -0
- package/src/schema/transactionRequest/baseShare.ts +17 -0
- package/src/schema/transactionRequest/commitmentShare.ts +12 -0
- package/src/schema/transactionRequest/encryptedShare.ts +10 -0
- package/src/schema/transactionRequest/index.ts +7 -0
- package/src/schema/transactionRequest/message.ts +104 -0
- package/src/schema/transactionRequest/shareType.ts +10 -0
- package/src/schema/transactionRequest/signatureShare.ts +29 -0
- package/src/schema/transactionRequest/signatureShareType.ts +11 -0
- package/src/schema/transactionRequest/transaction.ts +24 -0
- package/src/schema/transactionRequest/transactionRequest.ts +118 -0
- package/src/schema/transactionRequest/transactionRequestApiVersion.ts +12 -0
- package/src/schema/transactionRequest/unsignedTransaction.ts +77 -0
- package/src/schema/wallet/index.ts +1 -0
- package/src/schema/wallet/wallet.ts +7 -0
- package/src/schema/wallet/walletTypes.ts +16 -0
@@ -0,0 +1,87 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.TransactionRequest = exports.TransactionRequestFull = exports.TransactionRequestLite = exports.TransactionRequestBase = exports.TransactionRequestIdNonEmptyString = exports.TransactionRequestId = void 0;
|
27
|
+
const t = __importStar(require("io-ts"));
|
28
|
+
const io_ts_types_1 = require("io-ts-types");
|
29
|
+
const wallet_1 = require("../wallet");
|
30
|
+
const walletTypes_1 = require("../wallet/walletTypes");
|
31
|
+
const enterprise_1 = require("../enterprise");
|
32
|
+
const _1 = require(".");
|
33
|
+
const transactionRequestApiVersion_1 = require("./transactionRequestApiVersion");
|
34
|
+
const commitmentShare_1 = require("./commitmentShare");
|
35
|
+
const signatureShare_1 = require("./signatureShare");
|
36
|
+
const unsignedTransaction_1 = require("./unsignedTransaction");
|
37
|
+
const message_1 = require("./message");
|
38
|
+
const transaction_1 = require("./transaction");
|
39
|
+
exports.TransactionRequestId = t.string;
|
40
|
+
exports.TransactionRequestIdNonEmptyString = io_ts_types_1.NonEmptyString;
|
41
|
+
exports.TransactionRequestBase = t.intersection([
|
42
|
+
t.type({
|
43
|
+
txRequestId: exports.TransactionRequestId,
|
44
|
+
walletId: wallet_1.WalletIdString,
|
45
|
+
version: t.number,
|
46
|
+
state: _1.TransactionRequestState,
|
47
|
+
date: io_ts_types_1.DateFromISOString,
|
48
|
+
createdDate: io_ts_types_1.DateFromISOString,
|
49
|
+
userId: t.string,
|
50
|
+
initiatedBy: t.string,
|
51
|
+
updatedBy: t.string,
|
52
|
+
intents: t.array(t.unknown),
|
53
|
+
latest: t.boolean,
|
54
|
+
}),
|
55
|
+
t.partial({
|
56
|
+
apiVersion: transactionRequestApiVersion_1.TransactionRequestApiVersion,
|
57
|
+
idempotencyKey: t.string,
|
58
|
+
walletType: walletTypes_1.WalletTypes,
|
59
|
+
enterpriseId: enterprise_1.EnterpriseIdString,
|
60
|
+
intent: t.unknown,
|
61
|
+
pendingApprovalId: t.string,
|
62
|
+
policiesChecked: t.boolean,
|
63
|
+
isCanceled: t.boolean,
|
64
|
+
}),
|
65
|
+
]);
|
66
|
+
exports.TransactionRequestLite = t.intersection([
|
67
|
+
exports.TransactionRequestBase,
|
68
|
+
t.partial({
|
69
|
+
intent: t.union([_1.TransactionIntent, t.unknown]),
|
70
|
+
unsignedTxs: t.array(unsignedTransaction_1.UnsignedTransaction),
|
71
|
+
signatureShares: t.array(signatureShare_1.SignatureShare),
|
72
|
+
commitmentShares: t.array(commitmentShare_1.CommitmentShare),
|
73
|
+
txHashes: t.array(t.string),
|
74
|
+
}),
|
75
|
+
]);
|
76
|
+
exports.TransactionRequestFull = t.intersection([
|
77
|
+
exports.TransactionRequestBase,
|
78
|
+
t.partial({
|
79
|
+
transactions: t.array(transaction_1.Transaction),
|
80
|
+
messages: t.array(message_1.Message),
|
81
|
+
}),
|
82
|
+
]);
|
83
|
+
exports.TransactionRequest = t.union([
|
84
|
+
exports.TransactionRequestLite,
|
85
|
+
exports.TransactionRequestFull,
|
86
|
+
]);
|
87
|
+
//# sourceMappingURL=transactionRequest.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"transactionRequest.js","sourceRoot":"","sources":["../../../../src/schema/transactionRequest/transactionRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAgE;AAChE,sCAA2C;AAC3C,uDAAoD;AACpD,8CAAmD;AACnD,wBAA+D;AAC/D,iFAA8E;AAC9E,uDAAoD;AACpD,qDAAkD;AAClD,+DAA4D;AAC5D,uCAAoC;AACpC,+CAA4C;AAM/B,QAAA,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;AAQhC,QAAA,kCAAkC,GAAG,4BAAc,CAAC;AAMpD,QAAA,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC;IAEnD,CAAC,CAAC,IAAI,CAAC;QAEL,WAAW,EAAE,4BAAoB;QAEjC,QAAQ,EAAE,uBAAc;QAExB,OAAO,EAAE,CAAC,CAAC,MAAM;QAEjB,KAAK,EAAE,0BAAuB;QAK9B,IAAI,EAAE,+BAAiB;QAKvB,WAAW,EAAE,+BAAiB;QAE9B,MAAM,EAAE,CAAC,CAAC,MAAM;QAEhB,WAAW,EAAE,CAAC,CAAC,MAAM;QAErB,SAAS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BAAsB;CACvB,CAAC,CAAC"}
|
@@ -0,0 +1,32 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.TransactionRequestApiVersion = void 0;
|
27
|
+
const t = __importStar(require("io-ts"));
|
28
|
+
exports.TransactionRequestApiVersion = t.keyof({
|
29
|
+
lite: 1,
|
30
|
+
full: 1,
|
31
|
+
}, "TransactionRequestApiVersion");
|
32
|
+
//# sourceMappingURL=transactionRequestApiVersion.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"transactionRequestApiVersion.js","sourceRoot":"","sources":["../../../../src/schema/transactionRequest/transactionRequestApiVersion.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAEd,QAAA,4BAA4B,GAAG,CAAC,CAAC,KAAK,CACjD;IACE,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;CACR,EACD,8BAA8B,CAC/B,CAAC"}
|
@@ -0,0 +1,51 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
export declare const UnsignedTransaction: t.IntersectionC<[t.TypeC<{
|
3
|
+
parsedTx: t.IntersectionC<[t.TypeC<{
|
4
|
+
inputs: t.ArrayC<t.IntersectionC<[t.TypeC<{
|
5
|
+
valueString: t.StringC;
|
6
|
+
}>, t.PartialC<{
|
7
|
+
_id: t.StringC;
|
8
|
+
address: t.StringC;
|
9
|
+
chain: t.NumberC;
|
10
|
+
derivationIndex: t.NumberC;
|
11
|
+
index: t.NumberC;
|
12
|
+
value: t.UnionC<[t.NumberC, t.BigIntC]>;
|
13
|
+
}>]>>;
|
14
|
+
minerFee: t.UnionC<[t.StringC, t.NumberC]>;
|
15
|
+
outputs: t.ArrayC<t.IntersectionC<[t.TypeC<{
|
16
|
+
valueString: t.StringC;
|
17
|
+
}>, t.PartialC<{
|
18
|
+
address: t.StringC;
|
19
|
+
change: t.BooleanC;
|
20
|
+
coinName: t.StringC;
|
21
|
+
data: t.StringC;
|
22
|
+
isPayGo: t.BooleanC;
|
23
|
+
value: t.UnionC<[t.NumberC, t.BigIntC]>;
|
24
|
+
wallet: t.StringC;
|
25
|
+
walletV1: t.StringC;
|
26
|
+
baseAddress: t.StringC;
|
27
|
+
enterprise: t.StringC;
|
28
|
+
}>]>>;
|
29
|
+
spendAmount: t.UnionC<[t.StringC, t.NumberC]>;
|
30
|
+
}>, t.PartialC<{
|
31
|
+
gasPrice: t.NumberC;
|
32
|
+
hasUnvalidatedData: t.BooleanC;
|
33
|
+
payGoFee: t.UnionC<[t.StringC, t.NumberC]>;
|
34
|
+
spendAmounts: t.ArrayC<t.UnknownRecordC>;
|
35
|
+
type: t.StringC;
|
36
|
+
}>]>;
|
37
|
+
serializedTxHex: t.StringC;
|
38
|
+
signableHex: t.StringC;
|
39
|
+
}>, t.PartialC<{
|
40
|
+
derivationPath: t.StringC;
|
41
|
+
coinSpecific: t.IntersectionC<[t.UnknownRecordC, t.PartialC<{
|
42
|
+
nonceAddress: t.StringC;
|
43
|
+
stakingAddress: t.StringC;
|
44
|
+
signature: t.StringC;
|
45
|
+
}>]>;
|
46
|
+
feeInfo: t.TypeC<{
|
47
|
+
fee: t.UnionC<[t.StringC, t.NumberC]>;
|
48
|
+
feeString: t.StringC;
|
49
|
+
}>;
|
50
|
+
}>]>;
|
51
|
+
export type UnsignedTransaction = t.TypeOf<typeof UnsignedTransaction>;
|
@@ -0,0 +1,95 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.UnsignedTransaction = void 0;
|
27
|
+
const t = __importStar(require("io-ts"));
|
28
|
+
const Input = t.intersection([
|
29
|
+
t.type({
|
30
|
+
valueString: t.string,
|
31
|
+
}),
|
32
|
+
t.partial({
|
33
|
+
_id: t.string,
|
34
|
+
address: t.string,
|
35
|
+
chain: t.number,
|
36
|
+
derivationIndex: t.number,
|
37
|
+
index: t.number,
|
38
|
+
value: t.union([t.number, t.bigint]),
|
39
|
+
}),
|
40
|
+
]);
|
41
|
+
const Output = t.intersection([
|
42
|
+
t.type({
|
43
|
+
valueString: t.string,
|
44
|
+
}),
|
45
|
+
t.partial({
|
46
|
+
address: t.string,
|
47
|
+
change: t.boolean,
|
48
|
+
coinName: t.string,
|
49
|
+
data: t.string,
|
50
|
+
isPayGo: t.boolean,
|
51
|
+
value: t.union([t.number, t.bigint]),
|
52
|
+
wallet: t.string,
|
53
|
+
walletV1: t.string,
|
54
|
+
baseAddress: t.string,
|
55
|
+
enterprise: t.string,
|
56
|
+
}),
|
57
|
+
]);
|
58
|
+
const ParsedTx = t.intersection([
|
59
|
+
t.type({
|
60
|
+
inputs: t.array(Input),
|
61
|
+
minerFee: t.union([t.string, t.number]),
|
62
|
+
outputs: t.array(Output),
|
63
|
+
spendAmount: t.union([t.string, t.number]),
|
64
|
+
}),
|
65
|
+
t.partial({
|
66
|
+
gasPrice: t.number,
|
67
|
+
hasUnvalidatedData: t.boolean,
|
68
|
+
payGoFee: t.union([t.string, t.number]),
|
69
|
+
spendAmounts: t.array(t.UnknownRecord),
|
70
|
+
type: t.string,
|
71
|
+
}),
|
72
|
+
]);
|
73
|
+
exports.UnsignedTransaction = t.intersection([
|
74
|
+
t.type({
|
75
|
+
parsedTx: ParsedTx,
|
76
|
+
serializedTxHex: t.string,
|
77
|
+
signableHex: t.string,
|
78
|
+
}),
|
79
|
+
t.partial({
|
80
|
+
derivationPath: t.string,
|
81
|
+
coinSpecific: t.intersection([
|
82
|
+
t.UnknownRecord,
|
83
|
+
t.partial({
|
84
|
+
nonceAddress: t.string,
|
85
|
+
stakingAddress: t.string,
|
86
|
+
signature: t.string,
|
87
|
+
}),
|
88
|
+
]),
|
89
|
+
feeInfo: t.type({
|
90
|
+
fee: t.union([t.string, t.number]),
|
91
|
+
feeString: t.string,
|
92
|
+
}),
|
93
|
+
}),
|
94
|
+
]);
|
95
|
+
//# sourceMappingURL=unsignedTransaction.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"unsignedTransaction.js","sourceRoot":"","sources":["../../../../src/schema/transactionRequest/unsignedTransaction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAE3B,MAAM,KAAK,GAAG,CAAC,CAAC,YAAY,CAAC;IAC3B,CAAC,CAAC,IAAI,CAAC;QACL,WAAW,EAAE,CAAC,CAAC,MAAM;KACtB,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,GAAG,EAAE,CAAC,CAAC,MAAM;QACb,OAAO,EAAE,CAAC,CAAC,MAAM;QACjB,KAAK,EAAE,CAAC,CAAC,MAAM;QACf,eAAe,EAAE,CAAC,CAAC,MAAM;QACzB,KAAK,EAAE,CAAC,CAAC,MAAM;QACf,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;KACrC,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,MAAM,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5B,CAAC,CAAC,IAAI,CAAC;QACL,WAAW,EAAE,CAAC,CAAC,MAAM;KACtB,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,OAAO,EAAE,CAAC,CAAC,MAAM;QACjB,MAAM,EAAE,CAAC,CAAC,OAAO;QACjB,QAAQ,EAAE,CAAC,CAAC,MAAM;QAClB,IAAI,EAAE,CAAC,CAAC,MAAM;QACd,OAAO,EAAE,CAAC,CAAC,OAAO;QAClB,KAAK,EAAE,CAAC,CA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CAAC,CAAC,MAAM;QAExB,YAAY,EAAE,CAAC,CAAC,YAAY,CAAC;YAC3B,CAAC,CAAC,aAAa;YACf,CAAC,CAAC,OAAO,CAAC;gBACR,YAAY,EAAE,CAAC,CAAC,MAAM;gBACtB,cAAc,EAAE,CAAC,CAAC,MAAM;gBACxB,SAAS,EAAE,CAAC,CAAC,MAAM;aACpB,CAAC;SACH,CAAC;QACF,OAAO,EAAE,CAAC,CAAC,IAAI,CAAC;YACd,GAAG,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;YAClC,SAAS,EAAE,CAAC,CAAC,MAAM;SACpB,CAAC;KACH,CAAC;CACH,CAAC,CAAC"}
|
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
17
17
|
__exportStar(require("./wallet"), exports);
|
18
18
|
__exportStar(require("./multisigTypeVersion"), exports);
|
19
|
+
__exportStar(require("./walletTypes"), exports);
|
19
20
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/wallet/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,wDAAsC"}
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/wallet/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,wDAAsC;AACtC,gDAA8B"}
|
@@ -23,8 +23,9 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
23
|
return result;
|
24
24
|
};
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
-
exports.WalletUser = void 0;
|
26
|
+
exports.WalletUser = exports.WalletIdString = void 0;
|
27
27
|
const t = __importStar(require("io-ts"));
|
28
|
+
exports.WalletIdString = t.string;
|
28
29
|
exports.WalletUser = t.type({
|
29
30
|
user: t.string,
|
30
31
|
permissions: t.array(t.string),
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../../src/schema/wallet/wallet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;
|
1
|
+
{"version":3,"file":"wallet.js","sourceRoot":"","sources":["../../../../src/schema/wallet/wallet.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAMd,QAAA,cAAc,GAAG,CAAC,CAAC,MAAM,CAAC;AAG1B,QAAA,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC;IAC/B,IAAI,EAAE,CAAC,CAAC,MAAM;IACd,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;CAC/B,CAAC,CAAC"}
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
export declare const WalletTypes: t.KeyofC<{
|
3
|
+
backing: number;
|
4
|
+
cold: number;
|
5
|
+
custodial: number;
|
6
|
+
custodialPaired: number;
|
7
|
+
hot: number;
|
8
|
+
advanced: number;
|
9
|
+
trading: number;
|
10
|
+
}>;
|
11
|
+
export type WalletTypes = t.TypeOf<typeof WalletTypes>;
|
@@ -0,0 +1,37 @@
|
|
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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
15
|
+
}) : function(o, v) {
|
16
|
+
o["default"] = v;
|
17
|
+
});
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
19
|
+
if (mod && mod.__esModule) return mod;
|
20
|
+
var result = {};
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
22
|
+
__setModuleDefault(result, mod);
|
23
|
+
return result;
|
24
|
+
};
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
26
|
+
exports.WalletTypes = void 0;
|
27
|
+
const t = __importStar(require("io-ts"));
|
28
|
+
exports.WalletTypes = t.keyof({
|
29
|
+
backing: 1,
|
30
|
+
cold: 1,
|
31
|
+
custodial: 1,
|
32
|
+
custodialPaired: 1,
|
33
|
+
hot: 1,
|
34
|
+
advanced: 1,
|
35
|
+
trading: 1,
|
36
|
+
}, "WalletTypes");
|
37
|
+
//# sourceMappingURL=walletTypes.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"walletTypes.js","sourceRoot":"","sources":["../../../../src/schema/wallet/walletTypes.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAEd,QAAA,WAAW,GAAG,CAAC,CAAC,KAAK,CAChC;IACE,OAAO,EAAE,CAAC;IACV,IAAI,EAAE,CAAC;IACP,SAAS,EAAE,CAAC;IACZ,eAAe,EAAE,CAAC;IAClB,GAAG,EAAE,CAAC;IACN,QAAQ,EAAE,CAAC;IACX,OAAO,EAAE,CAAC;CACX,EACD,aAAa,CACd,CAAC"}
|
package/package.json
CHANGED
@@ -0,0 +1 @@
|
|
1
|
+
export * from "./enterpriseIdString";
|
package/src/schema/index.ts
CHANGED
@@ -0,0 +1,17 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
import { SignatureShareType } from "./signatureShareType";
|
3
|
+
|
4
|
+
export const BaseShare = t.type({
|
5
|
+
/**
|
6
|
+
* The source of the commitment share
|
7
|
+
* @example user
|
8
|
+
*/
|
9
|
+
from: SignatureShareType,
|
10
|
+
/**
|
11
|
+
* The recipient of the commitment share.
|
12
|
+
* @example bitgo
|
13
|
+
*/
|
14
|
+
to: SignatureShareType,
|
15
|
+
/** The commitment share. */
|
16
|
+
share: t.string,
|
17
|
+
});
|
@@ -0,0 +1,12 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
import { BaseShare } from "./baseShare";
|
3
|
+
|
4
|
+
export const CommitmentShare = t.intersection([
|
5
|
+
BaseShare,
|
6
|
+
t.type({
|
7
|
+
/** The type of the commitment share */
|
8
|
+
type: t.literal("commitment"),
|
9
|
+
}),
|
10
|
+
]);
|
11
|
+
|
12
|
+
export type CommitmentShare = t.TypeOf<typeof CommitmentShare>;
|
@@ -0,0 +1,10 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
import { BaseShare } from "./baseShare";
|
3
|
+
import { ShareType } from "./shareType";
|
4
|
+
|
5
|
+
export const EncryptedShare = t.intersection([
|
6
|
+
BaseShare,
|
7
|
+
t.type({ type: ShareType }),
|
8
|
+
]);
|
9
|
+
|
10
|
+
export type EncryptedShare = t.TypeOf<typeof EncryptedShare>;
|
@@ -1,3 +1,10 @@
|
|
1
1
|
export * from "./transactionState";
|
2
2
|
export * from "./transactionRequestState";
|
3
3
|
export * from "./intents";
|
4
|
+
export * from "./transactionRequest";
|
5
|
+
export * from "./transactionRequestApiVersion";
|
6
|
+
export * from "./commitmentShare";
|
7
|
+
export * from "./signatureShare";
|
8
|
+
export * from "./unsignedTransaction";
|
9
|
+
export * from "./message";
|
10
|
+
export * from "./transaction";
|
@@ -0,0 +1,104 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
import { DateFromISOString } from "io-ts-types";
|
3
|
+
import { TransactionState } from "./transactionState";
|
4
|
+
import { SignatureShare } from "./signatureShare";
|
5
|
+
import { CommitmentShare } from "./commitmentShare";
|
6
|
+
import { EncryptedShare } from "./encryptedShare";
|
7
|
+
|
8
|
+
/**
|
9
|
+
* Schema for the Message object used in TransactionRequests
|
10
|
+
* Used for message signing
|
11
|
+
*/
|
12
|
+
export const Message = t.intersection([
|
13
|
+
// Required fields
|
14
|
+
t.type({
|
15
|
+
/**
|
16
|
+
* The current state of the message
|
17
|
+
*/
|
18
|
+
state: TransactionState,
|
19
|
+
|
20
|
+
/**
|
21
|
+
* The raw message to be signed
|
22
|
+
*/
|
23
|
+
messageRaw: t.string,
|
24
|
+
}),
|
25
|
+
// Optional fields
|
26
|
+
t.partial({
|
27
|
+
/**
|
28
|
+
* Signature shares for the message
|
29
|
+
*/
|
30
|
+
signatureShares: t.array(SignatureShare),
|
31
|
+
|
32
|
+
/**
|
33
|
+
* Private signature shares for the message
|
34
|
+
*/
|
35
|
+
privateSignatureShares: t.array(SignatureShare),
|
36
|
+
|
37
|
+
/**
|
38
|
+
* Commitment shares for the message (used for EdDSA)
|
39
|
+
*/
|
40
|
+
commitmentShares: t.array(CommitmentShare),
|
41
|
+
|
42
|
+
/**
|
43
|
+
* Encrypted shares for the message
|
44
|
+
*/
|
45
|
+
encryptedShares: t.array(EncryptedShare),
|
46
|
+
|
47
|
+
/**
|
48
|
+
* Transaction hash
|
49
|
+
*/
|
50
|
+
txHash: t.string,
|
51
|
+
|
52
|
+
/**
|
53
|
+
* Date when the message was last updated
|
54
|
+
*/
|
55
|
+
updatedDate: DateFromISOString,
|
56
|
+
|
57
|
+
/**
|
58
|
+
* Date when the message was created
|
59
|
+
*/
|
60
|
+
createdDate: DateFromISOString,
|
61
|
+
|
62
|
+
/**
|
63
|
+
* The encoded message
|
64
|
+
*/
|
65
|
+
messageEncoded: t.string,
|
66
|
+
|
67
|
+
/**
|
68
|
+
* The broadcastable message
|
69
|
+
*/
|
70
|
+
messageBroadcastable: t.string,
|
71
|
+
|
72
|
+
/**
|
73
|
+
* The encoded message
|
74
|
+
*/
|
75
|
+
messageStandardType: t.string,
|
76
|
+
|
77
|
+
/**
|
78
|
+
* Derivation path for the message
|
79
|
+
*/
|
80
|
+
derivationPath: t.string,
|
81
|
+
|
82
|
+
/**
|
83
|
+
* Combined signature share
|
84
|
+
*/
|
85
|
+
combineSigShare: t.string,
|
86
|
+
|
87
|
+
/**
|
88
|
+
* Coin type for the message
|
89
|
+
*/
|
90
|
+
coin: t.string,
|
91
|
+
|
92
|
+
/**
|
93
|
+
* BitGo's Paillier challenge for ECDSA
|
94
|
+
*/
|
95
|
+
bitgoPaillierChallenge: t.unknown,
|
96
|
+
|
97
|
+
/**
|
98
|
+
* BitGo's encrypted challenge for ECDSA with Range Proofs
|
99
|
+
*/
|
100
|
+
encryptedChallenge: t.string,
|
101
|
+
}),
|
102
|
+
]);
|
103
|
+
|
104
|
+
export type Message = t.TypeOf<typeof Message>;
|
@@ -0,0 +1,29 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
import { SignatureShareType } from "./signatureShareType";
|
3
|
+
|
4
|
+
export const SignatureShareWithoutVssProof = t.type({
|
5
|
+
/** The source of the signature share. */
|
6
|
+
from: SignatureShareType,
|
7
|
+
/** The recipient of the signature share. */
|
8
|
+
to: SignatureShareType,
|
9
|
+
/** The signature share */
|
10
|
+
share: t.string,
|
11
|
+
});
|
12
|
+
|
13
|
+
export type SignatureShareWithoutVssProof = t.TypeOf<
|
14
|
+
typeof SignatureShareWithoutVssProof
|
15
|
+
>;
|
16
|
+
|
17
|
+
export const SignatureShare = t.intersection([
|
18
|
+
SignatureShareWithoutVssProof,
|
19
|
+
t.partial({
|
20
|
+
/** The VSS proof of the signature share */
|
21
|
+
vssProof: t.string,
|
22
|
+
/** The private share proof */
|
23
|
+
privateShareProof: t.string,
|
24
|
+
/** The public share */
|
25
|
+
publicShare: t.string,
|
26
|
+
}),
|
27
|
+
]);
|
28
|
+
|
29
|
+
export type SignatureShare = t.TypeOf<typeof SignatureShare>;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
import * as t from "io-ts";
|
2
|
+
import { DateFromISOString } from "io-ts-types";
|
3
|
+
import { TransactionState } from "./transactionState";
|
4
|
+
import { UnsignedTransaction } from "./unsignedTransaction";
|
5
|
+
import { SignatureShare } from "./signatureShare";
|
6
|
+
import { CommitmentShare } from "./commitmentShare";
|
7
|
+
|
8
|
+
export const Transaction = t.intersection([
|
9
|
+
// Required fields
|
10
|
+
t.type({
|
11
|
+
state: TransactionState,
|
12
|
+
unsignedTx: UnsignedTransaction,
|
13
|
+
}),
|
14
|
+
// Optional fields
|
15
|
+
t.partial({
|
16
|
+
signatureShares: t.array(SignatureShare),
|
17
|
+
commitmentShares: t.array(CommitmentShare),
|
18
|
+
txHash: t.string,
|
19
|
+
updatedDate: DateFromISOString,
|
20
|
+
createdDate: DateFromISOString,
|
21
|
+
}),
|
22
|
+
]);
|
23
|
+
|
24
|
+
export type Transaction = t.TypeOf<typeof Transaction>;
|