@bitgo/public-types 7.5.0 → 7.6.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/accelerationIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/accountBaseCreateAccountIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/accountBaseUpdateAccountIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/adaCancelIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/adaClaimTimelockIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/adaPaymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/adaPledgeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/adaStakeClaimRewardsIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/adaStakeIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/adaUnstakeIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/adaVoteDelegationIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/aptCustomTxIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/aptStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/aptUnstakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/aptWithdrawStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/atomPaymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/atomStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/atomUnstakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/atomWithdrawIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/babyCreateBtcDelegationIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/babyWithdrawRewardIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/baseBridgeFundsIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/baseGoStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/baseIntent.d.ts +115 -0
- package/dist/src/schema/transactionRequest/intents/baseIntent.js +10 -1
- package/dist/src/schema/transactionRequest/intents/baseIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/baseStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/baseStakeIntentWithCalldata.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/beraDelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/bscDelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/bscStakeClaimRewardsIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/bscUndelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/bscWithdrawUndelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonAllocationAllocateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonAllocationOfferWithdrawnIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonAllocationRejectIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonAllocationRequestIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonBroadridgeStandingDelegationIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonCommandIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonCosignDelegationAcceptIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonCosignDelegationProposalIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonEndInvestorOffboardingIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonEndInvestorOnboardingAcceptIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonEndInvestorOnboardingCancelIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonEndInvestorOnboardingOfferIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonEndInvestorOnboardingRejectIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonGovernanceLockCommon.d.ts +41 -0
- package/dist/src/schema/transactionRequest/intents/cantonGovernanceLockCommon.js +73 -0
- package/dist/src/schema/transactionRequest/intents/cantonGovernanceLockCommon.js.map +1 -0
- package/dist/src/schema/transactionRequest/intents/cantonGovernanceLockIntent.d.ts +676 -0
- package/dist/src/schema/transactionRequest/intents/cantonGovernanceLockIntent.js +106 -0
- package/dist/src/schema/transactionRequest/intents/cantonGovernanceLockIntent.js.map +1 -0
- package/dist/src/schema/transactionRequest/intents/cantonParticipantAllowListIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/cantonParticipantOnboardingRequestIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonPaymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonTransferAcceptIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonTransferAcknowledgeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonTransferOfferWithdrawnIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cantonTransferRejectIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/claimIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/consolidateTokenIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/coredaoClaimIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/coredaoDelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/coredaoUndelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cosmosContractCallIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cosmosPaymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cosmosStakeClaimRewardsIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cosmosStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cosmosSwitchValidatorIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cosmosUnstakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/cosmosWithdrawIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/defiApproveIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/defiDepositIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/defiRedeemIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/defiWithdrawIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/delegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/disableTokenIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/dotBaseIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/dotCreateAccountIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/dotPaymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/dotStakingIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/dotUnstakingIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/dotWithdrawStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/enableTokenIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/ethAccelerationIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/ethConsolidateTokenIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/ethFillNonceIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/ethLikeStakeIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/ethPaymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/ethStakingIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/ethTransferTokenIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/feeAddressTransferIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/fillNonceIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/goUnstakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/hbarUpdateAccountIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/hypeevmBridgeFundsIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/hypeevmEnableBridgingIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/hypeevmSpotTransferIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/icpPaymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/index.d.ts +2 -0
- package/dist/src/schema/transactionRequest/intents/index.js +2 -0
- package/dist/src/schema/transactionRequest/intents/index.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/intent.d.ts +1668 -3
- package/dist/src/schema/transactionRequest/intents/intent.js +8 -1
- package/dist/src/schema/transactionRequest/intents/intent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/intentGroups.d.ts +1668 -3
- package/dist/src/schema/transactionRequest/intents/intentGroups.js +8 -1
- package/dist/src/schema/transactionRequest/intents/intentGroups.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/intentType.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/intentType.js +6 -0
- package/dist/src/schema/transactionRequest/intents/intentType.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/iotaBuildOptions.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/iotaConsolidateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/iotaPaymentIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/lightningPaymentIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/mmiSignMessageIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/mmiSignTransactionIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/nearStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/nearUnstakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/nearWithdrawIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/paymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/polyxBaseIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/polyxCreateAccountIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/polyxPreApproveAssetIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/polyxStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/polyxSwitchValidatorIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/polyxUnstakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/polyxWithdrawIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/signMessageIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solAuthorizeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solClaimIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solCloseAssociatedTokenAccountIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solConfidentialTransferIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solCreateAssociatedTokenAccountIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solCustomTxIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solDeactivateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solDelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solGoUnstakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solPaymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/solStakeIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/solUnstakeIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/solVersionedCustomTxIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/stacksRegisterForBondIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/stakeClaimRewardsIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/stakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/stakeSwitchValidatorIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/stakeWithCallDataIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/substrateBaseIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/substratePaymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/suiBuildOptions.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/suiConsolidateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/suiCustomTxIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/suiGoUnstakeIntent.d.ts +18 -0
- package/dist/src/schema/transactionRequest/intents/suiPaymentIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/suiStakingIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/suiUnstakingIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/switchValidatorWithCallDataIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/taoClaimRootIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/taoStakeIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/taoStakingBaseIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/taoSwitchValidatorIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/taoTransferStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/taoUnstakeIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/tokenApprovalIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/tonDelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/tonMultiNominatorDelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/tonMultiNominatorUndelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/tonPaymentIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/tonSingleNominatorDelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/tonSingleNominatorUndelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/tonUndelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/tonWhalesDelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/tonWhalesUndelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/transferTokenIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/trxClaimRewardsIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/trxCreateAccountIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/trxDelegateResourceIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/trxFreezeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/trxUndelegateResourceIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/trxUnfreezeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/trxVoteIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/trxWithdrawExpireUnfreezeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/undelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/unstakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/unwrapNativeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/validatorRegistrationIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/vetDecreaseStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/vetDelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/vetIncreaseStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/vetSignalExitIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/vetStakeClaimRewardsIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/vetStakingIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/vetUnstakingIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/vetValidatorRegistrationIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/vetWithdrawStakeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/voteDelegationIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/walletRecoveryIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/walrusStakingIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/walrusUndelegateIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/walrusWithdrawIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/withdrawIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/wrapApproveIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/wrapNativeIntent.d.ts +6 -0
- package/dist/src/schema/transactionRequest/intents/xdcStakingIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/xdcUnstakingIntent.d.ts +12 -0
- package/dist/src/schema/transactionRequest/intents/zecPaymentIntent.d.ts +6 -0
- 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 +40 -1
- package/src/schema/transactionRequest/intents/cantonGovernanceLockCommon.ts +180 -0
- package/src/schema/transactionRequest/intents/cantonGovernanceLockIntent.ts +237 -0
- package/src/schema/transactionRequest/intents/index.ts +2 -0
- package/src/schema/transactionRequest/intents/intent.ts +16 -2
- package/src/schema/transactionRequest/intents/intentGroups.ts +18 -3
- package/src/schema/transactionRequest/intents/intentType.ts +16 -0
- package/src/schema/transactionRequest/transactionRequest.ts +3 -3
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Shared building blocks for the dedicated Canton CIP-0127 governance-lock intents.
|
|
5
|
+
*
|
|
6
|
+
* The backend derives the canonical `splice.lfdecentralizedtrust.org/reason` memo from these
|
|
7
|
+
* typed fields. Callers never supply a protocol memo, so every free-form string that ends up in
|
|
8
|
+
* that memo is restricted here to a form that cannot inject extra `key=value` pairs.
|
|
9
|
+
*
|
|
10
|
+
* Branded codecs use inline predicate functions cast to a type guard (same pattern as
|
|
11
|
+
* `CantonAmount`) so `@api-ts/openapi-generator` does not try to resolve the predicate as a codec.
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
export interface CantonGovernanceLockMemoTokenBrand {
|
|
15
|
+
readonly CantonGovernanceLockMemoToken: unique symbol;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Non-empty token with no whitespace, `&` or `=`. Used for lock subjects (SV names or FA party
|
|
20
|
+
* ids) and party ids, which the backend embeds verbatim in the CIP-0127 memo.
|
|
21
|
+
*/
|
|
22
|
+
export const CantonGovernanceLockMemoToken = t.brand(
|
|
23
|
+
t.string,
|
|
24
|
+
((
|
|
25
|
+
value: string,
|
|
26
|
+
): value is t.Branded<string, CantonGovernanceLockMemoTokenBrand> =>
|
|
27
|
+
/^[^\s&=]+$/.test(value)) as (
|
|
28
|
+
value: string,
|
|
29
|
+
) => value is t.Branded<string, CantonGovernanceLockMemoTokenBrand>,
|
|
30
|
+
"CantonGovernanceLockMemoToken",
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
export interface CantonGovernanceLockPositiveAmountBrand {
|
|
34
|
+
readonly CantonGovernanceLockPositiveAmount: unique symbol;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Strictly positive unsigned Canton decimal string (at most 10 fractional digits, matching
|
|
39
|
+
* Daml `Numeric 10`). No sign, no exponent.
|
|
40
|
+
*/
|
|
41
|
+
export const CantonGovernanceLockPositiveAmount = t.brand(
|
|
42
|
+
t.string,
|
|
43
|
+
((
|
|
44
|
+
value: string,
|
|
45
|
+
): value is t.Branded<string, CantonGovernanceLockPositiveAmountBrand> =>
|
|
46
|
+
/^\d+(\.\d{1,10})?$/.test(value) && /[1-9]/.test(value)) as (
|
|
47
|
+
value: string,
|
|
48
|
+
) => value is t.Branded<string, CantonGovernanceLockPositiveAmountBrand>,
|
|
49
|
+
"CantonGovernanceLockPositiveAmount",
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
export interface CantonGovernanceLockZeroAmountBrand {
|
|
53
|
+
readonly CantonGovernanceLockZeroAmount: unique symbol;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
/** Zero Canton decimal string, e.g. `0` or `0.0`. */
|
|
57
|
+
export const CantonGovernanceLockZeroAmount = t.brand(
|
|
58
|
+
t.string,
|
|
59
|
+
((
|
|
60
|
+
value: string,
|
|
61
|
+
): value is t.Branded<string, CantonGovernanceLockZeroAmountBrand> =>
|
|
62
|
+
/^0+(\.0{1,10})?$/.test(value)) as (
|
|
63
|
+
value: string,
|
|
64
|
+
) => value is t.Branded<string, CantonGovernanceLockZeroAmountBrand>,
|
|
65
|
+
"CantonGovernanceLockZeroAmount",
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export interface CantonGovernanceLockTimestampBrand {
|
|
69
|
+
readonly CantonGovernanceLockTimestamp: unique symbol;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* UTC ISO 8601 timestamp (`YYYY-MM-DDTHH:mm:ss[.fraction]Z`), the form CIP-0127 uses for
|
|
74
|
+
* `vesting-start-time` and `vested-until-time`. Must be a real calendar instant.
|
|
75
|
+
*/
|
|
76
|
+
export const CantonGovernanceLockTimestamp = t.brand(
|
|
77
|
+
t.string,
|
|
78
|
+
((
|
|
79
|
+
value: string,
|
|
80
|
+
): value is t.Branded<string, CantonGovernanceLockTimestampBrand> => {
|
|
81
|
+
const match =
|
|
82
|
+
/^(\d{4})-(\d{2})-(\d{2})T\d{2}:\d{2}:\d{2}(?:\.\d{1,9})?Z$/.exec(value);
|
|
83
|
+
if (!match) {
|
|
84
|
+
return false;
|
|
85
|
+
}
|
|
86
|
+
const parsed = new Date(value);
|
|
87
|
+
return (
|
|
88
|
+
!Number.isNaN(parsed.getTime()) &&
|
|
89
|
+
parsed.getUTCFullYear() === Number(match[1]) &&
|
|
90
|
+
parsed.getUTCMonth() + 1 === Number(match[2]) &&
|
|
91
|
+
parsed.getUTCDate() === Number(match[3])
|
|
92
|
+
);
|
|
93
|
+
}) as (
|
|
94
|
+
value: string,
|
|
95
|
+
) => value is t.Branded<string, CantonGovernanceLockTimestampBrand>,
|
|
96
|
+
"CantonGovernanceLockTimestamp",
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
export interface CantonGovernanceLockMicrosBrand {
|
|
100
|
+
readonly CantonGovernanceLockMicros: unique symbol;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Positive integer microsecond count as a decimal string (no sign, no leading zeros). Kept as a
|
|
105
|
+
* string so the value round-trips into the CIP-0127 memo without float precision loss.
|
|
106
|
+
*/
|
|
107
|
+
export const CantonGovernanceLockMicros = t.brand(
|
|
108
|
+
t.string,
|
|
109
|
+
((
|
|
110
|
+
value: string,
|
|
111
|
+
): value is t.Branded<string, CantonGovernanceLockMicrosBrand> =>
|
|
112
|
+
/^[1-9]\d*$/.test(value)) as (
|
|
113
|
+
value: string,
|
|
114
|
+
) => value is t.Branded<string, CantonGovernanceLockMicrosBrand>,
|
|
115
|
+
"CantonGovernanceLockMicros",
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
/** CIP-0127 `lock-kind` values. */
|
|
119
|
+
export const CantonGovernanceLockKind = t.union([
|
|
120
|
+
t.literal("sv-lock"),
|
|
121
|
+
t.literal("fa-lock"),
|
|
122
|
+
t.literal("provisional-fa-lock"),
|
|
123
|
+
]);
|
|
124
|
+
|
|
125
|
+
export type CantonGovernanceLockKind = t.TypeOf<
|
|
126
|
+
typeof CantonGovernanceLockKind
|
|
127
|
+
>;
|
|
128
|
+
|
|
129
|
+
/**
|
|
130
|
+
* Lock kinds that can vest. Provisional FA locks are returned immediately on unlock and never
|
|
131
|
+
* enter a vesting period.
|
|
132
|
+
*/
|
|
133
|
+
export const CantonGovernanceLockVestableKind = t.union([
|
|
134
|
+
t.literal("sv-lock"),
|
|
135
|
+
t.literal("fa-lock"),
|
|
136
|
+
]);
|
|
137
|
+
|
|
138
|
+
export type CantonGovernanceLockVestableKind = t.TypeOf<
|
|
139
|
+
typeof CantonGovernanceLockVestableKind
|
|
140
|
+
>;
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* Callers may never supply a protocol memo: the backend generates the canonical CIP-0127 memo.
|
|
144
|
+
* Declaring `memo` as `undefined` makes decoding fail if one is present.
|
|
145
|
+
*/
|
|
146
|
+
export const CantonGovernanceLockNoProtocolMemo = t.partial({
|
|
147
|
+
memo: t.undefined,
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
/**
|
|
151
|
+
* Identifies the target lock of a substitution or lock transfer by value (CIP-0127 resolves
|
|
152
|
+
* targets by kind, owner, subject and vesting state, never by amount).
|
|
153
|
+
*
|
|
154
|
+
* - `locked`: any lock kind; vesting metadata MUST be absent.
|
|
155
|
+
* - `vesting`: only sv/fa locks; both vesting metadata fields are REQUIRED.
|
|
156
|
+
*/
|
|
157
|
+
export const CantonGovernanceLockTarget = t.union([
|
|
158
|
+
t.intersection([
|
|
159
|
+
t.type({
|
|
160
|
+
lockKind: CantonGovernanceLockKind,
|
|
161
|
+
lockStatus: t.literal("locked"),
|
|
162
|
+
}),
|
|
163
|
+
t.partial({
|
|
164
|
+
vestingDurationMicros: t.undefined,
|
|
165
|
+
vestingEndTimeMicros: t.undefined,
|
|
166
|
+
}),
|
|
167
|
+
]),
|
|
168
|
+
t.type({
|
|
169
|
+
lockKind: CantonGovernanceLockVestableKind,
|
|
170
|
+
lockStatus: t.literal("vesting"),
|
|
171
|
+
/** Vesting duration in microseconds (`lock-vesting-duration-micros`). */
|
|
172
|
+
vestingDurationMicros: CantonGovernanceLockMicros,
|
|
173
|
+
/** Vesting end time in microseconds since the Unix epoch (`lock-vesting-end-time-micros`). */
|
|
174
|
+
vestingEndTimeMicros: CantonGovernanceLockMicros,
|
|
175
|
+
}),
|
|
176
|
+
]);
|
|
177
|
+
|
|
178
|
+
export type CantonGovernanceLockTarget = t.TypeOf<
|
|
179
|
+
typeof CantonGovernanceLockTarget
|
|
180
|
+
>;
|
|
@@ -0,0 +1,237 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { BaseIntent } from "./baseIntent";
|
|
3
|
+
import { intentTypes } from "./intentType";
|
|
4
|
+
import {
|
|
5
|
+
CantonGovernanceLockKind,
|
|
6
|
+
CantonGovernanceLockMicros,
|
|
7
|
+
CantonGovernanceLockMemoToken,
|
|
8
|
+
CantonGovernanceLockNoProtocolMemo,
|
|
9
|
+
CantonGovernanceLockPositiveAmount,
|
|
10
|
+
CantonGovernanceLockTarget,
|
|
11
|
+
CantonGovernanceLockTimestamp,
|
|
12
|
+
CantonGovernanceLockVestableKind,
|
|
13
|
+
CantonGovernanceLockZeroAmount,
|
|
14
|
+
} from "./cantonGovernanceLockCommon";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Canton CIP-0127 compatibility-mode governance-lock intents.
|
|
18
|
+
*
|
|
19
|
+
* Six dedicated intents, one per lock-manager request. They deliberately do NOT share an
|
|
20
|
+
* `action` discriminator and do NOT go through `CantonCommandIntent`. The backend generates the
|
|
21
|
+
* canonical `splice.lfdecentralizedtrust.org/reason` memo from the typed fields below; callers
|
|
22
|
+
* cannot supply a protocol memo (a `memo` field is rejected). `BaseIntent.sequenceId` is the
|
|
23
|
+
* client request / idempotency key, and `BaseIntent.comment` stays a human-readable note that is
|
|
24
|
+
* never part of the protocol memo.
|
|
25
|
+
*
|
|
26
|
+
* The lock owner / sender is the wallet's Canton party carried by the txRequest, so the intents
|
|
27
|
+
* only carry the lock subject and operation parameters.
|
|
28
|
+
*
|
|
29
|
+
* Proposal settlement reuses the existing intents: `transferAccept`, `transferReject`,
|
|
30
|
+
* `transferOfferWithdrawn` and `transferAcknowledge`.
|
|
31
|
+
*
|
|
32
|
+
* Intent type -> CIP-0127 `request=` memo value:
|
|
33
|
+
* - `cantonGovernanceLockCreate` -> `create-lock`
|
|
34
|
+
* - `cantonGovernanceLockUnlock` -> `unlock-and-start-vesting` (sv / fa locks)
|
|
35
|
+
* - `cantonGovernanceLockProvisionalUnlock` -> `unlock-and-start-vesting` (provisional FA lock)
|
|
36
|
+
* - `cantonGovernanceLockWithdraw` -> `withdraw-vested-funds`
|
|
37
|
+
* - `cantonGovernanceLockProposeSubstitution` -> `substitute-lock`
|
|
38
|
+
* - `cantonGovernanceLockProposeTransfer` -> `transfer-lock`
|
|
39
|
+
*/
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* @title Canton Governance Lock Create Intent
|
|
43
|
+
*
|
|
44
|
+
* Create a lock, top up an existing lock, or trigger an explicit merge.
|
|
45
|
+
*
|
|
46
|
+
* Lock keys auto-merge, so a create with a positive `amount` tops up an existing lock. A merge
|
|
47
|
+
* of existing locks with the same key is requested with `amount` zero AND `merge: true`; the
|
|
48
|
+
* transfer then carries empty `inputHoldingCids`. A zero amount without `merge: true`, or
|
|
49
|
+
* `merge: true` with a positive amount, is rejected.
|
|
50
|
+
*
|
|
51
|
+
* @param {String} intentType - Always `cantonGovernanceLockCreate`
|
|
52
|
+
* @param {String} lockKind - `sv-lock` | `fa-lock` | `provisional-fa-lock`
|
|
53
|
+
* @param {String} lockSubject - SV rights owner name or FA party id
|
|
54
|
+
* @param {String} amount - Amount to lock (decimal string); `0`/`0.0` only with `merge: true`
|
|
55
|
+
* @param {Boolean} [merge] - Must be `true` when `amount` is zero; must be absent/false otherwise
|
|
56
|
+
*/
|
|
57
|
+
export const CantonGovernanceLockCreateIntent = t.intersection([
|
|
58
|
+
BaseIntent,
|
|
59
|
+
CantonGovernanceLockNoProtocolMemo,
|
|
60
|
+
t.type({
|
|
61
|
+
intentType: intentTypes.cantonGovernanceLockCreate,
|
|
62
|
+
lockKind: CantonGovernanceLockKind,
|
|
63
|
+
lockSubject: CantonGovernanceLockMemoToken,
|
|
64
|
+
}),
|
|
65
|
+
t.union([
|
|
66
|
+
t.intersection([
|
|
67
|
+
t.type({ amount: CantonGovernanceLockPositiveAmount }),
|
|
68
|
+
t.partial({ merge: t.literal(false) }),
|
|
69
|
+
]),
|
|
70
|
+
t.type({
|
|
71
|
+
amount: CantonGovernanceLockZeroAmount,
|
|
72
|
+
merge: t.literal(true),
|
|
73
|
+
}),
|
|
74
|
+
]),
|
|
75
|
+
]);
|
|
76
|
+
|
|
77
|
+
export type CantonGovernanceLockCreateIntent = t.TypeOf<
|
|
78
|
+
typeof CantonGovernanceLockCreateIntent
|
|
79
|
+
>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* @title Canton Governance Lock Unlock Intent
|
|
83
|
+
*
|
|
84
|
+
* Unlock part or all of a regular SV or FA lock and start vesting. The transfer amount is
|
|
85
|
+
* ignored by the lock manager, so the transfer carries empty `inputHoldingCids`. Provisional FA
|
|
86
|
+
* locks use `CantonGovernanceLockProvisionalUnlockIntent` instead.
|
|
87
|
+
*
|
|
88
|
+
* @param {String} intentType - Always `cantonGovernanceLockUnlock`
|
|
89
|
+
* @param {String} lockKind - `sv-lock` | `fa-lock`
|
|
90
|
+
* @param {String} lockSubject - SV rights owner name or FA party id
|
|
91
|
+
* @param {String} unlockAmount - Amount to unlock (positive decimal string)
|
|
92
|
+
* @param {String} vestingStartTime - UTC ISO 8601 vesting start; must be submitted before it and at most 24h ahead (enforced on-ledger)
|
|
93
|
+
*/
|
|
94
|
+
export const CantonGovernanceLockUnlockIntent = t.intersection([
|
|
95
|
+
BaseIntent,
|
|
96
|
+
CantonGovernanceLockNoProtocolMemo,
|
|
97
|
+
t.type({
|
|
98
|
+
intentType: intentTypes.cantonGovernanceLockUnlock,
|
|
99
|
+
lockKind: CantonGovernanceLockVestableKind,
|
|
100
|
+
lockSubject: CantonGovernanceLockMemoToken,
|
|
101
|
+
unlockAmount: CantonGovernanceLockPositiveAmount,
|
|
102
|
+
vestingStartTime: CantonGovernanceLockTimestamp,
|
|
103
|
+
}),
|
|
104
|
+
]);
|
|
105
|
+
|
|
106
|
+
export type CantonGovernanceLockUnlockIntent = t.TypeOf<
|
|
107
|
+
typeof CantonGovernanceLockUnlockIntent
|
|
108
|
+
>;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @title Canton Governance Lock Provisional Unlock Intent
|
|
112
|
+
*
|
|
113
|
+
* Unlock a provisional FA lock. Provisional locks never vest: funds return to the owner
|
|
114
|
+
* immediately, so no vesting start time exists (one is rejected).
|
|
115
|
+
*
|
|
116
|
+
* @param {String} intentType - Always `cantonGovernanceLockProvisionalUnlock`
|
|
117
|
+
* @param {String} lockKind - Always `provisional-fa-lock`
|
|
118
|
+
* @param {String} lockSubject - FA party id
|
|
119
|
+
* @param {String} unlockAmount - Amount to unlock (positive decimal string)
|
|
120
|
+
*/
|
|
121
|
+
export const CantonGovernanceLockProvisionalUnlockIntent = t.intersection([
|
|
122
|
+
BaseIntent,
|
|
123
|
+
CantonGovernanceLockNoProtocolMemo,
|
|
124
|
+
t.type({
|
|
125
|
+
intentType: intentTypes.cantonGovernanceLockProvisionalUnlock,
|
|
126
|
+
lockKind: t.literal("provisional-fa-lock"),
|
|
127
|
+
lockSubject: CantonGovernanceLockMemoToken,
|
|
128
|
+
unlockAmount: CantonGovernanceLockPositiveAmount,
|
|
129
|
+
}),
|
|
130
|
+
t.partial({ vestingStartTime: t.undefined }),
|
|
131
|
+
]);
|
|
132
|
+
|
|
133
|
+
export type CantonGovernanceLockProvisionalUnlockIntent = t.TypeOf<
|
|
134
|
+
typeof CantonGovernanceLockProvisionalUnlockIntent
|
|
135
|
+
>;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* @title Canton Governance Lock Withdraw Intent
|
|
139
|
+
*
|
|
140
|
+
* Withdraw vested funds from a vesting lock. The target vesting lock is identified by value:
|
|
141
|
+
* copy `vestingDurationMicros` / `vestingEndTimeMicros` from the lock as displayed in the wallet.
|
|
142
|
+
* The transfer amount is ignored, so the transfer carries empty `inputHoldingCids`.
|
|
143
|
+
*
|
|
144
|
+
* @param {String} intentType - Always `cantonGovernanceLockWithdraw`
|
|
145
|
+
* @param {String} lockKind - `sv-lock` | `fa-lock` (provisional locks never vest)
|
|
146
|
+
* @param {String} lockSubject - SV rights owner name or FA party id
|
|
147
|
+
* @param {String} vestedUntilTime - UTC ISO 8601 time up to which vested funds are released; must be in the past (enforced on-ledger)
|
|
148
|
+
* @param {String} vestingDurationMicros - Vesting duration in microseconds
|
|
149
|
+
* @param {String} vestingEndTimeMicros - Vesting end time in microseconds since the Unix epoch
|
|
150
|
+
*/
|
|
151
|
+
export const CantonGovernanceLockWithdrawIntent = t.intersection([
|
|
152
|
+
BaseIntent,
|
|
153
|
+
CantonGovernanceLockNoProtocolMemo,
|
|
154
|
+
t.type({
|
|
155
|
+
intentType: intentTypes.cantonGovernanceLockWithdraw,
|
|
156
|
+
lockKind: CantonGovernanceLockVestableKind,
|
|
157
|
+
lockSubject: CantonGovernanceLockMemoToken,
|
|
158
|
+
vestedUntilTime: CantonGovernanceLockTimestamp,
|
|
159
|
+
vestingDurationMicros: CantonGovernanceLockMicros,
|
|
160
|
+
vestingEndTimeMicros: CantonGovernanceLockMicros,
|
|
161
|
+
}),
|
|
162
|
+
]);
|
|
163
|
+
|
|
164
|
+
export type CantonGovernanceLockWithdrawIntent = t.TypeOf<
|
|
165
|
+
typeof CantonGovernanceLockWithdrawIntent
|
|
166
|
+
>;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @title Canton Governance Lock Propose Substitution Intent
|
|
170
|
+
*
|
|
171
|
+
* Propose substituting some or all of an existing lock with the wallet's own funds. The result
|
|
172
|
+
* is a pending transfer instruction the target lock owner accepts or rejects (settled with
|
|
173
|
+
* `transferAccept` / `transferReject`) and the proposer can withdraw (`transferOfferWithdrawn`).
|
|
174
|
+
*
|
|
175
|
+
* The target lock is identified by value (kind, owner, subject, vesting state) — never by
|
|
176
|
+
* amount. `lockStatus: "locked"` forbids vesting metadata; `lockStatus: "vesting"` requires both
|
|
177
|
+
* vesting fields and only applies to sv/fa locks.
|
|
178
|
+
*
|
|
179
|
+
* @param {String} intentType - Always `cantonGovernanceLockProposeSubstitution`
|
|
180
|
+
* @param {String} targetLockOwner - Party id owning the lock being substituted
|
|
181
|
+
* @param {String} lockKind - `sv-lock` | `fa-lock` | `provisional-fa-lock`
|
|
182
|
+
* @param {String} lockSubject - SV rights owner name or FA party id
|
|
183
|
+
* @param {String} lockStatus - `locked` | `vesting`
|
|
184
|
+
* @param {String} amount - Amount to substitute (positive decimal string)
|
|
185
|
+
* @param {String} [vestingDurationMicros] - Required iff `lockStatus` is `vesting`
|
|
186
|
+
* @param {String} [vestingEndTimeMicros] - Required iff `lockStatus` is `vesting`
|
|
187
|
+
*/
|
|
188
|
+
export const CantonGovernanceLockProposeSubstitutionIntent = t.intersection([
|
|
189
|
+
BaseIntent,
|
|
190
|
+
CantonGovernanceLockNoProtocolMemo,
|
|
191
|
+
t.type({
|
|
192
|
+
intentType: intentTypes.cantonGovernanceLockProposeSubstitution,
|
|
193
|
+
targetLockOwner: CantonGovernanceLockMemoToken,
|
|
194
|
+
lockSubject: CantonGovernanceLockMemoToken,
|
|
195
|
+
amount: CantonGovernanceLockPositiveAmount,
|
|
196
|
+
}),
|
|
197
|
+
CantonGovernanceLockTarget,
|
|
198
|
+
]);
|
|
199
|
+
|
|
200
|
+
export type CantonGovernanceLockProposeSubstitutionIntent = t.TypeOf<
|
|
201
|
+
typeof CantonGovernanceLockProposeSubstitutionIntent
|
|
202
|
+
>;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* @title Canton Governance Lock Propose Transfer Intent
|
|
206
|
+
*
|
|
207
|
+
* Propose transferring part of a lock the wallet owns to a new owner. The result is a pending
|
|
208
|
+
* transfer instruction for the new owner (settled with `transferAccept` / `transferReject`) that
|
|
209
|
+
* the current owner can withdraw (`transferOfferWithdrawn`). The transfer amount is ignored by
|
|
210
|
+
* the lock manager, so the transfer carries empty `inputHoldingCids`.
|
|
211
|
+
*
|
|
212
|
+
* Target rules are the same as for substitution.
|
|
213
|
+
*
|
|
214
|
+
* @param {String} intentType - Always `cantonGovernanceLockProposeTransfer`
|
|
215
|
+
* @param {String} newLockOwner - Party id that will own the transferred lock
|
|
216
|
+
* @param {String} transferAmount - Amount to transfer (positive decimal string)
|
|
217
|
+
* @param {String} lockKind - `sv-lock` | `fa-lock` | `provisional-fa-lock`
|
|
218
|
+
* @param {String} lockSubject - SV rights owner name or FA party id
|
|
219
|
+
* @param {String} lockStatus - `locked` | `vesting`
|
|
220
|
+
* @param {String} [vestingDurationMicros] - Required iff `lockStatus` is `vesting`
|
|
221
|
+
* @param {String} [vestingEndTimeMicros] - Required iff `lockStatus` is `vesting`
|
|
222
|
+
*/
|
|
223
|
+
export const CantonGovernanceLockProposeTransferIntent = t.intersection([
|
|
224
|
+
BaseIntent,
|
|
225
|
+
CantonGovernanceLockNoProtocolMemo,
|
|
226
|
+
t.type({
|
|
227
|
+
intentType: intentTypes.cantonGovernanceLockProposeTransfer,
|
|
228
|
+
newLockOwner: CantonGovernanceLockMemoToken,
|
|
229
|
+
lockSubject: CantonGovernanceLockMemoToken,
|
|
230
|
+
transferAmount: CantonGovernanceLockPositiveAmount,
|
|
231
|
+
}),
|
|
232
|
+
CantonGovernanceLockTarget,
|
|
233
|
+
]);
|
|
234
|
+
|
|
235
|
+
export type CantonGovernanceLockProposeTransferIntent = t.TypeOf<
|
|
236
|
+
typeof CantonGovernanceLockProposeTransferIntent
|
|
237
|
+
>;
|
|
@@ -54,6 +54,8 @@ export * from "./cantonEndInvestorOnboardingAcceptIntent";
|
|
|
54
54
|
export * from "./cantonEndInvestorOnboardingRejectIntent";
|
|
55
55
|
export * from "./cantonEndInvestorOnboardingCancelIntent";
|
|
56
56
|
export * from "./cantonEndInvestorOffboardingIntent";
|
|
57
|
+
export * from "./cantonGovernanceLockCommon";
|
|
58
|
+
export * from "./cantonGovernanceLockIntent";
|
|
57
59
|
export * from "./cantonParticipantOnboardingRequestIntent";
|
|
58
60
|
export * from "./cantonParticipantAllowListIntent";
|
|
59
61
|
export * from "./claimIntent";
|
|
@@ -97,7 +97,7 @@ import { MmiSignTransactionIntent } from "./mmiSignTransactionIntent";
|
|
|
97
97
|
import { EthConsolidateIntent } from "./ethConsolidateIntent";
|
|
98
98
|
import { EthConsolidateTokenIntent } from "./ethConsolidateTokenIntent";
|
|
99
99
|
import { EthTransferTokenIntent } from "./ethTransferTokenIntent";
|
|
100
|
-
import {
|
|
100
|
+
import { BaseIntentCatchAll } from "./baseIntent";
|
|
101
101
|
import { DotConsolidateIntent } from "./dotConsolidateIntent";
|
|
102
102
|
import { SolCloseAssociatedTokenAccountIntent } from "./solCloseAssociatedTokenAccountIntent";
|
|
103
103
|
import { BaseStakeIntentWithCalldata } from "./baseStakeIntentWithCalldata";
|
|
@@ -145,6 +145,14 @@ import {
|
|
|
145
145
|
CantonParticipantAllowListAddIntent,
|
|
146
146
|
CantonParticipantAllowListRemoveIntent,
|
|
147
147
|
} from "./cantonParticipantAllowListIntent";
|
|
148
|
+
import {
|
|
149
|
+
CantonGovernanceLockCreateIntent,
|
|
150
|
+
CantonGovernanceLockUnlockIntent,
|
|
151
|
+
CantonGovernanceLockProvisionalUnlockIntent,
|
|
152
|
+
CantonGovernanceLockWithdrawIntent,
|
|
153
|
+
CantonGovernanceLockProposeSubstitutionIntent,
|
|
154
|
+
CantonGovernanceLockProposeTransferIntent,
|
|
155
|
+
} from "./cantonGovernanceLockIntent";
|
|
148
156
|
import { TonWhalesDelegateIntent } from "./tonWhalesDelegateIntent";
|
|
149
157
|
import { TonWhalesUndelegateIntent } from "./tonWhalesUndelegateIntent";
|
|
150
158
|
import { TrxClaimRewardsIntent } from "./trxClaimRewardsIntent";
|
|
@@ -207,6 +215,12 @@ export const TransactionIntent = t.union([
|
|
|
207
215
|
CantonParticipantOnboardingRequestIntent,
|
|
208
216
|
CantonParticipantAllowListAddIntent,
|
|
209
217
|
CantonParticipantAllowListRemoveIntent,
|
|
218
|
+
CantonGovernanceLockCreateIntent,
|
|
219
|
+
CantonGovernanceLockUnlockIntent,
|
|
220
|
+
CantonGovernanceLockProvisionalUnlockIntent,
|
|
221
|
+
CantonGovernanceLockWithdrawIntent,
|
|
222
|
+
CantonGovernanceLockProposeSubstitutionIntent,
|
|
223
|
+
CantonGovernanceLockProposeTransferIntent,
|
|
210
224
|
ClaimIntent,
|
|
211
225
|
CosmosContractCallIntent,
|
|
212
226
|
CosmosPaymentIntent,
|
|
@@ -334,7 +348,7 @@ export const TransactionIntent = t.union([
|
|
|
334
348
|
/**
|
|
335
349
|
* Catch all for past intents that have not been converted to codecs
|
|
336
350
|
*/
|
|
337
|
-
|
|
351
|
+
BaseIntentCatchAll,
|
|
338
352
|
]);
|
|
339
353
|
|
|
340
354
|
export type TransactionIntent = t.TypeOf<typeof TransactionIntent>;
|
|
@@ -40,6 +40,14 @@ import {
|
|
|
40
40
|
CantonParticipantAllowListAddIntent,
|
|
41
41
|
CantonParticipantAllowListRemoveIntent,
|
|
42
42
|
} from "./cantonParticipantAllowListIntent";
|
|
43
|
+
import {
|
|
44
|
+
CantonGovernanceLockCreateIntent,
|
|
45
|
+
CantonGovernanceLockUnlockIntent,
|
|
46
|
+
CantonGovernanceLockProvisionalUnlockIntent,
|
|
47
|
+
CantonGovernanceLockWithdrawIntent,
|
|
48
|
+
CantonGovernanceLockProposeSubstitutionIntent,
|
|
49
|
+
CantonGovernanceLockProposeTransferIntent,
|
|
50
|
+
} from "./cantonGovernanceLockIntent";
|
|
43
51
|
import { ClaimIntent } from "./claimIntent";
|
|
44
52
|
import { CosmosContractCallIntent } from "./cosmosContractCallIntent";
|
|
45
53
|
import { CosmosPaymentIntent } from "./cosmosPaymentIntent";
|
|
@@ -162,7 +170,7 @@ import { WalrusWithdrawIntent } from "./walrusWithdrawIntent";
|
|
|
162
170
|
import { XdcUploadKycIntent, XdcProposeIntent } from "./xdcStakingIntent";
|
|
163
171
|
import { XdcResignIntent, XdcWithdrawIntent } from "./xdcUnstakingIntent";
|
|
164
172
|
import { StacksRegisterForBondIntent } from "./stacksRegisterForBondIntent";
|
|
165
|
-
import {
|
|
173
|
+
import { BaseIntentCatchAll } from "./baseIntent";
|
|
166
174
|
import { ZecPaymentIntent } from "./zecPaymentIntent";
|
|
167
175
|
|
|
168
176
|
/**
|
|
@@ -251,6 +259,12 @@ export const TransactionIntentCommon = t.union([
|
|
|
251
259
|
CantonParticipantOnboardingRequestIntent,
|
|
252
260
|
CantonParticipantAllowListAddIntent,
|
|
253
261
|
CantonParticipantAllowListRemoveIntent,
|
|
262
|
+
CantonGovernanceLockCreateIntent,
|
|
263
|
+
CantonGovernanceLockUnlockIntent,
|
|
264
|
+
CantonGovernanceLockProvisionalUnlockIntent,
|
|
265
|
+
CantonGovernanceLockWithdrawIntent,
|
|
266
|
+
CantonGovernanceLockProposeSubstitutionIntent,
|
|
267
|
+
CantonGovernanceLockProposeTransferIntent,
|
|
254
268
|
DotConsolidateIntent,
|
|
255
269
|
DotCreateAccountIntent,
|
|
256
270
|
DotPaymentIntent,
|
|
@@ -406,9 +420,10 @@ export type TransactionIntentFullOnly = t.TypeOf<
|
|
|
406
420
|
|
|
407
421
|
/**
|
|
408
422
|
* Intents usable ONLY with `TransactionRequestLite`. No coin-specific intent is Lite-exclusive,
|
|
409
|
-
* so this is the open `BaseIntent`
|
|
423
|
+
* so this is the open `BaseIntentCatchAll` (`BaseIntent` minus intent types that own a strict
|
|
424
|
+
* codec, e.g. the CIP-0127 governance locks) — see the note at the top of this file.
|
|
410
425
|
*/
|
|
411
|
-
export const TransactionIntentLiteOnly =
|
|
426
|
+
export const TransactionIntentLiteOnly = BaseIntentCatchAll;
|
|
412
427
|
|
|
413
428
|
export type TransactionIntentLiteOnly = t.TypeOf<
|
|
414
429
|
typeof TransactionIntentLiteOnly
|
|
@@ -95,6 +95,22 @@ export const intentTypes = {
|
|
|
95
95
|
cantonParticipantAllowListRemove: t.literal(
|
|
96
96
|
"cantonParticipantAllowListRemove",
|
|
97
97
|
),
|
|
98
|
+
/**
|
|
99
|
+
* Canton CIP-0127 compatibility-mode governance-lock operations. Dedicated intents (no shared
|
|
100
|
+
* `action` field); the backend generates the canonical CIP-0127 reason memo for each.
|
|
101
|
+
*/
|
|
102
|
+
cantonGovernanceLockCreate: t.literal("cantonGovernanceLockCreate"),
|
|
103
|
+
cantonGovernanceLockUnlock: t.literal("cantonGovernanceLockUnlock"),
|
|
104
|
+
cantonGovernanceLockProvisionalUnlock: t.literal(
|
|
105
|
+
"cantonGovernanceLockProvisionalUnlock",
|
|
106
|
+
),
|
|
107
|
+
cantonGovernanceLockWithdraw: t.literal("cantonGovernanceLockWithdraw"),
|
|
108
|
+
cantonGovernanceLockProposeSubstitution: t.literal(
|
|
109
|
+
"cantonGovernanceLockProposeSubstitution",
|
|
110
|
+
),
|
|
111
|
+
cantonGovernanceLockProposeTransfer: t.literal(
|
|
112
|
+
"cantonGovernanceLockProposeTransfer",
|
|
113
|
+
),
|
|
98
114
|
/**
|
|
99
115
|
* Deposit assets into a DeFi protocol vault (e.g. Concrete USD1 → ctUSD1cx).
|
|
100
116
|
*/
|
|
@@ -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 { BaseIntentCatchAll } 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
|
+
BaseIntentCatchAll,
|
|
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
|
+
BaseIntentCatchAll,
|
|
132
132
|
t.null,
|
|
133
133
|
t.unknown,
|
|
134
134
|
]) as t.Type<unknown>,
|