@bitgo/public-types 6.92.0 → 6.94.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/schema/transactionRequest/intents/cantonAllocationRequestIntent.d.ts +1 -0
- package/dist/src/schema/transactionRequest/intents/cantonAllocationRequestIntent.js +1 -0
- package/dist/src/schema/transactionRequest/intents/cantonAllocationRequestIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/index.d.ts +1 -0
- package/dist/src/schema/transactionRequest/intents/index.js +1 -0
- package/dist/src/schema/transactionRequest/intents/index.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/intent.d.ts +1 -0
- package/dist/src/schema/transactionRequest/intents/intentGroups.d.ts +17896 -0
- package/dist/src/schema/transactionRequest/intents/intentGroups.js +346 -0
- package/dist/src/schema/transactionRequest/intents/intentGroups.js.map +1 -0
- package/dist/src/schema/transactionRequest/transactionRequest.d.ts +2 -0
- package/dist/src/schema/transactionRequest/transactionRequest.js +16 -1
- package/dist/src/schema/transactionRequest/transactionRequest.js.map +1 -1
- package/package.json +1 -1
- package/src/schema/transactionRequest/intents/cantonAllocationRequestIntent.ts +2 -0
- package/src/schema/transactionRequest/intents/index.ts +1 -0
- package/src/schema/transactionRequest/intents/intentGroups.ts +407 -0
- package/src/schema/transactionRequest/transactionRequest.ts +22 -2
|
@@ -0,0 +1,407 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
|
|
3
|
+
import { AdaConsolidateIntent } from "./adaConsolidateIntent";
|
|
4
|
+
import { AdaPaymentIntent } from "./adaPaymentIntent";
|
|
5
|
+
import { AdaStakeClaimRewardsIntent } from "./adaStakeClaimRewardsIntent";
|
|
6
|
+
import { AdaRealFiStakeIntent, AdaStakeIntent } from "./adaStakeIntent";
|
|
7
|
+
import { AdaRealFiUnstakeIntent, AdaUnstakeIntent } from "./adaUnstakeIntent";
|
|
8
|
+
import { AdaRealFiCancelIntent } from "./adaCancelIntent";
|
|
9
|
+
import { AdaRealFiClaimTimelockIntent } from "./adaClaimTimelockIntent";
|
|
10
|
+
import { AdaVoteDelegationIntent } from "./adaVoteDelegationIntent";
|
|
11
|
+
import { AptCustomTxIntent } from "./aptCustomTxIntent";
|
|
12
|
+
import { AtomPaymentIntent } from "./atomPaymentIntent";
|
|
13
|
+
import { AtomStakeIntent } from "./atomStakeIntent";
|
|
14
|
+
import { AtomUnstakeIntent } from "./atomUnstakeIntent";
|
|
15
|
+
import { BabyCreateBtcDelegationIntent } from "./babyCreateBtcDelegationIntent";
|
|
16
|
+
import { BabyWithdrawRewardIntent } from "./babyWithdrawRewardIntent";
|
|
17
|
+
import { BscDelegateIntent } from "./bscDelegateIntent";
|
|
18
|
+
import { BscUnDelegateIntent } from "./bscUndelegateIntent";
|
|
19
|
+
import { BscWithdrawUndelegateIntent } from "./bscWithdrawUndelegateIntent";
|
|
20
|
+
import { CantonAllocationAllocateIntent } from "./cantonAllocationAllocateIntent";
|
|
21
|
+
import { CantonAllocationOfferWithdrawnIntent } from "./cantonAllocationOfferWithdrawnIntent";
|
|
22
|
+
import { CantonAllocationRejectIntent } from "./cantonAllocationRejectIntent";
|
|
23
|
+
import { CantonAllocationRequestIntent } from "./cantonAllocationRequestIntent";
|
|
24
|
+
import { CantonCosignDelegationAcceptIntent } from "./cantonCosignDelegationAcceptIntent";
|
|
25
|
+
import { CantonCosignDelegationProposalIntent } from "./cantonCosignDelegationProposalIntent";
|
|
26
|
+
import { CantonCommandIntent } from "./cantonCommandIntent";
|
|
27
|
+
import { CantonPaymentIntent } from "./cantonPaymentIntent";
|
|
28
|
+
import { CantonTransferAcceptIntent } from "./cantonTransferAcceptIntent";
|
|
29
|
+
import { CantonTransferAcknowledgeIntent } from "./cantonTransferAcknowledgeIntent";
|
|
30
|
+
import { CantonTransferOfferWithdrawnIntent } from "./cantonTransferOfferWithdrawnIntent";
|
|
31
|
+
import { CantonTransferRejectIntent } from "./cantonTransferRejectIntent";
|
|
32
|
+
import { CantonEndInvestorOnboardingOfferIntent } from "./cantonEndInvestorOnboardingOfferIntent";
|
|
33
|
+
import { CantonEndInvestorOnboardingAcceptIntent } from "./cantonEndInvestorOnboardingAcceptIntent";
|
|
34
|
+
import { CantonEndInvestorOnboardingRejectIntent } from "./cantonEndInvestorOnboardingRejectIntent";
|
|
35
|
+
import { CantonParticipantOnboardingRequestIntent } from "./cantonParticipantOnboardingRequestIntent";
|
|
36
|
+
import {
|
|
37
|
+
CantonParticipantAllowListAddIntent,
|
|
38
|
+
CantonParticipantAllowListRemoveIntent,
|
|
39
|
+
} from "./cantonParticipantAllowListIntent";
|
|
40
|
+
import { ClaimIntent } from "./claimIntent";
|
|
41
|
+
import { CosmosContractCallIntent } from "./cosmosContractCallIntent";
|
|
42
|
+
import { CosmosPaymentIntent } from "./cosmosPaymentIntent";
|
|
43
|
+
import { CosmosStakeClaimRewardsIntent } from "./cosmosStakeClaimRewardsIntent";
|
|
44
|
+
import { CosmosStakeIntent } from "./cosmosStakeIntent";
|
|
45
|
+
import { CosmosSwitchValidatorIntent } from "./cosmosSwitchValidatorIntent";
|
|
46
|
+
import { CosmosUnstakeIntent } from "./cosmosUnstakeIntent";
|
|
47
|
+
import { DefiApproveIntent } from "./defiApproveIntent";
|
|
48
|
+
import { DefiDepositIntent } from "./defiDepositIntent";
|
|
49
|
+
import { DefiRedeemIntent } from "./defiRedeemIntent";
|
|
50
|
+
import { DefiWithdrawIntent } from "./defiWithdrawIntent";
|
|
51
|
+
import { WrapNativeIntent } from "./wrapNativeIntent";
|
|
52
|
+
import { UnwrapNativeIntent } from "./unwrapNativeIntent";
|
|
53
|
+
import { WrapApproveIntent } from "./wrapApproveIntent";
|
|
54
|
+
import { DotConsolidateIntent } from "./dotConsolidateIntent";
|
|
55
|
+
import { DotCreateAccountIntent } from "./dotCreateAccountIntent";
|
|
56
|
+
import { DotPaymentIntent } from "./dotPaymentIntent";
|
|
57
|
+
import { DotStakingIntent } from "./dotStakingIntent";
|
|
58
|
+
import { DotUnstakingIntent } from "./dotUnstakingIntent";
|
|
59
|
+
import { DotWithdrawStakeIntent } from "./dotWithdrawStakeIntent";
|
|
60
|
+
import { DelegateIntent } from "./delegateIntent";
|
|
61
|
+
import { EthAccelerationIntent } from "./ethAccelerationIntent";
|
|
62
|
+
import { EthConsolidateIntent } from "./ethConsolidateIntent";
|
|
63
|
+
import { EthConsolidateTokenIntent } from "./ethConsolidateTokenIntent";
|
|
64
|
+
import { EthFillNonceIntent } from "./ethFillNonceIntent";
|
|
65
|
+
import { FillNonceIntent } from "./fillNonceIntent";
|
|
66
|
+
import { EthPaymentIntent } from "./ethPaymentIntent";
|
|
67
|
+
import { EthStakingIntent } from "./ethStakingIntent";
|
|
68
|
+
import { EthTransferTokenIntent } from "./ethTransferTokenIntent";
|
|
69
|
+
import { StakeClaimRewardsIntent } from "./stakeClaimRewardsIntent";
|
|
70
|
+
import { UndelegateIntent } from "./undelegateIntent";
|
|
71
|
+
import { FeeAddressTransferIntent } from "./feeAddressTransferIntent";
|
|
72
|
+
import { HbarUpdateAccountIntent } from "./hbarUpdateAccountIntent";
|
|
73
|
+
import { HypeevmBridgeFundsIntent } from "./hypeevmBridgeFundsIntent";
|
|
74
|
+
import { HypeevmSpotTransferIntent } from "./hypeevmSpotTransferIntent";
|
|
75
|
+
import { HypeevmEnableBridgingIntent } from "./hypeevmEnableBridgingIntent";
|
|
76
|
+
import { IcpPaymentIntent } from "./icpPaymentIntent";
|
|
77
|
+
import { IotaConsolidateIntent } from "./iotaConsolidateIntent";
|
|
78
|
+
import { IotaPaymentIntent } from "./iotaPaymentIntent";
|
|
79
|
+
import { LightningPaymentIntent } from "./lightningPaymentIntent";
|
|
80
|
+
import { MmiSignMessageIntent } from "./mmiSignMessageIntent";
|
|
81
|
+
import { MmiSignTransactionIntent } from "./mmiSignTransactionIntent";
|
|
82
|
+
import { NearStakeIntent } from "./nearStakeIntent";
|
|
83
|
+
import { NearUnstakeIntent } from "./nearUnstakeIntent";
|
|
84
|
+
import { NearWithdrawIntent } from "./nearWithdrawIntent";
|
|
85
|
+
import { PolyxCreateAccountIntent } from "./polyxCreateAccountIntent";
|
|
86
|
+
import { PolyxPreApproveAssetIntent } from "./polyxPreApproveAssetIntent";
|
|
87
|
+
import { PolyxStakeIntent } from "./polyxStakeIntent";
|
|
88
|
+
import { PolyxSwitchValidatorIntent } from "./polyxSwitchValidatorIntent";
|
|
89
|
+
import { PolyxUnstakeIntent } from "./polyxUnstakeIntent";
|
|
90
|
+
import { PolyxWithdrawIntent } from "./polyxWithdrawIntent";
|
|
91
|
+
import { SolAuthorizeIntent } from "./solAuthorizeIntent";
|
|
92
|
+
import { SolClaimIntent } from "./solClaimIntent";
|
|
93
|
+
import { SolCloseAssociatedTokenAccountIntent } from "./solCloseAssociatedTokenAccountIntent";
|
|
94
|
+
import { SolConsolidateIntent } from "./solConsolidateIntent";
|
|
95
|
+
import { SolCreateAssociatedTokenAccountIntent } from "./solCreateAssociatedTokenAccountIntent";
|
|
96
|
+
import { SolCustomTxIntent } from "./solCustomTxIntent";
|
|
97
|
+
import { SolDeactivateIntent } from "./solDeactivateIntent";
|
|
98
|
+
import { SolDelegateIntent } from "./solDelegateIntent";
|
|
99
|
+
import { SolGoUnstakeIntent } from "./solGoUnstakeIntent";
|
|
100
|
+
import { SolPaymentIntent } from "./solPaymentIntent";
|
|
101
|
+
import { SolStakeIntent } from "./solStakeIntent";
|
|
102
|
+
import { SolUnstakeIntent } from "./solUnstakeIntent";
|
|
103
|
+
import { SolVersionedCustomTxIntent } from "./solVersionedCustomTxIntent";
|
|
104
|
+
import { SubstrateConsolidateIntent } from "./substrateConsolidateIntent";
|
|
105
|
+
import { SubstratePaymentIntent } from "./substratePaymentIntent";
|
|
106
|
+
import { SuiConsolidateIntent } from "./suiConsolidateIntent";
|
|
107
|
+
import { SuiCustomTxIntent } from "./suiCustomTxIntent";
|
|
108
|
+
import { SuiGoUnstakeIntent } from "./suiGoUnstakeIntent";
|
|
109
|
+
import { SuiPaymentIntent } from "./suiPaymentIntent";
|
|
110
|
+
import { SuiStakingIntent } from "./suiStakingIntent";
|
|
111
|
+
import { SuiUnstakingIntent } from "./suiUnstakingIntent";
|
|
112
|
+
import { TaoClaimRootIntent } from "./taoClaimRootIntent";
|
|
113
|
+
import { TaoStakeIntent } from "./taoStakeIntent";
|
|
114
|
+
import { TaoSwitchValidatorIntent } from "./taoSwitchValidatorIntent";
|
|
115
|
+
import { TaoTransferStakeIntent } from "./taoTransferStakeIntent";
|
|
116
|
+
import { TaoUnstakeIntent } from "./taoUnstakeIntent";
|
|
117
|
+
import { TokenApprovalIntent } from "./tokenApprovalIntent";
|
|
118
|
+
import { TonConsolidateIntent } from "./tonConsolidateIntent";
|
|
119
|
+
import { TonDelegateIntent } from "./tonDelegateIntent";
|
|
120
|
+
import { TonMultiNominatorDelegateIntent } from "./tonMultiNominatorDelegateIntent";
|
|
121
|
+
import { TonMultiNominatorUndelegateIntent } from "./tonMultiNominatorUndelegateIntent";
|
|
122
|
+
import { TonPaymentIntent } from "./tonPaymentIntent";
|
|
123
|
+
import { TonSingleNominatorDelegateIntent } from "./tonSingleNominatorDelegateIntent";
|
|
124
|
+
import { TonSingleNominatorUndelegateIntent } from "./tonSingleNominatorUndelegateIntent";
|
|
125
|
+
import { TonUndelegateIntent } from "./tonUndelegateIntent";
|
|
126
|
+
import { TonWhalesDelegateIntent } from "./tonWhalesDelegateIntent";
|
|
127
|
+
import { TonWhalesUndelegateIntent } from "./tonWhalesUndelegateIntent";
|
|
128
|
+
import { TrxClaimRewardsIntent } from "./trxClaimRewardsIntent";
|
|
129
|
+
import { TrxDelegateResourceIntent } from "./trxDelegateResourceIntent";
|
|
130
|
+
import { TrxFreezeIntent } from "./trxFreezeIntent";
|
|
131
|
+
import { TrxUndelegateResourceIntent } from "./trxUndelegateResourceIntent";
|
|
132
|
+
import { TrxUnfreezeIntent } from "./trxUnfreezeIntent";
|
|
133
|
+
import { TrxVoteIntent } from "./trxVoteIntent";
|
|
134
|
+
import { TrxWithdrawExpireUnfreezeIntent } from "./trxWithdrawExpireUnfreezeIntent";
|
|
135
|
+
import { VetStakingIntent } from "./vetStakingIntent";
|
|
136
|
+
import { VetDelegateIntent } from "./vetDelegateIntent";
|
|
137
|
+
import {
|
|
138
|
+
VetExitDelegationIntent,
|
|
139
|
+
VetBurnNFTIntent,
|
|
140
|
+
} from "./vetUnstakingIntent";
|
|
141
|
+
import { VetStakeClaimRewardsIntent } from "./vetStakeClaimRewardsIntent";
|
|
142
|
+
import { VetValidatorRegistrationIntent } from "./vetValidatorRegistrationIntent";
|
|
143
|
+
import { VetIncreaseStakeIntent } from "./vetIncreaseStakeIntent";
|
|
144
|
+
import { VetDecreaseStakeIntent } from "./vetDecreaseStakeIntent";
|
|
145
|
+
import { VetSignalExitIntent } from "./vetSignalExitIntent";
|
|
146
|
+
import { VetWithdrawStakeIntent } from "./vetWithdrawStakeIntent";
|
|
147
|
+
import { WalletRecoveryIntent } from "./walletRecoveryIntent";
|
|
148
|
+
import { BaseStakeIntentWithCalldata } from "./baseStakeIntentWithCalldata";
|
|
149
|
+
import { StakeWithCallDataIntent } from "./stakeWithCallDataIntent";
|
|
150
|
+
import { SwitchValidatorWithCallDataIntent } from "./switchValidatorWithCallDataIntent";
|
|
151
|
+
import { CoreDaoDelegateIntent } from "./coredaoDelegateIntent";
|
|
152
|
+
import { CoreDaoUndelegateIntent } from "./coredaoUndelegateIntent";
|
|
153
|
+
import { CoreDaoClaimIntent } from "./coredaoClaimIntent";
|
|
154
|
+
import { EthLikeStakeIntent } from "./ethLikeStakeIntent";
|
|
155
|
+
import { BeraDelegateIntent } from "./beraDelegateIntent";
|
|
156
|
+
import { WalrusStakingIntent } from "./walrusStakingIntent";
|
|
157
|
+
import { WalrusUndelegateIntent } from "./walrusUndelegateIntent";
|
|
158
|
+
import { WalrusWithdrawIntent } from "./walrusWithdrawIntent";
|
|
159
|
+
import { XdcUploadKycIntent, XdcProposeIntent } from "./xdcStakingIntent";
|
|
160
|
+
import { XdcResignIntent, XdcWithdrawIntent } from "./xdcUnstakingIntent";
|
|
161
|
+
import { StacksRegisterForBondIntent } from "./stacksRegisterForBondIntent";
|
|
162
|
+
import { BaseIntent } from "./baseIntent";
|
|
163
|
+
|
|
164
|
+
/**
|
|
165
|
+
* Intent schema groups for `TransactionRequestFull` and `TransactionRequestLite` (WCI-2003).
|
|
166
|
+
*
|
|
167
|
+
* `TransactionIntent` deliberately stays unchanged — these groups are additive and exist so the
|
|
168
|
+
* generated OpenAPI can scope intents to the TxRequest variant they can actually be used with.
|
|
169
|
+
* Previously only `TransactionRequestLite` overrode `intent`, so every intent variant rendered
|
|
170
|
+
* under Lite and `TransactionRequestFull.intent` rendered unconstrained.
|
|
171
|
+
*
|
|
172
|
+
* Membership rule — an intent is Full-only when its coin cannot run the Lite flow, i.e. when ANY
|
|
173
|
+
* of the following hold for the coin family that owns the intent:
|
|
174
|
+
* - the primary key curve is secp256k1 (Lite is EdDSA TSS incremental signing);
|
|
175
|
+
* - the family uses the legacy pre-TxRequest signing flow (e.g. hbar, trx, stx, btc/lightning);
|
|
176
|
+
* - the family has no TSS support at all (e.g. hbar);
|
|
177
|
+
* - the intent is rejected under apiVersion=lite by wallet-platform regardless of coin
|
|
178
|
+
* (message signing and wrapApprove).
|
|
179
|
+
* Everything else is Common. Lite vs Full is chosen by the wallet (EdDSA hot wallet makes Lite
|
|
180
|
+
* available; cold/custodial is always Full), never by the intent, so the Full set and the Common
|
|
181
|
+
* set together cover every intent and no intent is Lite-only.
|
|
182
|
+
*
|
|
183
|
+
* Together the groups PARTITION `TransactionIntent`: every coin-specific union member appears in
|
|
184
|
+
* exactly one of Common or Full-only, and none appears in both. The `BaseIntent` catch-all is the
|
|
185
|
+
* one member that is shared — it is `TransactionIntentLiteOnly`'s only entry, and it is also added
|
|
186
|
+
* at the point of use in `TransactionRequestLite.intent` and `TransactionRequestFull.intent` so
|
|
187
|
+
* each variant keeps accepting intents that have no codec yet.
|
|
188
|
+
*
|
|
189
|
+
* ADDING A NEW INTENT — any intent added to the `TransactionIntent` union MUST also be added to
|
|
190
|
+
* one of the groups below, in the same relative order as it appears in the union. Apply the
|
|
191
|
+
* membership rule above: Full-only if its coin cannot run the Lite flow, Common otherwise.
|
|
192
|
+
* `intentGroups.test.ts` asserts `Common ∪ FullOnly ∪ LiteOnly === TransactionIntent`, so an
|
|
193
|
+
* intent added to the union without being placed in a group fails the build rather than silently
|
|
194
|
+
* dropping out of the generated spec.
|
|
195
|
+
*
|
|
196
|
+
* `TransactionIntentLiteOnly` IS `BaseIntent` — there is currently no Lite-exclusive intent, and
|
|
197
|
+
* the group is declared as the open catch-all so it is still a real, emittable codec (`t.never`
|
|
198
|
+
* has no structure, contributes nothing to the generated spec, and is not assignable to io-ts'
|
|
199
|
+
* `Mixed`). If a genuinely Lite-exclusive intent ever appears, drop the `BaseIntent` aliasing and
|
|
200
|
+
* make the group a `t.union([...])` of the real intents, and update the test that pins the group
|
|
201
|
+
* to the catch-all — the catch-all is already added at both use sites, so nothing else needs it.
|
|
202
|
+
*/
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* Intents usable with BOTH `TransactionRequestFull` and `TransactionRequestLite` — every
|
|
206
|
+
* Lite-capable coin also supports Full, so this is a superset of the Lite-usable intents.
|
|
207
|
+
* Coin families: Ada, Apt, Canton, Dot, Iota, Near, Polyx, Sol, Substrate, Sui, Tao, Ton and
|
|
208
|
+
* Walrus (which rides the Sui handler).
|
|
209
|
+
*
|
|
210
|
+
* The coin-agnostic intents here are the ones genuinely reachable from a Lite-capable coin:
|
|
211
|
+
* `FillNonceIntent` (the base that `EthFillNonceIntent` extends; non-EVM coins use it directly),
|
|
212
|
+
* `FeeAddressTransferIntent` (IOTA gas tank), `WalletRecoveryIntent` (chain-agnostic) and
|
|
213
|
+
* `StakeClaimRewardsIntent`. The last is a special case: it is the SAME codec object as
|
|
214
|
+
* `AdaStakeClaimRewardsIntent`, so it cannot be scoped to Full-only without also removing Ada's
|
|
215
|
+
* claim-rewards intent from Lite, even though its own JSDoc describes EVM chains.
|
|
216
|
+
*/
|
|
217
|
+
export const TransactionIntentCommon = t.union([
|
|
218
|
+
AdaConsolidateIntent,
|
|
219
|
+
AdaPaymentIntent,
|
|
220
|
+
AdaStakeClaimRewardsIntent,
|
|
221
|
+
AdaRealFiStakeIntent,
|
|
222
|
+
AdaStakeIntent,
|
|
223
|
+
AdaRealFiUnstakeIntent,
|
|
224
|
+
AdaUnstakeIntent,
|
|
225
|
+
AdaRealFiCancelIntent,
|
|
226
|
+
AdaRealFiClaimTimelockIntent,
|
|
227
|
+
AdaVoteDelegationIntent,
|
|
228
|
+
AptCustomTxIntent,
|
|
229
|
+
CantonAllocationAllocateIntent,
|
|
230
|
+
CantonAllocationOfferWithdrawnIntent,
|
|
231
|
+
CantonAllocationRejectIntent,
|
|
232
|
+
CantonAllocationRequestIntent,
|
|
233
|
+
CantonCosignDelegationAcceptIntent,
|
|
234
|
+
CantonCosignDelegationProposalIntent,
|
|
235
|
+
CantonCommandIntent,
|
|
236
|
+
CantonPaymentIntent,
|
|
237
|
+
CantonTransferAcceptIntent,
|
|
238
|
+
CantonTransferAcknowledgeIntent,
|
|
239
|
+
CantonTransferOfferWithdrawnIntent,
|
|
240
|
+
CantonTransferRejectIntent,
|
|
241
|
+
CantonEndInvestorOnboardingOfferIntent,
|
|
242
|
+
CantonEndInvestorOnboardingAcceptIntent,
|
|
243
|
+
CantonEndInvestorOnboardingRejectIntent,
|
|
244
|
+
CantonParticipantOnboardingRequestIntent,
|
|
245
|
+
CantonParticipantAllowListAddIntent,
|
|
246
|
+
CantonParticipantAllowListRemoveIntent,
|
|
247
|
+
DotConsolidateIntent,
|
|
248
|
+
DotCreateAccountIntent,
|
|
249
|
+
DotPaymentIntent,
|
|
250
|
+
DotStakingIntent,
|
|
251
|
+
DotUnstakingIntent,
|
|
252
|
+
DotWithdrawStakeIntent,
|
|
253
|
+
FillNonceIntent,
|
|
254
|
+
StakeClaimRewardsIntent,
|
|
255
|
+
FeeAddressTransferIntent,
|
|
256
|
+
IotaConsolidateIntent,
|
|
257
|
+
IotaPaymentIntent,
|
|
258
|
+
NearStakeIntent,
|
|
259
|
+
NearUnstakeIntent,
|
|
260
|
+
NearWithdrawIntent,
|
|
261
|
+
PolyxCreateAccountIntent,
|
|
262
|
+
PolyxPreApproveAssetIntent,
|
|
263
|
+
PolyxStakeIntent,
|
|
264
|
+
PolyxSwitchValidatorIntent,
|
|
265
|
+
PolyxUnstakeIntent,
|
|
266
|
+
PolyxWithdrawIntent,
|
|
267
|
+
SolAuthorizeIntent,
|
|
268
|
+
SolClaimIntent,
|
|
269
|
+
SolCloseAssociatedTokenAccountIntent,
|
|
270
|
+
SolConsolidateIntent,
|
|
271
|
+
SolCreateAssociatedTokenAccountIntent,
|
|
272
|
+
SolCustomTxIntent,
|
|
273
|
+
SolDeactivateIntent,
|
|
274
|
+
SolDelegateIntent,
|
|
275
|
+
SolGoUnstakeIntent,
|
|
276
|
+
SolPaymentIntent,
|
|
277
|
+
SolStakeIntent,
|
|
278
|
+
SolUnstakeIntent,
|
|
279
|
+
SolVersionedCustomTxIntent,
|
|
280
|
+
SubstrateConsolidateIntent,
|
|
281
|
+
SubstratePaymentIntent,
|
|
282
|
+
SuiConsolidateIntent,
|
|
283
|
+
SuiCustomTxIntent,
|
|
284
|
+
SuiGoUnstakeIntent,
|
|
285
|
+
SuiPaymentIntent,
|
|
286
|
+
SuiStakingIntent,
|
|
287
|
+
SuiUnstakingIntent,
|
|
288
|
+
TaoClaimRootIntent,
|
|
289
|
+
TaoStakeIntent,
|
|
290
|
+
TaoSwitchValidatorIntent,
|
|
291
|
+
TaoTransferStakeIntent,
|
|
292
|
+
TaoUnstakeIntent,
|
|
293
|
+
TonConsolidateIntent,
|
|
294
|
+
TonDelegateIntent,
|
|
295
|
+
TonMultiNominatorDelegateIntent,
|
|
296
|
+
TonMultiNominatorUndelegateIntent,
|
|
297
|
+
TonPaymentIntent,
|
|
298
|
+
TonSingleNominatorDelegateIntent,
|
|
299
|
+
TonSingleNominatorUndelegateIntent,
|
|
300
|
+
TonUndelegateIntent,
|
|
301
|
+
TonWhalesDelegateIntent,
|
|
302
|
+
TonWhalesUndelegateIntent,
|
|
303
|
+
WalletRecoveryIntent,
|
|
304
|
+
WalrusStakingIntent,
|
|
305
|
+
WalrusUndelegateIntent,
|
|
306
|
+
WalrusWithdrawIntent,
|
|
307
|
+
]);
|
|
308
|
+
|
|
309
|
+
export type TransactionIntentCommon = t.TypeOf<typeof TransactionIntentCommon>;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Intents usable ONLY with `TransactionRequestFull`, because the owning coin cannot run the
|
|
313
|
+
* Lite flow. Coin families: Atom/CosmosLike, Baby, Bera, Bsc, CoreDao, EthLike (incl. DeFi,
|
|
314
|
+
* MMI, ERC-7984 wrap), Hbar, Hypeevm, Icp, Lightning, Stacks, Trx, Vet and Xdc.
|
|
315
|
+
*
|
|
316
|
+
* `ClaimIntent`, `DelegateIntent` and `UndelegateIntent` are here despite having no coin prefix:
|
|
317
|
+
* each documents itself as EVM-only, no Ed25519 codec derives from them (only `VetDelegateIntent`
|
|
318
|
+
* and `VetUnstakingIntent` do, and Vet is secp256k1), and every Lite-capable coin that uses those
|
|
319
|
+
* intentTypes has its own codec (e.g. `SolClaimIntent`, `SolDelegateIntent`, `TonDelegateIntent`,
|
|
320
|
+
* `TonUndelegateIntent`, `WalrusUndelegateIntent`).
|
|
321
|
+
*/
|
|
322
|
+
export const TransactionIntentFullOnly = t.union([
|
|
323
|
+
AtomPaymentIntent,
|
|
324
|
+
AtomStakeIntent,
|
|
325
|
+
AtomUnstakeIntent,
|
|
326
|
+
BabyCreateBtcDelegationIntent,
|
|
327
|
+
BabyWithdrawRewardIntent,
|
|
328
|
+
BscDelegateIntent,
|
|
329
|
+
BscUnDelegateIntent,
|
|
330
|
+
BscWithdrawUndelegateIntent,
|
|
331
|
+
ClaimIntent,
|
|
332
|
+
CosmosContractCallIntent,
|
|
333
|
+
CosmosPaymentIntent,
|
|
334
|
+
CosmosStakeClaimRewardsIntent,
|
|
335
|
+
CosmosStakeIntent,
|
|
336
|
+
CosmosSwitchValidatorIntent,
|
|
337
|
+
CosmosUnstakeIntent,
|
|
338
|
+
DefiApproveIntent,
|
|
339
|
+
DefiDepositIntent,
|
|
340
|
+
DefiRedeemIntent,
|
|
341
|
+
DefiWithdrawIntent,
|
|
342
|
+
WrapNativeIntent,
|
|
343
|
+
UnwrapNativeIntent,
|
|
344
|
+
WrapApproveIntent,
|
|
345
|
+
DelegateIntent,
|
|
346
|
+
EthAccelerationIntent,
|
|
347
|
+
EthConsolidateIntent,
|
|
348
|
+
EthConsolidateTokenIntent,
|
|
349
|
+
EthFillNonceIntent,
|
|
350
|
+
EthPaymentIntent,
|
|
351
|
+
EthStakingIntent,
|
|
352
|
+
EthTransferTokenIntent,
|
|
353
|
+
UndelegateIntent,
|
|
354
|
+
HbarUpdateAccountIntent,
|
|
355
|
+
HypeevmBridgeFundsIntent,
|
|
356
|
+
HypeevmSpotTransferIntent,
|
|
357
|
+
HypeevmEnableBridgingIntent,
|
|
358
|
+
IcpPaymentIntent,
|
|
359
|
+
LightningPaymentIntent,
|
|
360
|
+
MmiSignMessageIntent,
|
|
361
|
+
MmiSignTransactionIntent,
|
|
362
|
+
TokenApprovalIntent,
|
|
363
|
+
TrxClaimRewardsIntent,
|
|
364
|
+
TrxDelegateResourceIntent,
|
|
365
|
+
TrxFreezeIntent,
|
|
366
|
+
TrxUndelegateResourceIntent,
|
|
367
|
+
TrxUnfreezeIntent,
|
|
368
|
+
TrxVoteIntent,
|
|
369
|
+
TrxWithdrawExpireUnfreezeIntent,
|
|
370
|
+
VetStakingIntent,
|
|
371
|
+
VetDelegateIntent,
|
|
372
|
+
VetExitDelegationIntent,
|
|
373
|
+
VetBurnNFTIntent,
|
|
374
|
+
VetStakeClaimRewardsIntent,
|
|
375
|
+
VetValidatorRegistrationIntent,
|
|
376
|
+
VetIncreaseStakeIntent,
|
|
377
|
+
VetDecreaseStakeIntent,
|
|
378
|
+
VetSignalExitIntent,
|
|
379
|
+
VetWithdrawStakeIntent,
|
|
380
|
+
BaseStakeIntentWithCalldata,
|
|
381
|
+
StakeWithCallDataIntent,
|
|
382
|
+
SwitchValidatorWithCallDataIntent,
|
|
383
|
+
CoreDaoDelegateIntent,
|
|
384
|
+
CoreDaoUndelegateIntent,
|
|
385
|
+
CoreDaoClaimIntent,
|
|
386
|
+
EthLikeStakeIntent,
|
|
387
|
+
BeraDelegateIntent,
|
|
388
|
+
XdcUploadKycIntent,
|
|
389
|
+
XdcProposeIntent,
|
|
390
|
+
XdcResignIntent,
|
|
391
|
+
XdcWithdrawIntent,
|
|
392
|
+
StacksRegisterForBondIntent,
|
|
393
|
+
]);
|
|
394
|
+
|
|
395
|
+
export type TransactionIntentFullOnly = t.TypeOf<
|
|
396
|
+
typeof TransactionIntentFullOnly
|
|
397
|
+
>;
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Intents usable ONLY with `TransactionRequestLite`. No coin-specific intent is Lite-exclusive,
|
|
401
|
+
* so this is the open `BaseIntent` catch-all — see the note at the top of this file.
|
|
402
|
+
*/
|
|
403
|
+
export const TransactionIntentLiteOnly = BaseIntent;
|
|
404
|
+
|
|
405
|
+
export type TransactionIntentLiteOnly = t.TypeOf<
|
|
406
|
+
typeof TransactionIntentLiteOnly
|
|
407
|
+
>;
|
|
@@ -3,7 +3,13 @@ import { DateFromISOString, NonEmptyString } from "io-ts-types";
|
|
|
3
3
|
import { WalletIdString } from "../wallet";
|
|
4
4
|
import { WalletTypes } from "../wallet/walletTypes";
|
|
5
5
|
import { EnterpriseIdString } from "../enterprise";
|
|
6
|
-
import {
|
|
6
|
+
import { TransactionRequestState } from ".";
|
|
7
|
+
import { BaseIntent } from "./intents/baseIntent";
|
|
8
|
+
import {
|
|
9
|
+
TransactionIntentCommon,
|
|
10
|
+
TransactionIntentFullOnly,
|
|
11
|
+
TransactionIntentLiteOnly,
|
|
12
|
+
} from "./intents/intentGroups";
|
|
7
13
|
import { TransactionRequestApiVersion } from "./transactionRequestApiVersion";
|
|
8
14
|
import { CommitmentShare } from "./commitmentShare";
|
|
9
15
|
import { SignatureShare } from "./signatureShare";
|
|
@@ -96,7 +102,13 @@ export const TransactionRequestLite = t.intersection([
|
|
|
96
102
|
TransactionRequestBase,
|
|
97
103
|
t.partial({
|
|
98
104
|
/** The intent of the transaction request */
|
|
99
|
-
intent: t.union([
|
|
105
|
+
intent: t.union([
|
|
106
|
+
TransactionIntentLiteOnly,
|
|
107
|
+
TransactionIntentCommon,
|
|
108
|
+
BaseIntent,
|
|
109
|
+
t.null,
|
|
110
|
+
t.unknown,
|
|
111
|
+
]) as t.Type<unknown>,
|
|
100
112
|
/** Holds all unsigned transactions that will be used to fulfill the TxRequest for MPC wallets. */
|
|
101
113
|
unsignedTxs: t.array(UnsignedTransaction),
|
|
102
114
|
/** Only used for MPC coins. This is used to collect signature shares from and exchange them with the user. */
|
|
@@ -112,6 +124,14 @@ export type TransactionRequestLite = t.TypeOf<typeof TransactionRequestLite>;
|
|
|
112
124
|
export const TransactionRequestFull = t.intersection([
|
|
113
125
|
TransactionRequestBase,
|
|
114
126
|
t.partial({
|
|
127
|
+
/** The intent of the transaction request */
|
|
128
|
+
intent: t.union([
|
|
129
|
+
TransactionIntentFullOnly,
|
|
130
|
+
TransactionIntentCommon,
|
|
131
|
+
BaseIntent,
|
|
132
|
+
t.null,
|
|
133
|
+
t.unknown,
|
|
134
|
+
]) as t.Type<unknown>,
|
|
115
135
|
/** The transactions associated with the transaction request */
|
|
116
136
|
transactions: t.array(Transaction),
|
|
117
137
|
/** The messages associated with the transaction request */
|