@bitgo/public-types 5.97.0 → 6.1.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.
Files changed (41) hide show
  1. package/dist/src/schema/index.d.ts +1 -0
  2. package/dist/src/schema/index.js +1 -0
  3. package/dist/src/schema/index.js.map +1 -1
  4. package/dist/src/schema/transactionRequest/intents/intent.d.ts +40 -26
  5. package/dist/src/schema/transactionRequest/intents/solAuthorizeIntent.d.ts +2 -2
  6. package/dist/src/schema/transactionRequest/intents/solBuildOptions.d.ts +2 -2
  7. package/dist/src/schema/transactionRequest/intents/solBuildOptions.js +2 -3
  8. package/dist/src/schema/transactionRequest/intents/solBuildOptions.js.map +1 -1
  9. package/dist/src/schema/transactionRequest/intents/solClaimIntent.d.ts +2 -2
  10. package/dist/src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.d.ts +32 -5
  11. package/dist/src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.js +18 -2
  12. package/dist/src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.js.map +1 -1
  13. package/dist/src/schema/transactionRequest/intents/solCreateAssociatedTokenAccountIntent.d.ts +2 -2
  14. package/dist/src/schema/transactionRequest/intents/solCustomTxIntent.d.ts +2 -2
  15. package/dist/src/schema/transactionRequest/intents/solDeactivateIntent.d.ts +2 -2
  16. package/dist/src/schema/transactionRequest/intents/solDelegateIntent.d.ts +2 -2
  17. package/dist/src/schema/transactionRequest/intents/solGoUnstakeIntent.d.ts +2 -2
  18. package/dist/src/schema/transactionRequest/intents/solPaymentIntent.d.ts +2 -2
  19. package/dist/src/schema/transactionRequest/intents/solStakeIntent.d.ts +4 -4
  20. package/dist/src/schema/transactionRequest/intents/solUnstakeIntent.d.ts +4 -4
  21. package/dist/src/schema/transactionRequest/intents/solVersionedCustomTxIntent.d.ts +2 -2
  22. package/dist/src/schema/transactionRequest/transactionRequest.d.ts +80 -52
  23. package/dist/src/schema/webauthn/index.d.ts +2 -0
  24. package/dist/src/schema/webauthn/index.js +19 -0
  25. package/dist/src/schema/webauthn/index.js.map +1 -0
  26. package/dist/src/schema/webauthn/webAuthnOtpDevice.d.ts +7 -0
  27. package/dist/src/schema/webauthn/webAuthnOtpDevice.js +3 -0
  28. package/dist/src/schema/webauthn/webAuthnOtpDevice.js.map +1 -0
  29. package/dist/src/schema/webauthn/webauthnDevice.d.ts +18 -0
  30. package/dist/src/schema/webauthn/webauthnDevice.js +39 -0
  31. package/dist/src/schema/webauthn/webauthnDevice.js.map +1 -0
  32. package/dist/src/utils/getAssetsFromIntent.js +13 -4
  33. package/dist/src/utils/getAssetsFromIntent.js.map +1 -1
  34. package/package.json +1 -1
  35. package/src/schema/index.ts +1 -0
  36. package/src/schema/transactionRequest/intents/solBuildOptions.ts +20 -3
  37. package/src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.ts +94 -5
  38. package/src/schema/webauthn/index.ts +2 -0
  39. package/src/schema/webauthn/webAuthnOtpDevice.ts +8 -0
  40. package/src/schema/webauthn/webauthnDevice.ts +21 -0
  41. package/src/utils/getAssetsFromIntent.ts +21 -4
@@ -7,3 +7,4 @@ export * from "./wallet";
7
7
  export * from "./tss";
8
8
  export * from "./lightning";
9
9
  export * from "./enterprise";
10
+ export * from "./webauthn";
@@ -23,4 +23,5 @@ __exportStar(require("./wallet"), exports);
23
23
  __exportStar(require("./tss"), exports);
24
24
  __exportStar(require("./lightning"), exports);
25
25
  __exportStar(require("./enterprise"), exports);
26
+ __exportStar(require("./webauthn"), exports);
26
27
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,wCAAsB;AACtB,8CAA4B;AAC5B,+CAA6B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/schema/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,uDAAqC;AACrC,4CAA0B;AAC1B,0CAAwB;AACxB,2CAAyB;AACzB,2CAAyB;AACzB,wCAAsB;AACtB,8CAA4B;AAC5B,+CAA6B;AAC7B,6CAA2B"}
@@ -5058,8 +5058,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5058
5058
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5059
5059
  }>]>, t.IntersectionC<[t.PartialC<{
5060
5060
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5061
- }>, t.TypeC<{
5062
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5061
+ }>, t.PartialC<{
5062
+ memo: t.StringC;
5063
5063
  }>]>, t.TypeC<{
5064
5064
  intentType: t.LiteralC<"authorize">;
5065
5065
  transactionMessage: t.StringC;
@@ -5145,8 +5145,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5145
5145
  }, unknown>, t.UndefinedC]>;
5146
5146
  }>]>, t.IntersectionC<[t.PartialC<{
5147
5147
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5148
- }>, t.TypeC<{
5149
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5148
+ }>, t.PartialC<{
5149
+ memo: t.StringC;
5150
5150
  }>]>, t.TypeC<{
5151
5151
  amount: t.TypeC<{
5152
5152
  value: t.StringC;
@@ -5215,12 +5215,26 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5215
5215
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5216
5216
  }>]>, t.IntersectionC<[t.PartialC<{
5217
5217
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5218
- }>, t.TypeC<{
5219
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5218
+ }>, t.PartialC<{
5219
+ memo: t.StringC;
5220
5220
  }>]>, t.TypeC<{
5221
5221
  intentType: t.LiteralC<"closeAssociatedTokenAccount">;
5222
- accountAddress: t.StringC;
5223
- destinationAddress: t.StringC;
5222
+ recipients: t.RefinementC<t.ArrayC<t.RefinementC<t.IntersectionC<[t.TypeC<{
5223
+ address: t.PartialC<{
5224
+ address: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5225
+ option: t.UnionC<[t.Type<{
5226
+ [x: string]: unknown;
5227
+ }, {
5228
+ [x: string]: unknown;
5229
+ }, unknown>, t.UndefinedC]>;
5230
+ }>;
5231
+ amount: t.TypeC<{
5232
+ value: t.StringC;
5233
+ symbol: t.StringC;
5234
+ }>;
5235
+ }>, t.PartialC<{
5236
+ data: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5237
+ }>]>>>>;
5224
5238
  }>]>, t.IntersectionC<[t.PartialC<{
5225
5239
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5226
5240
  }>, t.TypeC<{
@@ -5349,8 +5363,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5349
5363
  }>]>>;
5350
5364
  }>]>, t.IntersectionC<[t.PartialC<{
5351
5365
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5352
- }>, t.TypeC<{
5353
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5366
+ }>, t.PartialC<{
5367
+ memo: t.StringC;
5354
5368
  }>]>]>, t.IntersectionC<[t.IntersectionC<[t.TypeC<{
5355
5369
  intentType: t.KeyofC<{
5356
5370
  payment: t.LiteralC<"payment">;
@@ -5412,8 +5426,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5412
5426
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5413
5427
  }>]>, t.IntersectionC<[t.PartialC<{
5414
5428
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5415
- }>, t.TypeC<{
5416
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5429
+ }>, t.PartialC<{
5430
+ memo: t.StringC;
5417
5431
  }>]>, t.TypeC<{
5418
5432
  intentType: t.LiteralC<"customTx">;
5419
5433
  solInstructions: t.ArrayC<t.TypeC<{
@@ -5486,8 +5500,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5486
5500
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5487
5501
  }>]>, t.IntersectionC<[t.PartialC<{
5488
5502
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5489
- }>, t.TypeC<{
5490
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5503
+ }>, t.PartialC<{
5504
+ memo: t.StringC;
5491
5505
  }>]>, t.TypeC<{
5492
5506
  intentType: t.LiteralC<"deactivate">;
5493
5507
  stakingAddresses: t.UnionC<[t.Type<string[], string[], unknown>, t.UndefinedC]>;
@@ -5553,8 +5567,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5553
5567
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5554
5568
  }>]>, t.IntersectionC<[t.PartialC<{
5555
5569
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5556
- }>, t.TypeC<{
5557
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5570
+ }>, t.PartialC<{
5571
+ memo: t.StringC;
5558
5572
  }>]>, t.TypeC<{
5559
5573
  intentType: t.LiteralC<"delegate">;
5560
5574
  validatorAddress: t.StringC;
@@ -5641,8 +5655,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5641
5655
  }>]>>;
5642
5656
  }>]>, t.IntersectionC<[t.PartialC<{
5643
5657
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5644
- }>, t.TypeC<{
5645
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5658
+ }>, t.PartialC<{
5659
+ memo: t.StringC;
5646
5660
  }>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
5647
5661
  intentType: t.KeyofC<{
5648
5662
  payment: t.LiteralC<"payment">;
@@ -5726,8 +5740,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5726
5740
  isTestTransaction: t.BooleanC;
5727
5741
  }>]>]>, t.IntersectionC<[t.PartialC<{
5728
5742
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5729
- }>, t.TypeC<{
5730
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5743
+ }>, t.PartialC<{
5744
+ memo: t.StringC;
5731
5745
  }>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
5732
5746
  intentType: t.KeyofC<{
5733
5747
  payment: t.LiteralC<"payment">;
@@ -5795,8 +5809,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5795
5809
  intentType: t.LiteralC<"stake">;
5796
5810
  }>]>, t.IntersectionC<[t.PartialC<{
5797
5811
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5798
- }>, t.TypeC<{
5799
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5812
+ }>, t.PartialC<{
5813
+ memo: t.StringC;
5800
5814
  }>]>, t.TypeC<{
5801
5815
  amount: t.TypeC<{
5802
5816
  value: t.StringC;
@@ -5873,8 +5887,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5873
5887
  intentType: t.LiteralC<"unstake">;
5874
5888
  }>]>, t.IntersectionC<[t.PartialC<{
5875
5889
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5876
- }>, t.TypeC<{
5877
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5890
+ }>, t.PartialC<{
5891
+ memo: t.StringC;
5878
5892
  }>]>, t.TypeC<{
5879
5893
  stakingAddress: t.StringC;
5880
5894
  }>, t.PartialC<{
@@ -5982,8 +5996,8 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
5982
5996
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5983
5997
  }>]>, t.IntersectionC<[t.PartialC<{
5984
5998
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5985
- }>, t.TypeC<{
5986
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5999
+ }>, t.PartialC<{
6000
+ memo: t.StringC;
5987
6001
  }>]>, t.TypeC<{
5988
6002
  intentType: t.LiteralC<"customTx">;
5989
6003
  solVersionedTransactionData: t.IntersectionC<[t.TypeC<{
@@ -60,8 +60,8 @@ export declare const SolAuthorizeIntent: t.IntersectionC<[t.IntersectionC<[t.Typ
60
60
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
61
61
  }>]>, t.IntersectionC<[t.PartialC<{
62
62
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
63
- }>, t.TypeC<{
64
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
63
+ }>, t.PartialC<{
64
+ memo: t.StringC;
65
65
  }>]>, t.TypeC<{
66
66
  intentType: t.LiteralC<"authorize">;
67
67
  transactionMessage: t.StringC;
@@ -1,7 +1,7 @@
1
1
  import * as t from "io-ts";
2
2
  export declare const SolBuildOptions: t.IntersectionC<[t.PartialC<{
3
3
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
4
- }>, t.TypeC<{
5
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
4
+ }>, t.PartialC<{
5
+ memo: t.StringC;
6
6
  }>]>;
7
7
  export type SolBuildOptions = t.TypeOf<typeof SolBuildOptions>;
@@ -25,12 +25,11 @@ var __importStar = (this && this.__importStar) || function (mod) {
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
26
  exports.SolBuildOptions = void 0;
27
27
  const t = __importStar(require("io-ts"));
28
- const utils_1 = require("../../../utils");
29
28
  const accountBaseBuildOptions_1 = require("./accountBaseBuildOptions");
30
29
  exports.SolBuildOptions = t.intersection([
31
30
  accountBaseBuildOptions_1.AccountBaseBuildOptions,
32
- t.type({
33
- memo: utils_1.optionalString,
31
+ t.partial({
32
+ memo: t.string,
34
33
  }),
35
34
  ]);
36
35
  //# sourceMappingURL=solBuildOptions.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"solBuildOptions.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/solBuildOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,0CAAgD;AAChD,uEAAoE;AAEvD,QAAA,eAAe,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5C,iDAAuB;IACvB,CAAC,CAAC,IAAI,CAAC;QACL,IAAI,EAAE,sBAAc;KACrB,CAAC;CACH,CAAC,CAAC"}
1
+ {"version":3,"file":"solBuildOptions.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/solBuildOptions.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,uEAAoE;AAoBvD,QAAA,eAAe,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5C,iDAAuB;IACvB,CAAC,CAAC,OAAO,CAAC;QACR,IAAI,EAAE,CAAC,CAAC,MAAM;KACf,CAAC;CACH,CAAC,CAAC"}
@@ -74,8 +74,8 @@ export declare const SolClaimIntent: t.IntersectionC<[t.IntersectionC<[t.Interse
74
74
  }, unknown>, t.UndefinedC]>;
75
75
  }>]>, t.IntersectionC<[t.PartialC<{
76
76
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
77
- }>, t.TypeC<{
78
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
77
+ }>, t.PartialC<{
78
+ memo: t.StringC;
79
79
  }>]>, t.TypeC<{
80
80
  amount: t.TypeC<{
81
81
  value: t.StringC;
@@ -1,4 +1,15 @@
1
1
  import * as t from "io-ts";
2
+ import type { Address } from "./address";
3
+ export type SolCloseAssociatedTokenAccountRecipient = {
4
+ address: Address & {
5
+ address: string;
6
+ };
7
+ amount: {
8
+ value: "0";
9
+ symbol: string;
10
+ };
11
+ data?: string | undefined;
12
+ };
2
13
  export declare const SolCloseAssociatedTokenAccountIntent: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
3
14
  intentType: t.KeyofC<{
4
15
  payment: t.LiteralC<"payment">;
@@ -60,11 +71,27 @@ export declare const SolCloseAssociatedTokenAccountIntent: t.IntersectionC<[t.In
60
71
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
61
72
  }>]>, t.IntersectionC<[t.PartialC<{
62
73
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
63
- }>, t.TypeC<{
64
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
74
+ }>, t.PartialC<{
75
+ memo: t.StringC;
65
76
  }>]>, t.TypeC<{
66
77
  intentType: t.LiteralC<"closeAssociatedTokenAccount">;
67
- accountAddress: t.StringC;
68
- destinationAddress: t.StringC;
78
+ recipients: t.RefinementC<t.ArrayC<t.RefinementC<t.IntersectionC<[t.TypeC<{
79
+ address: t.PartialC<{
80
+ address: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
81
+ option: t.UnionC<[t.Type<{
82
+ [x: string]: unknown;
83
+ }, {
84
+ [x: string]: unknown;
85
+ }, unknown>, t.UndefinedC]>;
86
+ }>;
87
+ amount: t.TypeC<{
88
+ value: t.StringC;
89
+ symbol: t.StringC;
90
+ }>;
91
+ }>, t.PartialC<{
92
+ data: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
93
+ }>]>>>>;
69
94
  }>]>;
70
- export type SolCloseAssociatedTokenAccountIntent = t.TypeOf<typeof SolCloseAssociatedTokenAccountIntent>;
95
+ export type SolCloseAssociatedTokenAccountIntent = Omit<t.TypeOf<typeof SolCloseAssociatedTokenAccountIntent>, "recipients"> & {
96
+ recipients: SolCloseAssociatedTokenAccountRecipient[];
97
+ };
@@ -27,14 +27,30 @@ exports.SolCloseAssociatedTokenAccountIntent = 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 recipientEntry_1 = require("./recipientEntry");
30
31
  const solBuildOptions_1 = require("./solBuildOptions");
32
+ function isSolCloseAssociatedTokenAccountRecipient(recipient) {
33
+ if (recipient.amount.value !== "0") {
34
+ return false;
35
+ }
36
+ const recipientRecord = recipient;
37
+ if ("tokenName" in recipientRecord || "tokenData" in recipientRecord) {
38
+ return false;
39
+ }
40
+ const addressFields = recipient.address;
41
+ if (typeof addressFields?.address !== "string") {
42
+ return false;
43
+ }
44
+ return true;
45
+ }
46
+ const solCloseAssociatedTokenAccountRecipientEntry = t.refinement(recipientEntry_1.RecipientEntry, isSolCloseAssociatedTokenAccountRecipient, "SolCloseAssociatedTokenAccountRecipientEntry");
47
+ const solCloseAssociatedTokenAccountRecipients = t.refinement(t.array(solCloseAssociatedTokenAccountRecipientEntry), (recipients) => recipients.length > 0, "SolCloseAssociatedTokenAccountRecipients");
31
48
  exports.SolCloseAssociatedTokenAccountIntent = t.intersection([
32
49
  baseIntent_1.BaseIntent,
33
50
  solBuildOptions_1.SolBuildOptions,
34
51
  t.type({
35
52
  intentType: intentType_1.intentTypes.closeAssociatedTokenAccount,
36
- accountAddress: t.string,
37
- destinationAddress: t.string,
53
+ recipients: solCloseAssociatedTokenAccountRecipients,
38
54
  }),
39
55
  ]);
40
56
  //# sourceMappingURL=solCloseAssociatedTokenAccountIntent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"solCloseAssociatedTokenAccountIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,6CAA2C;AAC3C,uDAAoD;AAKvC,QAAA,oCAAoC,GAAG,CAAC,CAAC,YAAY,CAAC;IACjE,uBAAU;IACV,iCAAe;IACf,CAAC,CAAC,IAAI,CAAC;QACL,UAAU,EAAE,wBAAW,CAAC,2BAA2B;QACnD,cAAc,EAAE,CAAC,CAAC,MAAM;QACxB,kBAAkB,EAAE,CAAC,CAAC,MAAM;KAC7B,CAAC;CACH,CAAC,CAAC"}
1
+ {"version":3,"file":"solCloseAssociatedTokenAccountIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAE3B,6CAA0C;AAC1C,6CAA2C;AAC3C,qDAAkD;AAClD,uDAAoD;AAoCpD,SAAS,yCAAyC,CAChD,SAAyB;IAEzB,IAAI,SAAS,CAAC,MAAM,CAAC,KAAK,KAAK,GAAG,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,eAAe,GAAG,SAAoC,CAAC;IAG7D,IAAI,WAAW,IAAI,eAAe,IAAI,WAAW,IAAI,eAAe,EAAE,CAAC;QACrE,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,aAAa,GAAG,SAAS,CAAC,OAAgC,CAAC;IACjE,IAAI,OAAO,aAAa,EAAE,OAAO,KAAK,QAAQ,EAAE,CAAC;QAC/C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC;AAWD,MAAM,4CAA4C,GAAG,CAAC,CAAC,UAAU,CAC/D,+BAAc,EACd,yCAAyC,EACzC,8CAA8C,CAC/C,CAAC;AAEF,MAAM,wCAAwC,GAAG,CAAC,CAAC,UAAU,CAC3D,CAAC,CAAC,KAAK,CAAC,4CAA4C,CAAC,EACrD,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,MAAM,GAAG,CAAC,EACrC,0CAA0C,CAC3C,CAAC;AAWW,QAAA,oCAAoC,GAAG,CAAC,CAAC,YAAY,CAAC;IACjE,uBAAU;IACV,iCAAe;IACf,CAAC,CAAC,IAAI,CAAC;QACL,UAAU,EAAE,wBAAW,CAAC,2BAA2B;QACnD,UAAU,EAAE,wCAAwC;KACrD,CAAC;CACH,CAAC,CAAC"}
@@ -67,7 +67,7 @@ export declare const SolCreateAssociatedTokenAccountIntent: t.IntersectionC<[t.I
67
67
  }>]>>;
68
68
  }>]>, t.IntersectionC<[t.PartialC<{
69
69
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
70
- }>, t.TypeC<{
71
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
70
+ }>, t.PartialC<{
71
+ memo: t.StringC;
72
72
  }>]>]>;
73
73
  export type SolCreateAssociatedTokenAccountIntent = t.TypeOf<typeof SolCreateAssociatedTokenAccountIntent>;
@@ -60,8 +60,8 @@ export declare const SolCustomTxIntent: t.IntersectionC<[t.IntersectionC<[t.Type
60
60
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
61
61
  }>]>, t.IntersectionC<[t.PartialC<{
62
62
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
63
- }>, t.TypeC<{
64
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
63
+ }>, t.PartialC<{
64
+ memo: t.StringC;
65
65
  }>]>, t.TypeC<{
66
66
  intentType: t.LiteralC<"customTx">;
67
67
  solInstructions: t.ArrayC<t.TypeC<{
@@ -60,8 +60,8 @@ export declare const SolDeactivateIntent: t.IntersectionC<[t.IntersectionC<[t.Ty
60
60
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
61
61
  }>]>, t.IntersectionC<[t.PartialC<{
62
62
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
63
- }>, t.TypeC<{
64
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
63
+ }>, t.PartialC<{
64
+ memo: t.StringC;
65
65
  }>]>, t.TypeC<{
66
66
  intentType: t.LiteralC<"deactivate">;
67
67
  stakingAddresses: t.UnionC<[t.Type<string[], string[], unknown>, t.UndefinedC]>;
@@ -60,8 +60,8 @@ export declare const SolDelegateIntent: t.IntersectionC<[t.IntersectionC<[t.Type
60
60
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
61
61
  }>]>, t.IntersectionC<[t.PartialC<{
62
62
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
63
- }>, t.TypeC<{
64
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
63
+ }>, t.PartialC<{
64
+ memo: t.StringC;
65
65
  }>]>, t.TypeC<{
66
66
  intentType: t.LiteralC<"delegate">;
67
67
  validatorAddress: t.StringC;
@@ -80,7 +80,7 @@ export declare const SolGoUnstakeIntent: t.IntersectionC<[t.IntersectionC<[t.Int
80
80
  }>]>>;
81
81
  }>]>, t.IntersectionC<[t.PartialC<{
82
82
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
83
- }>, t.TypeC<{
84
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
83
+ }>, t.PartialC<{
84
+ memo: t.StringC;
85
85
  }>]>]>;
86
86
  export type SolGoUnstakeIntent = t.TypeOf<typeof SolGoUnstakeIntent>;
@@ -82,7 +82,7 @@ export declare const SolPaymentIntent: t.IntersectionC<[t.IntersectionC<[t.Inter
82
82
  isTestTransaction: t.BooleanC;
83
83
  }>]>]>, t.IntersectionC<[t.PartialC<{
84
84
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
85
- }>, t.TypeC<{
86
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
85
+ }>, t.PartialC<{
86
+ memo: t.StringC;
87
87
  }>]>]>;
88
88
  export type SolPaymentIntent = t.TypeOf<typeof SolPaymentIntent>;
@@ -66,8 +66,8 @@ export declare const SolStakeIntent: t.IntersectionC<[t.IntersectionC<[t.Interse
66
66
  intentType: t.LiteralC<"stake">;
67
67
  }>]>, t.IntersectionC<[t.PartialC<{
68
68
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
69
- }>, t.TypeC<{
70
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
69
+ }>, t.PartialC<{
70
+ memo: t.StringC;
71
71
  }>]>, t.TypeC<{
72
72
  amount: t.TypeC<{
73
73
  value: t.StringC;
@@ -146,8 +146,8 @@ export declare const SolJitoStakeIntent: t.IntersectionC<[t.IntersectionC<[t.Int
146
146
  intentType: t.LiteralC<"stake">;
147
147
  }>]>, t.IntersectionC<[t.PartialC<{
148
148
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
149
- }>, t.TypeC<{
150
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
149
+ }>, t.PartialC<{
150
+ memo: t.StringC;
151
151
  }>]>, t.TypeC<{
152
152
  amount: t.TypeC<{
153
153
  value: t.StringC;
@@ -66,8 +66,8 @@ export declare const SolUnstakeIntent: t.IntersectionC<[t.IntersectionC<[t.Inter
66
66
  intentType: t.LiteralC<"unstake">;
67
67
  }>]>, t.IntersectionC<[t.PartialC<{
68
68
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
69
- }>, t.TypeC<{
70
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
69
+ }>, t.PartialC<{
70
+ memo: t.StringC;
71
71
  }>]>, t.TypeC<{
72
72
  stakingAddress: t.StringC;
73
73
  }>, t.PartialC<{
@@ -183,8 +183,8 @@ export declare const SolJitoUnstakeIntent: t.IntersectionC<[t.IntersectionC<[t.I
183
183
  intentType: t.LiteralC<"unstake">;
184
184
  }>]>, t.IntersectionC<[t.PartialC<{
185
185
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
186
- }>, t.TypeC<{
187
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
186
+ }>, t.PartialC<{
187
+ memo: t.StringC;
188
188
  }>]>, t.TypeC<{
189
189
  stakingAddress: t.StringC;
190
190
  }>, t.PartialC<{
@@ -60,8 +60,8 @@ export declare const SolVersionedCustomTxIntent: t.IntersectionC<[t.Intersection
60
60
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
61
61
  }>]>, t.IntersectionC<[t.PartialC<{
62
62
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
63
- }>, t.TypeC<{
64
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
63
+ }>, t.PartialC<{
64
+ memo: t.StringC;
65
65
  }>]>, t.TypeC<{
66
66
  intentType: t.LiteralC<"customTx">;
67
67
  solVersionedTransactionData: t.IntersectionC<[t.TypeC<{
@@ -5156,8 +5156,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5156
5156
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5157
5157
  }>]>, t.IntersectionC<[t.PartialC<{
5158
5158
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5159
- }>, t.TypeC<{
5160
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5159
+ }>, t.PartialC<{
5160
+ memo: t.StringC;
5161
5161
  }>]>, t.TypeC<{
5162
5162
  intentType: t.LiteralC<"authorize">;
5163
5163
  transactionMessage: t.StringC;
@@ -5243,8 +5243,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5243
5243
  }, unknown>, t.UndefinedC]>;
5244
5244
  }>]>, t.IntersectionC<[t.PartialC<{
5245
5245
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5246
- }>, t.TypeC<{
5247
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5246
+ }>, t.PartialC<{
5247
+ memo: t.StringC;
5248
5248
  }>]>, t.TypeC<{
5249
5249
  amount: t.TypeC<{
5250
5250
  value: t.StringC;
@@ -5313,12 +5313,26 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5313
5313
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5314
5314
  }>]>, t.IntersectionC<[t.PartialC<{
5315
5315
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5316
- }>, t.TypeC<{
5317
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5316
+ }>, t.PartialC<{
5317
+ memo: t.StringC;
5318
5318
  }>]>, t.TypeC<{
5319
5319
  intentType: t.LiteralC<"closeAssociatedTokenAccount">;
5320
- accountAddress: t.StringC;
5321
- destinationAddress: t.StringC;
5320
+ recipients: t.RefinementC<t.ArrayC<t.RefinementC<t.IntersectionC<[t.TypeC<{
5321
+ address: t.PartialC<{
5322
+ address: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5323
+ option: t.UnionC<[t.Type<{
5324
+ [x: string]: unknown;
5325
+ }, {
5326
+ [x: string]: unknown;
5327
+ }, unknown>, t.UndefinedC]>;
5328
+ }>;
5329
+ amount: t.TypeC<{
5330
+ value: t.StringC;
5331
+ symbol: t.StringC;
5332
+ }>;
5333
+ }>, t.PartialC<{
5334
+ data: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5335
+ }>]>>>>;
5322
5336
  }>]>, t.IntersectionC<[t.PartialC<{
5323
5337
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5324
5338
  }>, t.TypeC<{
@@ -5447,8 +5461,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5447
5461
  }>]>>;
5448
5462
  }>]>, t.IntersectionC<[t.PartialC<{
5449
5463
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5450
- }>, t.TypeC<{
5451
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5464
+ }>, t.PartialC<{
5465
+ memo: t.StringC;
5452
5466
  }>]>]>, t.IntersectionC<[t.IntersectionC<[t.TypeC<{
5453
5467
  intentType: t.KeyofC<{
5454
5468
  payment: t.LiteralC<"payment">;
@@ -5510,8 +5524,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5510
5524
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5511
5525
  }>]>, t.IntersectionC<[t.PartialC<{
5512
5526
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5513
- }>, t.TypeC<{
5514
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5527
+ }>, t.PartialC<{
5528
+ memo: t.StringC;
5515
5529
  }>]>, t.TypeC<{
5516
5530
  intentType: t.LiteralC<"customTx">;
5517
5531
  solInstructions: t.ArrayC<t.TypeC<{
@@ -5584,8 +5598,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5584
5598
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5585
5599
  }>]>, t.IntersectionC<[t.PartialC<{
5586
5600
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5587
- }>, t.TypeC<{
5588
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5601
+ }>, t.PartialC<{
5602
+ memo: t.StringC;
5589
5603
  }>]>, t.TypeC<{
5590
5604
  intentType: t.LiteralC<"deactivate">;
5591
5605
  stakingAddresses: t.UnionC<[t.Type<string[], string[], unknown>, t.UndefinedC]>;
@@ -5651,8 +5665,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5651
5665
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5652
5666
  }>]>, t.IntersectionC<[t.PartialC<{
5653
5667
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5654
- }>, t.TypeC<{
5655
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5668
+ }>, t.PartialC<{
5669
+ memo: t.StringC;
5656
5670
  }>]>, t.TypeC<{
5657
5671
  intentType: t.LiteralC<"delegate">;
5658
5672
  validatorAddress: t.StringC;
@@ -5739,8 +5753,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5739
5753
  }>]>>;
5740
5754
  }>]>, t.IntersectionC<[t.PartialC<{
5741
5755
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5742
- }>, t.TypeC<{
5743
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5756
+ }>, t.PartialC<{
5757
+ memo: t.StringC;
5744
5758
  }>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
5745
5759
  intentType: t.KeyofC<{
5746
5760
  payment: t.LiteralC<"payment">;
@@ -5824,8 +5838,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5824
5838
  isTestTransaction: t.BooleanC;
5825
5839
  }>]>]>, t.IntersectionC<[t.PartialC<{
5826
5840
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5827
- }>, t.TypeC<{
5828
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5841
+ }>, t.PartialC<{
5842
+ memo: t.StringC;
5829
5843
  }>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
5830
5844
  intentType: t.KeyofC<{
5831
5845
  payment: t.LiteralC<"payment">;
@@ -5893,8 +5907,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5893
5907
  intentType: t.LiteralC<"stake">;
5894
5908
  }>]>, t.IntersectionC<[t.PartialC<{
5895
5909
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5896
- }>, t.TypeC<{
5897
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5910
+ }>, t.PartialC<{
5911
+ memo: t.StringC;
5898
5912
  }>]>, t.TypeC<{
5899
5913
  amount: t.TypeC<{
5900
5914
  value: t.StringC;
@@ -5971,8 +5985,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
5971
5985
  intentType: t.LiteralC<"unstake">;
5972
5986
  }>]>, t.IntersectionC<[t.PartialC<{
5973
5987
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
5974
- }>, t.TypeC<{
5975
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
5988
+ }>, t.PartialC<{
5989
+ memo: t.StringC;
5976
5990
  }>]>, t.TypeC<{
5977
5991
  stakingAddress: t.StringC;
5978
5992
  }>, t.PartialC<{
@@ -6080,8 +6094,8 @@ export declare const TransactionRequestLite: t.IntersectionC<[t.IntersectionC<[t
6080
6094
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
6081
6095
  }>]>, t.IntersectionC<[t.PartialC<{
6082
6096
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
6083
- }>, t.TypeC<{
6084
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
6097
+ }>, t.PartialC<{
6098
+ memo: t.StringC;
6085
6099
  }>]>, t.TypeC<{
6086
6100
  intentType: t.LiteralC<"customTx">;
6087
6101
  solVersionedTransactionData: t.IntersectionC<[t.TypeC<{
@@ -15911,8 +15925,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
15911
15925
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
15912
15926
  }>]>, t.IntersectionC<[t.PartialC<{
15913
15927
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
15914
- }>, t.TypeC<{
15915
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
15928
+ }>, t.PartialC<{
15929
+ memo: t.StringC;
15916
15930
  }>]>, t.TypeC<{
15917
15931
  intentType: t.LiteralC<"authorize">;
15918
15932
  transactionMessage: t.StringC;
@@ -15998,8 +16012,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
15998
16012
  }, unknown>, t.UndefinedC]>;
15999
16013
  }>]>, t.IntersectionC<[t.PartialC<{
16000
16014
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16001
- }>, t.TypeC<{
16002
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16015
+ }>, t.PartialC<{
16016
+ memo: t.StringC;
16003
16017
  }>]>, t.TypeC<{
16004
16018
  amount: t.TypeC<{
16005
16019
  value: t.StringC;
@@ -16068,12 +16082,26 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
16068
16082
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16069
16083
  }>]>, t.IntersectionC<[t.PartialC<{
16070
16084
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16071
- }>, t.TypeC<{
16072
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16085
+ }>, t.PartialC<{
16086
+ memo: t.StringC;
16073
16087
  }>]>, t.TypeC<{
16074
16088
  intentType: t.LiteralC<"closeAssociatedTokenAccount">;
16075
- accountAddress: t.StringC;
16076
- destinationAddress: t.StringC;
16089
+ recipients: t.RefinementC<t.ArrayC<t.RefinementC<t.IntersectionC<[t.TypeC<{
16090
+ address: t.PartialC<{
16091
+ address: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16092
+ option: t.UnionC<[t.Type<{
16093
+ [x: string]: unknown;
16094
+ }, {
16095
+ [x: string]: unknown;
16096
+ }, unknown>, t.UndefinedC]>;
16097
+ }>;
16098
+ amount: t.TypeC<{
16099
+ value: t.StringC;
16100
+ symbol: t.StringC;
16101
+ }>;
16102
+ }>, t.PartialC<{
16103
+ data: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16104
+ }>]>>>>;
16077
16105
  }>]>, t.IntersectionC<[t.PartialC<{
16078
16106
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16079
16107
  }>, t.TypeC<{
@@ -16202,8 +16230,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
16202
16230
  }>]>>;
16203
16231
  }>]>, t.IntersectionC<[t.PartialC<{
16204
16232
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16205
- }>, t.TypeC<{
16206
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16233
+ }>, t.PartialC<{
16234
+ memo: t.StringC;
16207
16235
  }>]>]>, t.IntersectionC<[t.IntersectionC<[t.TypeC<{
16208
16236
  intentType: t.KeyofC<{
16209
16237
  payment: t.LiteralC<"payment">;
@@ -16265,8 +16293,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
16265
16293
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16266
16294
  }>]>, t.IntersectionC<[t.PartialC<{
16267
16295
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16268
- }>, t.TypeC<{
16269
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16296
+ }>, t.PartialC<{
16297
+ memo: t.StringC;
16270
16298
  }>]>, t.TypeC<{
16271
16299
  intentType: t.LiteralC<"customTx">;
16272
16300
  solInstructions: t.ArrayC<t.TypeC<{
@@ -16339,8 +16367,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
16339
16367
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16340
16368
  }>]>, t.IntersectionC<[t.PartialC<{
16341
16369
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16342
- }>, t.TypeC<{
16343
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16370
+ }>, t.PartialC<{
16371
+ memo: t.StringC;
16344
16372
  }>]>, t.TypeC<{
16345
16373
  intentType: t.LiteralC<"deactivate">;
16346
16374
  stakingAddresses: t.UnionC<[t.Type<string[], string[], unknown>, t.UndefinedC]>;
@@ -16406,8 +16434,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
16406
16434
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16407
16435
  }>]>, t.IntersectionC<[t.PartialC<{
16408
16436
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16409
- }>, t.TypeC<{
16410
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16437
+ }>, t.PartialC<{
16438
+ memo: t.StringC;
16411
16439
  }>]>, t.TypeC<{
16412
16440
  intentType: t.LiteralC<"delegate">;
16413
16441
  validatorAddress: t.StringC;
@@ -16494,8 +16522,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
16494
16522
  }>]>>;
16495
16523
  }>]>, t.IntersectionC<[t.PartialC<{
16496
16524
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16497
- }>, t.TypeC<{
16498
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16525
+ }>, t.PartialC<{
16526
+ memo: t.StringC;
16499
16527
  }>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
16500
16528
  intentType: t.KeyofC<{
16501
16529
  payment: t.LiteralC<"payment">;
@@ -16579,8 +16607,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
16579
16607
  isTestTransaction: t.BooleanC;
16580
16608
  }>]>]>, t.IntersectionC<[t.PartialC<{
16581
16609
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16582
- }>, t.TypeC<{
16583
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16610
+ }>, t.PartialC<{
16611
+ memo: t.StringC;
16584
16612
  }>]>]>, t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
16585
16613
  intentType: t.KeyofC<{
16586
16614
  payment: t.LiteralC<"payment">;
@@ -16648,8 +16676,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
16648
16676
  intentType: t.LiteralC<"stake">;
16649
16677
  }>]>, t.IntersectionC<[t.PartialC<{
16650
16678
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16651
- }>, t.TypeC<{
16652
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16679
+ }>, t.PartialC<{
16680
+ memo: t.StringC;
16653
16681
  }>]>, t.TypeC<{
16654
16682
  amount: t.TypeC<{
16655
16683
  value: t.StringC;
@@ -16726,8 +16754,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
16726
16754
  intentType: t.LiteralC<"unstake">;
16727
16755
  }>]>, t.IntersectionC<[t.PartialC<{
16728
16756
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16729
- }>, t.TypeC<{
16730
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16757
+ }>, t.PartialC<{
16758
+ memo: t.StringC;
16731
16759
  }>]>, t.TypeC<{
16732
16760
  stakingAddress: t.StringC;
16733
16761
  }>, t.PartialC<{
@@ -16835,8 +16863,8 @@ export declare const TransactionRequest: t.UnionC<[t.IntersectionC<[t.Intersecti
16835
16863
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16836
16864
  }>]>, t.IntersectionC<[t.PartialC<{
16837
16865
  nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16838
- }>, t.TypeC<{
16839
- memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
16866
+ }>, t.PartialC<{
16867
+ memo: t.StringC;
16840
16868
  }>]>, t.TypeC<{
16841
16869
  intentType: t.LiteralC<"customTx">;
16842
16870
  solVersionedTransactionData: t.IntersectionC<[t.TypeC<{
@@ -0,0 +1,2 @@
1
+ export * from "./webauthnDevice";
2
+ export * from "./webAuthnOtpDevice";
@@ -0,0 +1,19 @@
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 __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./webauthnDevice"), exports);
18
+ __exportStar(require("./webAuthnOtpDevice"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/schema/webauthn/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,sDAAoC"}
@@ -0,0 +1,7 @@
1
+ export interface WebAuthnOtpDevice {
2
+ id: string;
3
+ credentialId: string;
4
+ prfSalt?: string;
5
+ isPasskey?: boolean;
6
+ extensions?: Record<string, boolean>;
7
+ }
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=webAuthnOtpDevice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webAuthnOtpDevice.js","sourceRoot":"","sources":["../../../../src/schema/webauthn/webAuthnOtpDevice.ts"],"names":[],"mappings":""}
@@ -0,0 +1,18 @@
1
+ import * as t from "io-ts";
2
+ export declare const AuthenticatorInfo: t.TypeC<{
3
+ credID: t.StringC;
4
+ fmt: t.StringC;
5
+ publicKey: t.StringC;
6
+ }>;
7
+ export type AuthenticatorInfo = t.TypeOf<typeof AuthenticatorInfo>;
8
+ export declare const WebauthnDevice: t.TypeC<{
9
+ otpDeviceId: t.StringC;
10
+ authenticatorInfo: t.TypeC<{
11
+ credID: t.StringC;
12
+ fmt: t.StringC;
13
+ publicKey: t.StringC;
14
+ }>;
15
+ prfSalt: t.StringC;
16
+ encryptedPrv: t.StringC;
17
+ }>;
18
+ export type WebauthnDevice = t.TypeOf<typeof WebauthnDevice>;
@@ -0,0 +1,39 @@
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.WebauthnDevice = exports.AuthenticatorInfo = void 0;
27
+ const t = __importStar(require("io-ts"));
28
+ exports.AuthenticatorInfo = t.type({
29
+ credID: t.string,
30
+ fmt: t.string,
31
+ publicKey: t.string,
32
+ });
33
+ exports.WebauthnDevice = t.type({
34
+ otpDeviceId: t.string,
35
+ authenticatorInfo: exports.AuthenticatorInfo,
36
+ prfSalt: t.string,
37
+ encryptedPrv: t.string,
38
+ });
39
+ //# sourceMappingURL=webauthnDevice.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"webauthnDevice.js","sourceRoot":"","sources":["../../../../src/schema/webauthn/webauthnDevice.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAEd,QAAA,iBAAiB,GAAG,CAAC,CAAC,IAAI,CAAC;IAEtC,MAAM,EAAE,CAAC,CAAC,MAAM;IAEhB,GAAG,EAAE,CAAC,CAAC,MAAM;IAEb,SAAS,EAAE,CAAC,CAAC,MAAM;CACpB,CAAC,CAAC;AAIU,QAAA,cAAc,GAAG,CAAC,CAAC,IAAI,CAAC;IACnC,WAAW,EAAE,CAAC,CAAC,MAAM;IACrB,iBAAiB,EAAE,yBAAiB;IACpC,OAAO,EAAE,CAAC,CAAC,MAAM;IACjB,YAAY,EAAE,CAAC,CAAC,MAAM;CACvB,CAAC,CAAC"}
@@ -3,6 +3,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAssetsFromIntent = getAssetsFromIntent;
4
4
  const Either_1 = require("fp-ts/lib/Either");
5
5
  const baseIntent_1 = require("../schema/transactionRequest/intents/baseIntent");
6
+ const intentType_1 = require("../schema/transactionRequest/intents/intentType");
7
+ const INTENT_TYPES_SKIP_RECIPIENT_AMOUNT_SYMBOL_AS_ASSET = new Set([
8
+ intentType_1.intentTypes.closeAssociatedTokenAccount.value,
9
+ ]);
6
10
  function getAssetsFromIntent(intent) {
7
11
  if (!intent || typeof intent !== "object") {
8
12
  return [];
@@ -10,10 +14,15 @@ function getAssetsFromIntent(intent) {
10
14
  const assetStrings = new Set();
11
15
  const recipientsDecoded = baseIntent_1.BaseIntentWithRecipients.decode(intent);
12
16
  if ((0, Either_1.isRight)(recipientsDecoded)) {
13
- const data = recipientsDecoded.right;
14
- for (const recipient of data.recipients) {
15
- if (recipient.amount?.symbol) {
16
- assetStrings.add(recipient.amount.symbol);
17
+ const intentType = intent["intentType"];
18
+ const skipRecipientAmountSymbol = typeof intentType === "string" &&
19
+ INTENT_TYPES_SKIP_RECIPIENT_AMOUNT_SYMBOL_AS_ASSET.has(intentType);
20
+ if (!skipRecipientAmountSymbol) {
21
+ const data = recipientsDecoded.right;
22
+ for (const recipient of data.recipients) {
23
+ if (recipient.amount?.symbol) {
24
+ assetStrings.add(recipient.amount.symbol);
25
+ }
17
26
  }
18
27
  }
19
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"getAssetsFromIntent.js","sourceRoot":"","sources":["../../../src/utils/getAssetsFromIntent.ts"],"names":[],"mappings":";;AAwBA,kDAwDC;AAhFD,6CAA2C;AAC3C,gFAKyD;AAkBzD,SAAgB,mBAAmB,CAAC,MAAe;IACjD,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IAKvC,MAAM,iBAAiB,GAAG,qCAAwB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClE,IAAI,IAAA,gBAAO,EAAC,iBAAiB,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC;QACrC,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACxC,IAAI,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;gBAC7B,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;YAC5C,CAAC;QACH,CAAC;IACH,CAAC;IAKD,MAAM,gBAAgB,GAAG,oCAAuB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChE,IAAI,IAAA,gBAAO,EAAC,gBAAgB,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC;QACpC,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACxC,IAAI,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC;gBACnC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;IACH,CAAC;IAKD,MAAM,gBAAgB,GAAG,oCAAuB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChE,IAAI,IAAA,gBAAO,EAAC,gBAAgB,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC;QACpC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAKD,MAAM,aAAa,GAAG,iCAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAI,IAAA,gBAAO,EAAC,aAAa,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC;QACjC,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YACxB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;AACzC,CAAC"}
1
+ {"version":3,"file":"getAssetsFromIntent.js","sourceRoot":"","sources":["../../../src/utils/getAssetsFromIntent.ts"],"names":[],"mappings":";;AAmCA,kDA8DC;AAjGD,6CAA2C;AAC3C,gFAKyD;AACzD,gFAA8E;AAQ9E,MAAM,kDAAkD,GAAG,IAAI,GAAG,CAAS;IACzE,wBAAW,CAAC,2BAA2B,CAAC,KAAK;CAC9C,CAAC,CAAC;AAkBH,SAAgB,mBAAmB,CAAC,MAAe;IACjD,IAAI,CAAC,MAAM,IAAI,OAAO,MAAM,KAAK,QAAQ,EAAE,CAAC;QAC1C,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,MAAM,YAAY,GAAG,IAAI,GAAG,EAAU,CAAC;IAKvC,MAAM,iBAAiB,GAAG,qCAAwB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClE,IAAI,IAAA,gBAAO,EAAC,iBAAiB,CAAC,EAAE,CAAC;QAC/B,MAAM,UAAU,GAAI,MAAkC,CAAC,YAAY,CAAC,CAAC;QACrE,MAAM,yBAAyB,GAC7B,OAAO,UAAU,KAAK,QAAQ;YAC9B,kDAAkD,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QACrE,IAAI,CAAC,yBAAyB,EAAE,CAAC;YAC/B,MAAM,IAAI,GAAG,iBAAiB,CAAC,KAAK,CAAC;YACrC,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;gBACxC,IAAI,SAAS,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;oBAC7B,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;gBAC5C,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IAKD,MAAM,gBAAgB,GAAG,oCAAuB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChE,IAAI,IAAA,gBAAO,EAAC,gBAAgB,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC;QACpC,KAAK,MAAM,SAAS,IAAI,IAAI,CAAC,UAAU,EAAE,CAAC;YACxC,IAAI,SAAS,CAAC,SAAS,EAAE,SAAS,EAAE,CAAC;gBACnC,YAAY,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,SAAS,CAAC,CAAC;YAClD,CAAC;QACH,CAAC;IACH,CAAC;IAKD,MAAM,gBAAgB,GAAG,oCAAuB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAChE,IAAI,IAAA,gBAAO,EAAC,gBAAgB,CAAC,EAAE,CAAC;QAC9B,MAAM,IAAI,GAAG,gBAAgB,CAAC,KAAK,CAAC;QACpC,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;YACnB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;QACnC,CAAC;IACH,CAAC;IAKD,MAAM,aAAa,GAAG,iCAAoB,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAC1D,IAAI,IAAA,gBAAO,EAAC,aAAa,CAAC,EAAE,CAAC;QAC3B,MAAM,IAAI,GAAG,aAAa,CAAC,KAAK,CAAC;QACjC,IAAI,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC;YACxB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;QACvC,CAAC;IACH,CAAC;IAED,OAAO,KAAK,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,IAAI,EAAE,CAAC;AACzC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitgo/public-types",
3
- "version": "5.97.0",
3
+ "version": "6.1.0",
4
4
  "description": "Collection of types exposed externally as part of the BitGo public API",
5
5
  "license": "UNLICENSED",
6
6
  "author": "",
@@ -7,3 +7,4 @@ export * from "./wallet";
7
7
  export * from "./tss";
8
8
  export * from "./lightning";
9
9
  export * from "./enterprise";
10
+ export * from "./webauthn";
@@ -1,11 +1,28 @@
1
1
  import * as t from "io-ts";
2
- import { optionalString } from "../../../utils";
3
2
  import { AccountBaseBuildOptions } from "./accountBaseBuildOptions";
4
3
 
4
+ /**
5
+ * Solana build fragment intersected by **every** Sol intent codec that composes
6
+ * `SolBuildOptions` (e.g. payment, stake, consolidate, close-ATA, etc.).
7
+ *
8
+ * **`memo` change is a wire-format alignment, not a type-narrowing change.**
9
+ * Switching from `t.type({ memo: optionalString })` to
10
+ * `t.partial({ memo: t.string })` lets the **key be omitted** on the wire — real
11
+ * prebuild payloads frequently leave `memo` out, and the previous `t.type` form
12
+ * required the key for `.is()` even when the value would have been `undefined`.
13
+ * When `memo` is present, the value is validated as a `string`; if a caller
14
+ * passes `memo: undefined`, `t.partial` does not run the inner codec (the key
15
+ * is treated as absent), so runtime stays compatible with spreads.
16
+ *
17
+ * Inferred TS types are effectively unchanged: optional-key inference for
18
+ * `t.partial` already produces `memo?: string | undefined`, the same shape
19
+ * `t.TypeOf` would have given with `optionalString`. Package-wide Solana intent
20
+ * fix, not limited to close-ATA.
21
+ */
5
22
  export const SolBuildOptions = t.intersection([
6
23
  AccountBaseBuildOptions,
7
- t.type({
8
- memo: optionalString,
24
+ t.partial({
25
+ memo: t.string,
9
26
  }),
10
27
  ]);
11
28
 
@@ -1,21 +1,110 @@
1
1
  import * as t from "io-ts";
2
+ import type { Address } from "./address";
2
3
  import { BaseIntent } from "./baseIntent";
3
4
  import { intentTypes } from "./intentType";
5
+ import { RecipientEntry } from "./recipientEntry";
4
6
  import { SolBuildOptions } from "./solBuildOptions";
5
7
 
8
+ /**
9
+ * One close-ATA recipient row: ATA in `address.address`, zero placeholder amount,
10
+ * no token payload. Narrower than {@link RecipientEntry} for compile-time use
11
+ * when you annotate with this type after a successful decode.
12
+ *
13
+ * **Address typing:** {@link Address} is `t.partial` in io-ts, so
14
+ * `t.TypeOf<typeof RecipientEntry>["address"]` still allows a missing inner
15
+ * `address`. The refinement rejects non-strings at **runtime**, but io-ts does
16
+ * not narrow `TypeOf` on refinements—so `decode(...).right` alone will not show
17
+ * `address.address` as required. Use this named type (via
18
+ * {@link SolCloseAssociatedTokenAccountIntent}) for the stricter contract; do
19
+ * not widen back to plain `t.TypeOf<typeof SolCloseAssociatedTokenAccountIntent>`
20
+ * if you need the guarantee on `address.address`.
21
+ *
22
+ * `amount.value` must be the **exact string** `"0"`. The refinement uses string
23
+ * equality (not numeric parsing), so `"0.0"`, `"0.00"`, `"00"`, `"-0"`, `"0x0"`,
24
+ * etc. are rejected. Construct close-ATA placeholders with the literal `"0"`.
25
+ *
26
+ * `amount.symbol` follows {@link RecipientEntry} / `Amount`: any string
27
+ * (including `""`); it is not validated as a ticker and is ignored for asset extraction.
28
+ */
29
+ export type SolCloseAssociatedTokenAccountRecipient = {
30
+ // Intersection tightens Address.address from string | undefined to required string.
31
+ address: Address & { address: string };
32
+ amount: { value: "0"; symbol: string };
33
+ /**
34
+ * Matches {@link RecipientEntry} / `optionalString` (`string | undefined`).
35
+ * Note: the underlying codec is `t.partial({ data: optionalString })`, so the
36
+ * key may also be absent at runtime; in TS the three states (absent,
37
+ * `undefined`, `string`) collapse to `string | undefined` here.
38
+ */
39
+ data?: string | undefined;
40
+ };
41
+
42
+ function isSolCloseAssociatedTokenAccountRecipient(
43
+ recipient: RecipientEntry,
44
+ ): recipient is SolCloseAssociatedTokenAccountRecipient {
45
+ if (recipient.amount.value !== "0") {
46
+ return false;
47
+ }
48
+ const recipientRecord = recipient as Record<string, unknown>;
49
+ // RecipientEntry’s codec does not declare token fields; io-ts still accepts
50
+ // extra keys, and values widened from richer recipient shapes may carry them.
51
+ if ("tokenName" in recipientRecord || "tokenData" in recipientRecord) {
52
+ return false;
53
+ }
54
+ const addressFields = recipient.address as { address?: unknown };
55
+ if (typeof addressFields?.address !== "string") {
56
+ return false;
57
+ }
58
+ return true;
59
+ }
60
+
61
+ /**
62
+ * Internal io-ts refinement for one close-ATA recipient row (not exported).
63
+ *
64
+ * io-ts does not propagate refinement predicates into `TypeOf`, so
65
+ * `decode(...).right` is still typed as {@link RecipientEntry}. For the narrowed
66
+ * row shape after validation, use {@link SolCloseAssociatedTokenAccountRecipient}
67
+ * (see {@link SolCloseAssociatedTokenAccountIntent}’s exported type, which
68
+ * overrides `recipients` accordingly).
69
+ */
70
+ const solCloseAssociatedTokenAccountRecipientEntry = t.refinement(
71
+ RecipientEntry,
72
+ isSolCloseAssociatedTokenAccountRecipient,
73
+ "SolCloseAssociatedTokenAccountRecipientEntry",
74
+ );
75
+
76
+ const solCloseAssociatedTokenAccountRecipients = t.refinement(
77
+ t.array(solCloseAssociatedTokenAccountRecipientEntry),
78
+ (recipients) => recipients.length > 0,
79
+ "SolCloseAssociatedTokenAccountRecipients",
80
+ );
81
+
6
82
  /**
7
83
  * @title SOL Close Associated Token Account Intent
84
+ *
85
+ * After `decode`, prefer annotating or threading values as the exported
86
+ * {@link SolCloseAssociatedTokenAccountIntent} **type alias** (below), not raw
87
+ * `t.TypeOf<typeof SolCloseAssociatedTokenAccountIntent>` from io-ts alone, so
88
+ * `recipients` rows keep {@link SolCloseAssociatedTokenAccountRecipient} narrowing
89
+ * (see codec / refinement limitations in that type’s docblock).
8
90
  */
9
91
  export const SolCloseAssociatedTokenAccountIntent = t.intersection([
10
92
  BaseIntent,
11
93
  SolBuildOptions,
12
94
  t.type({
13
95
  intentType: intentTypes.closeAssociatedTokenAccount,
14
- accountAddress: t.string,
15
- destinationAddress: t.string,
96
+ recipients: solCloseAssociatedTokenAccountRecipients,
16
97
  }),
17
98
  ]);
18
99
 
19
- export type SolCloseAssociatedTokenAccountIntent = t.TypeOf<
20
- typeof SolCloseAssociatedTokenAccountIntent
21
- >;
100
+ /**
101
+ * Intent shape with narrowed `recipients`; use this after `decode` instead of
102
+ * relying only on `t.TypeOf<typeof SolCloseAssociatedTokenAccountIntent>` from
103
+ * the codec so recipient `address.address` and `amount.value` typing match runtime rules.
104
+ */
105
+ export type SolCloseAssociatedTokenAccountIntent = Omit<
106
+ t.TypeOf<typeof SolCloseAssociatedTokenAccountIntent>,
107
+ "recipients"
108
+ > & {
109
+ recipients: SolCloseAssociatedTokenAccountRecipient[];
110
+ };
@@ -0,0 +1,2 @@
1
+ export * from "./webauthnDevice";
2
+ export * from "./webAuthnOtpDevice";
@@ -0,0 +1,8 @@
1
+ export interface WebAuthnOtpDevice {
2
+ id: string;
3
+ /** Base64url-encoded WebAuthn credential ID */
4
+ credentialId: string;
5
+ prfSalt?: string;
6
+ isPasskey?: boolean;
7
+ extensions?: Record<string, boolean>;
8
+ }
@@ -0,0 +1,21 @@
1
+ import * as t from "io-ts";
2
+
3
+ export const AuthenticatorInfo = t.type({
4
+ /** Base64url-encoded WebAuthn credential ID */
5
+ credID: t.string,
6
+ /** Attestation format (e.g. "packed", "none") */
7
+ fmt: t.string,
8
+ /** Base64url-encoded COSE public key */
9
+ publicKey: t.string,
10
+ });
11
+
12
+ export type AuthenticatorInfo = t.TypeOf<typeof AuthenticatorInfo>;
13
+
14
+ export const WebauthnDevice = t.type({
15
+ otpDeviceId: t.string,
16
+ authenticatorInfo: AuthenticatorInfo,
17
+ prfSalt: t.string,
18
+ encryptedPrv: t.string,
19
+ });
20
+
21
+ export type WebauthnDevice = t.TypeOf<typeof WebauthnDevice>;
@@ -5,6 +5,17 @@ import {
5
5
  BaseIntentWithTokenName,
6
6
  BaseIntentWithAmount,
7
7
  } from "../schema/transactionRequest/intents/baseIntent";
8
+ import { intentTypes } from "../schema/transactionRequest/intents/intentType";
9
+
10
+ /**
11
+ * `intentType` values for intents that decode as `BaseIntentWithRecipients`
12
+ * but use `recipients[].amount.symbol` as a non-asset placeholder (do not extract).
13
+ * Extend this set when adding similar intents; a schema-driven marker would be
14
+ * a larger refactor.
15
+ */
16
+ const INTENT_TYPES_SKIP_RECIPIENT_AMOUNT_SYMBOL_AS_ASSET = new Set<string>([
17
+ intentTypes.closeAssociatedTokenAccount.value,
18
+ ]);
8
19
 
9
20
  /**
10
21
  * Extracts all asset-related strings from a transaction intent
@@ -34,10 +45,16 @@ export function getAssetsFromIntent(intent: unknown): string[] {
34
45
  // Extracts: symbol from amount field
35
46
  const recipientsDecoded = BaseIntentWithRecipients.decode(intent);
36
47
  if (isRight(recipientsDecoded)) {
37
- const data = recipientsDecoded.right;
38
- for (const recipient of data.recipients) {
39
- if (recipient.amount?.symbol) {
40
- assetStrings.add(recipient.amount.symbol);
48
+ const intentType = (intent as Record<string, unknown>)["intentType"];
49
+ const skipRecipientAmountSymbol =
50
+ typeof intentType === "string" &&
51
+ INTENT_TYPES_SKIP_RECIPIENT_AMOUNT_SYMBOL_AS_ASSET.has(intentType);
52
+ if (!skipRecipientAmountSymbol) {
53
+ const data = recipientsDecoded.right;
54
+ for (const recipient of data.recipients) {
55
+ if (recipient.amount?.symbol) {
56
+ assetStrings.add(recipient.amount.symbol);
57
+ }
41
58
  }
42
59
  }
43
60
  }