@bitgo/public-types 6.88.0 → 6.89.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.
@@ -1,4 +1,13 @@
1
1
  import * as t from "io-ts";
2
+ export declare const SolV1TransactionConfig: t.TypeC<{
3
+ computeUnitLimit: t.UnionC<[t.NumberC, t.NullC]>;
4
+ heapSize: t.UnionC<[t.NumberC, t.NullC]>;
5
+ loadedAccountsDataSizeLimit: t.UnionC<[t.NumberC, t.NullC]>;
6
+ priorityFee: t.UnionC<[t.NumberC, t.NullC]>;
7
+ }>;
8
+ export type SolV1TransactionConfig = t.TypeOf<typeof SolV1TransactionConfig>;
9
+ export declare const SolConfidentialTransferOperation: t.UnionC<[t.LiteralC<"deposit">, t.LiteralC<"applyPendingBalance">, t.LiteralC<"transfer">, t.LiteralC<"withdraw">]>;
10
+ export type SolConfidentialTransferOperation = t.TypeOf<typeof SolConfidentialTransferOperation>;
2
11
  export declare const SolConfidentialTransferIntent: t.IntersectionC<[t.IntersectionC<[t.TypeC<{
3
12
  intentType: t.KeyofC<{
4
13
  payment: t.LiteralC<"payment">;
@@ -92,32 +101,17 @@ export declare const SolConfidentialTransferIntent: t.IntersectionC<[t.Intersect
92
101
  memo: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
93
102
  }>]>, t.TypeC<{
94
103
  intentType: t.LiteralC<"confidentialTransfer">;
95
- solConfidentialTransferData: t.IntersectionC<[t.TypeC<{
96
- tokenId: t.StringC;
97
- recipient: t.StringC;
98
- amount: t.StringC;
99
- }>, t.PartialC<{
100
- solVersionedTransactionData: t.IntersectionC<[t.TypeC<{
101
- versionedInstructions: t.ArrayC<t.TypeC<{
102
- programIdIndex: t.NumberC;
103
- accountKeyIndexes: t.ArrayC<t.NumberC>;
104
- data: t.StringC;
105
- }>>;
106
- addressLookupTables: t.ArrayC<t.TypeC<{
107
- accountKey: t.StringC;
108
- writableIndexes: t.ArrayC<t.NumberC>;
109
- readonlyIndexes: t.ArrayC<t.NumberC>;
110
- }>>;
111
- staticAccountKeys: t.ArrayC<t.StringC>;
112
- messageHeader: t.TypeC<{
113
- numRequiredSignatures: t.NumberC;
114
- numReadonlySignedAccounts: t.NumberC;
115
- numReadonlyUnsignedAccounts: t.NumberC;
116
- }>;
117
- }>, t.PartialC<{
118
- recentBlockhash: t.StringC;
119
- version: t.UnionC<[t.LiteralC<0>, t.LiteralC<1>]>;
120
- }>]>;
121
- }>]>;
104
+ token: t.StringC;
105
+ operation: t.UnionC<[t.LiteralC<"deposit">, t.LiteralC<"applyPendingBalance">, t.LiteralC<"transfer">, t.LiteralC<"withdraw">]>;
106
+ amount: t.StringC;
107
+ }>, t.PartialC<{
108
+ version: t.LiteralC<1>;
109
+ transactionConfig: t.TypeC<{
110
+ computeUnitLimit: t.UnionC<[t.NumberC, t.NullC]>;
111
+ heapSize: t.UnionC<[t.NumberC, t.NullC]>;
112
+ loadedAccountsDataSizeLimit: t.UnionC<[t.NumberC, t.NullC]>;
113
+ priorityFee: t.UnionC<[t.NumberC, t.NullC]>;
114
+ }>;
115
+ recipientAddress: t.StringC;
122
116
  }>]>;
123
117
  export type SolConfidentialTransferIntent = t.TypeOf<typeof SolConfidentialTransferIntent>;
@@ -23,27 +23,36 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.SolConfidentialTransferIntent = void 0;
26
+ exports.SolConfidentialTransferIntent = exports.SolConfidentialTransferOperation = exports.SolV1TransactionConfig = void 0;
27
27
  const t = __importStar(require("io-ts"));
28
28
  const baseIntent_1 = require("./baseIntent");
29
29
  const solBuildOptions_1 = require("./solBuildOptions");
30
- const solVersionedTransactionData_1 = require("./solVersionedTransactionData");
31
30
  const intentType_1 = require("./intentType");
31
+ exports.SolV1TransactionConfig = t.type({
32
+ computeUnitLimit: t.union([t.number, t.null]),
33
+ heapSize: t.union([t.number, t.null]),
34
+ loadedAccountsDataSizeLimit: t.union([t.number, t.null]),
35
+ priorityFee: t.union([t.number, t.null]),
36
+ });
37
+ exports.SolConfidentialTransferOperation = t.union([
38
+ t.literal("deposit"),
39
+ t.literal("applyPendingBalance"),
40
+ t.literal("transfer"),
41
+ t.literal("withdraw"),
42
+ ]);
32
43
  exports.SolConfidentialTransferIntent = t.intersection([
33
44
  baseIntent_1.BaseIntent,
34
45
  solBuildOptions_1.SolBuildOptions,
35
46
  t.type({
36
47
  intentType: intentType_1.intentTypes.confidentialTransfer,
37
- solConfidentialTransferData: t.intersection([
38
- t.type({
39
- tokenId: t.string,
40
- recipient: t.string,
41
- amount: t.string,
42
- }),
43
- t.partial({
44
- solVersionedTransactionData: solVersionedTransactionData_1.SolVersionedTransactionData,
45
- }),
46
- ]),
48
+ token: t.string,
49
+ operation: exports.SolConfidentialTransferOperation,
50
+ amount: t.string,
51
+ }),
52
+ t.partial({
53
+ version: t.literal(1),
54
+ transactionConfig: exports.SolV1TransactionConfig,
55
+ recipientAddress: t.string,
47
56
  }),
48
57
  ]);
49
58
  //# sourceMappingURL=solConfidentialTransferIntent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"solConfidentialTransferIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/solConfidentialTransferIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,uDAAoD;AACpD,+EAA4E;AAC5E,6CAA2C;AAY9B,QAAA,6BAA6B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC1D,uBAAU;IACV,iCAAe;IACf,CAAC,CAAC,IAAI,CAAC;QAEL,UAAU,EAAE,wBAAW,CAAC,oBAAoB;QAC5C,2BAA2B,EAAE,CAAC,CAAC,YAAY,CAAC;YAC1C,CAAC,CAAC,IAAI,CAAC;gBAEL,OAAO,EAAE,CAAC,CAAC,MAAM;gBAEjB,SAAS,EAAE,CAAC,CAAC,MAAM;gBAEnB,MAAM,EAAE,CAAC,CAAC,MAAM;aACjB,CAAC;YACF,CAAC,CAAC,OAAO,CAAC;gBAER,2BAA2B,EAAE,yDAA2B;aACzD,CAAC;SACH,CAAC;KACH,CAAC;CACH,CAAC,CAAC"}
1
+ {"version":3,"file":"solConfidentialTransferIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/solConfidentialTransferIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAA0C;AAC1C,uDAAoD;AACpD,6CAA2C;AAU9B,QAAA,sBAAsB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC3C,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IAC7C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACrC,2BAA2B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;IACxD,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC;CACzC,CAAC,CAAC;AAWU,QAAA,gCAAgC,GAAG,CAAC,CAAC,KAAK,CAAC;IACtD,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC;IACpB,CAAC,CAAC,OAAO,CAAC,qBAAqB,CAAC;IAChC,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;IACrB,CAAC,CAAC,OAAO,CAAC,UAAU,CAAC;CACtB,CAAC,CAAC;AAiBU,QAAA,6BAA6B,GAAG,CAAC,CAAC,YAAY,CAAC;IAC1D,uBAAU;IACV,iCAAe;IACf,CAAC,CAAC,IAAI,CAAC;QAEL,UAAU,EAAE,wBAAW,CAAC,oBAAoB;QAE5C,KAAK,EAAE,CAAC,CAAC,MAAM;QAEf,SAAS,EAAE,wCAAgC;QAE3C,MAAM,EAAE,CAAC,CAAC,MAAM;KACjB,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QAER,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC;QAErB,iBAAiB,EAAE,8BAAsB;QAEzC,gBAAgB,EAAE,CAAC,CAAC,MAAM;KAC3B,CAAC;CACH,CAAC,CAAC"}
@@ -11,12 +11,12 @@ export declare const AddOrganizationWebhookRequestBodyC: t.TypeC<{
11
11
  }>;
12
12
  export type AddOrganizationWebhookRequestBody = t.TypeOf<typeof AddOrganizationWebhookRequestBodyC>;
13
13
  export declare const ListOrganizationWebhooksRequestBody: {
14
- type: t.UnionC<[t.Type<"txRequest" | "txRequestTransaction" | "transfer" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", "txRequest" | "txRequestTransaction" | "transfer" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", unknown>, t.UndefinedC]>;
14
+ type: t.UnionC<[t.Type<"transfer" | "txRequest" | "txRequestTransaction" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", "transfer" | "txRequest" | "txRequestTransaction" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", unknown>, t.UndefinedC]>;
15
15
  limit: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
16
16
  prevId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
17
17
  };
18
18
  export declare const ListOrganizationWebhooksRequestBodyC: t.TypeC<{
19
- type: t.UnionC<[t.Type<"txRequest" | "txRequestTransaction" | "transfer" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", "txRequest" | "txRequestTransaction" | "transfer" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", unknown>, t.UndefinedC]>;
19
+ type: t.UnionC<[t.Type<"transfer" | "txRequest" | "txRequestTransaction" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", "transfer" | "txRequest" | "txRequestTransaction" | "pendingapproval" | "bankAccount" | "userKycState" | "enterpriseKycState" | "identityStatus" | "idvStatus" | "accessToken" | "reversal" | "tradeOrder" | "whitelistApproved" | "whitelistRejected", unknown>, t.UndefinedC]>;
20
20
  limit: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
21
21
  prevId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
22
22
  }>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bitgo/public-types",
3
- "version": "6.88.0",
3
+ "version": "6.89.0",
4
4
  "description": "Collection of types exposed externally as part of the BitGo public API",
5
5
  "license": "UNLICENSED",
6
6
  "author": "",
@@ -1,16 +1,51 @@
1
1
  import * as t from "io-ts";
2
2
  import { BaseIntent } from "./baseIntent";
3
3
  import { SolBuildOptions } from "./solBuildOptions";
4
- import { SolVersionedTransactionData } from "./solVersionedTransactionData";
5
4
  import { intentTypes } from "./intentType";
6
5
 
7
6
  /**
8
- * Structured Solana Token-2022 confidential-transfer intent (Phase 1a).
7
+ * Solana Token-2022 confidential-transfer (CT) transaction config carried on a
8
+ * structured v1 intent. Mirrors the SDK `SolV1TransactionConfig` shape so a
9
+ * client-supplied config (compute budget / priority fee) round-trips through
10
+ * the v1 (SIMD-0296/0385) serializer. Absent fields are coerced to null by the
11
+ * SDK; clients may omit the config entirely (the server fixes it from
12
+ * `V1_TRANSACTION_CONFIG`).
13
+ */
14
+ export const SolV1TransactionConfig = t.type({
15
+ computeUnitLimit: t.union([t.number, t.null]),
16
+ heapSize: t.union([t.number, t.null]),
17
+ loadedAccountsDataSizeLimit: t.union([t.number, t.null]),
18
+ priorityFee: t.union([t.number, t.null]),
19
+ });
20
+
21
+ export type SolV1TransactionConfig = t.TypeOf<typeof SolV1TransactionConfig>;
22
+
23
+ /**
24
+ * Solana confidential-transfer operation. Deposit moves public SPL tokens into
25
+ * confidential pending balance; applyPendingBalance credits pending balance
26
+ * into available balance; transfer moves confidential balance to another
27
+ * confidential account; withdraw moves confidential available balance back to
28
+ * public SPL balance.
29
+ */
30
+ export const SolConfidentialTransferOperation = t.union([
31
+ t.literal("deposit"),
32
+ t.literal("applyPendingBalance"),
33
+ t.literal("transfer"),
34
+ t.literal("withdraw"),
35
+ ]);
36
+
37
+ export type SolConfidentialTransferOperation = t.TypeOf<
38
+ typeof SolConfidentialTransferOperation
39
+ >;
40
+
41
+ /**
42
+ * Structured Solana Token-2022 confidential-transfer intent.
9
43
  *
10
- * Clients supply structured fields (tokenId, recipient, amount); the platform
11
- * validates the SDK-built envelope against those fields before signing (interim
12
- * carrier while server-side proof generation is wired) and will construct the
13
- * instructions server-side once that integration lands.
44
+ * Clients supply structured fields (token, operation, amount, recipient); the
45
+ * platform assembles the v1 (SIMD-0296/0385) transaction server-side via the
46
+ * SDK ConfidentialTransferBuilder — zk proofs are generated by the KMS and
47
+ * never client-supplied. The sender's and (for transfer/withdraw) recipient's
48
+ * Associated Token Accounts must already exist and be CT-configured on-chain.
14
49
  *
15
50
  * @title SOL Confidential Transfer Intent
16
51
  */
@@ -20,20 +55,20 @@ export const SolConfidentialTransferIntent = t.intersection([
20
55
  t.type({
21
56
  /** Must be "confidentialTransfer". */
22
57
  intentType: intentTypes.confidentialTransfer,
23
- solConfidentialTransferData: t.intersection([
24
- t.type({
25
- /** The Token-2022 mint (confidential token) to transfer. */
26
- tokenId: t.string,
27
- /** The recipient address (ATA of the recipient for the token). */
28
- recipient: t.string,
29
- /** The amount to transfer, as a decimal string in the token's base units. */
30
- amount: t.string,
31
- }),
32
- t.partial({
33
- /** SDK-built confidential-transfer envelope (interim carrier; server-validated). */
34
- solVersionedTransactionData: SolVersionedTransactionData,
35
- }),
36
- ]),
58
+ /** The confidential token to operate on, as a statics token name (e.g. "sol:usdc"). */
59
+ token: t.string,
60
+ /** The confidential-transfer operation to build. */
61
+ operation: SolConfidentialTransferOperation,
62
+ /** The amount in atomic units (base units of the token's decimalPlaces). */
63
+ amount: t.string,
64
+ }),
65
+ t.partial({
66
+ /** Wire version marker; CT is v1-only, so the only valid value is 1. */
67
+ version: t.literal(1),
68
+ /** v1 transaction config (compute budget / priority fee); server-fixed if absent. */
69
+ transactionConfig: SolV1TransactionConfig,
70
+ /** Recipient address (ATA) — required for transfer and withdraw operations. */
71
+ recipientAddress: t.string,
37
72
  }),
38
73
  ]);
39
74