@bitgo/public-types 6.22.0 → 6.24.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/index.d.ts +1 -2
- package/dist/src/schema/transactionRequest/intents/index.js +1 -2
- package/dist/src/schema/transactionRequest/intents/index.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/intent.d.ts +94 -168
- package/dist/src/schema/transactionRequest/intents/intent.js +2 -4
- package/dist/src/schema/transactionRequest/intents/intent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/{irysPledgeIntent.d.ts → polyxSwitchValidatorIntent.d.ts} +20 -20
- package/dist/src/schema/transactionRequest/intents/{irysPledgeIntent.js → polyxSwitchValidatorIntent.js} +7 -12
- package/dist/src/schema/transactionRequest/intents/polyxSwitchValidatorIntent.js.map +1 -0
- package/dist/src/schema/transactionRequest/intents/trxClaimRewardsIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/trxDelegateResourceIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/trxFreezeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/trxUndelegateResourceIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/trxUnfreezeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/trxVoteIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/trxWithdrawExpireUnfreezeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/vetDecreaseStakeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/vetDelegateIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/vetIncreaseStakeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/vetSignalExitIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/vetStakeClaimRewardsIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/vetStakingIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/vetUnstakingIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/vetValidatorRegistrationIntent.d.ts +1 -1
- package/dist/src/schema/transactionRequest/intents/vetValidatorRegistrationIntent.js +5 -1
- package/dist/src/schema/transactionRequest/intents/vetValidatorRegistrationIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/vetWithdrawStakeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/transactionRequest.d.ts +188 -336
- package/package.json +1 -1
- package/src/schema/transactionRequest/intents/index.ts +1 -2
- package/src/schema/transactionRequest/intents/intent.ts +2 -4
- package/src/schema/transactionRequest/intents/polyxSwitchValidatorIntent.ts +20 -0
- package/src/schema/transactionRequest/intents/trxClaimRewardsIntent.ts +6 -0
- package/src/schema/transactionRequest/intents/trxDelegateResourceIntent.ts +9 -0
- package/src/schema/transactionRequest/intents/trxFreezeIntent.ts +9 -0
- package/src/schema/transactionRequest/intents/trxUndelegateResourceIntent.ts +9 -0
- package/src/schema/transactionRequest/intents/trxUnfreezeIntent.ts +8 -0
- package/src/schema/transactionRequest/intents/trxVoteIntent.ts +11 -0
- package/src/schema/transactionRequest/intents/trxWithdrawExpireUnfreezeIntent.ts +7 -0
- package/src/schema/transactionRequest/intents/vetDecreaseStakeIntent.ts +6 -6
- package/src/schema/transactionRequest/intents/vetDelegateIntent.ts +7 -5
- package/src/schema/transactionRequest/intents/vetIncreaseStakeIntent.ts +6 -6
- package/src/schema/transactionRequest/intents/vetSignalExitIntent.ts +7 -6
- package/src/schema/transactionRequest/intents/vetStakeClaimRewardsIntent.ts +6 -8
- package/src/schema/transactionRequest/intents/vetStakingIntent.ts +6 -7
- package/src/schema/transactionRequest/intents/vetUnstakingIntent.ts +10 -15
- package/src/schema/transactionRequest/intents/vetValidatorRegistrationIntent.ts +11 -8
- package/src/schema/transactionRequest/intents/vetWithdrawStakeIntent.ts +7 -6
- package/dist/src/schema/transactionRequest/intents/irysPledgeIntent.js.map +0 -1
- package/dist/src/schema/transactionRequest/intents/irysStakeIntent.d.ts +0 -93
- package/dist/src/schema/transactionRequest/intents/irysStakeIntent.js +0 -41
- package/dist/src/schema/transactionRequest/intents/irysStakeIntent.js.map +0 -1
- package/src/schema/transactionRequest/intents/irysPledgeIntent.ts +0 -38
- package/src/schema/transactionRequest/intents/irysStakeIntent.ts +0 -35
|
@@ -4,13 +4,19 @@ import { BaseIntentWithAmount } from "./baseIntent";
|
|
|
4
4
|
import { intentTypes } from "./intentType";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Claim accumulated Tron staking rewards (WithdrawBalance) to the owner's
|
|
8
|
+
* address. The reward balance must be non-zero; the handler does not verify
|
|
9
|
+
* the amount before submitting the transaction. Valid on TRX and TTRX.
|
|
10
|
+
*
|
|
7
11
|
* @title TRX Claim Rewards Intent
|
|
8
12
|
*/
|
|
9
13
|
export const TrxClaimRewardsIntent = t.intersection([
|
|
10
14
|
BaseStakeIntent,
|
|
11
15
|
BaseIntentWithAmount,
|
|
12
16
|
t.type({
|
|
17
|
+
/** Must be `"stakeClaimRewards"`. */
|
|
13
18
|
intentType: intentTypes.stakeClaimRewards,
|
|
19
|
+
/** Tron address of the wallet owner; must match the wallet's root address. */
|
|
14
20
|
ownerAddress: t.string,
|
|
15
21
|
}),
|
|
16
22
|
]);
|
|
@@ -4,15 +4,24 @@ import { BaseStakeIntent } from "./baseStakeIntent";
|
|
|
4
4
|
import { intentTypes } from "./intentType";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Delegate staked BANDWIDTH or ENERGY resources to another Tron address
|
|
8
|
+
* (DelegateResourceContract). The owner must have sufficient staked
|
|
9
|
+
* resources; the receiver address must be an active Tron account; and the
|
|
10
|
+
* amount must be at least 1 TRX (1,000,000 sun). Valid on TRX and TTRX.
|
|
11
|
+
*
|
|
7
12
|
* @title TRX Delegate Resource Intent
|
|
8
13
|
*/
|
|
9
14
|
export const TrxDelegateResourceIntent = t.intersection([
|
|
10
15
|
BaseStakeIntent,
|
|
11
16
|
BaseIntentWithAmount,
|
|
12
17
|
t.type({
|
|
18
|
+
/** Must be `"delegateResource"`. */
|
|
13
19
|
intentType: intentTypes.delegateResource,
|
|
20
|
+
/** Tron address of the resource owner delegating their staked resources. */
|
|
14
21
|
ownerAddress: t.string,
|
|
22
|
+
/** Tron address of the account receiving the delegated resources; must be an active Tron account. */
|
|
15
23
|
receiverAddress: t.string,
|
|
24
|
+
/** The resource type to delegate: `BANDWIDTH` or `ENERGY`. */
|
|
16
25
|
resource: t.union([t.literal("BANDWIDTH"), t.literal("ENERGY")]),
|
|
17
26
|
}),
|
|
18
27
|
]);
|
|
@@ -4,15 +4,24 @@ import { BaseIntentWithAmount } from "./baseIntent";
|
|
|
4
4
|
import { intentTypes } from "./intentType";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Stake (freeze) TRX to obtain BANDWIDTH or ENERGY using the Tron Stake V2
|
|
8
|
+
* protocol (FreezeBalanceV2). The spendable balance must be greater than or
|
|
9
|
+
* equal to the freeze amount plus the transaction fee.
|
|
10
|
+
* Valid on TRX and TTRX.
|
|
11
|
+
*
|
|
7
12
|
* @title TRX Freeze Intent
|
|
8
13
|
*/
|
|
9
14
|
export const TrxFreezeIntent = t.intersection([
|
|
10
15
|
BaseStakeIntent,
|
|
11
16
|
BaseIntentWithAmount,
|
|
12
17
|
t.type({
|
|
18
|
+
/** Must be `"stake"`. */
|
|
13
19
|
intentType: intentTypes.stake,
|
|
20
|
+
/** Tron address of the Super Representative the user intends to vote for after freezing. Stored by the staking service to auto-construct the subsequent vote intent; not consumed by wallet-platform's freeze transaction builder. */
|
|
14
21
|
validatorAddress: t.string,
|
|
22
|
+
/** Tron address of the wallet owner staking the TRX. */
|
|
15
23
|
ownerAddress: t.string,
|
|
24
|
+
/** The resource type to obtain by staking: `BANDWIDTH` or `ENERGY`. */
|
|
16
25
|
resource: t.union([t.literal("BANDWIDTH"), t.literal("ENERGY")]),
|
|
17
26
|
}),
|
|
18
27
|
]);
|
|
@@ -4,15 +4,24 @@ import { BaseStakeIntent } from "./baseStakeIntent";
|
|
|
4
4
|
import { intentTypes } from "./intentType";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Reclaim previously delegated BANDWIDTH or ENERGY resources from a
|
|
8
|
+
* receiver address (UnDelegateResourceContract). The undelegatable balance
|
|
9
|
+
* must be sufficient to cover the requested amount.
|
|
10
|
+
* Valid on TRX and TTRX.
|
|
11
|
+
*
|
|
7
12
|
* @title TRX Undelegate Resource Intent
|
|
8
13
|
*/
|
|
9
14
|
export const TrxUndelegateResourceIntent = t.intersection([
|
|
10
15
|
BaseStakeIntent,
|
|
11
16
|
BaseIntentWithAmount,
|
|
12
17
|
t.type({
|
|
18
|
+
/** Must be `"undelegateResource"`. */
|
|
13
19
|
intentType: intentTypes.undelegateResource,
|
|
20
|
+
/** Tron address of the resource owner reclaiming the delegated resources. */
|
|
14
21
|
ownerAddress: t.string,
|
|
22
|
+
/** Tron address of the account from which the resources are being reclaimed. */
|
|
15
23
|
receiverAddress: t.string,
|
|
24
|
+
/** The resource type to reclaim: `BANDWIDTH` or `ENERGY`. */
|
|
16
25
|
resource: t.union([t.literal("BANDWIDTH"), t.literal("ENERGY")]),
|
|
17
26
|
}),
|
|
18
27
|
]);
|
|
@@ -4,14 +4,22 @@ import { BaseIntentWithAmount } from "./baseIntent";
|
|
|
4
4
|
import { intentTypes } from "./intentType";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Unstake (unfreeze) previously staked TRX using the Tron Stake V2
|
|
8
|
+
* protocol (UnfreezeBalanceV2). Initiates the unstaking waiting period;
|
|
9
|
+
* use the `claim` intent to withdraw the TRX after the waiting period
|
|
10
|
+
* has elapsed. Valid on TRX and TTRX.
|
|
11
|
+
*
|
|
7
12
|
* @title TRX Unfreeze Intent
|
|
8
13
|
*/
|
|
9
14
|
export const TrxUnfreezeIntent = t.intersection([
|
|
10
15
|
BaseStakeIntent,
|
|
11
16
|
BaseIntentWithAmount,
|
|
12
17
|
t.type({
|
|
18
|
+
/** Must be `"unstake"`. */
|
|
13
19
|
intentType: intentTypes.unstake,
|
|
20
|
+
/** Tron address of the wallet owner unstaking the TRX. */
|
|
14
21
|
ownerAddress: t.string,
|
|
22
|
+
/** The resource type to unstake: `BANDWIDTH` or `ENERGY`. */
|
|
15
23
|
resource: t.union([t.literal("BANDWIDTH"), t.literal("ENERGY")]),
|
|
16
24
|
}),
|
|
17
25
|
]);
|
|
@@ -4,22 +4,33 @@ import { BaseIntentWithAmount } from "./baseIntent";
|
|
|
4
4
|
import { intentTypes } from "./intentType";
|
|
5
5
|
|
|
6
6
|
export const TrxVote = t.type({
|
|
7
|
+
/** Tron address of the Super Representative (SR) receiving the votes. */
|
|
7
8
|
vote_address: t.string,
|
|
9
|
+
/** Number of votes to allocate to this SR, as a decimal string. */
|
|
8
10
|
vote_count: t.string,
|
|
9
11
|
});
|
|
10
12
|
|
|
11
13
|
export type TrxVote = t.TypeOf<typeof TrxVote>;
|
|
12
14
|
|
|
13
15
|
/**
|
|
16
|
+
* Cast votes for Tron Super Representatives (SR) using accumulated Tron
|
|
17
|
+
* Power (VoteWitnessContract). The total vote count across all entries must
|
|
18
|
+
* not exceed the available Tron Power. Each staked TRX provides 1 unit of
|
|
19
|
+
* Tron Power. Valid on TRX and TTRX.
|
|
20
|
+
*
|
|
14
21
|
* @title TRX Vote Intent
|
|
15
22
|
*/
|
|
16
23
|
export const TrxVoteIntent = t.intersection([
|
|
17
24
|
BaseStakeIntent,
|
|
18
25
|
BaseIntentWithAmount,
|
|
19
26
|
t.type({
|
|
27
|
+
/** Must be `"voteDelegation"`. */
|
|
20
28
|
intentType: intentTypes.voteDelegation,
|
|
29
|
+
/** Tron address of the Super Representative selected during the freeze step. Carried forward by the staking service so the user does not need to re-select a validator; not consumed by wallet-platform's vote transaction builder (which reads the `votes` array instead). */
|
|
21
30
|
validatorAddress: t.string,
|
|
31
|
+
/** Tron address of the wallet owner casting the votes. */
|
|
22
32
|
ownerAddress: t.string,
|
|
33
|
+
/** List of vote allocations. Each entry specifies a Super Representative address and the number of votes to assign. Total votes must not exceed available Tron Power. */
|
|
23
34
|
votes: t.array(TrxVote),
|
|
24
35
|
}),
|
|
25
36
|
]);
|
|
@@ -4,13 +4,20 @@ import { BaseIntentWithAmount } from "./baseIntent";
|
|
|
4
4
|
import { intentTypes } from "./intentType";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Withdraw previously unstaked TRX after the Tron unstaking waiting period
|
|
8
|
+
* has elapsed (WithdrawExpireUnfreeze). The handler does not verify that
|
|
9
|
+
* the waiting period has passed before submitting the transaction. Use the
|
|
10
|
+
* `unstake` intent to begin the unstaking process. Valid on TRX and TTRX.
|
|
11
|
+
*
|
|
7
12
|
* @title TRX Withdraw Expire Unfreeze Intent
|
|
8
13
|
*/
|
|
9
14
|
export const TrxWithdrawExpireUnfreezeIntent = t.intersection([
|
|
10
15
|
BaseStakeIntent,
|
|
11
16
|
BaseIntentWithAmount,
|
|
12
17
|
t.type({
|
|
18
|
+
/** Must be `"claim"`. */
|
|
13
19
|
intentType: intentTypes.claim,
|
|
20
|
+
/** Tron address of the wallet owner withdrawing the unstaked TRX. */
|
|
14
21
|
ownerAddress: t.string,
|
|
15
22
|
}),
|
|
16
23
|
]);
|
|
@@ -5,19 +5,19 @@ import { BaseIntentWithAmount } from "./baseIntent";
|
|
|
5
5
|
import { intentTypes } from "./intentType";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param {Amount} amount - The amount of VET to remove from the existing stake
|
|
12
|
-
* @param {string} validatorAddress - The address of the validator
|
|
13
|
-
* @param {string} stakingContractAddress - The address of the staking contract
|
|
8
|
+
* Withdraw a portion of VET staked with a VeChain validator, reducing the
|
|
9
|
+
* position size. The specified amount is returned to the sender's wallet. No
|
|
10
|
+
* VET is spent — gas is paid by the enterprise gas tank (VTHO).
|
|
14
11
|
*/
|
|
15
12
|
export const VetDecreaseStakeIntent = t.intersection([
|
|
16
13
|
BaseStakeIntent,
|
|
17
14
|
BaseIntentWithAmount,
|
|
18
15
|
t.type({
|
|
16
|
+
/** Must be "decreaseStake". */
|
|
19
17
|
intentType: intentTypes.decreaseStake,
|
|
18
|
+
/** Address of the validator whose staked position is being reduced. */
|
|
20
19
|
validatorAddress: NonEmptyString,
|
|
20
|
+
/** Address of the VeChain staking contract holding the position. */
|
|
21
21
|
stakingContractAddress: NonEmptyString,
|
|
22
22
|
}),
|
|
23
23
|
]);
|
|
@@ -3,17 +3,19 @@ import { DelegateIntent } from "./delegateIntent";
|
|
|
3
3
|
import { NonEmptyString } from "io-ts-types";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @param {string} validatorAddress - address of the validator to delegate to
|
|
6
|
+
* Delegate a VeChain staking NFT to a validator, granting the validator voting
|
|
7
|
+
* and reward rights for that position. No VET is spent — this is an NFT
|
|
8
|
+
* assignment operation, not a financial transfer. Gas is paid by the enterprise
|
|
9
|
+
* gas tank (VTHO).
|
|
11
10
|
*/
|
|
12
11
|
export const VetDelegateIntent = t.intersection([
|
|
13
12
|
DelegateIntent,
|
|
14
13
|
t.type({
|
|
14
|
+
/** ID of the staking NFT to delegate to the validator. */
|
|
15
15
|
tokenId: NonEmptyString,
|
|
16
|
+
/** Address of the VeChain staking (Stargate) contract that holds the NFT. */
|
|
16
17
|
stakingContractAddress: NonEmptyString,
|
|
18
|
+
/** Address of the validator to delegate the staking NFT to. */
|
|
17
19
|
validatorAddress: NonEmptyString,
|
|
18
20
|
}),
|
|
19
21
|
]);
|
|
@@ -5,19 +5,19 @@ import { BaseIntentWithAmount } from "./baseIntent";
|
|
|
5
5
|
import { intentTypes } from "./intentType";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param {Amount} amount - The amount of VET to add to the existing stake
|
|
12
|
-
* @param {string} validatorAddress - The address of the validator
|
|
13
|
-
* @param {string} stakingContractAddress - The address of the staking contract
|
|
8
|
+
* Increase the VET staked with an existing VeChain validator by depositing
|
|
9
|
+
* additional VET into the staking contract. The sender must have sufficient VET
|
|
10
|
+
* balance. Gas is paid by the enterprise gas tank (VTHO).
|
|
14
11
|
*/
|
|
15
12
|
export const VetIncreaseStakeIntent = t.intersection([
|
|
16
13
|
BaseStakeIntent,
|
|
17
14
|
BaseIntentWithAmount,
|
|
18
15
|
t.type({
|
|
16
|
+
/** Must be "increaseStake". */
|
|
19
17
|
intentType: intentTypes.increaseStake,
|
|
18
|
+
/** Address of the validator whose staked position is being increased. */
|
|
20
19
|
validatorAddress: NonEmptyString,
|
|
20
|
+
/** Address of the VeChain staking contract holding the existing position. */
|
|
21
21
|
stakingContractAddress: NonEmptyString,
|
|
22
22
|
}),
|
|
23
23
|
]);
|
|
@@ -4,18 +4,19 @@ import { NonEmptyString } from "io-ts-types";
|
|
|
4
4
|
import { intentTypes } from "./intentType";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param {string} validatorAddress - The address of the validator to exit
|
|
12
|
-
* @param {string} stakingContractAddress - The address of the staking contract
|
|
7
|
+
* Signal the intent to exit a VeChain validator staking position, initiating
|
|
8
|
+
* the cooldown period. This is the first step in the validator unstake flow —
|
|
9
|
+
* must be followed by `withdrawStake` after the cooldown expires. No VET is
|
|
10
|
+
* spent; gas is paid by the enterprise gas tank (VTHO).
|
|
13
11
|
*/
|
|
14
12
|
export const VetSignalExitIntent = t.intersection([
|
|
15
13
|
BaseStakeIntent,
|
|
16
14
|
t.type({
|
|
15
|
+
/** Must be "signalExit". */
|
|
17
16
|
intentType: intentTypes.signalExit,
|
|
17
|
+
/** Address of the validator node whose position is being exited. */
|
|
18
18
|
validatorAddress: NonEmptyString,
|
|
19
|
+
/** Address of the VeChain staking contract where the validator position is held. */
|
|
19
20
|
stakingContractAddress: NonEmptyString,
|
|
20
21
|
}),
|
|
21
22
|
]);
|
|
@@ -3,19 +3,17 @@ import { NonEmptyString } from "io-ts-types";
|
|
|
3
3
|
import { StakeClaimRewardsIntent } from "./stakeClaimRewardsIntent";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* This intent calls the claimRewards function on the stargate contract for a specific NFT token.
|
|
11
|
-
*
|
|
12
|
-
* @param {string} tokenId - The ID of the NFT token to claim rewards for
|
|
13
|
-
* @param {string} stakingContractAddress - The address of the stargate contract
|
|
6
|
+
* Claim VTHO rewards accumulated by a VeChain staking NFT position. Rewards
|
|
7
|
+
* accrue in VTHO (VeChain's energy token) for each NFT held in the Stargate
|
|
8
|
+
* contract. Supply the NFT's token ID and the staking contract address. Gas is
|
|
9
|
+
* paid by the enterprise gas tank (VTHO).
|
|
14
10
|
*/
|
|
15
11
|
export const VetStakeClaimRewardsIntent = t.intersection([
|
|
16
12
|
StakeClaimRewardsIntent,
|
|
17
13
|
t.type({
|
|
14
|
+
/** ID of the staking NFT whose accumulated VTHO rewards will be claimed. */
|
|
18
15
|
tokenId: NonEmptyString,
|
|
16
|
+
/** Address of the VeChain staking (Stargate) contract that holds the NFT. */
|
|
19
17
|
stakingContractAddress: NonEmptyString,
|
|
20
18
|
}),
|
|
21
19
|
]);
|
|
@@ -4,19 +4,18 @@ import { BaseIntentWithAmount } from "./baseIntent";
|
|
|
4
4
|
import { NonEmptyString } from "io-ts-types";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param {Amount} amount - The amount of VET to stake
|
|
12
|
-
* @param {string} stakingContractAddress - The address of the staking contract
|
|
13
|
-
* @param {string} levelId - The level of the NFT tier
|
|
7
|
+
* Activate a new VeChain staking position by depositing VET into the staking
|
|
8
|
+
* contract. Use `levelId` to select the staking tier. To add to an existing
|
|
9
|
+
* position, use `increaseStake` instead. All VeChain gas fees are paid by the
|
|
10
|
+
* enterprise gas tank (VTHO); the sender pays no gas.
|
|
14
11
|
*/
|
|
15
12
|
export const VetStakingIntent = t.intersection([
|
|
16
13
|
StakeIntent,
|
|
17
14
|
BaseIntentWithAmount,
|
|
18
15
|
t.type({
|
|
16
|
+
/** Address of the VeChain staking contract that will hold the staked VET. */
|
|
19
17
|
stakingContractAddress: NonEmptyString,
|
|
18
|
+
/** Staking tier level in the VeChain contract. Determines reward rate and lock parameters. */
|
|
20
19
|
levelId: NonEmptyString,
|
|
21
20
|
}),
|
|
22
21
|
]);
|
|
@@ -3,23 +3,18 @@ import { UnstakeIntent } from "./unstakeIntent";
|
|
|
3
3
|
import { NonEmptyString } from "io-ts-types";
|
|
4
4
|
import { UndelegateIntent } from "./undelegateIntent";
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* @title Common VET unstake intent fields
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @param {string} tokenId - The ID of the NFT token
|
|
11
|
-
* @param {string} stakingContractAddress - The address of the stargate contract
|
|
12
|
-
*/
|
|
13
6
|
const VetUnstakeCommonFields = t.type({
|
|
7
|
+
/** ID of the staking NFT to operate on. */
|
|
14
8
|
tokenId: NonEmptyString,
|
|
9
|
+
/** Address of the VeChain staking (Stargate) contract that holds the NFT. */
|
|
15
10
|
stakingContractAddress: NonEmptyString,
|
|
16
11
|
});
|
|
17
12
|
|
|
18
13
|
/**
|
|
19
|
-
*
|
|
20
|
-
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
14
|
+
* Remove validator delegation for a VeChain staking NFT, returning it to an
|
|
15
|
+
* undelegated state. This is the first step in the full unstaking flow — must
|
|
16
|
+
* precede `unstake` (burn NFT). No VET is spent; gas is paid by the enterprise
|
|
17
|
+
* gas tank (VTHO).
|
|
23
18
|
*/
|
|
24
19
|
export const VetExitDelegationIntent = t.intersection([
|
|
25
20
|
UndelegateIntent,
|
|
@@ -29,10 +24,10 @@ export const VetExitDelegationIntent = t.intersection([
|
|
|
29
24
|
export type VetExitDelegationIntent = t.TypeOf<typeof VetExitDelegationIntent>;
|
|
30
25
|
|
|
31
26
|
/**
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
27
|
+
* Burn a VeChain staking NFT to complete the unstaking withdrawal and reclaim
|
|
28
|
+
* staked VET. This is the second (final) step in the basic unstaking flow —
|
|
29
|
+
* must be preceded by `undelegate`. No VET is spent by the sender; gas is paid
|
|
30
|
+
* by the enterprise gas tank (VTHO).
|
|
36
31
|
*/
|
|
37
32
|
export const VetBurnNFTIntent = t.intersection([
|
|
38
33
|
UnstakeIntent,
|
|
@@ -4,20 +4,23 @@ import { NonEmptyString } from "io-ts-types";
|
|
|
4
4
|
import { BaseIntentWithAmount } from "./baseIntent";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
* @param {Amount} amount - The amount of VET to stake
|
|
11
|
-
* @param {string} validatorAddress - The address of the validator
|
|
12
|
-
* @param {number} stakingPeriod - The staking period which can be one of the three -- 60480 (7 days), 129600 (15 days) or 259200 (30 days).
|
|
13
|
-
* @param {string} stakingContractAddress - The address of the staking contract
|
|
7
|
+
* Register a new validator node in VeChain's staking contract by depositing a
|
|
8
|
+
* VET bond. The staking period determines the lock duration (60480, 129600, or
|
|
9
|
+
* 259200 blocks). Gas is paid by the enterprise gas tank (VTHO).
|
|
14
10
|
*/
|
|
15
11
|
export const VetValidatorRegistrationIntent = t.intersection([
|
|
16
12
|
ValidatorRegistrationIntent,
|
|
17
13
|
BaseIntentWithAmount,
|
|
18
14
|
t.type({
|
|
15
|
+
/** Address of the validator node being registered. Must be a valid VeChain address. */
|
|
19
16
|
validatorAddress: NonEmptyString,
|
|
20
|
-
|
|
17
|
+
/** Duration of the staking lock period in blocks. Valid values: 60480 (~7 days), 129600 (~15 days), 259200 (~30 days). */
|
|
18
|
+
stakingPeriod: t.union([
|
|
19
|
+
t.literal(60480),
|
|
20
|
+
t.literal(129600),
|
|
21
|
+
t.literal(259200),
|
|
22
|
+
]),
|
|
23
|
+
/** Address of the VeChain staking contract to register the validator with. */
|
|
21
24
|
stakingContractAddress: NonEmptyString,
|
|
22
25
|
}),
|
|
23
26
|
]);
|
|
@@ -4,18 +4,19 @@ import { NonEmptyString } from "io-ts-types";
|
|
|
4
4
|
import { intentTypes } from "./intentType";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* @param {string} validatorAddress - The address of the validator to withdraw from
|
|
12
|
-
* @param {string} stakingContractAddress - The address of the staking contract
|
|
7
|
+
* Withdraw a VeChain validator's staked VET after the cooldown period from a
|
|
8
|
+
* `signalExit` has completed. This is the second (final) step in the validator
|
|
9
|
+
* unstake flow. No VET is spent — staked VET is returned to the sender; gas is
|
|
10
|
+
* paid by the enterprise gas tank (VTHO).
|
|
13
11
|
*/
|
|
14
12
|
export const VetWithdrawStakeIntent = t.intersection([
|
|
15
13
|
BaseStakeIntent,
|
|
16
14
|
t.type({
|
|
15
|
+
/** Must be "withdrawStake". */
|
|
17
16
|
intentType: intentTypes.withdrawStake,
|
|
17
|
+
/** Address of the validator node whose staked VET is being withdrawn. */
|
|
18
18
|
validatorAddress: NonEmptyString,
|
|
19
|
+
/** Address of the VeChain staking contract holding the exited position. */
|
|
19
20
|
stakingContractAddress: NonEmptyString,
|
|
20
21
|
}),
|
|
21
22
|
]);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"irysPledgeIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/irysPledgeIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,uDAAoD;AACpD,6CAA2C;AAC3C,uDAAyD;AAM5C,QAAA,0BAA0B,GAAG,CAAC,CAAC,YAAY,CAAC;IACvD,sCAAoB;IACpB,CAAC,CAAC,IAAI,CAAC;QAEL,WAAW,EAAE,CAAC,CAAC,MAAM;KACtB,CAAC;CACH,CAAC,CAAC;AAcU,QAAA,gBAAgB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC7C,iCAAe;IACf,CAAC,CAAC,IAAI,CAAC;QACL,UAAU,EAAE,wBAAW,CAAC,MAAM;QAC9B,gBAAgB,EAAE,kCAA0B;KAC7C,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
|
-
export declare const IrysCommitmentParams: t.TypeC<{
|
|
3
|
-
commitmentFee: t.StringC;
|
|
4
|
-
commitmentValue: t.StringC;
|
|
5
|
-
signerAddress: t.StringC;
|
|
6
|
-
chainId: t.NumberC;
|
|
7
|
-
}>;
|
|
8
|
-
export type IrysCommitmentParams = t.TypeOf<typeof IrysCommitmentParams>;
|
|
9
|
-
export declare const IrysStakeIntent: t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.IntersectionC<[t.TypeC<{
|
|
10
|
-
intentType: t.KeyofC<{
|
|
11
|
-
payment: t.LiteralC<"payment">;
|
|
12
|
-
transferToken: t.LiteralC<"transferToken">;
|
|
13
|
-
consolidate: t.LiteralC<"consolidate">;
|
|
14
|
-
consolidateToken: t.LiteralC<"consolidateToken">;
|
|
15
|
-
fanout: t.LiteralC<"fanout">;
|
|
16
|
-
stake: t.LiteralC<"stake">;
|
|
17
|
-
unstake: t.LiteralC<"unstake">;
|
|
18
|
-
delegate: t.LiteralC<"delegate">;
|
|
19
|
-
undelegate: t.LiteralC<"undelegate">;
|
|
20
|
-
switchValidator: t.LiteralC<"switchValidator">;
|
|
21
|
-
claim: t.LiteralC<"claim">;
|
|
22
|
-
stakeClaimRewards: t.LiteralC<"stakeClaimRewards">;
|
|
23
|
-
pledge: t.LiteralC<"pledge">;
|
|
24
|
-
voteDelegation: t.LiteralC<"voteDelegation">;
|
|
25
|
-
vote: t.LiteralC<"vote">;
|
|
26
|
-
createAccount: t.LiteralC<"createAccount">;
|
|
27
|
-
updateAccount: t.LiteralC<"updateAccount">;
|
|
28
|
-
addTrustLine: t.LiteralC<"addTrustLine">;
|
|
29
|
-
removeTrustLine: t.LiteralC<"removeTrustLine">;
|
|
30
|
-
signMessage: t.LiteralC<"signMessage">;
|
|
31
|
-
signTypedStructuredData: t.LiteralC<"signTypedStructuredData">;
|
|
32
|
-
enableToken: t.LiteralC<"enableToken">;
|
|
33
|
-
authorize: t.LiteralC<"authorize">;
|
|
34
|
-
acceleration: t.LiteralC<"acceleration">;
|
|
35
|
-
fillNonce: t.LiteralC<"fillNonce">;
|
|
36
|
-
walletRecovery: t.LiteralC<"walletRecovery">;
|
|
37
|
-
contractCall: t.LiteralC<"contractCall">;
|
|
38
|
-
deactivate: t.LiteralC<"deactivate">;
|
|
39
|
-
customTx: t.LiteralC<"customTx">;
|
|
40
|
-
closeAssociatedTokenAccount: t.LiteralC<"closeAssociatedTokenAccount">;
|
|
41
|
-
stakeWithCallData: t.LiteralC<"stakeWithCallData">;
|
|
42
|
-
unstakeWithCallData: t.LiteralC<"unstakeWithCallData">;
|
|
43
|
-
switchValidatorWithCallData: t.LiteralC<"switchValidatorWithCallData">;
|
|
44
|
-
feeAddressTransfer: t.LiteralC<"feeAddressTransfer">;
|
|
45
|
-
tokenApproval: t.LiteralC<"tokenApproval">;
|
|
46
|
-
transferStake: t.LiteralC<"transferStake">;
|
|
47
|
-
validatorRegistration: t.LiteralC<"validatorRegistration">;
|
|
48
|
-
increaseStake: t.LiteralC<"increaseStake">;
|
|
49
|
-
decreaseStake: t.LiteralC<"decreaseStake">;
|
|
50
|
-
signalExit: t.LiteralC<"signalExit">;
|
|
51
|
-
withdrawStake: t.LiteralC<"withdrawStake">;
|
|
52
|
-
spotTransfer: t.LiteralC<"spotTransfer">;
|
|
53
|
-
bridgeFunds: t.LiteralC<"bridgeFunds">;
|
|
54
|
-
enableBridging: t.LiteralC<"enableBridging">;
|
|
55
|
-
goUnstake: t.LiteralC<"goUnstake">;
|
|
56
|
-
createBtcDelegation: t.LiteralC<"createBtcDelegation">;
|
|
57
|
-
transferAccept: t.LiteralC<"transferAccept">;
|
|
58
|
-
transferReject: t.LiteralC<"transferReject">;
|
|
59
|
-
transferAcknowledge: t.LiteralC<"transferAcknowledge">;
|
|
60
|
-
transferOfferWithdrawn: t.LiteralC<"transferOfferWithdrawn">;
|
|
61
|
-
cosignDelegationProposal: t.LiteralC<"cosignDelegationProposal">;
|
|
62
|
-
cosignDelegationAccept: t.LiteralC<"cosignDelegationAccept">;
|
|
63
|
-
allocationRequest: t.LiteralC<"allocationRequest">;
|
|
64
|
-
cantonCommand: t.LiteralC<"cantonCommand">;
|
|
65
|
-
allocationAllocate: t.LiteralC<"allocationAllocate">;
|
|
66
|
-
"defi-deposit": t.LiteralC<"defi-deposit">;
|
|
67
|
-
"defi-redeem": t.LiteralC<"defi-redeem">;
|
|
68
|
-
"defi-approve": t.LiteralC<"defi-approve">;
|
|
69
|
-
delegateResource: t.LiteralC<"delegateResource">;
|
|
70
|
-
undelegateResource: t.LiteralC<"undelegateResource">;
|
|
71
|
-
export: t.LiteralC<"export">;
|
|
72
|
-
import: t.LiteralC<"import">;
|
|
73
|
-
importtoc: t.LiteralC<"importtoc">;
|
|
74
|
-
}>;
|
|
75
|
-
}>, t.PartialC<{
|
|
76
|
-
sequenceId: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
77
|
-
comment: t.UnionC<[t.Type<string, string, unknown>, t.UndefinedC]>;
|
|
78
|
-
nonce: t.UnionC<[t.Type<string | number, string | number, unknown>, t.UndefinedC]>;
|
|
79
|
-
}>]>, t.TypeC<{
|
|
80
|
-
stakingRequestId: t.StringC;
|
|
81
|
-
}>, t.PartialC<{
|
|
82
|
-
source: t.KeyofC<typeof import("./stakingRequestSource").StakingRequestSourceEnum>;
|
|
83
|
-
}>]>, t.TypeC<{
|
|
84
|
-
intentType: t.LiteralC<"stake">;
|
|
85
|
-
}>]>, t.TypeC<{
|
|
86
|
-
commitmentParams: t.TypeC<{
|
|
87
|
-
commitmentFee: t.StringC;
|
|
88
|
-
commitmentValue: t.StringC;
|
|
89
|
-
signerAddress: t.StringC;
|
|
90
|
-
chainId: t.NumberC;
|
|
91
|
-
}>;
|
|
92
|
-
}>]>;
|
|
93
|
-
export type IrysStakeIntent = t.TypeOf<typeof IrysStakeIntent>;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.IrysStakeIntent = exports.IrysCommitmentParams = void 0;
|
|
27
|
-
const t = __importStar(require("io-ts"));
|
|
28
|
-
const stakeIntent_1 = require("./stakeIntent");
|
|
29
|
-
exports.IrysCommitmentParams = t.type({
|
|
30
|
-
commitmentFee: t.string,
|
|
31
|
-
commitmentValue: t.string,
|
|
32
|
-
signerAddress: t.string,
|
|
33
|
-
chainId: t.number,
|
|
34
|
-
});
|
|
35
|
-
exports.IrysStakeIntent = t.intersection([
|
|
36
|
-
stakeIntent_1.StakeIntent,
|
|
37
|
-
t.type({
|
|
38
|
-
commitmentParams: exports.IrysCommitmentParams,
|
|
39
|
-
}),
|
|
40
|
-
]);
|
|
41
|
-
//# sourceMappingURL=irysStakeIntent.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"irysStakeIntent.js","sourceRoot":"","sources":["../../../../../src/schema/transactionRequest/intents/irysStakeIntent.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yCAA2B;AAC3B,+CAA4C;AAM/B,QAAA,oBAAoB,GAAG,CAAC,CAAC,IAAI,CAAC;IAEzC,aAAa,EAAE,CAAC,CAAC,MAAM;IAEvB,eAAe,EAAE,CAAC,CAAC,MAAM;IAEzB,aAAa,EAAE,CAAC,CAAC,MAAM;IAEvB,OAAO,EAAE,CAAC,CAAC,MAAM;CAClB,CAAC,CAAC;AAWU,QAAA,eAAe,GAAG,CAAC,CAAC,YAAY,CAAC;IAC5C,yBAAW;IACX,CAAC,CAAC,IAAI,CAAC;QACL,gBAAgB,EAAE,4BAAoB;KACvC,CAAC;CACH,CAAC,CAAC"}
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import * as t from "io-ts";
|
|
2
|
-
import { BaseStakeIntent } from "./baseStakeIntent";
|
|
3
|
-
import { intentTypes } from "./intentType";
|
|
4
|
-
import { IrysCommitmentParams } from "./irysStakeIntent";
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Extended commitment parameters for Irys PLEDGE transactions.
|
|
8
|
-
* Includes pledgeCount (number of partitions to pledge).
|
|
9
|
-
*/
|
|
10
|
-
export const IrysPledgeCommitmentParams = t.intersection([
|
|
11
|
-
IrysCommitmentParams,
|
|
12
|
-
t.type({
|
|
13
|
-
/** Number of partitions to pledge (each is 16TB). */
|
|
14
|
-
pledgeCount: t.number,
|
|
15
|
-
}),
|
|
16
|
-
]);
|
|
17
|
-
|
|
18
|
-
export type IrysPledgeCommitmentParams = t.TypeOf<
|
|
19
|
-
typeof IrysPledgeCommitmentParams
|
|
20
|
-
>;
|
|
21
|
-
|
|
22
|
-
/**
|
|
23
|
-
* @title Irys Pledge Intent
|
|
24
|
-
*
|
|
25
|
-
* Intent for Irys PLEDGE commitment transactions.
|
|
26
|
-
* PLEDGE commits to store a 16TB partition (repeatable, each adds a partition).
|
|
27
|
-
* Requires an active STAKE delegation first.
|
|
28
|
-
* Routes to BGM_IRYS (mechanism 86) via irys/signtx keyserver path.
|
|
29
|
-
*/
|
|
30
|
-
export const IrysPledgeIntent = t.intersection([
|
|
31
|
-
BaseStakeIntent,
|
|
32
|
-
t.type({
|
|
33
|
-
intentType: intentTypes.pledge,
|
|
34
|
-
commitmentParams: IrysPledgeCommitmentParams,
|
|
35
|
-
}),
|
|
36
|
-
]);
|
|
37
|
-
|
|
38
|
-
export type IrysPledgeIntent = t.TypeOf<typeof IrysPledgeIntent>;
|