@bitgo/public-types 6.5.2 → 6.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.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/accountBaseBuildOptions.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/accountBaseConsolidateIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/baseBridgeFundsIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/baseIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/baseStakeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/baseStakeIntentWithCalldata.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/claimIntent.d.ts +70 -0
- package/dist/src/schema/transactionRequest/intents/claimIntent.js +36 -0
- package/dist/src/schema/transactionRequest/intents/claimIntent.js.map +1 -0
- package/dist/src/schema/transactionRequest/intents/delegateIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/ethAccelerationIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/ethBuildOptions.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/ethConsolidateIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/ethConsolidateTokenIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/ethFillNonceIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/ethPaymentIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/ethStakingIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/ethTransferTokenIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/fillNonceIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/hypeevmBridgeFundsIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/hypeevmSpotTransferIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/index.d.ts +3 -0
- package/dist/src/schema/transactionRequest/intents/index.js +3 -0
- package/dist/src/schema/transactionRequest/intents/index.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/intent.d.ts +412 -1
- package/dist/src/schema/transactionRequest/intents/intent.js +12 -0
- package/dist/src/schema/transactionRequest/intents/intent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/paymentIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/stakeClaimRewardsIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/stakeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/stakeWithCallDataIntent.d.ts +72 -0
- package/dist/src/schema/transactionRequest/intents/stakeWithCallDataIntent.js +36 -0
- package/dist/src/schema/transactionRequest/intents/stakeWithCallDataIntent.js.map +1 -0
- package/dist/src/schema/transactionRequest/intents/switchValidatorWithCallDataIntent.d.ts +72 -0
- package/dist/src/schema/transactionRequest/intents/switchValidatorWithCallDataIntent.js +36 -0
- package/dist/src/schema/transactionRequest/intents/switchValidatorWithCallDataIntent.js.map +1 -0
- package/dist/src/schema/transactionRequest/intents/tokenApprovalIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/transferTokenIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/undelegateIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/transactionRequest.d.ts +1082 -260
- package/package.json +1 -1
- package/src/schema/transactionRequest/intents/accelerationIntent.ts +7 -0
- package/src/schema/transactionRequest/intents/accountBaseBuildOptions.ts +1 -0
- package/src/schema/transactionRequest/intents/accountBaseConsolidateIntent.ts +6 -0
- package/src/schema/transactionRequest/intents/baseBridgeFundsIntent.ts +4 -5
- package/src/schema/transactionRequest/intents/baseIntent.ts +9 -0
- package/src/schema/transactionRequest/intents/baseStakeIntent.ts +2 -0
- package/src/schema/transactionRequest/intents/baseStakeIntentWithCalldata.ts +1 -0
- package/src/schema/transactionRequest/intents/claimIntent.ts +20 -0
- package/src/schema/transactionRequest/intents/delegateIntent.ts +6 -0
- package/src/schema/transactionRequest/intents/ethAccelerationIntent.ts +5 -0
- package/src/schema/transactionRequest/intents/ethBuildOptions.ts +10 -0
- package/src/schema/transactionRequest/intents/ethConsolidateIntent.ts +4 -0
- package/src/schema/transactionRequest/intents/ethConsolidateTokenIntent.ts +8 -0
- package/src/schema/transactionRequest/intents/ethFillNonceIntent.ts +4 -0
- package/src/schema/transactionRequest/intents/ethPaymentIntent.ts +5 -0
- package/src/schema/transactionRequest/intents/ethStakingIntent.ts +9 -0
- package/src/schema/transactionRequest/intents/ethTransferTokenIntent.ts +4 -0
- package/src/schema/transactionRequest/intents/fillNonceIntent.ts +8 -0
- package/src/schema/transactionRequest/intents/hypeevmBridgeFundsIntent.ts +4 -4
- package/src/schema/transactionRequest/intents/hypeevmSpotTransferIntent.ts +4 -0
- package/src/schema/transactionRequest/intents/index.ts +3 -0
- package/src/schema/transactionRequest/intents/intent.ts +12 -0
- package/src/schema/transactionRequest/intents/paymentIntent.ts +3 -0
- package/src/schema/transactionRequest/intents/stakeClaimRewardsIntent.ts +6 -0
- package/src/schema/transactionRequest/intents/stakeIntent.ts +1 -0
- package/src/schema/transactionRequest/intents/stakeWithCallDataIntent.ts +20 -0
- package/src/schema/transactionRequest/intents/switchValidatorWithCallDataIntent.ts +22 -0
- package/src/schema/transactionRequest/intents/tokenApprovalIntent.ts +5 -1
- package/src/schema/transactionRequest/intents/transferTokenIntent.ts +1 -0
- package/src/schema/transactionRequest/intents/undelegateIntent.ts +6 -0
package/package.json
CHANGED
|
@@ -2,13 +2,20 @@ import * as t from "io-ts";
|
|
|
2
2
|
import { BaseIntent } from "./baseIntent";
|
|
3
3
|
import { intentTypes } from "./intentType";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Base codec for acceleration intents. Replaces a stuck pending EVM transaction
|
|
7
|
+
* with a higher-fee version to accelerate confirmation (replace-by-fee).
|
|
8
|
+
*/
|
|
5
9
|
export const AccelerationIntent = t.intersection([
|
|
6
10
|
BaseIntent,
|
|
7
11
|
t.type({
|
|
12
|
+
/** Must be "acceleration". */
|
|
8
13
|
intentType: intentTypes.acceleration,
|
|
14
|
+
/** Transaction hash (0x-prefixed) of the pending transaction to accelerate. */
|
|
9
15
|
txid: t.string,
|
|
10
16
|
}),
|
|
11
17
|
t.partial({
|
|
18
|
+
/** Sender address of the original transaction. */
|
|
12
19
|
senderAddress: t.string,
|
|
13
20
|
}),
|
|
14
21
|
]);
|
|
@@ -12,13 +12,19 @@ import { TokenRecipientEntry } from "./tokenRecipientEntry";
|
|
|
12
12
|
export const AccountBaseConsolidateIntent = t.intersection([
|
|
13
13
|
AccountBaseBuildOptions,
|
|
14
14
|
t.type({
|
|
15
|
+
/** Must be "consolidate". */
|
|
15
16
|
intentType: intentTypes.consolidate,
|
|
17
|
+
/** Destination address for consolidated funds. Must be a wallet-owned address. */
|
|
16
18
|
receiveAddress: t.string,
|
|
17
19
|
}),
|
|
18
20
|
t.partial({
|
|
21
|
+
/** Index of the wallet address to use as the sender. */
|
|
19
22
|
senderAddressIndex: optionalNumber,
|
|
23
|
+
/** Opaque identifier used to correlate consolidation requests. */
|
|
20
24
|
consolidateId: optionalString,
|
|
25
|
+
/** Token recipients for token consolidation flows. */
|
|
21
26
|
recipients: Optional(t.array(TokenRecipientEntry)),
|
|
27
|
+
/** When true, leaves a small amount in the source address to keep it alive. */
|
|
22
28
|
keepAlive: optionalBoolean,
|
|
23
29
|
}),
|
|
24
30
|
]);
|
|
@@ -3,16 +3,15 @@ import { BaseIntent, BaseIntentWithAmount } from "./baseIntent";
|
|
|
3
3
|
import { intentTypes } from "./intentType";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
7
|
-
* Intent for bridging assets across chains or protocols
|
|
6
|
+
* Base codec for bridge-funds intents across chains or protocols.
|
|
8
7
|
*
|
|
9
|
-
*
|
|
10
|
-
* The amount.value specifies how much to bridge
|
|
8
|
+
* @title Bridge Funds Intent
|
|
11
9
|
*/
|
|
12
10
|
export const BaseBridgeFundsIntent = t.intersection([
|
|
13
11
|
BaseIntent,
|
|
14
|
-
BaseIntentWithAmount,
|
|
12
|
+
BaseIntentWithAmount,
|
|
15
13
|
t.type({
|
|
14
|
+
/** Must be "bridgeFunds". */
|
|
16
15
|
intentType: intentTypes.bridgeFunds,
|
|
17
16
|
}),
|
|
18
17
|
]);
|
|
@@ -13,8 +13,11 @@ export const BaseIntent = t.intersection([
|
|
|
13
13
|
intentType: IntentType,
|
|
14
14
|
}),
|
|
15
15
|
t.partial({
|
|
16
|
+
/** Client-assigned sequence identifier for idempotency. */
|
|
16
17
|
sequenceId: optionalString,
|
|
18
|
+
/** Human-readable memo attached to the transaction. */
|
|
17
19
|
comment: optionalString,
|
|
20
|
+
/** Override the on-chain nonce for this transaction. */
|
|
18
21
|
nonce: Optional(t.union([t.string, t.number])),
|
|
19
22
|
}),
|
|
20
23
|
]);
|
|
@@ -26,7 +29,9 @@ export const BaseIntentWithoutNonce = t.intersection([
|
|
|
26
29
|
intentType: IntentType,
|
|
27
30
|
}),
|
|
28
31
|
t.partial({
|
|
32
|
+
/** Client-assigned sequence identifier for idempotency. */
|
|
29
33
|
sequenceId: optionalString,
|
|
34
|
+
/** Human-readable memo attached to the transaction. */
|
|
30
35
|
comment: optionalString,
|
|
31
36
|
}),
|
|
32
37
|
]);
|
|
@@ -63,6 +68,7 @@ export type BaseIntentWithoutNonce = t.TypeOf<typeof BaseIntentWithoutNonce>;
|
|
|
63
68
|
* Asset extraction: Extracts `symbol` from each recipient's amount
|
|
64
69
|
*/
|
|
65
70
|
export const BaseIntentWithRecipients = t.type({
|
|
71
|
+
/** Array of recipient addresses and amounts. */
|
|
66
72
|
recipients: t.array(RecipientEntry),
|
|
67
73
|
});
|
|
68
74
|
|
|
@@ -85,6 +91,7 @@ export type BaseIntentWithRecipients = t.TypeOf<
|
|
|
85
91
|
* Note: This also matches BaseIntentWithRecipients since TokenRecipientEntry extends RecipientEntry
|
|
86
92
|
*/
|
|
87
93
|
export const BaseIntentWithTokenRecipients = t.type({
|
|
94
|
+
/** Recipients of the token transfer. Each entry must include tokenData with tokenName and tokenContractAddress. */
|
|
88
95
|
recipients: t.array(TokenRecipientEntry),
|
|
89
96
|
});
|
|
90
97
|
|
|
@@ -120,6 +127,7 @@ export type BaseIntentWithTokenData = t.TypeOf<typeof BaseIntentWithTokenData>;
|
|
|
120
127
|
* Asset extraction: Extracts tokenName
|
|
121
128
|
*/
|
|
122
129
|
export const BaseIntentWithTokenName = t.type({
|
|
130
|
+
/** Name of the ERC-20 token to approve (e.g. "usdc", "weth"). */
|
|
123
131
|
tokenName: t.string,
|
|
124
132
|
});
|
|
125
133
|
|
|
@@ -141,6 +149,7 @@ export type BaseIntentWithTokenName = t.TypeOf<typeof BaseIntentWithTokenName>;
|
|
|
141
149
|
* Asset extraction: Extracts symbol from the amount field
|
|
142
150
|
*/
|
|
143
151
|
export const BaseIntentWithAmount = t.type({
|
|
152
|
+
/** Transaction amount. amount.symbol identifies the asset (e.g. "hypeevm:eth"); amount.value is the quantity in base units. */
|
|
144
153
|
amount: Amount,
|
|
145
154
|
});
|
|
146
155
|
|
|
@@ -5,9 +5,11 @@ import { StakingRequestSource } from "./stakingRequestSource";
|
|
|
5
5
|
export const BaseStakeIntent = t.intersection([
|
|
6
6
|
BaseIntent,
|
|
7
7
|
t.type({
|
|
8
|
+
/** ID of the staking request, obtained from the BitGo staking service. */
|
|
8
9
|
stakingRequestId: t.string,
|
|
9
10
|
}),
|
|
10
11
|
t.partial({
|
|
12
|
+
/** Origin of the staking request: MANUAL (user-initiated), AUTO_STAKE, or EXTERNAL. */
|
|
11
13
|
source: StakingRequestSource,
|
|
12
14
|
}),
|
|
13
15
|
]);
|
|
@@ -11,6 +11,7 @@ import { BaseStakeIntent } from "./baseStakeIntent";
|
|
|
11
11
|
export const BaseStakeIntentWithCalldata = t.intersection([
|
|
12
12
|
BaseStakeIntent,
|
|
13
13
|
t.type({
|
|
14
|
+
/** Pre-computed ABI-encoded calldata for the staking contract interaction, provided by the BitGo staking service. */
|
|
14
15
|
calldata: t.string,
|
|
15
16
|
}),
|
|
16
17
|
]);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { BaseStakeIntent } from "./baseStakeIntent";
|
|
3
|
+
import { intentTypes } from "./intentType";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Claim unstaked or unbonded funds from an EVM validator after the
|
|
7
|
+
* undelegation cooldown period. Requires a staking request ID from the
|
|
8
|
+
* BitGo staking service.
|
|
9
|
+
*
|
|
10
|
+
* @title Claim Intent
|
|
11
|
+
*/
|
|
12
|
+
export const ClaimIntent = t.intersection([
|
|
13
|
+
BaseStakeIntent,
|
|
14
|
+
t.type({
|
|
15
|
+
/** Must be "claim". */
|
|
16
|
+
intentType: intentTypes.claim,
|
|
17
|
+
}),
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
export type ClaimIntent = t.TypeOf<typeof ClaimIntent>;
|
|
@@ -2,9 +2,15 @@ import * as t from "io-ts";
|
|
|
2
2
|
import { BaseStakeIntent } from "./baseStakeIntent";
|
|
3
3
|
import { intentTypes } from "./intentType";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Delegate staked assets to a validator on EVM-compatible chains that support
|
|
7
|
+
* delegated proof-of-stake (e.g. BSC). Requires a staking request ID from the
|
|
8
|
+
* BitGo staking service.
|
|
9
|
+
*/
|
|
5
10
|
export const DelegateIntent = t.intersection([
|
|
6
11
|
BaseStakeIntent,
|
|
7
12
|
t.type({
|
|
13
|
+
/** Must be "delegate". */
|
|
8
14
|
intentType: intentTypes.delegate,
|
|
9
15
|
}),
|
|
10
16
|
]);
|
|
@@ -5,12 +5,17 @@ import { FeeOption } from "./feeOption";
|
|
|
5
5
|
import { EIP1559FeeOptions } from "./eip1559FeeOptions";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* Replace a stuck pending EVM transaction with a higher-fee version to
|
|
9
|
+
* accelerate confirmation. Supply the original transaction's txid and new
|
|
10
|
+
* feeOptions that exceed the original.
|
|
11
|
+
*
|
|
8
12
|
* @title ETH Acceleration Intent
|
|
9
13
|
*/
|
|
10
14
|
export const EthAccelerationIntent = t.intersection([
|
|
11
15
|
AccelerationIntent,
|
|
12
16
|
EthBuildOptionsWithoutFeeOptions,
|
|
13
17
|
t.type({
|
|
18
|
+
/** New fee settings (must be higher than the original transaction). Use EIP1559FeeOptions for London-compatible chains. */
|
|
14
19
|
feeOptions: t.union([FeeOption, EIP1559FeeOptions]),
|
|
15
20
|
}),
|
|
16
21
|
]);
|
|
@@ -8,9 +8,13 @@ import { HopParams } from "./hopParams";
|
|
|
8
8
|
export const EthBuildOptions = t.intersection([
|
|
9
9
|
AccountBaseBuildOptions,
|
|
10
10
|
t.partial({
|
|
11
|
+
/** Override gas estimation. Provide EIP1559FeeOptions for EIP-1559 chains or FeeOption for legacy. */
|
|
11
12
|
feeOptions: Optional(t.union([FeeOption, EIP1559FeeOptions])),
|
|
13
|
+
/** Parameters for BitGo Hop transactions (cross-chain bridging via the Hop protocol). */
|
|
12
14
|
hopParams: Optional(HopParams),
|
|
15
|
+
/** Target receive address override. Defaults to wallet's primary receive address. */
|
|
13
16
|
receiveAddress: optionalString,
|
|
17
|
+
/** Index of the wallet address to use as the sender. */
|
|
14
18
|
senderAddressIndex: optionalNumber,
|
|
15
19
|
}),
|
|
16
20
|
]);
|
|
@@ -20,8 +24,11 @@ export type EthBuildOptions = t.TypeOf<typeof EthBuildOptions>;
|
|
|
20
24
|
export const EthBuildOptionsWithoutFeeOptions = t.intersection([
|
|
21
25
|
AccountBaseBuildOptions,
|
|
22
26
|
t.partial({
|
|
27
|
+
/** Parameters for BitGo Hop transactions (cross-chain bridging via the Hop protocol). */
|
|
23
28
|
hopParams: Optional(HopParams),
|
|
29
|
+
/** Target receive address override. Defaults to wallet's primary receive address. */
|
|
24
30
|
receiveAddress: optionalString,
|
|
31
|
+
/** Index of the wallet address to use as the sender. */
|
|
25
32
|
senderAddressIndex: optionalNumber,
|
|
26
33
|
}),
|
|
27
34
|
]);
|
|
@@ -33,8 +40,11 @@ export type EthBuildOptionsWithoutFeeOptions = t.TypeOf<
|
|
|
33
40
|
// This is the same as Omit<EthBuildOptions, 'hopParams' | 'nonce'>
|
|
34
41
|
// but `omit` is not easily available in io-ts
|
|
35
42
|
export const EthFillNonceBuildOptions = t.partial({
|
|
43
|
+
/** Override gas estimation for the fill-nonce transaction. */
|
|
36
44
|
feeOptions: Optional(t.union([FeeOption, EIP1559FeeOptions])),
|
|
45
|
+
/** Target receive address override. Defaults to wallet's primary receive address. */
|
|
37
46
|
receiveAddress: optionalString,
|
|
47
|
+
/** Index of the wallet address to use as the sender. */
|
|
38
48
|
senderAddressIndex: optionalNumber,
|
|
39
49
|
});
|
|
40
50
|
|
|
@@ -3,6 +3,10 @@ import { AccountBaseConsolidateIntent } from "./accountBaseConsolidateIntent";
|
|
|
3
3
|
import { EthBuildOptions } from "./ethBuildOptions";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Consolidate ETH from multiple receive addresses into the wallet's main
|
|
7
|
+
* address on EVM-compatible chains. Used for wallet housekeeping. Provide
|
|
8
|
+
* receiveAddress as the sweep destination.
|
|
9
|
+
*
|
|
6
10
|
* @title ETH Consolidate Intent
|
|
7
11
|
*/
|
|
8
12
|
export const EthConsolidateIntent = t.intersection([
|
|
@@ -6,15 +6,23 @@ import { TokenRecipientEntry } from "./tokenRecipientEntry";
|
|
|
6
6
|
import { EthBuildOptions } from "./ethBuildOptions";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Consolidate ERC-20 tokens from receive addresses into the wallet's main
|
|
10
|
+
* address on EVM-compatible chains. Supply token details in the
|
|
11
|
+
* recipients[].tokenData field.
|
|
12
|
+
*
|
|
9
13
|
* @title ETH Consolidate Token Intent
|
|
10
14
|
*/
|
|
11
15
|
export const EthConsolidateTokenIntent = t.intersection([
|
|
12
16
|
BaseIntent,
|
|
13
17
|
EthBuildOptions,
|
|
14
18
|
t.type({
|
|
19
|
+
/** Must be "consolidateToken". */
|
|
15
20
|
intentType: intentTypes.consolidateToken,
|
|
21
|
+
/** Array of token recipients. Each entry specifies the token contract and amount via tokenData. */
|
|
16
22
|
recipients: t.array(TokenRecipientEntry),
|
|
23
|
+
/** Opaque identifier to correlate consolidation requests. */
|
|
17
24
|
consolidateId: optionalString,
|
|
25
|
+
/** When true, leaves a minimal token balance in the source address. */
|
|
18
26
|
keepAlive: optionalBoolean,
|
|
19
27
|
}),
|
|
20
28
|
]);
|
|
@@ -3,6 +3,10 @@ import { FillNonceIntent } from "./fillNonceIntent";
|
|
|
3
3
|
import { EthFillNonceBuildOptions } from "./ethBuildOptions";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Submit a zero-value self-send to consume a specific nonce on
|
|
7
|
+
* EVM-compatible chains. Used to unblock transaction queues when a nonce gap
|
|
8
|
+
* has formed.
|
|
9
|
+
*
|
|
6
10
|
* @title ETH Fill Nonce Intent
|
|
7
11
|
*/
|
|
8
12
|
export const EthFillNonceIntent = t.intersection([
|
|
@@ -4,12 +4,17 @@ import { EthBuildOptions } from "./ethBuildOptions";
|
|
|
4
4
|
import { optionalBoolean } from "../../../utils";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
|
+
* Transfer ETH or ERC-20 tokens to one or more recipients on EVM-compatible
|
|
8
|
+
* chains. Specify recipients with their address and amount. Optionally
|
|
9
|
+
* override fee settings via feeOptions.
|
|
10
|
+
*
|
|
7
11
|
* @title ETH Payment Intent
|
|
8
12
|
*/
|
|
9
13
|
export const EthPaymentIntent = t.intersection([
|
|
10
14
|
PaymentIntent,
|
|
11
15
|
EthBuildOptions,
|
|
12
16
|
t.type({
|
|
17
|
+
/** When true, sends to the wallet's own receive address. */
|
|
13
18
|
selfSend: optionalBoolean,
|
|
14
19
|
}),
|
|
15
20
|
]);
|
|
@@ -3,15 +3,24 @@ import { StakeIntent } from "./stakeIntent";
|
|
|
3
3
|
import { EthBuildOptions } from "./ethBuildOptions";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Submit an ETH 2.0 validator staking deposit on Ethereum. Requires a
|
|
7
|
+
* pre-created staking request from the BitGo staking service. All validator
|
|
8
|
+
* fields (pubkey, withdrawalCredentials, signature, depositDataRoot) are
|
|
9
|
+
* provided by the staking service.
|
|
10
|
+
*
|
|
6
11
|
* @title ETH Staking Intent
|
|
7
12
|
*/
|
|
8
13
|
export const EthStakingIntent = t.intersection([
|
|
9
14
|
StakeIntent,
|
|
10
15
|
EthBuildOptions,
|
|
11
16
|
t.type({
|
|
17
|
+
/** BLS public key of the validator (hex-encoded, provided by the staking service). */
|
|
12
18
|
pubkey: t.string,
|
|
19
|
+
/** Withdrawal credentials for the validator (provided by the staking service). */
|
|
13
20
|
withdrawalCredentials: t.string,
|
|
21
|
+
/** BLS signature over the deposit data (provided by the staking service). */
|
|
14
22
|
signature: t.string,
|
|
23
|
+
/** SHA-256 hash of the deposit data (provided by the staking service). */
|
|
15
24
|
depositDataRoot: t.string,
|
|
16
25
|
}),
|
|
17
26
|
]);
|
|
@@ -3,6 +3,10 @@ import { EthBuildOptions } from "./ethBuildOptions";
|
|
|
3
3
|
import { TransferTokenIntent } from "./transferTokenIntent";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Transfer ERC-20 tokens to one or more recipients on EVM-compatible chains.
|
|
7
|
+
* Each recipient entry must include tokenData specifying the token contract
|
|
8
|
+
* and amount.
|
|
9
|
+
*
|
|
6
10
|
* @title ETH Transfer Token Intent
|
|
7
11
|
*/
|
|
8
12
|
export const EthTransferTokenIntent = t.intersection([
|
|
@@ -2,13 +2,21 @@ import * as t from "io-ts";
|
|
|
2
2
|
import { BaseIntentWithoutNonce } from "./baseIntent";
|
|
3
3
|
import { intentTypes } from "./intentType";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Base codec for fill-nonce intents. Submits a zero-value self-send to consume
|
|
7
|
+
* a specific nonce on EVM-compatible chains. Used to unblock transaction queues
|
|
8
|
+
* when a nonce gap has formed.
|
|
9
|
+
*/
|
|
5
10
|
export const FillNonceIntent = t.intersection([
|
|
6
11
|
BaseIntentWithoutNonce,
|
|
7
12
|
t.type({
|
|
13
|
+
/** Must be "fillNonce". */
|
|
8
14
|
intentType: intentTypes.fillNonce,
|
|
15
|
+
/** The nonce value to fill. The transaction will be a self-send that consumes this nonce. */
|
|
9
16
|
nonce: t.union([t.string, t.number]),
|
|
10
17
|
}),
|
|
11
18
|
t.partial({
|
|
19
|
+
/** Sender address with the stuck nonce. Defaults to the wallet's base address. */
|
|
12
20
|
senderAddress: t.string,
|
|
13
21
|
}),
|
|
14
22
|
]);
|
|
@@ -6,15 +6,15 @@ import { FeeOption } from "./feeOption";
|
|
|
6
6
|
import { EIP1559FeeOptions } from "./eip1559FeeOptions";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
10
|
-
*
|
|
9
|
+
* Bridge funds between HypeEVM L2 and L1. Specify the amount and asset via
|
|
10
|
+
* the amount field. Used exclusively on the HypeEVM chain.
|
|
11
11
|
*
|
|
12
|
-
*
|
|
13
|
-
* The amount.value specifies how much to bridge
|
|
12
|
+
* @title Hypeevm Bridge Funds Intent
|
|
14
13
|
*/
|
|
15
14
|
export const HypeevmBridgeFundsIntent = t.intersection([
|
|
16
15
|
BaseBridgeFundsIntent,
|
|
17
16
|
t.partial({
|
|
17
|
+
/** Override gas estimation for the bridge transaction. */
|
|
18
18
|
feeOptions: Optional(t.union([FeeOption, EIP1559FeeOptions])),
|
|
19
19
|
}),
|
|
20
20
|
]);
|
|
@@ -3,12 +3,16 @@ import { BaseIntent, BaseIntentWithRecipients } from "./baseIntent";
|
|
|
3
3
|
import { intentTypes } from "./intentType";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Transfer assets via the HypeEVM spot trading mechanism. Provide recipients
|
|
7
|
+
* with their address and amount. Used exclusively on the HypeEVM chain.
|
|
8
|
+
*
|
|
6
9
|
* @title Hypeevm Spot Transfer Intent
|
|
7
10
|
*/
|
|
8
11
|
export const HypeevmSpotTransferIntent = t.intersection([
|
|
9
12
|
BaseIntent,
|
|
10
13
|
BaseIntentWithRecipients,
|
|
11
14
|
t.type({
|
|
15
|
+
/** Must be "spotTransfer". */
|
|
12
16
|
intentType: intentTypes.spotTransfer,
|
|
13
17
|
}),
|
|
14
18
|
]);
|
|
@@ -38,6 +38,7 @@ export * from "./cantonTransferAcceptIntent";
|
|
|
38
38
|
export * from "./cantonTransferAcknowledgeIntent";
|
|
39
39
|
export * from "./cantonTransferOfferWithdrawnIntent";
|
|
40
40
|
export * from "./cantonTransferRejectIntent";
|
|
41
|
+
export * from "./claimIntent";
|
|
41
42
|
export * from "./consolidateTokenIntent";
|
|
42
43
|
export * from "./coredaoClaimIntent";
|
|
43
44
|
export * from "./coredaoDelegateIntent";
|
|
@@ -128,6 +129,8 @@ export * from "./solVersionedCustomTxIntent";
|
|
|
128
129
|
export * from "./stakeClaimRewardsIntent";
|
|
129
130
|
export * from "./stakeIntent";
|
|
130
131
|
export * from "./stakeSwitchValidatorIntent";
|
|
132
|
+
export * from "./stakeWithCallDataIntent";
|
|
133
|
+
export * from "./switchValidatorWithCallDataIntent";
|
|
131
134
|
export * from "./stakingRequestSource";
|
|
132
135
|
export * from "./substrateAccountBaseBuildOptions";
|
|
133
136
|
export * from "./substrateBaseIntent";
|
|
@@ -13,6 +13,7 @@ import { BabyWithdrawRewardIntent } from "./babyWithdrawRewardIntent";
|
|
|
13
13
|
import { BscDelegateIntent } from "./bscDelegateIntent";
|
|
14
14
|
import { BscUnDelegateIntent } from "./bscUndelegateIntent";
|
|
15
15
|
import { BscWithdrawUndelegateIntent } from "./bscWithdrawUndelegateIntent";
|
|
16
|
+
import { ClaimIntent } from "./claimIntent";
|
|
16
17
|
import {
|
|
17
18
|
VetExitDelegationIntent,
|
|
18
19
|
VetBurnNFTIntent,
|
|
@@ -91,6 +92,8 @@ import { BaseIntent } from "./baseIntent";
|
|
|
91
92
|
import { DotConsolidateIntent } from "./dotConsolidateIntent";
|
|
92
93
|
import { SolCloseAssociatedTokenAccountIntent } from "./solCloseAssociatedTokenAccountIntent";
|
|
93
94
|
import { BaseStakeIntentWithCalldata } from "./baseStakeIntentWithCalldata";
|
|
95
|
+
import { StakeWithCallDataIntent } from "./stakeWithCallDataIntent";
|
|
96
|
+
import { SwitchValidatorWithCallDataIntent } from "./switchValidatorWithCallDataIntent";
|
|
94
97
|
import { CoreDaoDelegateIntent } from "./coredaoDelegateIntent";
|
|
95
98
|
import { CoreDaoUndelegateIntent } from "./coredaoUndelegateIntent";
|
|
96
99
|
import { CoreDaoClaimIntent } from "./coredaoClaimIntent";
|
|
@@ -129,6 +132,9 @@ import { XdcResignIntent } from "./xdcUnstakingIntent";
|
|
|
129
132
|
import { XdcWithdrawIntent } from "./xdcUnstakingIntent";
|
|
130
133
|
import { HypeevmBridgeFundsIntent } from "./hypeevmBridgeFundsIntent";
|
|
131
134
|
import { HypeevmEnableBridgingIntent } from "./hypeevmEnableBridgingIntent";
|
|
135
|
+
import { DelegateIntent } from "./delegateIntent";
|
|
136
|
+
import { UndelegateIntent } from "./undelegateIntent";
|
|
137
|
+
import { StakeClaimRewardsIntent } from "./stakeClaimRewardsIntent";
|
|
132
138
|
|
|
133
139
|
export const TransactionIntent = t.union([
|
|
134
140
|
AdaConsolidateIntent,
|
|
@@ -152,6 +158,7 @@ export const TransactionIntent = t.union([
|
|
|
152
158
|
CantonTransferAcknowledgeIntent,
|
|
153
159
|
CantonTransferOfferWithdrawnIntent,
|
|
154
160
|
CantonTransferRejectIntent,
|
|
161
|
+
ClaimIntent,
|
|
155
162
|
CosmosPaymentIntent,
|
|
156
163
|
CosmosStakeIntent,
|
|
157
164
|
CosmosSwitchValidatorIntent,
|
|
@@ -165,6 +172,7 @@ export const TransactionIntent = t.union([
|
|
|
165
172
|
DotStakingIntent,
|
|
166
173
|
DotUnstakingIntent,
|
|
167
174
|
DotWithdrawStakeIntent,
|
|
175
|
+
DelegateIntent,
|
|
168
176
|
EthAccelerationIntent,
|
|
169
177
|
EthConsolidateIntent,
|
|
170
178
|
EthConsolidateTokenIntent,
|
|
@@ -172,6 +180,8 @@ export const TransactionIntent = t.union([
|
|
|
172
180
|
EthPaymentIntent,
|
|
173
181
|
EthStakingIntent,
|
|
174
182
|
EthTransferTokenIntent,
|
|
183
|
+
StakeClaimRewardsIntent,
|
|
184
|
+
UndelegateIntent,
|
|
175
185
|
FeeAddressTransferIntent,
|
|
176
186
|
HbarUpdateAccountIntent,
|
|
177
187
|
HypeevmBridgeFundsIntent,
|
|
@@ -246,6 +256,8 @@ export const TransactionIntent = t.union([
|
|
|
246
256
|
VetWithdrawStakeIntent,
|
|
247
257
|
WalletRecoveryIntent,
|
|
248
258
|
BaseStakeIntentWithCalldata,
|
|
259
|
+
StakeWithCallDataIntent,
|
|
260
|
+
SwitchValidatorWithCallDataIntent,
|
|
249
261
|
CoreDaoDelegateIntent,
|
|
250
262
|
CoreDaoUndelegateIntent,
|
|
251
263
|
CoreDaoClaimIntent,
|
|
@@ -7,10 +7,13 @@ export const PaymentIntent = t.intersection([
|
|
|
7
7
|
BaseIntentWithRecipients,
|
|
8
8
|
t.union([
|
|
9
9
|
t.type({
|
|
10
|
+
/** Must be "payment". */
|
|
10
11
|
intentType: intentTypes.payment,
|
|
11
12
|
}),
|
|
12
13
|
t.type({
|
|
14
|
+
/** Must be "payment". */
|
|
13
15
|
intentType: intentTypes.payment,
|
|
16
|
+
/** When true, marks this as a test transaction (not broadcast to the network). */
|
|
14
17
|
isTestTransaction: t.boolean,
|
|
15
18
|
}),
|
|
16
19
|
]),
|
|
@@ -3,10 +3,16 @@ import { intentTypes } from "./intentType";
|
|
|
3
3
|
import { BaseStakeIntent } from "./baseStakeIntent";
|
|
4
4
|
import { BaseIntentWithAmount } from "./baseIntent";
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Claim accumulated staking rewards on EVM-compatible chains. Specify the
|
|
8
|
+
* amount of rewards to claim. Requires a staking request ID from the BitGo
|
|
9
|
+
* staking service.
|
|
10
|
+
*/
|
|
6
11
|
export const StakeClaimRewardsIntent = t.intersection([
|
|
7
12
|
BaseStakeIntent,
|
|
8
13
|
BaseIntentWithAmount,
|
|
9
14
|
t.type({
|
|
15
|
+
/** Must be "stakeClaimRewards". */
|
|
10
16
|
intentType: intentTypes.stakeClaimRewards,
|
|
11
17
|
}),
|
|
12
18
|
]);
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { BaseStakeIntentWithCalldata } from "./baseStakeIntentWithCalldata";
|
|
3
|
+
import { intentTypes } from "./intentType";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Submit an EVM staking transaction using pre-computed calldata provided by
|
|
7
|
+
* the BitGo staking service. Used when the staking protocol requires custom
|
|
8
|
+
* calldata that cannot be derived from standard deposit parameters.
|
|
9
|
+
*
|
|
10
|
+
* @title Stake With CallData Intent
|
|
11
|
+
*/
|
|
12
|
+
export const StakeWithCallDataIntent = t.intersection([
|
|
13
|
+
BaseStakeIntentWithCalldata,
|
|
14
|
+
t.type({
|
|
15
|
+
/** Must be "stakeWithCallData". */
|
|
16
|
+
intentType: intentTypes.stakeWithCallData,
|
|
17
|
+
}),
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
export type StakeWithCallDataIntent = t.TypeOf<typeof StakeWithCallDataIntent>;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { BaseStakeIntentWithCalldata } from "./baseStakeIntentWithCalldata";
|
|
3
|
+
import { intentTypes } from "./intentType";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Switch validators on EVM-compatible chains using pre-computed calldata.
|
|
7
|
+
* Supply the staking service's stakingRequestId and the pre-computed calldata
|
|
8
|
+
* for the validator switch.
|
|
9
|
+
*
|
|
10
|
+
* @title Switch Validator With CallData Intent
|
|
11
|
+
*/
|
|
12
|
+
export const SwitchValidatorWithCallDataIntent = t.intersection([
|
|
13
|
+
BaseStakeIntentWithCalldata,
|
|
14
|
+
t.type({
|
|
15
|
+
/** Must be "switchValidatorWithCallData". */
|
|
16
|
+
intentType: intentTypes.switchValidatorWithCallData,
|
|
17
|
+
}),
|
|
18
|
+
]);
|
|
19
|
+
|
|
20
|
+
export type SwitchValidatorWithCallDataIntent = t.TypeOf<
|
|
21
|
+
typeof SwitchValidatorWithCallDataIntent
|
|
22
|
+
>;
|
|
@@ -3,13 +3,17 @@ import { BaseIntent, BaseIntentWithTokenName } from "./baseIntent";
|
|
|
3
3
|
import { intentTypes } from "./intentType";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Approve an ERC-20 token for spending by the BitGo batcher contract on
|
|
7
|
+
* EVM-compatible chains. Required before sending a token that has not been
|
|
8
|
+
* previously approved. Provide tokenName to identify the token.
|
|
9
|
+
*
|
|
6
10
|
* @title Intent for approving tokens for spending by a batcher contract
|
|
7
|
-
* The server will determine the spender address and approval amount
|
|
8
11
|
*/
|
|
9
12
|
export const TokenApprovalIntent = t.intersection([
|
|
10
13
|
BaseIntent,
|
|
11
14
|
BaseIntentWithTokenName,
|
|
12
15
|
t.type({
|
|
16
|
+
/** Must be "tokenApproval". */
|
|
13
17
|
intentType: intentTypes.tokenApproval,
|
|
14
18
|
}),
|
|
15
19
|
]);
|
|
@@ -2,9 +2,15 @@ import * as t from "io-ts";
|
|
|
2
2
|
import { BaseStakeIntent } from "./baseStakeIntent";
|
|
3
3
|
import { intentTypes } from "./intentType";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* Remove delegation of staked assets from a validator on EVM-compatible chains.
|
|
7
|
+
* Initiates the unbonding period. Requires a staking request ID from the BitGo
|
|
8
|
+
* staking service.
|
|
9
|
+
*/
|
|
5
10
|
export const UndelegateIntent = t.intersection([
|
|
6
11
|
BaseStakeIntent,
|
|
7
12
|
t.type({
|
|
13
|
+
/** Must be "undelegate". */
|
|
8
14
|
intentType: intentTypes.undelegate,
|
|
9
15
|
}),
|
|
10
16
|
]);
|