@bitgo/public-types 7.6.2 → 7.6.4
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/baseIntent.d.ts +100 -2
- package/dist/src/schema/transactionRequest/intents/baseIntent.js +9 -18
- package/dist/src/schema/transactionRequest/intents/baseIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/intent.d.ts +99 -13
- package/dist/src/schema/transactionRequest/intents/intentGroups.d.ts +99 -13
- package/dist/src/schema/transactionRequest/transactionRequest.js +2 -2
- package/dist/src/schema/transactionRequest/transactionRequest.js.map +1 -1
- package/package.json +1 -1
- package/src/schema/transactionRequest/intents/baseIntent.ts +29 -78
- package/src/schema/transactionRequest/transactionRequest.ts +3 -3
|
@@ -99,8 +99,106 @@ export declare const BaseIntent: t.IntersectionC<[t.TypeC<{
|
|
|
99
99
|
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
100
100
|
}>]>;
|
|
101
101
|
export type BaseIntent = t.TypeOf<typeof BaseIntent>;
|
|
102
|
-
export declare const BaseIntentCatchAll: t.
|
|
103
|
-
|
|
102
|
+
export declare const BaseIntentCatchAll: t.RefinementC<t.IntersectionC<[t.TypeC<{
|
|
103
|
+
intentType: t.KeyofC<{
|
|
104
|
+
payment: t.LiteralC<"payment">;
|
|
105
|
+
transferToken: t.LiteralC<"transferToken">;
|
|
106
|
+
consolidate: t.LiteralC<"consolidate">;
|
|
107
|
+
consolidateToken: t.LiteralC<"consolidateToken">;
|
|
108
|
+
fanout: t.LiteralC<"fanout">;
|
|
109
|
+
stake: t.LiteralC<"stake">;
|
|
110
|
+
unstake: t.LiteralC<"unstake">;
|
|
111
|
+
cancel: t.LiteralC<"cancel">;
|
|
112
|
+
delegate: t.LiteralC<"delegate">;
|
|
113
|
+
undelegate: t.LiteralC<"undelegate">;
|
|
114
|
+
switchValidator: t.LiteralC<"switchValidator">;
|
|
115
|
+
claim: t.LiteralC<"claim">;
|
|
116
|
+
stakeClaimRewards: t.LiteralC<"stakeClaimRewards">;
|
|
117
|
+
pledge: t.LiteralC<"pledge">;
|
|
118
|
+
voteDelegation: t.LiteralC<"voteDelegation">;
|
|
119
|
+
vote: t.LiteralC<"vote">;
|
|
120
|
+
createAccount: t.LiteralC<"createAccount">;
|
|
121
|
+
updateAccount: t.LiteralC<"updateAccount">;
|
|
122
|
+
addTrustLine: t.LiteralC<"addTrustLine">;
|
|
123
|
+
removeTrustLine: t.LiteralC<"removeTrustLine">;
|
|
124
|
+
signMessage: t.LiteralC<"signMessage">;
|
|
125
|
+
signTypedStructuredData: t.LiteralC<"signTypedStructuredData">;
|
|
126
|
+
enableToken: t.LiteralC<"enableToken">;
|
|
127
|
+
disableToken: t.LiteralC<"disableToken">;
|
|
128
|
+
authorize: t.LiteralC<"authorize">;
|
|
129
|
+
acceleration: t.LiteralC<"acceleration">;
|
|
130
|
+
fillNonce: t.LiteralC<"fillNonce">;
|
|
131
|
+
walletRecovery: t.LiteralC<"walletRecovery">;
|
|
132
|
+
contractCall: t.LiteralC<"contractCall">;
|
|
133
|
+
deactivate: t.LiteralC<"deactivate">;
|
|
134
|
+
customTx: t.LiteralC<"customTx">;
|
|
135
|
+
confidentialTransfer: t.LiteralC<"confidentialTransfer">;
|
|
136
|
+
closeAssociatedTokenAccount: t.LiteralC<"closeAssociatedTokenAccount">;
|
|
137
|
+
stakeWithCallData: t.LiteralC<"stakeWithCallData">;
|
|
138
|
+
unstakeWithCallData: t.LiteralC<"unstakeWithCallData">;
|
|
139
|
+
switchValidatorWithCallData: t.LiteralC<"switchValidatorWithCallData">;
|
|
140
|
+
feeAddressTransfer: t.LiteralC<"feeAddressTransfer">;
|
|
141
|
+
tokenApproval: t.LiteralC<"tokenApproval">;
|
|
142
|
+
transferStake: t.LiteralC<"transferStake">;
|
|
143
|
+
validatorRegistration: t.LiteralC<"validatorRegistration">;
|
|
144
|
+
increaseStake: t.LiteralC<"increaseStake">;
|
|
145
|
+
decreaseStake: t.LiteralC<"decreaseStake">;
|
|
146
|
+
signalExit: t.LiteralC<"signalExit">;
|
|
147
|
+
withdrawStake: t.LiteralC<"withdrawStake">;
|
|
148
|
+
spotTransfer: t.LiteralC<"spotTransfer">;
|
|
149
|
+
bridgeFunds: t.LiteralC<"bridgeFunds">;
|
|
150
|
+
enableBridging: t.LiteralC<"enableBridging">;
|
|
151
|
+
goUnstake: t.LiteralC<"goUnstake">;
|
|
152
|
+
createBtcDelegation: t.LiteralC<"createBtcDelegation">;
|
|
153
|
+
transferAccept: t.LiteralC<"transferAccept">;
|
|
154
|
+
transferReject: t.LiteralC<"transferReject">;
|
|
155
|
+
transferAcknowledge: t.LiteralC<"transferAcknowledge">;
|
|
156
|
+
transferOfferWithdrawn: t.LiteralC<"transferOfferWithdrawn">;
|
|
157
|
+
cosignDelegationProposal: t.LiteralC<"cosignDelegationProposal">;
|
|
158
|
+
cosignDelegationAccept: t.LiteralC<"cosignDelegationAccept">;
|
|
159
|
+
allocationRequest: t.LiteralC<"allocationRequest">;
|
|
160
|
+
cantonCommand: t.LiteralC<"cantonCommand">;
|
|
161
|
+
cantonBroadridgeStandingDelegation: t.LiteralC<"cantonBroadridgeStandingDelegation">;
|
|
162
|
+
allocationAllocate: t.LiteralC<"allocationAllocate">;
|
|
163
|
+
allocationOfferWithdrawn: t.LiteralC<"allocationOfferWithdrawn">;
|
|
164
|
+
allocationReject: t.LiteralC<"allocationReject">;
|
|
165
|
+
cantonEndInvestorOnboardingOffer: t.LiteralC<"cantonEndInvestorOnboardingOffer">;
|
|
166
|
+
cantonEndInvestorOnboardingAccept: t.LiteralC<"cantonEndInvestorOnboardingAccept">;
|
|
167
|
+
cantonEndInvestorOnboardingReject: t.LiteralC<"cantonEndInvestorOnboardingReject">;
|
|
168
|
+
cantonEndInvestorOnboardingCancel: t.LiteralC<"cantonEndInvestorOnboardingCancel">;
|
|
169
|
+
cantonEndInvestorOffboarding: t.LiteralC<"cantonEndInvestorOffboarding">;
|
|
170
|
+
cantonParticipantOnboardingRequest: t.LiteralC<"cantonParticipantOnboardingRequest">;
|
|
171
|
+
cantonParticipantAllowListAdd: t.LiteralC<"cantonParticipantAllowListAdd">;
|
|
172
|
+
cantonParticipantAllowListRemove: t.LiteralC<"cantonParticipantAllowListRemove">;
|
|
173
|
+
cantonGovernanceLockCreate: t.LiteralC<"cantonGovernanceLockCreate">;
|
|
174
|
+
cantonGovernanceLockUnlock: t.LiteralC<"cantonGovernanceLockUnlock">;
|
|
175
|
+
cantonGovernanceLockProvisionalUnlock: t.LiteralC<"cantonGovernanceLockProvisionalUnlock">;
|
|
176
|
+
cantonGovernanceLockWithdraw: t.LiteralC<"cantonGovernanceLockWithdraw">;
|
|
177
|
+
cantonGovernanceLockProposeSubstitution: t.LiteralC<"cantonGovernanceLockProposeSubstitution">;
|
|
178
|
+
cantonGovernanceLockProposeTransfer: t.LiteralC<"cantonGovernanceLockProposeTransfer">;
|
|
179
|
+
"defi-deposit": t.LiteralC<"defi-deposit">;
|
|
180
|
+
"defi-redeem": t.LiteralC<"defi-redeem">;
|
|
181
|
+
"defi-approve": t.LiteralC<"defi-approve">;
|
|
182
|
+
"defi-withdraw": t.LiteralC<"defi-withdraw">;
|
|
183
|
+
"wrap-native": t.LiteralC<"wrap-native">;
|
|
184
|
+
"unwrap-native": t.LiteralC<"unwrap-native">;
|
|
185
|
+
wrapApprove: t.LiteralC<"wrapApprove">;
|
|
186
|
+
wrap: t.LiteralC<"wrap">;
|
|
187
|
+
unwrap: t.LiteralC<"unwrap">;
|
|
188
|
+
finalizeUnwrap: t.LiteralC<"finalizeUnwrap">;
|
|
189
|
+
delegateResource: t.LiteralC<"delegateResource">;
|
|
190
|
+
undelegateResource: t.LiteralC<"undelegateResource">;
|
|
191
|
+
stacksRegisterForBond: t.LiteralC<"stacksRegisterForBond">;
|
|
192
|
+
export: t.LiteralC<"export">;
|
|
193
|
+
import: t.LiteralC<"import">;
|
|
194
|
+
importtoc: t.LiteralC<"importtoc">;
|
|
195
|
+
}>;
|
|
196
|
+
}>, t.PartialC<{
|
|
197
|
+
sequenceId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
198
|
+
comment: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
199
|
+
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
200
|
+
}>]>>;
|
|
201
|
+
export type BaseIntentCatchAll = t.TypeOf<typeof BaseIntentCatchAll>;
|
|
104
202
|
export declare const BaseIntentWithoutNonce: t.IntersectionC<[t.TypeC<{
|
|
105
203
|
intentType: t.KeyofC<{
|
|
106
204
|
payment: t.LiteralC<"payment">;
|
|
@@ -30,17 +30,15 @@ const utils_1 = require("../../../utils");
|
|
|
30
30
|
const recipientEntry_1 = require("./recipientEntry");
|
|
31
31
|
const tokenRecipientEntry_1 = require("./tokenRecipientEntry");
|
|
32
32
|
const amount_1 = require("./amount");
|
|
33
|
-
const BaseIntentRequired = t.type({
|
|
34
|
-
intentType: intentType_1.IntentType,
|
|
35
|
-
});
|
|
36
|
-
const BaseIntentOptional = t.partial({
|
|
37
|
-
sequenceId: utils_1.optionalString,
|
|
38
|
-
comment: utils_1.optionalString,
|
|
39
|
-
nonce: (0, utils_1.Optional)(t.union([t.string, t.number])),
|
|
40
|
-
});
|
|
41
33
|
exports.BaseIntent = t.intersection([
|
|
42
|
-
|
|
43
|
-
|
|
34
|
+
t.type({
|
|
35
|
+
intentType: intentType_1.IntentType,
|
|
36
|
+
}),
|
|
37
|
+
t.partial({
|
|
38
|
+
sequenceId: utils_1.optionalString,
|
|
39
|
+
comment: utils_1.optionalString,
|
|
40
|
+
nonce: (0, utils_1.Optional)(t.union([t.string, t.number])),
|
|
41
|
+
}),
|
|
44
42
|
]);
|
|
45
43
|
const CATCH_ALL_EXCLUDED_INTENT_TYPES = [
|
|
46
44
|
intentType_1.intentTypes.cantonGovernanceLockCreate.value,
|
|
@@ -50,14 +48,7 @@ const CATCH_ALL_EXCLUDED_INTENT_TYPES = [
|
|
|
50
48
|
intentType_1.intentTypes.cantonGovernanceLockProposeSubstitution.value,
|
|
51
49
|
intentType_1.intentTypes.cantonGovernanceLockProposeTransfer.value,
|
|
52
50
|
];
|
|
53
|
-
|
|
54
|
-
const BaseIntentCatchAllRuntime = t.intersection([
|
|
55
|
-
t.type({ intentType: t.keyof(CatchAllIntentTypes) }),
|
|
56
|
-
BaseIntentOptional,
|
|
57
|
-
]);
|
|
58
|
-
exports.BaseIntentCatchAll = BaseIntentCatchAllRuntime;
|
|
59
|
-
const _catchAllGuardsHold = [true, true];
|
|
60
|
-
void _catchAllGuardsHold;
|
|
51
|
+
exports.BaseIntentCatchAll = t.refinement(exports.BaseIntent, (intent) => !CATCH_ALL_EXCLUDED_INTENT_TYPES.includes(intent.intentType), "BaseIntentCatchAll");
|
|
61
52
|
exports.BaseIntentWithoutNonce = t.intersection([
|
|
62
53
|
t.type({
|
|
63
54
|
intentType: intentType_1.IntentType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"baseIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/baseIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAuD;AACvD,0CAA0D;AAC1D,qDAAkD;AAClD,+DAA4D;AAC5D,qCAAkC;
|
|
1
|
+
{"version":3,"file":"baseIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/baseIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAuD;AACvD,0CAA0D;AAC1D,qDAAkD;AAClD,+DAA4D;AAC5D,qCAAkC;AAKrB,QAAA,UAAU,GAAG,CAAC,CAAC,YAAY,CAAC;IACvC,CAAC,CAAC,IAAI,CAAC;QACL,UAAU,EAAE,uBAAU;KACvB,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QAER,UAAU,EAAE,sBAAc;QAE1B,OAAO,EAAE,sBAAc;QAEvB,KAAK,EAAE,IAAA,gBAAQ,EAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC;KAC/C,CAAC;CACH,CAAC,CAAC;AAUH,MAAM,+BAA+B,GAA0B;IAC7D,wBAAW,CAAC,0BAA0B,CAAC,KAAK;IAC5C,wBAAW,CAAC,0BAA0B,CAAC,KAAK;IAC5C,wBAAW,CAAC,qCAAqC,CAAC,KAAK;IACvD,wBAAW,CAAC,4BAA4B,CAAC,KAAK;IAC9C,wBAAW,CAAC,uCAAuC,CAAC,KAAK;IACzD,wBAAW,CAAC,mCAAmC,CAAC,KAAK;CACtD,CAAC;AAcW,QAAA,kBAAkB,GAAG,CAAC,CAAC,UAAU,CAC5C,kBAAU,EACV,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,+BAA+B,CAAC,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,EACxE,oBAAoB,CACrB,CAAC;AAIW,QAAA,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC;IACnD,CAAC,CAAC,IAAI,CAAC;QACL,UAAU,EAAE,uBAAU;KACvB,CAAC;IACF,CAAC,CAAC,OAAO,CAAC;QAER,UAAU,EAAE,sBAAc;QAE1B,OAAO,EAAE,sBAAc;KACxB,CAAC;CACH,CAAC,CAAC;AAiCU,QAAA,wBAAwB,GAAG,CAAC,CAAC,IAAI,CAAC;IAE7C,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,+BAAc,CAAC;CACpC,CAAC,CAAC;AAoBU,QAAA,6BAA6B,GAAG,CAAC,CAAC,IAAI,CAAC;IAElD,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,yCAAmB,CAAC;CACzC,CAAC,CAAC;AAUU,QAAA,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC;IAC5C,UAAU,EAAE,CAAC,CAAC,KAAK,CACjB,CAAC,CAAC,OAAO,CAAC;QACR,SAAS,EAAE,CAAC,CAAC,OAAO,CAAC;YACnB,SAAS,EAAE,CAAC,CAAC,MAAM;SACpB,CAAC;KACH,CAAC,CACH;CACF,CAAC,CAAC;AAgBU,QAAA,uBAAuB,GAAG,CAAC,CAAC,IAAI,CAAC;IAE5C,SAAS,EAAE,CAAC,CAAC,MAAM;CACpB,CAAC,CAAC;AAmBU,QAAA,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC;IAEzC,MAAM,EAAE,eAAM;CACf,CAAC,CAAC"}
|
|
@@ -20359,17 +20359,103 @@ export declare const TransactionIntent: t.UnionC<[t.IntersectionC<[t.Intersectio
|
|
|
20359
20359
|
isTestTransaction: t.BooleanC;
|
|
20360
20360
|
}>]>]>, t.TypeC<{
|
|
20361
20361
|
unifiedRecipientPreference: t.UnionC<[t.Type<"shielded" | "transparent", "shielded" | "transparent", unknown>, t.UndefinedC]>;
|
|
20362
|
-
}>]>, t.
|
|
20363
|
-
intentType:
|
|
20364
|
-
|
|
20365
|
-
|
|
20366
|
-
|
|
20367
|
-
|
|
20368
|
-
|
|
20369
|
-
|
|
20370
|
-
|
|
20371
|
-
|
|
20372
|
-
|
|
20373
|
-
|
|
20374
|
-
|
|
20362
|
+
}>]>, t.RefinementC<t.IntersectionC<[t.TypeC<{
|
|
20363
|
+
intentType: t.KeyofC<{
|
|
20364
|
+
payment: t.LiteralC<"payment">;
|
|
20365
|
+
transferToken: t.LiteralC<"transferToken">;
|
|
20366
|
+
consolidate: t.LiteralC<"consolidate">;
|
|
20367
|
+
consolidateToken: t.LiteralC<"consolidateToken">;
|
|
20368
|
+
fanout: t.LiteralC<"fanout">;
|
|
20369
|
+
stake: t.LiteralC<"stake">;
|
|
20370
|
+
unstake: t.LiteralC<"unstake">;
|
|
20371
|
+
cancel: t.LiteralC<"cancel">;
|
|
20372
|
+
delegate: t.LiteralC<"delegate">;
|
|
20373
|
+
undelegate: t.LiteralC<"undelegate">;
|
|
20374
|
+
switchValidator: t.LiteralC<"switchValidator">;
|
|
20375
|
+
claim: t.LiteralC<"claim">;
|
|
20376
|
+
stakeClaimRewards: t.LiteralC<"stakeClaimRewards">;
|
|
20377
|
+
pledge: t.LiteralC<"pledge">;
|
|
20378
|
+
voteDelegation: t.LiteralC<"voteDelegation">;
|
|
20379
|
+
vote: t.LiteralC<"vote">;
|
|
20380
|
+
createAccount: t.LiteralC<"createAccount">;
|
|
20381
|
+
updateAccount: t.LiteralC<"updateAccount">;
|
|
20382
|
+
addTrustLine: t.LiteralC<"addTrustLine">;
|
|
20383
|
+
removeTrustLine: t.LiteralC<"removeTrustLine">;
|
|
20384
|
+
signMessage: t.LiteralC<"signMessage">;
|
|
20385
|
+
signTypedStructuredData: t.LiteralC<"signTypedStructuredData">;
|
|
20386
|
+
enableToken: t.LiteralC<"enableToken">;
|
|
20387
|
+
disableToken: t.LiteralC<"disableToken">;
|
|
20388
|
+
authorize: t.LiteralC<"authorize">;
|
|
20389
|
+
acceleration: t.LiteralC<"acceleration">;
|
|
20390
|
+
fillNonce: t.LiteralC<"fillNonce">;
|
|
20391
|
+
walletRecovery: t.LiteralC<"walletRecovery">;
|
|
20392
|
+
contractCall: t.LiteralC<"contractCall">;
|
|
20393
|
+
deactivate: t.LiteralC<"deactivate">;
|
|
20394
|
+
customTx: t.LiteralC<"customTx">;
|
|
20395
|
+
confidentialTransfer: t.LiteralC<"confidentialTransfer">;
|
|
20396
|
+
closeAssociatedTokenAccount: t.LiteralC<"closeAssociatedTokenAccount">;
|
|
20397
|
+
stakeWithCallData: t.LiteralC<"stakeWithCallData">;
|
|
20398
|
+
unstakeWithCallData: t.LiteralC<"unstakeWithCallData">;
|
|
20399
|
+
switchValidatorWithCallData: t.LiteralC<"switchValidatorWithCallData">;
|
|
20400
|
+
feeAddressTransfer: t.LiteralC<"feeAddressTransfer">;
|
|
20401
|
+
tokenApproval: t.LiteralC<"tokenApproval">;
|
|
20402
|
+
transferStake: t.LiteralC<"transferStake">;
|
|
20403
|
+
validatorRegistration: t.LiteralC<"validatorRegistration">;
|
|
20404
|
+
increaseStake: t.LiteralC<"increaseStake">;
|
|
20405
|
+
decreaseStake: t.LiteralC<"decreaseStake">;
|
|
20406
|
+
signalExit: t.LiteralC<"signalExit">;
|
|
20407
|
+
withdrawStake: t.LiteralC<"withdrawStake">;
|
|
20408
|
+
spotTransfer: t.LiteralC<"spotTransfer">;
|
|
20409
|
+
bridgeFunds: t.LiteralC<"bridgeFunds">;
|
|
20410
|
+
enableBridging: t.LiteralC<"enableBridging">;
|
|
20411
|
+
goUnstake: t.LiteralC<"goUnstake">;
|
|
20412
|
+
createBtcDelegation: t.LiteralC<"createBtcDelegation">;
|
|
20413
|
+
transferAccept: t.LiteralC<"transferAccept">;
|
|
20414
|
+
transferReject: t.LiteralC<"transferReject">;
|
|
20415
|
+
transferAcknowledge: t.LiteralC<"transferAcknowledge">;
|
|
20416
|
+
transferOfferWithdrawn: t.LiteralC<"transferOfferWithdrawn">;
|
|
20417
|
+
cosignDelegationProposal: t.LiteralC<"cosignDelegationProposal">;
|
|
20418
|
+
cosignDelegationAccept: t.LiteralC<"cosignDelegationAccept">;
|
|
20419
|
+
allocationRequest: t.LiteralC<"allocationRequest">;
|
|
20420
|
+
cantonCommand: t.LiteralC<"cantonCommand">;
|
|
20421
|
+
cantonBroadridgeStandingDelegation: t.LiteralC<"cantonBroadridgeStandingDelegation">;
|
|
20422
|
+
allocationAllocate: t.LiteralC<"allocationAllocate">;
|
|
20423
|
+
allocationOfferWithdrawn: t.LiteralC<"allocationOfferWithdrawn">;
|
|
20424
|
+
allocationReject: t.LiteralC<"allocationReject">;
|
|
20425
|
+
cantonEndInvestorOnboardingOffer: t.LiteralC<"cantonEndInvestorOnboardingOffer">;
|
|
20426
|
+
cantonEndInvestorOnboardingAccept: t.LiteralC<"cantonEndInvestorOnboardingAccept">;
|
|
20427
|
+
cantonEndInvestorOnboardingReject: t.LiteralC<"cantonEndInvestorOnboardingReject">;
|
|
20428
|
+
cantonEndInvestorOnboardingCancel: t.LiteralC<"cantonEndInvestorOnboardingCancel">;
|
|
20429
|
+
cantonEndInvestorOffboarding: t.LiteralC<"cantonEndInvestorOffboarding">;
|
|
20430
|
+
cantonParticipantOnboardingRequest: t.LiteralC<"cantonParticipantOnboardingRequest">;
|
|
20431
|
+
cantonParticipantAllowListAdd: t.LiteralC<"cantonParticipantAllowListAdd">;
|
|
20432
|
+
cantonParticipantAllowListRemove: t.LiteralC<"cantonParticipantAllowListRemove">;
|
|
20433
|
+
cantonGovernanceLockCreate: t.LiteralC<"cantonGovernanceLockCreate">;
|
|
20434
|
+
cantonGovernanceLockUnlock: t.LiteralC<"cantonGovernanceLockUnlock">;
|
|
20435
|
+
cantonGovernanceLockProvisionalUnlock: t.LiteralC<"cantonGovernanceLockProvisionalUnlock">;
|
|
20436
|
+
cantonGovernanceLockWithdraw: t.LiteralC<"cantonGovernanceLockWithdraw">;
|
|
20437
|
+
cantonGovernanceLockProposeSubstitution: t.LiteralC<"cantonGovernanceLockProposeSubstitution">;
|
|
20438
|
+
cantonGovernanceLockProposeTransfer: t.LiteralC<"cantonGovernanceLockProposeTransfer">;
|
|
20439
|
+
"defi-deposit": t.LiteralC<"defi-deposit">;
|
|
20440
|
+
"defi-redeem": t.LiteralC<"defi-redeem">;
|
|
20441
|
+
"defi-approve": t.LiteralC<"defi-approve">;
|
|
20442
|
+
"defi-withdraw": t.LiteralC<"defi-withdraw">;
|
|
20443
|
+
"wrap-native": t.LiteralC<"wrap-native">;
|
|
20444
|
+
"unwrap-native": t.LiteralC<"unwrap-native">;
|
|
20445
|
+
wrapApprove: t.LiteralC<"wrapApprove">;
|
|
20446
|
+
wrap: t.LiteralC<"wrap">;
|
|
20447
|
+
unwrap: t.LiteralC<"unwrap">;
|
|
20448
|
+
finalizeUnwrap: t.LiteralC<"finalizeUnwrap">;
|
|
20449
|
+
delegateResource: t.LiteralC<"delegateResource">;
|
|
20450
|
+
undelegateResource: t.LiteralC<"undelegateResource">;
|
|
20451
|
+
stacksRegisterForBond: t.LiteralC<"stacksRegisterForBond">;
|
|
20452
|
+
export: t.LiteralC<"export">;
|
|
20453
|
+
import: t.LiteralC<"import">;
|
|
20454
|
+
importtoc: t.LiteralC<"importtoc">;
|
|
20455
|
+
}>;
|
|
20456
|
+
}>, t.PartialC<{
|
|
20457
|
+
sequenceId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
20458
|
+
comment: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
20459
|
+
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
20460
|
+
}>]>>]>;
|
|
20375
20461
|
export type TransactionIntent = t.TypeOf<typeof TransactionIntent>;
|
|
@@ -20363,17 +20363,103 @@ export declare const TransactionIntentFullOnly: t.UnionC<[t.IntersectionC<[t.Int
|
|
|
20363
20363
|
unifiedRecipientPreference: t.UnionC<[t.Type<"shielded" | "transparent", "shielded" | "transparent", unknown>, t.UndefinedC]>;
|
|
20364
20364
|
}>]>]>;
|
|
20365
20365
|
export type TransactionIntentFullOnly = t.TypeOf<typeof TransactionIntentFullOnly>;
|
|
20366
|
-
export declare const TransactionIntentLiteOnly: t.
|
|
20367
|
-
intentType:
|
|
20368
|
-
|
|
20369
|
-
|
|
20370
|
-
|
|
20371
|
-
|
|
20372
|
-
|
|
20373
|
-
|
|
20374
|
-
|
|
20375
|
-
|
|
20376
|
-
|
|
20377
|
-
|
|
20378
|
-
|
|
20366
|
+
export declare const TransactionIntentLiteOnly: t.RefinementC<t.IntersectionC<[t.TypeC<{
|
|
20367
|
+
intentType: t.KeyofC<{
|
|
20368
|
+
payment: t.LiteralC<"payment">;
|
|
20369
|
+
transferToken: t.LiteralC<"transferToken">;
|
|
20370
|
+
consolidate: t.LiteralC<"consolidate">;
|
|
20371
|
+
consolidateToken: t.LiteralC<"consolidateToken">;
|
|
20372
|
+
fanout: t.LiteralC<"fanout">;
|
|
20373
|
+
stake: t.LiteralC<"stake">;
|
|
20374
|
+
unstake: t.LiteralC<"unstake">;
|
|
20375
|
+
cancel: t.LiteralC<"cancel">;
|
|
20376
|
+
delegate: t.LiteralC<"delegate">;
|
|
20377
|
+
undelegate: t.LiteralC<"undelegate">;
|
|
20378
|
+
switchValidator: t.LiteralC<"switchValidator">;
|
|
20379
|
+
claim: t.LiteralC<"claim">;
|
|
20380
|
+
stakeClaimRewards: t.LiteralC<"stakeClaimRewards">;
|
|
20381
|
+
pledge: t.LiteralC<"pledge">;
|
|
20382
|
+
voteDelegation: t.LiteralC<"voteDelegation">;
|
|
20383
|
+
vote: t.LiteralC<"vote">;
|
|
20384
|
+
createAccount: t.LiteralC<"createAccount">;
|
|
20385
|
+
updateAccount: t.LiteralC<"updateAccount">;
|
|
20386
|
+
addTrustLine: t.LiteralC<"addTrustLine">;
|
|
20387
|
+
removeTrustLine: t.LiteralC<"removeTrustLine">;
|
|
20388
|
+
signMessage: t.LiteralC<"signMessage">;
|
|
20389
|
+
signTypedStructuredData: t.LiteralC<"signTypedStructuredData">;
|
|
20390
|
+
enableToken: t.LiteralC<"enableToken">;
|
|
20391
|
+
disableToken: t.LiteralC<"disableToken">;
|
|
20392
|
+
authorize: t.LiteralC<"authorize">;
|
|
20393
|
+
acceleration: t.LiteralC<"acceleration">;
|
|
20394
|
+
fillNonce: t.LiteralC<"fillNonce">;
|
|
20395
|
+
walletRecovery: t.LiteralC<"walletRecovery">;
|
|
20396
|
+
contractCall: t.LiteralC<"contractCall">;
|
|
20397
|
+
deactivate: t.LiteralC<"deactivate">;
|
|
20398
|
+
customTx: t.LiteralC<"customTx">;
|
|
20399
|
+
confidentialTransfer: t.LiteralC<"confidentialTransfer">;
|
|
20400
|
+
closeAssociatedTokenAccount: t.LiteralC<"closeAssociatedTokenAccount">;
|
|
20401
|
+
stakeWithCallData: t.LiteralC<"stakeWithCallData">;
|
|
20402
|
+
unstakeWithCallData: t.LiteralC<"unstakeWithCallData">;
|
|
20403
|
+
switchValidatorWithCallData: t.LiteralC<"switchValidatorWithCallData">;
|
|
20404
|
+
feeAddressTransfer: t.LiteralC<"feeAddressTransfer">;
|
|
20405
|
+
tokenApproval: t.LiteralC<"tokenApproval">;
|
|
20406
|
+
transferStake: t.LiteralC<"transferStake">;
|
|
20407
|
+
validatorRegistration: t.LiteralC<"validatorRegistration">;
|
|
20408
|
+
increaseStake: t.LiteralC<"increaseStake">;
|
|
20409
|
+
decreaseStake: t.LiteralC<"decreaseStake">;
|
|
20410
|
+
signalExit: t.LiteralC<"signalExit">;
|
|
20411
|
+
withdrawStake: t.LiteralC<"withdrawStake">;
|
|
20412
|
+
spotTransfer: t.LiteralC<"spotTransfer">;
|
|
20413
|
+
bridgeFunds: t.LiteralC<"bridgeFunds">;
|
|
20414
|
+
enableBridging: t.LiteralC<"enableBridging">;
|
|
20415
|
+
goUnstake: t.LiteralC<"goUnstake">;
|
|
20416
|
+
createBtcDelegation: t.LiteralC<"createBtcDelegation">;
|
|
20417
|
+
transferAccept: t.LiteralC<"transferAccept">;
|
|
20418
|
+
transferReject: t.LiteralC<"transferReject">;
|
|
20419
|
+
transferAcknowledge: t.LiteralC<"transferAcknowledge">;
|
|
20420
|
+
transferOfferWithdrawn: t.LiteralC<"transferOfferWithdrawn">;
|
|
20421
|
+
cosignDelegationProposal: t.LiteralC<"cosignDelegationProposal">;
|
|
20422
|
+
cosignDelegationAccept: t.LiteralC<"cosignDelegationAccept">;
|
|
20423
|
+
allocationRequest: t.LiteralC<"allocationRequest">;
|
|
20424
|
+
cantonCommand: t.LiteralC<"cantonCommand">;
|
|
20425
|
+
cantonBroadridgeStandingDelegation: t.LiteralC<"cantonBroadridgeStandingDelegation">;
|
|
20426
|
+
allocationAllocate: t.LiteralC<"allocationAllocate">;
|
|
20427
|
+
allocationOfferWithdrawn: t.LiteralC<"allocationOfferWithdrawn">;
|
|
20428
|
+
allocationReject: t.LiteralC<"allocationReject">;
|
|
20429
|
+
cantonEndInvestorOnboardingOffer: t.LiteralC<"cantonEndInvestorOnboardingOffer">;
|
|
20430
|
+
cantonEndInvestorOnboardingAccept: t.LiteralC<"cantonEndInvestorOnboardingAccept">;
|
|
20431
|
+
cantonEndInvestorOnboardingReject: t.LiteralC<"cantonEndInvestorOnboardingReject">;
|
|
20432
|
+
cantonEndInvestorOnboardingCancel: t.LiteralC<"cantonEndInvestorOnboardingCancel">;
|
|
20433
|
+
cantonEndInvestorOffboarding: t.LiteralC<"cantonEndInvestorOffboarding">;
|
|
20434
|
+
cantonParticipantOnboardingRequest: t.LiteralC<"cantonParticipantOnboardingRequest">;
|
|
20435
|
+
cantonParticipantAllowListAdd: t.LiteralC<"cantonParticipantAllowListAdd">;
|
|
20436
|
+
cantonParticipantAllowListRemove: t.LiteralC<"cantonParticipantAllowListRemove">;
|
|
20437
|
+
cantonGovernanceLockCreate: t.LiteralC<"cantonGovernanceLockCreate">;
|
|
20438
|
+
cantonGovernanceLockUnlock: t.LiteralC<"cantonGovernanceLockUnlock">;
|
|
20439
|
+
cantonGovernanceLockProvisionalUnlock: t.LiteralC<"cantonGovernanceLockProvisionalUnlock">;
|
|
20440
|
+
cantonGovernanceLockWithdraw: t.LiteralC<"cantonGovernanceLockWithdraw">;
|
|
20441
|
+
cantonGovernanceLockProposeSubstitution: t.LiteralC<"cantonGovernanceLockProposeSubstitution">;
|
|
20442
|
+
cantonGovernanceLockProposeTransfer: t.LiteralC<"cantonGovernanceLockProposeTransfer">;
|
|
20443
|
+
"defi-deposit": t.LiteralC<"defi-deposit">;
|
|
20444
|
+
"defi-redeem": t.LiteralC<"defi-redeem">;
|
|
20445
|
+
"defi-approve": t.LiteralC<"defi-approve">;
|
|
20446
|
+
"defi-withdraw": t.LiteralC<"defi-withdraw">;
|
|
20447
|
+
"wrap-native": t.LiteralC<"wrap-native">;
|
|
20448
|
+
"unwrap-native": t.LiteralC<"unwrap-native">;
|
|
20449
|
+
wrapApprove: t.LiteralC<"wrapApprove">;
|
|
20450
|
+
wrap: t.LiteralC<"wrap">;
|
|
20451
|
+
unwrap: t.LiteralC<"unwrap">;
|
|
20452
|
+
finalizeUnwrap: t.LiteralC<"finalizeUnwrap">;
|
|
20453
|
+
delegateResource: t.LiteralC<"delegateResource">;
|
|
20454
|
+
undelegateResource: t.LiteralC<"undelegateResource">;
|
|
20455
|
+
stacksRegisterForBond: t.LiteralC<"stacksRegisterForBond">;
|
|
20456
|
+
export: t.LiteralC<"export">;
|
|
20457
|
+
import: t.LiteralC<"import">;
|
|
20458
|
+
importtoc: t.LiteralC<"importtoc">;
|
|
20459
|
+
}>;
|
|
20460
|
+
}>, t.PartialC<{
|
|
20461
|
+
sequenceId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
20462
|
+
comment: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
20463
|
+
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
20464
|
+
}>]>>;
|
|
20379
20465
|
export type TransactionIntentLiteOnly = t.TypeOf<typeof TransactionIntentLiteOnly>;
|
|
@@ -76,7 +76,7 @@ exports.TransactionRequestLite = t.intersection([
|
|
|
76
76
|
intent: t.union([
|
|
77
77
|
intentGroups_1.TransactionIntentLiteOnly,
|
|
78
78
|
intentGroups_1.TransactionIntentCommon,
|
|
79
|
-
baseIntent_1.
|
|
79
|
+
baseIntent_1.BaseIntent,
|
|
80
80
|
t.null,
|
|
81
81
|
t.unknown,
|
|
82
82
|
]),
|
|
@@ -92,7 +92,7 @@ exports.TransactionRequestFull = t.intersection([
|
|
|
92
92
|
intent: t.union([
|
|
93
93
|
intentGroups_1.TransactionIntentFullOnly,
|
|
94
94
|
intentGroups_1.TransactionIntentCommon,
|
|
95
|
-
baseIntent_1.
|
|
95
|
+
baseIntent_1.BaseIntent,
|
|
96
96
|
t.null,
|
|
97
97
|
t.unknown,
|
|
98
98
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactionRequest.js","sourceRoot":"","sources":["../../../../src/schema/transactionRequest/transactionRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAgE;AAChE,sCAA2C;AAC3C,uDAAoD;AACpD,8CAAmD;AACnD,wBAA4C;AAC5C,
|
|
1
|
+
{"version":3,"file":"transactionRequest.js","sourceRoot":"","sources":["../../../../src/schema/transactionRequest/transactionRequest.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,6CAAgE;AAChE,sCAA2C;AAC3C,uDAAoD;AACpD,8CAAmD;AACnD,wBAA4C;AAC5C,qDAAkD;AAClD,yDAIgC;AAChC,iFAA8E;AAC9E,uDAAoD;AACpD,qDAAkD;AAClD,+DAA4D;AAC5D,uCAAoC;AACpC,+CAA4C;AAC5C,2CAAwC;AAK3B,QAAA,oBAAoB,GAAG,CAAC,CAAC,MAAM,CAAC;AAQhC,QAAA,kCAAkC,GAAG,4BAAc,CAAC;AAMpD,QAAA,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC;IAEnD,CAAC,CAAC,IAAI,CAAC;QAEL,WAAW,EAAE,4BAAoB;QAEjC,QAAQ,EAAE,uBAAc;QAExB,OAAO,EAAE,CAAC,CAAC,MAAM;QAEjB,KAAK,EAAE,0BAAuB;QAK9B,IAAI,EAAE,+BAAiB;QAKvB,WAAW,EAAE,+BAAiB;QAE9B,MAAM,EAAE,CAAC,CAAC,MAAM;QAEhB,WAAW,EAAE,CAAC,CAAC,MAAM;QAErB,SAAS,EAAE,CAAC,CAAC,MAAM;QAEnB,OAAO,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;QAE3B,MAAM,EAAE,CAAC,CAAC,OAAO;KAClB,CAAC;IAEF,CAAC,CAAC,OAAO,CAAC;QAER,UAAU,EAAE,2DAA4B;QAExC,cAAc,EAAE,CAAC,CAAC,MAAM;QAGxB,UAAU,EAAE,yBAAW;QAEvB,YAAY,EAAE,+BAAkB;QAEhC,cAAc,EAAE,CAAC,CAAC,MAAM;QAExB,MAAM,EAAE,CAAC,CAAC,OAAO;QAEjB,iBAAiB,EAAE,CAAC,CAAC,MAAM;QAG3B,eAAe,EAAE,CAAC,CAAC,OAAO;QAE1B,UAAU,EAAE,CAAC,CAAC,OAAO;QAErB,YAAY,EAAE,CAAC,CAAC,MAAM;QAEtB,qBAAqB,EAAE,CAAC,CAAC,OAAO;QAEhC,SAAS,EAAE,qBAAS;KACrB,CAAC;CACH,CAAC,CAAC;AAEU,QAAA,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC;IACnD,8BAAsB;IACtB,CAAC,CAAC,OAAO,CAAC;QAER,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC;YACd,wCAAyB;YACzB,sCAAuB;YACvB,uBAAU;YACV,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,OAAO;SACV,CAAoB;QAErB,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,yCAAmB,CAAC;QAEzC,eAAe,EAAE,CAAC,CAAC,KAAK,CAAC,+BAAc,CAAC;QAExC,gBAAgB,EAAE,CAAC,CAAC,KAAK,CAAC,iCAAe,CAAC;QAE1C,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC;KAC5B,CAAC;CACH,CAAC,CAAC;AAGU,QAAA,sBAAsB,GAAG,CAAC,CAAC,YAAY,CAAC;IACnD,8BAAsB;IACtB,CAAC,CAAC,OAAO,CAAC;QAER,MAAM,EAAE,CAAC,CAAC,KAAK,CAAC;YACd,wCAAyB;YACzB,sCAAuB;YACvB,uBAAU;YACV,CAAC,CAAC,IAAI;YACN,CAAC,CAAC,OAAO;SACV,CAAoB;QAErB,YAAY,EAAE,CAAC,CAAC,KAAK,CAAC,yBAAW,CAAC;QAElC,QAAQ,EAAE,CAAC,CAAC,KAAK,CAAC,iBAAO,CAAC;KAC3B,CAAC;CACH,CAAC,CAAC;AAGU,QAAA,kBAAkB,GAAG,CAAC,CAAC,KAAK,CAAC;IACxC,8BAAsB;IACtB,8BAAsB;CACvB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -8,23 +8,18 @@ import { Amount } from "./amount";
|
|
|
8
8
|
/**
|
|
9
9
|
* @title Intent
|
|
10
10
|
*/
|
|
11
|
-
/** Required fragment, split out so {@link BaseIntentCatchAll} can narrow `intentType`. */
|
|
12
|
-
const BaseIntentRequired = t.type({
|
|
13
|
-
intentType: IntentType,
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
const BaseIntentOptional = t.partial({
|
|
17
|
-
/** Client-assigned sequence identifier for idempotency. */
|
|
18
|
-
sequenceId: optionalString,
|
|
19
|
-
/** Human-readable memo attached to the transaction. */
|
|
20
|
-
comment: optionalString,
|
|
21
|
-
/** Override the on-chain nonce for this transaction. */
|
|
22
|
-
nonce: Optional(t.union([t.string, t.number])),
|
|
23
|
-
});
|
|
24
|
-
|
|
25
11
|
export const BaseIntent = t.intersection([
|
|
26
|
-
|
|
27
|
-
|
|
12
|
+
t.type({
|
|
13
|
+
intentType: IntentType,
|
|
14
|
+
}),
|
|
15
|
+
t.partial({
|
|
16
|
+
/** Client-assigned sequence identifier for idempotency. */
|
|
17
|
+
sequenceId: optionalString,
|
|
18
|
+
/** Human-readable memo attached to the transaction. */
|
|
19
|
+
comment: optionalString,
|
|
20
|
+
/** Override the on-chain nonce for this transaction. */
|
|
21
|
+
nonce: Optional(t.union([t.string, t.number])),
|
|
22
|
+
}),
|
|
28
23
|
]);
|
|
29
24
|
|
|
30
25
|
export type BaseIntent = t.TypeOf<typeof BaseIntent>;
|
|
@@ -35,78 +30,34 @@ export type BaseIntent = t.TypeOf<typeof BaseIntent>;
|
|
|
35
30
|
* of these intents (e.g. one carrying a forbidden protocol `memo`) would fall through the
|
|
36
31
|
* dedicated codec and still decode as a plain `BaseIntent`.
|
|
37
32
|
*/
|
|
38
|
-
const CATCH_ALL_EXCLUDED_INTENT_TYPES = [
|
|
33
|
+
const CATCH_ALL_EXCLUDED_INTENT_TYPES: ReadonlyArray<string> = [
|
|
39
34
|
intentTypes.cantonGovernanceLockCreate.value,
|
|
40
35
|
intentTypes.cantonGovernanceLockUnlock.value,
|
|
41
36
|
intentTypes.cantonGovernanceLockProvisionalUnlock.value,
|
|
42
37
|
intentTypes.cantonGovernanceLockWithdraw.value,
|
|
43
38
|
intentTypes.cantonGovernanceLockProposeSubstitution.value,
|
|
44
39
|
intentTypes.cantonGovernanceLockProposeTransfer.value,
|
|
45
|
-
]
|
|
40
|
+
];
|
|
46
41
|
|
|
47
42
|
/**
|
|
48
|
-
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
(
|
|
59
|
-
Object.entries(intentTypes) as Array<
|
|
60
|
-
[keyof typeof intentTypes, (typeof intentTypes)[keyof typeof intentTypes]]
|
|
61
|
-
>
|
|
62
|
-
).filter(
|
|
63
|
-
([key]) =>
|
|
64
|
-
!(CATCH_ALL_EXCLUDED_INTENT_TYPES as ReadonlyArray<string>).includes(key),
|
|
65
|
-
),
|
|
66
|
-
) as CatchAllIntentTypesMap;
|
|
67
|
-
|
|
68
|
-
/**
|
|
69
|
-
* Catch-all for intents that have no codec yet: the open fallback of intent unions. At RUNTIME it
|
|
70
|
-
* rejects every `intentType` listed in {@link CATCH_ALL_EXCLUDED_INTENT_TYPES} (the keyof below
|
|
71
|
-
* omits them), so an invalid payload for one of those intents cannot decode as a plain
|
|
72
|
-
* `BaseIntent` — it must match its dedicated codec higher up in the union.
|
|
73
|
-
*
|
|
74
|
-
* The DECLARED type is deliberately the full-width `BaseIntent`, not `t.TypeOf` of the runtime
|
|
75
|
-
* codec: stored-intent unions in consumers (e.g. wallet-platform's `Intent`) are built over the
|
|
76
|
-
* FULL {@link IntentType} registry, so a narrowed static type would make those unions
|
|
77
|
-
* unassignable to `TransactionIntent` — every catch-all-shaped member would fail to match. The
|
|
78
|
-
* runtime codec stays a plain intersection with a narrower keyof (no `t.refinement`, no
|
|
79
|
-
* `t.brand`), so OpenAPI generation emits a plain enum and no unresolvable schema.
|
|
43
|
+
* Catch-all for intents that have no codec yet: `BaseIntent` minus every `intentType` that owns a
|
|
44
|
+
* dedicated codec listed above. Use this, not `BaseIntent`, as the open fallback in intent unions.
|
|
45
|
+
*
|
|
46
|
+
* Uses {@link t.refinement} so the runtime rejects the excluded `intentType`s while
|
|
47
|
+
* `t.TypeOf` stays the plain full-width {@link BaseIntent} (no brand marker), keeping stored
|
|
48
|
+
* intents — whose unions span the full registry — assignable for decode AND encode.
|
|
49
|
+
*
|
|
50
|
+
* @assumes consumers that generate OpenAPI from this codec register a `refinement` handler in
|
|
51
|
+
* their `.openapi-generator.rc.js` that emits the inner schema (the wallet-platform sdk does);
|
|
52
|
+
* without it the generator emits an unresolvable `$ref` for the refinement.
|
|
80
53
|
*/
|
|
81
|
-
const
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
export const BaseIntentCatchAll: t.Type<BaseIntent> =
|
|
87
|
-
BaseIntentCatchAllRuntime as unknown as t.Type<BaseIntent>;
|
|
54
|
+
export const BaseIntentCatchAll = t.refinement(
|
|
55
|
+
BaseIntent,
|
|
56
|
+
(intent) => !CATCH_ALL_EXCLUDED_INTENT_TYPES.includes(intent.intentType),
|
|
57
|
+
"BaseIntentCatchAll",
|
|
58
|
+
);
|
|
88
59
|
|
|
89
|
-
export type BaseIntentCatchAll =
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
* Compile-time drift guards:
|
|
93
|
-
* 1. The exclusion list may only contain registry keys — an unknown name fails to compile.
|
|
94
|
-
* 2. The catch-all's declared `intentType` remains a subset of {@link IntentType}, so a decoded
|
|
95
|
-
* catch-all intent's `intentType` still assigns to any API expecting a supported intent name.
|
|
96
|
-
*/
|
|
97
|
-
type ExcludedIntentType = (typeof CATCH_ALL_EXCLUDED_INTENT_TYPES)[number];
|
|
98
|
-
type _ExcludedKeysAreRegistryKeys =
|
|
99
|
-
ExcludedIntentType extends keyof typeof intentTypes ? true : never;
|
|
100
|
-
type _CatchAllIntentTypeIsIntentType = t.TypeOf<
|
|
101
|
-
typeof BaseIntentCatchAll
|
|
102
|
-
>["intentType"] extends IntentType
|
|
103
|
-
? true
|
|
104
|
-
: never;
|
|
105
|
-
const _catchAllGuardsHold: [
|
|
106
|
-
_ExcludedKeysAreRegistryKeys,
|
|
107
|
-
_CatchAllIntentTypeIsIntentType,
|
|
108
|
-
] = [true, true];
|
|
109
|
-
void _catchAllGuardsHold;
|
|
60
|
+
export type BaseIntentCatchAll = t.TypeOf<typeof BaseIntentCatchAll>;
|
|
110
61
|
|
|
111
62
|
export const BaseIntentWithoutNonce = t.intersection([
|
|
112
63
|
t.type({
|
|
@@ -4,7 +4,7 @@ import { WalletIdString } from "../wallet";
|
|
|
4
4
|
import { WalletTypes } from "../wallet/walletTypes";
|
|
5
5
|
import { EnterpriseIdString } from "../enterprise";
|
|
6
6
|
import { TransactionRequestState } from ".";
|
|
7
|
-
import {
|
|
7
|
+
import { BaseIntent } from "./intents/baseIntent";
|
|
8
8
|
import {
|
|
9
9
|
TransactionIntentCommon,
|
|
10
10
|
TransactionIntentFullOnly,
|
|
@@ -105,7 +105,7 @@ export const TransactionRequestLite = t.intersection([
|
|
|
105
105
|
intent: t.union([
|
|
106
106
|
TransactionIntentLiteOnly,
|
|
107
107
|
TransactionIntentCommon,
|
|
108
|
-
|
|
108
|
+
BaseIntent,
|
|
109
109
|
t.null,
|
|
110
110
|
t.unknown,
|
|
111
111
|
]) as t.Type<unknown>,
|
|
@@ -128,7 +128,7 @@ export const TransactionRequestFull = t.intersection([
|
|
|
128
128
|
intent: t.union([
|
|
129
129
|
TransactionIntentFullOnly,
|
|
130
130
|
TransactionIntentCommon,
|
|
131
|
-
|
|
131
|
+
BaseIntent,
|
|
132
132
|
t.null,
|
|
133
133
|
t.unknown,
|
|
134
134
|
]) as t.Type<unknown>,
|