@bitgo/public-types 6.5.2 → 6.7.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/atomPaymentIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/atomStakeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/atomUnstakeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/atomWithdrawIntent.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/cosmosContractCallIntent.d.ts +70 -0
- package/dist/src/schema/transactionRequest/intents/cosmosContractCallIntent.js +41 -0
- package/dist/src/schema/transactionRequest/intents/cosmosContractCallIntent.js.map +1 -0
- package/dist/src/schema/transactionRequest/intents/cosmosPaymentIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/cosmosStakeClaimRewardsIntent.d.ts +71 -0
- package/dist/src/schema/transactionRequest/intents/cosmosStakeClaimRewardsIntent.js +37 -0
- package/dist/src/schema/transactionRequest/intents/cosmosStakeClaimRewardsIntent.js.map +1 -0
- package/dist/src/schema/transactionRequest/intents/cosmosStakeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/cosmosSwitchValidatorIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/cosmosUnstakeIntent.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/cosmosWithdrawIntent.js.map +1 -1
- 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 +5 -0
- package/dist/src/schema/transactionRequest/intents/index.js +5 -0
- package/dist/src/schema/transactionRequest/intents/index.js.map +1 -1
- package/dist/src/schema/transactionRequest/intents/intent.d.ts +717 -265
- package/dist/src/schema/transactionRequest/intents/intent.js +18 -4
- 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/stakeSwitchValidatorIntent.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 +1434 -530
- 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/atomPaymentIntent.ts +5 -0
- package/src/schema/transactionRequest/intents/atomStakeIntent.ts +6 -0
- package/src/schema/transactionRequest/intents/atomUnstakeIntent.ts +6 -0
- package/src/schema/transactionRequest/intents/atomWithdrawIntent.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/cosmosContractCallIntent.ts +30 -0
- package/src/schema/transactionRequest/intents/cosmosPaymentIntent.ts +5 -0
- package/src/schema/transactionRequest/intents/cosmosStakeClaimRewardsIntent.ts +23 -0
- package/src/schema/transactionRequest/intents/cosmosStakeIntent.ts +6 -0
- package/src/schema/transactionRequest/intents/cosmosSwitchValidatorIntent.ts +4 -0
- package/src/schema/transactionRequest/intents/cosmosUnstakeIntent.ts +7 -0
- package/src/schema/transactionRequest/intents/cosmosWithdrawIntent.ts +6 -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 +5 -0
- package/src/schema/transactionRequest/intents/intent.ts +18 -4
- 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/stakeSwitchValidatorIntent.ts +2 -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,11 +3,16 @@ import { optionalString } from "../../../utils";
|
|
|
3
3
|
import { PaymentIntent } from "./paymentIntent";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Transfer tokens from a Cosmos-family wallet to one or more recipient
|
|
7
|
+
* addresses. Supported on all Cosmos-family chains. An optional memo may
|
|
8
|
+
* be included for exchange routing or identification.
|
|
9
|
+
*
|
|
6
10
|
* @title Atom Payment Intent
|
|
7
11
|
*/
|
|
8
12
|
export const AtomPaymentIntent = t.intersection([
|
|
9
13
|
PaymentIntent,
|
|
10
14
|
t.type({
|
|
15
|
+
/** Optional memo string attached to the transaction, used for routing or identification by exchanges. */
|
|
11
16
|
memo: optionalString,
|
|
12
17
|
}),
|
|
13
18
|
]);
|
|
@@ -5,15 +5,21 @@ import { StakeIntent } from "./stakeIntent";
|
|
|
5
5
|
import { BaseIntentWithAmount } from "./baseIntent";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* Delegate (stake) tokens to one or more validators on ATOM. Use
|
|
9
|
+
* `validatorAddress` and `amount` for a single validator, or `recipients`
|
|
10
|
+
* for multi-validator delegation.
|
|
11
|
+
*
|
|
8
12
|
* @title Atom Stake Intent
|
|
9
13
|
*/
|
|
10
14
|
export const AtomStakeIntent = t.intersection([
|
|
11
15
|
StakeIntent,
|
|
12
16
|
BaseIntentWithAmount,
|
|
13
17
|
t.type({
|
|
18
|
+
/** Bech32 validator address to delegate tokens to (e.g. cosmosvaloper1...). */
|
|
14
19
|
validatorAddress: t.string,
|
|
15
20
|
}),
|
|
16
21
|
t.partial({
|
|
22
|
+
/** Optional list of validator–amount pairs for multi-validator delegation. When provided, overrides validatorAddress and amount. */
|
|
17
23
|
recipients: Optional(t.array(RecipientEntry)),
|
|
18
24
|
}),
|
|
19
25
|
]);
|
|
@@ -5,15 +5,21 @@ import { RecipientEntry } from "./recipientEntry";
|
|
|
5
5
|
import { Optional } from "../../../utils";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
+
* Undelegate (unstake) tokens from one or more validators on ATOM. Tokens
|
|
9
|
+
* enter the unbonding period. Use `validatorAddress` and `amount` for
|
|
10
|
+
* single validator or `recipients` for multi-validator.
|
|
11
|
+
*
|
|
8
12
|
* @title Atom Unstake Intent
|
|
9
13
|
*/
|
|
10
14
|
export const AtomUnstakeIntent = t.intersection([
|
|
11
15
|
UnstakeIntent,
|
|
12
16
|
BaseIntentWithAmount,
|
|
13
17
|
t.type({
|
|
18
|
+
/** Bech32 validator address to undelegate tokens from (e.g. cosmosvaloper1...). */
|
|
14
19
|
validatorAddress: t.string,
|
|
15
20
|
}),
|
|
16
21
|
t.partial({
|
|
22
|
+
/** Optional list of validator–amount pairs for multi-validator undelegation. When provided, overrides validatorAddress and amount. */
|
|
17
23
|
recipients: Optional(t.array(RecipientEntry)),
|
|
18
24
|
}),
|
|
19
25
|
]);
|
|
@@ -3,7 +3,13 @@ import { WithdrawIntent } from "./withdrawIntent";
|
|
|
3
3
|
import { BaseIntentWithAmount } from "./baseIntent";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Internal codec for ATOM staking reward claims. The `claim` intentType
|
|
7
|
+
* discriminant is not dispatched by the server — do not use directly. Use
|
|
8
|
+
* `CosmosStakeClaimRewardsIntent` with `intentType: stakeClaimRewards`
|
|
9
|
+
* instead.
|
|
10
|
+
*
|
|
6
11
|
* @title Atom Withdraw Intent
|
|
12
|
+
* @deprecated
|
|
7
13
|
*/
|
|
8
14
|
export const AtomWithdrawIntent = t.intersection([
|
|
9
15
|
WithdrawIntent,
|
|
@@ -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>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { BaseIntent } from "./baseIntent";
|
|
3
|
+
import { intentTypes } from "./intentType";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Execute a Wasm smart contract on a Cosmos-family chain. Supported on all
|
|
7
|
+
* Cosmos-family chains. The hash chain additionally supports fee-grant via
|
|
8
|
+
* the optional feeGranter field.
|
|
9
|
+
*
|
|
10
|
+
* @title Cosmos Contract Call Intent
|
|
11
|
+
*/
|
|
12
|
+
export const CosmosContractCallIntent = t.intersection([
|
|
13
|
+
BaseIntent,
|
|
14
|
+
t.type({
|
|
15
|
+
/** Must be "contractCall" */
|
|
16
|
+
intentType: intentTypes.contractCall,
|
|
17
|
+
/** Bech32 contract address to execute */
|
|
18
|
+
contract: t.string,
|
|
19
|
+
/** Hex-encoded binary message to pass to the contract Execute entrypoint */
|
|
20
|
+
msgHex: t.string,
|
|
21
|
+
}),
|
|
22
|
+
t.partial({
|
|
23
|
+
/** Optional Bech32 address paying transaction fees on behalf of the submitter (fee-grant). Supported on hash chain; passed through for any chain. */
|
|
24
|
+
feeGranter: t.string,
|
|
25
|
+
}),
|
|
26
|
+
]);
|
|
27
|
+
|
|
28
|
+
export type CosmosContractCallIntent = t.TypeOf<
|
|
29
|
+
typeof CosmosContractCallIntent
|
|
30
|
+
>;
|
|
@@ -3,11 +3,16 @@ import { PaymentIntent } from "./paymentIntent";
|
|
|
3
3
|
import { optionalString } from "../../../utils";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
|
+
* Transfer tokens from a Cosmos-family wallet to one or more recipient
|
|
7
|
+
* addresses. Supported on all Cosmos-family chains. An optional memo may
|
|
8
|
+
* be included for exchange routing or identification.
|
|
9
|
+
*
|
|
6
10
|
* @title Cosmos Payment Intent
|
|
7
11
|
*/
|
|
8
12
|
export const CosmosPaymentIntent = t.intersection([
|
|
9
13
|
PaymentIntent,
|
|
10
14
|
t.type({
|
|
15
|
+
/** Optional memo string attached to the transaction, used for routing or identification by exchanges. */
|
|
11
16
|
memo: optionalString,
|
|
12
17
|
}),
|
|
13
18
|
]);
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import * as t from "io-ts";
|
|
2
|
+
import { BaseStakeIntent } from "./baseStakeIntent";
|
|
3
|
+
import { intentTypes } from "./intentType";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Claim accumulated staking rewards from a validator on a Cosmos-family chain.
|
|
7
|
+
* Supported on all Cosmos-family chains. Submit with intentType stakeClaimRewards.
|
|
8
|
+
*
|
|
9
|
+
* @title Cosmos Stake Claim Rewards Intent
|
|
10
|
+
*/
|
|
11
|
+
export const CosmosStakeClaimRewardsIntent = t.intersection([
|
|
12
|
+
BaseStakeIntent,
|
|
13
|
+
t.type({
|
|
14
|
+
/** Must be "stakeClaimRewards" */
|
|
15
|
+
intentType: intentTypes.stakeClaimRewards,
|
|
16
|
+
/** Bech32 validator address to withdraw accumulated staking rewards from (e.g. cosmosvaloper1...) */
|
|
17
|
+
validatorAddress: t.string,
|
|
18
|
+
}),
|
|
19
|
+
]);
|
|
20
|
+
|
|
21
|
+
export type CosmosStakeClaimRewardsIntent = t.TypeOf<
|
|
22
|
+
typeof CosmosStakeClaimRewardsIntent
|
|
23
|
+
>;
|
|
@@ -6,6 +6,10 @@ import { RecipientEntry } from "./recipientEntry";
|
|
|
6
6
|
import { Optional } from "../../../utils";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Delegate (stake) tokens to one or more validators on a Cosmos-family
|
|
10
|
+
* chain. Use `validatorAddress` and `amount` for a single validator, or
|
|
11
|
+
* `recipients` for multi-validator delegation in a single transaction.
|
|
12
|
+
*
|
|
9
13
|
* @title Cosmos Stake Intent
|
|
10
14
|
*/
|
|
11
15
|
export const CosmosStakeIntent = t.intersection([
|
|
@@ -13,9 +17,11 @@ export const CosmosStakeIntent = t.intersection([
|
|
|
13
17
|
BaseIntentWithAmount,
|
|
14
18
|
t.type({
|
|
15
19
|
intentType: intentTypes.delegate,
|
|
20
|
+
/** Bech32 validator address to delegate tokens to (e.g. cosmosvaloper1...). */
|
|
16
21
|
validatorAddress: t.string,
|
|
17
22
|
}),
|
|
18
23
|
t.partial({
|
|
24
|
+
/** Optional list of validator–amount pairs for multi-validator delegation. When provided, overrides validatorAddress and amount. */
|
|
19
25
|
recipients: Optional(t.array(RecipientEntry)),
|
|
20
26
|
}),
|
|
21
27
|
]);
|
|
@@ -2,6 +2,10 @@ import * as t from "io-ts";
|
|
|
2
2
|
import { StakeSwitchValidatorIntent } from "./stakeSwitchValidatorIntent";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
+
* Atomically move a delegation from one validator to another (redelegate)
|
|
6
|
+
* on a Cosmos-family chain. The redelegation is subject to the chain's
|
|
7
|
+
* redelegation cooldown rules.
|
|
8
|
+
*
|
|
5
9
|
* @title Cosmos Switch Validator Intent
|
|
6
10
|
*/
|
|
7
11
|
export const CosmosSwitchValidatorIntent = StakeSwitchValidatorIntent;
|
|
@@ -6,6 +6,11 @@ import { RecipientEntry } from "./recipientEntry";
|
|
|
6
6
|
import { Optional } from "../../../utils";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
+
* Undelegate (unstake) tokens from one or more validators on a
|
|
10
|
+
* Cosmos-family chain. Tokens enter the chain's unbonding period and are
|
|
11
|
+
* not immediately available. Use `validatorAddress` and `amount` for a
|
|
12
|
+
* single validator, or `recipients` for multi-validator undelegation.
|
|
13
|
+
*
|
|
9
14
|
* @title Cosmos Unstake Intent
|
|
10
15
|
*/
|
|
11
16
|
export const CosmosUnstakeIntent = t.intersection([
|
|
@@ -13,9 +18,11 @@ export const CosmosUnstakeIntent = t.intersection([
|
|
|
13
18
|
BaseIntentWithAmount,
|
|
14
19
|
t.type({
|
|
15
20
|
intentType: intentTypes.undelegate,
|
|
21
|
+
/** Bech32 validator address to undelegate tokens from (e.g. cosmosvaloper1...). */
|
|
16
22
|
validatorAddress: t.string,
|
|
17
23
|
}),
|
|
18
24
|
t.partial({
|
|
25
|
+
/** Optional list of validator–amount pairs for multi-validator undelegation. When provided, overrides validatorAddress and amount. */
|
|
19
26
|
recipients: Optional(t.array(RecipientEntry)),
|
|
20
27
|
}),
|
|
21
28
|
]);
|
|
@@ -2,7 +2,13 @@ import * as t from "io-ts";
|
|
|
2
2
|
import { WithdrawIntent } from "./withdrawIntent";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
|
+
* Internal codec for cosmos-family staking reward claims. The `claim`
|
|
6
|
+
* intentType discriminant is not dispatched by the server — do not use
|
|
7
|
+
* directly. Use `CosmosStakeClaimRewardsIntent` with
|
|
8
|
+
* `intentType: stakeClaimRewards` instead.
|
|
9
|
+
*
|
|
5
10
|
* @title Cosmos Withdraw Intent
|
|
11
|
+
* @deprecated
|
|
6
12
|
*/
|
|
7
13
|
export const CosmosWithdrawIntent = t.intersection([
|
|
8
14
|
WithdrawIntent,
|
|
@@ -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
|
]);
|