@bitgo/public-types 3.4.0 → 3.6.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/transactionRequest/intents/intent.d.ts +9 -1
- package/dist/src/schema/transactionRequest/intents/tonDelegateIntent.d.ts +3 -0
- package/dist/src/schema/transactionRequest/intents/tonDelegateIntent.js +5 -0
- package/dist/src/schema/transactionRequest/intents/tonDelegateIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/tonUndelegateIntent.d.ts +6 -1
- package/dist/src/schema/transactionRequest/intents/tonUndelegateIntent.js +4 -1
- package/dist/src/schema/transactionRequest/intents/tonUndelegateIntent.js.map +1 -1
- package/package.json +1 -1
- package/src/schema/transactionRequest/intents/tonDelegateIntent.ts +13 -0
- package/src/schema/transactionRequest/intents/tonUndelegateIntent.ts +10 -1
@@ -3133,6 +3133,9 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
|
|
3133
3133
|
value: t.StringC;
|
3134
3134
|
symbol: t.StringC;
|
3135
3135
|
}>;
|
3136
|
+
useSingleNominator: t.BooleanC;
|
3137
|
+
}>, t.PartialC<{
|
3138
|
+
ownerAddress: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
3136
3139
|
}>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
3137
3140
|
intentType: t.KeyofC<{
|
3138
3141
|
payment: t.LiteralC<"payment">;
|
@@ -3226,8 +3229,13 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
|
|
3226
3229
|
comment: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
3227
3230
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
3228
3231
|
}>]>, t.TypeC<{
|
3229
|
-
intentType: t.LiteralC<"
|
3232
|
+
intentType: t.LiteralC<"undelegate">;
|
3230
3233
|
validatorAddress: t.StringC;
|
3234
|
+
useSingleNominator: t.BooleanC;
|
3235
|
+
singleNominatorAmount: t.TypeC<{
|
3236
|
+
value: t.StringC;
|
3237
|
+
symbol: t.StringC;
|
3238
|
+
}>;
|
3231
3239
|
}>]>, t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
3232
3240
|
intentType: t.KeyofC<{
|
3233
3241
|
payment: t.LiteralC<"payment">;
|
@@ -42,5 +42,8 @@ export declare const TonDelegateIntent: t.IntersectionC<[t.IntersectionC<[t.Type
|
|
42
42
|
value: t.StringC;
|
43
43
|
symbol: t.StringC;
|
44
44
|
}>;
|
45
|
+
useSingleNominator: t.BooleanC;
|
46
|
+
}>, t.PartialC<{
|
47
|
+
ownerAddress: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
45
48
|
}>]>;
|
46
49
|
export type TonDelegateIntent = t.TypeOf<typeof TonDelegateIntent>;
|
@@ -28,12 +28,17 @@ const t = __importStar(require("io-ts"));
|
|
28
28
|
const baseIntent_1 = require("./baseIntent");
|
29
29
|
const amount_1 = require("./amount");
|
30
30
|
const intentType_1 = require("./intentType");
|
31
|
+
const utils_1 = require("../../../utils");
|
31
32
|
exports.TonDelegateIntent = t.intersection([
|
32
33
|
baseIntent_1.BaseIntent,
|
33
34
|
t.type({
|
34
35
|
intentType: intentType_1.intentTypes.delegate,
|
35
36
|
validatorAddress: t.string,
|
36
37
|
amount: amount_1.Amount,
|
38
|
+
useSingleNominator: t.boolean,
|
39
|
+
}),
|
40
|
+
t.partial({
|
41
|
+
ownerAddress: utils_1.optionalString,
|
37
42
|
}),
|
38
43
|
]);
|
39
44
|
//# sourceMappingURL=tonDelegateIntent.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tonDelegateIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/tonDelegateIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,qCAAkC;AAClC,6CAA2C;
|
1
|
+
{"version":3,"file":"tonDelegateIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/tonDelegateIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,qCAAkC;AAClC,6CAA2C;AAC3C,0CAAgD;AAanC,QAAA,iBAAiB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC9C,uBAAU;IACV,CAAC,CAAC,IAAI,CAAC;QACL,UAAU,EAAE,wBAAW,CAAC,QAAQ;QAChC,gBAAgB,EAAE,CAAC,CAAC,MAAM;QAC1B,MAAM,EAAE,eAAM;QACd,kBAAkB,EAAE,CAAC,CAAC,OAAO;KAC9B,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,YAAY,EAAE,sBAAc;KAC7B,CAAC;CACH,CAAC,CAAC"}
|
@@ -36,7 +36,12 @@ export declare const TonUndelegateIntent: t.IntersectionC<[t.IntersectionC<[t.Ty
|
|
36
36
|
comment: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
37
37
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
38
38
|
}>]>, t.TypeC<{
|
39
|
-
intentType: t.LiteralC<"
|
39
|
+
intentType: t.LiteralC<"undelegate">;
|
40
40
|
validatorAddress: t.StringC;
|
41
|
+
useSingleNominator: t.BooleanC;
|
42
|
+
singleNominatorAmount: t.TypeC<{
|
43
|
+
value: t.StringC;
|
44
|
+
symbol: t.StringC;
|
45
|
+
}>;
|
41
46
|
}>]>;
|
42
47
|
export type TonUndelegateIntent = t.TypeOf<typeof TonUndelegateIntent>;
|
@@ -27,11 +27,14 @@ exports.TonUndelegateIntent = void 0;
|
|
27
27
|
const t = __importStar(require("io-ts"));
|
28
28
|
const baseIntent_1 = require("./baseIntent");
|
29
29
|
const intentType_1 = require("./intentType");
|
30
|
+
const amount_1 = require("./amount");
|
30
31
|
exports.TonUndelegateIntent = t.intersection([
|
31
32
|
baseIntent_1.BaseIntent,
|
32
33
|
t.type({
|
33
|
-
intentType: intentType_1.intentTypes.
|
34
|
+
intentType: intentType_1.intentTypes.undelegate,
|
34
35
|
validatorAddress: t.string,
|
36
|
+
useSingleNominator: t.boolean,
|
37
|
+
singleNominatorAmount: amount_1.Amount,
|
35
38
|
}),
|
36
39
|
]);
|
37
40
|
//# sourceMappingURL=tonUndelegateIntent.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"tonUndelegateIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/tonUndelegateIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,6CAA2C;
|
1
|
+
{"version":3,"file":"tonUndelegateIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/tonUndelegateIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,6CAA2C;AAC3C,qCAAkC;AAWrB,QAAA,mBAAmB,GAAG,CAAC,CAAC,YAAY,CAAC;IAChD,uBAAU;IACV,CAAC,CAAC,IAAI,CAAC;QACL,UAAU,EAAE,wBAAW,CAAC,UAAU;QAClC,gBAAgB,EAAE,CAAC,CAAC,MAAM;QAC1B,kBAAkB,EAAE,CAAC,CAAC,OAAO;QAC7B,qBAAqB,EAAE,eAAM;KAC9B,CAAC;CACH,CAAC,CAAC"}
|
package/package.json
CHANGED
@@ -2,9 +2,18 @@ import * as t from "io-ts";
|
|
2
2
|
import { BaseIntent } from "./baseIntent";
|
3
3
|
import { Amount } from "./amount";
|
4
4
|
import { intentTypes } from "./intentType";
|
5
|
+
import { optionalString } from "../../../utils";
|
5
6
|
|
6
7
|
/**
|
7
8
|
* @title TON Delegate Intent
|
9
|
+
*
|
10
|
+
* @description The intent for delegate/stake requests and transactions for TON
|
11
|
+
*
|
12
|
+
* @param {string} intentType The type of intent (always set to delegate)
|
13
|
+
* @param {string} validatorAddress The address of the validator
|
14
|
+
* @param {boolean} useSingleNominator Whether to use a single nominator pool, if false then a multi nominator pool will be used
|
15
|
+
* @param {Amount} singleNominatorAmount The amount to delegate to the single nominator pool
|
16
|
+
* @param {string} ownerAddress The owner wallet address of the single nominator pool, if applicable (optional)
|
8
17
|
*/
|
9
18
|
export const TonDelegateIntent = t.intersection([
|
10
19
|
BaseIntent,
|
@@ -12,6 +21,10 @@ export const TonDelegateIntent = t.intersection([
|
|
12
21
|
intentType: intentTypes.delegate,
|
13
22
|
validatorAddress: t.string,
|
14
23
|
amount: Amount,
|
24
|
+
useSingleNominator: t.boolean,
|
25
|
+
}),
|
26
|
+
t.partial({
|
27
|
+
ownerAddress: optionalString,
|
15
28
|
}),
|
16
29
|
]);
|
17
30
|
|
@@ -1,15 +1,24 @@
|
|
1
1
|
import * as t from "io-ts";
|
2
2
|
import { BaseIntent } from "./baseIntent";
|
3
3
|
import { intentTypes } from "./intentType";
|
4
|
+
import { Amount } from "./amount";
|
4
5
|
|
5
6
|
/**
|
6
7
|
* @title TON Undelegate Intent
|
8
|
+
* @description The intent for undelegate/unstake requests and transactions for TON
|
9
|
+
*
|
10
|
+
* @param {string} intentType The type of intent (always set to undelegate)
|
11
|
+
* @param {string} validatorAddress The address of the validator
|
12
|
+
* @param {boolean} useSingleNominator Whether to use a single nominator pool, if false then a multi nominator pool will be used
|
13
|
+
* @param {Amount} singleNominatorAmount The amount to delegate to the single nominator pool
|
7
14
|
*/
|
8
15
|
export const TonUndelegateIntent = t.intersection([
|
9
16
|
BaseIntent,
|
10
17
|
t.type({
|
11
|
-
intentType: intentTypes.
|
18
|
+
intentType: intentTypes.undelegate,
|
12
19
|
validatorAddress: t.string,
|
20
|
+
useSingleNominator: t.boolean,
|
21
|
+
singleNominatorAmount: Amount,
|
13
22
|
}),
|
14
23
|
]);
|
15
24
|
|