@bitgo/public-types 6.24.0 → 6.26.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.
@@ -81,8 +81,8 @@ export declare const CantonCommandIntent: t.IntersectionC<[t.IntersectionC<[t.Ty
81
81
  ExerciseCommand: t.IntersectionC<[t.TypeC<{
82
82
  templateId: t.StringC;
83
83
  choice: t.StringC;
84
- choiceArgument: t.RecordC<t.StringC, t.UnknownC>;
85
84
  }>, t.PartialC<{
85
+ choiceArgument: t.RecordC<t.StringC, t.UnknownC>;
86
86
  contractId: t.StringC;
87
87
  }>]>;
88
88
  }>]>;
@@ -98,5 +98,7 @@ export declare const CantonCommandIntent: t.IntersectionC<[t.IntersectionC<[t.Ty
98
98
  resolveAll: t.BooleanC;
99
99
  }>]>>;
100
100
  }>]>;
101
+ }>, t.PartialC<{
102
+ token: t.StringC;
101
103
  }>]>;
102
104
  export type CantonCommandIntent = t.TypeOf<typeof CantonCommandIntent>;
@@ -38,9 +38,9 @@ const ExerciseCommand = t.type({
38
38
  t.type({
39
39
  templateId: t.string,
40
40
  choice: t.string,
41
- choiceArgument: t.record(t.string, t.unknown),
42
41
  }),
43
42
  t.partial({
43
+ choiceArgument: t.record(t.string, t.unknown),
44
44
  contractId: t.string,
45
45
  }),
46
46
  ]),
@@ -73,5 +73,8 @@ exports.CantonCommandIntent = t.intersection([
73
73
  intentType: intentType_1.intentTypes.cantonCommand,
74
74
  cantonCommandParams: CantonCommandParams,
75
75
  }),
76
+ t.partial({
77
+ token: t.string,
78
+ }),
76
79
  ]);
77
80
  //# sourceMappingURL=cantonCommandIntent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"cantonCommandIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/cantonCommandIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,6CAA2C;AAqB3C,MAAM,aAAa,GA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CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;KACzB,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QACR,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;QACzB,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,mBAAmB,CAAC;KAC/C,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,mBAAmB,GAAG,CAAC,CAAC,YAAY,CAAC;IAChD,uBAAU;IACV,CAAC,CAAC,IAAI,CAAC;QACL,UAAU,EAAE,wBAAW,CAAC,aAAa;QACrC,mBAAmB,EAAE,mBAAmB;KACzC,CAAC;CACH,CAAC,CAAC"}
1
+ {"version":3,"file":"cantonCommandIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/cantonCommandIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,6CAA2C;AAqB3C,MAAM,aAAa,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3B,aAAa,EAAE,CAAC,CAAC,IAAI,CAAC;QACpB,UAAU,EAAE,CAAC,CAAC,MAAM;QACpB,eAAe,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;KAC/C,CAAC;CACH,CAAC,CAAC;AAEH,MAAM,eAAe,GAAG,CAAC,CAAC,IAAI,CAAC;IAC7B,eAAe,EAAE,CAAC,CAAC,YAAY,CAAC;QAC9B,CAAC,CAAC,IAAI,CAAC;YACL,UAAU,EAAE,CAAC,CAAC,MAAM;YACpB,MAAM,EAAE,CAAC,CAAC,MAAM;SACjB,CAAC;QACF,CAAC,CAAC,OAAO,CAAC;YAER,cAAc,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC;YAE7C,UAAU,EAAE,CAAC,CAAC,MAAM;SACrB,CAAC;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>;
82
82
  }>]>, t.PartialC<{
83
83
  stakedNodeId: t.UnionC<[t.Type<number, number, unknown>, t.UndefinedC]>;
84
+ stakedAccountId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
84
85
  declineStakingReward: t.UnionC<[t.Type<boolean, boolean, unknown>, t.UndefinedC]>;
85
86
  }>]>;
86
87
  export type HbarUpdateAccountIntent = t.TypeOf<typeof HbarUpdateAccountIntent>;
@@ -31,6 +31,7 @@ exports.HbarUpdateAccountIntent = t.intersection([
31
31
  accountBaseUpdateAccountIntent_1.AccountBaseUpdateAccountIntent,
32
32
  t.partial({
33
33
  stakedNodeId: utils_1.optionalNumber,
34
+ stakedAccountId: utils_1.optionalString,
34
35
  declineStakingReward: utils_1.optionalBoolean,
35
36
  }),
36
37
  ]);
@@ -1 +1 @@
1
- {"version":3,"file":"hbarUpdateAccountIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/hbarUpdateAccountIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,qFAAkF;AAClF,0CAAiE;AASpD,QAAA,uBAAuB,GAAG,CAAC,CAAC,YAAY,CAAC;IACpD,+DAA8B;IAC9B,CAAC,CAAC,OAAO,CAAC;QACR,YAAY,EAAE,sBAAc;QAC5B,oBAAoB,EAAE,uBAAe;KACtC,CAAC;CACH,CAAC,CAAC"}
1
+ {"version":3,"file":"hbarUpdateAccountIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/hbarUpdateAccountIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,qFAAkF;AAClF,0CAIwB;AAeX,QAAA,uBAAuB,GAAG,CAAC,CAAC,YAAY,CAAC;IACpD,+DAA8B;IAC9B,CAAC,CAAC,OAAO,CAAC;QACR,YAAY,EAAE,sBAAc;QAC5B,eAAe,EAAE,sBAAc;QAC/B,oBAAoB,EAAE,uBAAe;KACtC,CAAC;CACH,CAAC,CAAC"}
@@ -1694,8 +1694,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
1694
1694
  ExerciseCommand: t.IntersectionC<[t.TypeC<{
1695
1695
  templateId: t.StringC;
1696
1696
  choice: t.StringC;
1697
- choiceArgument: t.RecordC<t.StringC, t.UnknownC>;
1698
1697
  }>, t.PartialC<{
1698
+ choiceArgument: t.RecordC<t.StringC, t.UnknownC>;
1699
1699
  contractId: t.StringC;
1700
1700
  }>]>;
1701
1701
  }>]>;
@@ -1711,6 +1711,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
1711
1711
  resolveAll: t.BooleanC;
1712
1712
  }>]>>;
1713
1713
  }>]>;
1714
+ }>, t.PartialC<{
1715
+ token: t.StringC;
1714
1716
  }>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
1715
1717
  intentType: t.KeyofC<{
1716
1718
  payment: t.LiteralC<"payment">;
@@ -4785,6 +4787,7 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
4785
4787
  }, unknown>, t.UndefinedC]>;
4786
4788
  }>]>, t.PartialC<{
4787
4789
  stakedNodeId: t.UnionC<[t.Type<number, number, unknown>, t.UndefinedC]>;
4790
+ stakedAccountId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
4788
4791
  declineStakingReward: t.UnionC<[t.Type<boolean, boolean, unknown>, t.UndefinedC]>;
4789
4792
  }>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
4790
4793
  intentType: t.KeyofC<{
@@ -1792,8 +1792,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
1792
1792
  ExerciseCommand: t.IntersectionC<[t.TypeC<{
1793
1793
  templateId: t.StringC;
1794
1794
  choice: t.StringC;
1795
- choiceArgument: t.RecordC<t.StringC, t.UnknownC>;
1796
1795
  }>, t.PartialC<{
1796
+ choiceArgument: t.RecordC<t.StringC, t.UnknownC>;
1797
1797
  contractId: t.StringC;
1798
1798
  }>]>;
1799
1799
  }>]>;
@@ -1809,6 +1809,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
1809
1809
  resolveAll: t.BooleanC;
1810
1810
  }>]>>;
1811
1811
  }>]>;
1812
+ }>, t.PartialC<{
1813
+ token: t.StringC;
1812
1814
  }>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
1813
1815
  intentType: t.KeyofC<{
1814
1816
  payment: t.LiteralC<"payment">;
@@ -4883,6 +4885,7 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
4883
4885
  }, unknown>, t.UndefinedC]>;
4884
4886
  }>]>, t.PartialC<{
4885
4887
  stakedNodeId: t.UnionC<[t.Type<number, number, unknown>, t.UndefinedC]>;
4888
+ stakedAccountId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
4886
4889
  declineStakingReward: t.UnionC<[t.Type<boolean, boolean, unknown>, t.UndefinedC]>;
4887
4890
  }>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
4888
4891
  intentType: t.KeyofC<{
@@ -15054,8 +15057,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
15054
15057
  ExerciseCommand: t.IntersectionC<[t.TypeC<{
15055
15058
  templateId: t.StringC;
15056
15059
  choice: t.StringC;
15057
- choiceArgument: t.RecordC<t.StringC, t.UnknownC>;
15058
15060
  }>, t.PartialC<{
15061
+ choiceArgument: t.RecordC<t.StringC, t.UnknownC>;
15059
15062
  contractId: t.StringC;
15060
15063
  }>]>;
15061
15064
  }>]>;
@@ -15071,6 +15074,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
15071
15074
  resolveAll: t.BooleanC;
15072
15075
  }>]>>;
15073
15076
  }>]>;
15077
+ }>, t.PartialC<{
15078
+ token: t.StringC;
15074
15079
  }>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
15075
15080
  intentType: t.KeyofC<{
15076
15081
  payment: t.LiteralC<"payment">;
@@ -18145,6 +18150,7 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
18145
18150
  }, unknown>, t.UndefinedC]>;
18146
18151
  }>]>, t.PartialC<{
18147
18152
  stakedNodeId: t.UnionC<[t.Type<number, number, unknown>, t.UndefinedC]>;
18153
+ stakedAccountId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
18148
18154
  declineStakingReward: t.UnionC<[t.Type<boolean, boolean, unknown>, t.UndefinedC]>;
18149
18155
  }>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
18150
18156
  intentType: t.KeyofC<{
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitgo/public-types",
3
- "version": "6.24.0",
3
+ "version": "6.26.0",
4
4
  "description": "Collection of types exposed externally as part of the BitGo public API",
5
5
  "license": "UNLICENSED",
6
6
  "author": "",
@@ -33,9 +33,10 @@ const ExerciseCommand = t.type({
33
33
  t.type({
34
34
  templateId: t.string,
35
35
  choice: t.string,
36
- choiceArgument: t.record(t.string, t.unknown),
37
36
  }),
38
37
  t.partial({
38
+ // optional: no-arg choices omit it
39
+ choiceArgument: t.record(t.string, t.unknown),
39
40
  // omit when contractId will be injected via resolveContracts at build time
40
41
  contractId: t.string,
41
42
  }),
@@ -75,6 +76,13 @@ export const CantonCommandIntent = t.intersection([
75
76
  intentType: intentTypes.cantonCommand,
76
77
  cantonCommandParams: CantonCommandParams,
77
78
  }),
79
+ t.partial({
80
+ /**
81
+ * Optional registered coin/token identifier for the command target (e.g. "tcanton:stgusd1").
82
+ * This is not an auth/session token.
83
+ */
84
+ token: t.string,
85
+ }),
78
86
  ]);
79
87
 
80
88
  export type CantonCommandIntent = t.TypeOf<typeof CantonCommandIntent>;
@@ -1,18 +1,29 @@
1
1
  import * as t from "io-ts";
2
2
  import { AccountBaseUpdateAccountIntent } from "./accountBaseUpdateAccountIntent";
3
- import { optionalNumber, optionalBoolean } from "../../../utils";
3
+ import {
4
+ optionalNumber,
5
+ optionalBoolean,
6
+ optionalString,
7
+ } from "../../../utils";
4
8
 
5
9
  /**
6
10
  * @title HBAR Update Account Intent
7
11
  *
8
12
  * Extends the base updateAccount intent with Hedera-specific staking fields.
9
- * Used for stake (stakedNodeId >= 0), unstake (stakedNodeId = -1), and
10
- * switch validator (stakedNodeId = new node) operations.
13
+ *
14
+ * Supports two mutually exclusive staking modes:
15
+ * - **Node staking (direct):** Set `stakedNodeId` to a consensus node ID
16
+ * (>= 0 to stake, -1 to unstake).
17
+ * - **Account staking (indirect):** Set `stakedAccountId` to a Hedera account
18
+ * in "0.0.X" format ("0.0.0" to unstake).
19
+ *
20
+ * Only one of `stakedNodeId` or `stakedAccountId` should be provided per request.
11
21
  */
12
22
  export const HbarUpdateAccountIntent = t.intersection([
13
23
  AccountBaseUpdateAccountIntent,
14
24
  t.partial({
15
25
  stakedNodeId: optionalNumber,
26
+ stakedAccountId: optionalString,
16
27
  declineStakingReward: optionalBoolean,
17
28
  }),
18
29
  ]);