@bitgo/public-types 5.4.0 → 5.5.1

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 (31) hide show
  1. package/dist/src/schema/transactionRequest/intents/index.d.ts +3 -0
  2. package/dist/src/schema/transactionRequest/intents/index.js +3 -0
  3. package/dist/src/schema/transactionRequest/intents/index.js.map +1 -1
  4. package/dist/src/schema/transactionRequest/intents/intent.d.ts +157 -1
  5. package/dist/src/schema/transactionRequest/intents/intent.js +4 -0
  6. package/dist/src/schema/transactionRequest/intents/intent.js.map +1 -1
  7. package/dist/src/schema/transactionRequest/intents/polyxBaseIntent.d.ts +79 -0
  8. package/dist/src/schema/transactionRequest/intents/polyxBaseIntent.js +38 -0
  9. package/dist/src/schema/transactionRequest/intents/polyxBaseIntent.js.map +1 -0
  10. package/dist/src/schema/transactionRequest/intents/polyxStakeIntent.d.ts +2 -2
  11. package/dist/src/schema/transactionRequest/intents/polyxStakeIntent.js +4 -6
  12. package/dist/src/schema/transactionRequest/intents/polyxStakeIntent.js.map +1 -1
  13. package/dist/src/schema/transactionRequest/intents/polyxUnstakeIntent.d.ts +81 -0
  14. package/dist/src/schema/transactionRequest/intents/polyxUnstakeIntent.js +36 -0
  15. package/dist/src/schema/transactionRequest/intents/polyxUnstakeIntent.js.map +1 -0
  16. package/dist/src/schema/transactionRequest/intents/polyxWithdrawIntent.d.ts +81 -0
  17. package/dist/src/schema/transactionRequest/intents/polyxWithdrawIntent.js +36 -0
  18. package/dist/src/schema/transactionRequest/intents/polyxWithdrawIntent.js.map +1 -0
  19. package/dist/src/schema/transactions/tronTransaction.d.ts +30 -192
  20. package/dist/src/schema/transactions/tronTransaction.js +35 -66
  21. package/dist/src/schema/transactions/tronTransaction.js.map +1 -1
  22. package/dist/src/schema/webhook/addWalletWebhookRequest.js.map +1 -1
  23. package/package.json +1 -1
  24. package/src/schema/transactionRequest/intents/index.ts +3 -0
  25. package/src/schema/transactionRequest/intents/intent.ts +4 -0
  26. package/src/schema/transactionRequest/intents/polyxBaseIntent.ts +18 -0
  27. package/src/schema/transactionRequest/intents/polyxStakeIntent.ts +4 -6
  28. package/src/schema/transactionRequest/intents/polyxUnstakeIntent.ts +15 -0
  29. package/src/schema/transactionRequest/intents/polyxWithdrawIntent.ts +15 -0
  30. package/src/schema/transactions/tronTransaction.ts +36 -71
  31. package/src/schema/webhook/addWalletWebhookRequest.ts +3 -0
@@ -7,59 +7,34 @@ export const TronResourceType = t.keyof({
7
7
  });
8
8
  export type TronResourceType = t.TypeOf<typeof TronResourceType>;
9
9
 
10
- export const TronTransactionType = t.keyof({
11
- freeze: 1,
12
- unfreeze: 1,
13
- vote: 1,
14
- claimRewards: 1,
15
- delegateResource: 1,
16
- undelegateResource: 1,
17
- withdrawExpireUnfreeze: 1,
10
+ export const TronFreezeTransaction = t.type({
11
+ type: t.literal("freeze"),
12
+ owner_address: t.string,
13
+ frozen_balance: t.string,
14
+ resource: TronResourceType,
18
15
  });
19
- export type TronTransactionType = t.TypeOf<typeof TronTransactionType>;
20
16
 
21
- export const TronTransactionBase = t.type({
22
- transactionType: TronTransactionType,
17
+ export const TronUnfreezeTransaction = t.type({
18
+ type: t.literal("unfreeze"),
19
+ owner_address: t.string,
20
+ unfreeze_balance: t.string,
21
+ resource: TronResourceType,
23
22
  });
24
23
 
25
- export const TronFreezeTransaction = t.intersection([
26
- TronTransactionBase,
27
- t.type({
28
- transactionType: t.literal("freeze"),
29
- owner_address: t.string,
30
- frozen_balance: t.string,
31
- resource: TronResourceType,
32
- }),
33
- ]);
34
-
35
- export const TronUnfreezeTransaction = t.intersection([
36
- TronTransactionBase,
37
- t.type({
38
- transactionType: t.literal("unfreeze"),
39
- owner_address: t.string,
40
- unfreeze_balance: t.string,
41
- resource: TronResourceType,
42
- }),
43
- ]);
44
-
45
- export const TronVoteTransaction = t.intersection([
46
- TronTransactionBase,
47
- t.type({
48
- transactionType: t.literal("vote"),
49
- owner_address: t.string,
50
- votes: t.array(
51
- t.type({
52
- vote_address: t.string,
53
- vote_count: t.string,
54
- }),
55
- ),
56
- }),
57
- ]);
24
+ export const TronVoteTransaction = t.type({
25
+ type: t.literal("vote"),
26
+ owner_address: t.string,
27
+ votes: t.array(
28
+ t.type({
29
+ vote_address: t.string,
30
+ vote_count: t.string,
31
+ }),
32
+ ),
33
+ });
58
34
 
59
35
  export const TronDelegateResourceTransaction = t.intersection([
60
- TronTransactionBase,
61
36
  t.type({
62
- transactionType: t.literal("delegateResource"),
37
+ type: t.literal("delegateResource"),
63
38
  owner_address: t.string,
64
39
  resource: TronResourceType,
65
40
  receiver_address: t.string,
@@ -71,32 +46,23 @@ export const TronDelegateResourceTransaction = t.intersection([
71
46
  }),
72
47
  ]);
73
48
 
74
- export const TronUndelegateResourceTransaction = t.intersection([
75
- TronTransactionBase,
76
- t.type({
77
- transactionType: t.literal("undelegateResource"),
78
- owner_address: t.string,
79
- resource: TronResourceType,
80
- receiver_address: t.string,
81
- balance: t.string,
82
- }),
83
- ]);
49
+ export const TronUndelegateResourceTransaction = t.type({
50
+ type: t.literal("undelegateResource"),
51
+ owner_address: t.string,
52
+ resource: TronResourceType,
53
+ receiver_address: t.string,
54
+ balance: t.string,
55
+ });
84
56
 
85
- export const TronClaimRewardsTransaction = t.intersection([
86
- TronTransactionBase,
87
- t.type({
88
- transactionType: t.literal("claimRewards"),
89
- owner_address: t.string,
90
- }),
91
- ]);
57
+ export const TronClaimRewardsTransaction = t.type({
58
+ type: t.literal("claimRewards"),
59
+ owner_address: t.string,
60
+ });
92
61
 
93
- export const TronWithdrawExpireUnfreezeTransaction = t.intersection([
94
- TronTransactionBase,
95
- t.type({
96
- transactionType: t.literal("withdrawExpireUnfreeze"),
97
- owner_address: t.string,
98
- }),
99
- ]);
62
+ export const TronWithdrawExpireUnfreezeTransaction = t.type({
63
+ type: t.literal("withdrawExpireUnfreeze"),
64
+ owner_address: t.string,
65
+ });
100
66
 
101
67
  export const TronTransaction = t.union([
102
68
  TronFreezeTransaction,
@@ -108,7 +74,6 @@ export const TronTransaction = t.union([
108
74
  TronWithdrawExpireUnfreezeTransaction,
109
75
  ]);
110
76
 
111
- export type TronTransactionBase = t.TypeOf<typeof TronTransactionBase>;
112
77
  export type TronFreezeTransaction = t.TypeOf<typeof TronFreezeTransaction>;
113
78
  export type TronUnfreezeTransaction = t.TypeOf<typeof TronUnfreezeTransaction>;
114
79
  export type TronVoteTransaction = t.TypeOf<typeof TronVoteTransaction>;
@@ -33,6 +33,9 @@ export const AddWalletWebhookRequestBody = {
33
33
  listenToFailureStates: Optional(t.boolean),
34
34
  txRequestStates: Optional(t.array(TransactionRequestState)),
35
35
  txRequestTransactionStates: Optional(t.array(TransactionState)),
36
+ /**
37
+ * Custom HTTP header key/values to be included with every notification for the webhook.
38
+ */
36
39
  customHttpHeaders: Optional(t.record(t.string, t.string)),
37
40
  };
38
41
  export const AddWalletWebhookRequestBodyC = t.type({