@injectivelabs/sdk-ts 1.16.4-alpha.0 → 1.16.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/core/modules/msgs.d.ts +2 -1
- package/dist/cjs/core/modules/staking/index.d.ts +2 -1
- package/dist/cjs/core/modules/staking/index.js +3 -1
- package/dist/cjs/core/modules/staking/msgs/MsgTransferDelegation.d.ts +49 -0
- package/dist/cjs/core/modules/staking/msgs/MsgTransferDelegation.js +64 -0
- package/dist/cjs/core/tx/eip712/maps.js +2 -0
- package/dist/esm/core/modules/msgs.d.ts +2 -1
- package/dist/esm/core/modules/staking/index.d.ts +2 -1
- package/dist/esm/core/modules/staking/index.js +2 -1
- package/dist/esm/core/modules/staking/msgs/MsgTransferDelegation.d.ts +49 -0
- package/dist/esm/core/modules/staking/msgs/MsgTransferDelegation.js +58 -0
- package/dist/esm/core/tx/eip712/maps.js +2 -0
- package/package.json +6 -6
|
@@ -36,6 +36,7 @@ import MsgUnderwrite from './insurance/msgs/MsgUnderwrite.js';
|
|
|
36
36
|
import MsgSendToEth from './peggy/msgs/MsgSendToEth.js';
|
|
37
37
|
import MsgDelegate from './staking/msgs/MsgDelegate.js';
|
|
38
38
|
import MsgUndelegate from './staking/msgs/MsgUndelegate.js';
|
|
39
|
+
import MsgTransferDelegation from './staking/msgs/MsgTransferDelegation.js';
|
|
39
40
|
import MsgEditValidator from './staking/msgs/MsgEditValidator.js';
|
|
40
41
|
import MsgCreateValidator from './staking/msgs/MsgCreateValidator.js';
|
|
41
42
|
import MsgBeginRedelegate from './staking/msgs/MsgBeginRedelegate.js';
|
|
@@ -62,7 +63,7 @@ import { MsgSubmitProposal } from './gov/index.js';
|
|
|
62
63
|
/**
|
|
63
64
|
* @category Messages
|
|
64
65
|
*/
|
|
65
|
-
export type Msgs = MsgBid | MsgRevoke | MsgGrant | MsgAuthzExec | MsgSend | MsgMultiSend | MsgBatchUpdateOrders | MsgWithdrawDelegatorReward | MsgBatchCancelDerivativeOrders | MsgBatchCancelSpotOrders | MsgCancelDerivativeOrder | MsgCancelSpotOrder | MsgCreateDerivativeLimitOrder | MsgCreateDerivativeMarketOrder | MsgCreateSpotLimitOrder | MsgCreateSpotMarketOrder | MsgDeposit | MsgIncreasePositionMargin | MsgInstantSpotMarketLaunch | MsgWithdraw | MsgGovDeposit | MsgSubmitProposal | MsgVote | MsgTransfer | MsgCreateInsuranceFund | MsgRequestRedemption | MsgUnderwrite | MsgSendToEth | MsgDelegate | MsgUndelegate | MsgBeginRedelegate | MsgCancelUnbondingDelegation | MsgExecuteContract | MsgExecuteContractCompat | MsgMigrateContract | MsgUpdateAdmin | MsgExec | MsgInstantiateContract | MsgCreateBinaryOptionsLimitOrder | MsgCreateBinaryOptionsMarketOrder | MsgCancelBinaryOptionsOrder | MsgBatchCancelBinaryOptionsOrders | MsgWithdrawValidatorCommission | MsgEditValidator | MsgReclaimLockedFunds | MsgExternalTransfer | MsgStoreCode | MsgRewardsOptOut | MsgCreateValidator | MsgMint | MsgBurn | MsgChangeAdmin | MsgCreateDenom | MsgSetDenomMetadata | MsgGrantAllowance | MsgRevokeAllowance | MsgAdminUpdateBinaryOptionsMarket | MsgLiquidatePosition | MsgSignData | MsgGrantWithAuthorization | MsgAuthorizeStakeGrants;
|
|
66
|
+
export type Msgs = MsgBid | MsgRevoke | MsgGrant | MsgAuthzExec | MsgSend | MsgMultiSend | MsgBatchUpdateOrders | MsgWithdrawDelegatorReward | MsgBatchCancelDerivativeOrders | MsgBatchCancelSpotOrders | MsgCancelDerivativeOrder | MsgCancelSpotOrder | MsgCreateDerivativeLimitOrder | MsgCreateDerivativeMarketOrder | MsgCreateSpotLimitOrder | MsgCreateSpotMarketOrder | MsgDeposit | MsgIncreasePositionMargin | MsgInstantSpotMarketLaunch | MsgWithdraw | MsgGovDeposit | MsgSubmitProposal | MsgVote | MsgTransfer | MsgCreateInsuranceFund | MsgRequestRedemption | MsgUnderwrite | MsgSendToEth | MsgDelegate | MsgUndelegate | MsgBeginRedelegate | MsgTransferDelegation | MsgCancelUnbondingDelegation | MsgExecuteContract | MsgExecuteContractCompat | MsgMigrateContract | MsgUpdateAdmin | MsgExec | MsgInstantiateContract | MsgCreateBinaryOptionsLimitOrder | MsgCreateBinaryOptionsMarketOrder | MsgCancelBinaryOptionsOrder | MsgBatchCancelBinaryOptionsOrders | MsgWithdrawValidatorCommission | MsgEditValidator | MsgReclaimLockedFunds | MsgExternalTransfer | MsgStoreCode | MsgRewardsOptOut | MsgCreateValidator | MsgMint | MsgBurn | MsgChangeAdmin | MsgCreateDenom | MsgSetDenomMetadata | MsgGrantAllowance | MsgRevokeAllowance | MsgAdminUpdateBinaryOptionsMarket | MsgLiquidatePosition | MsgSignData | MsgGrantWithAuthorization | MsgAuthorizeStakeGrants;
|
|
66
67
|
/**
|
|
67
68
|
* @category Messages
|
|
68
69
|
*/
|
|
@@ -3,5 +3,6 @@ import MsgUndelegate from './msgs/MsgUndelegate.js';
|
|
|
3
3
|
import MsgEditValidator from './msgs/MsgEditValidator.js';
|
|
4
4
|
import MsgCreateValidator from './msgs/MsgCreateValidator.js';
|
|
5
5
|
import MsgBeginRedelegate from './msgs/MsgBeginRedelegate.js';
|
|
6
|
+
import MsgTransferDelegation from './msgs/MsgTransferDelegation.js';
|
|
6
7
|
import MsgCancelUnbondingDelegation from './msgs/MsgCancelUnbondingDelegation.js';
|
|
7
|
-
export { MsgDelegate, MsgUndelegate, MsgEditValidator, MsgCreateValidator, MsgBeginRedelegate, MsgCancelUnbondingDelegation, };
|
|
8
|
+
export { MsgDelegate, MsgUndelegate, MsgEditValidator, MsgCreateValidator, MsgBeginRedelegate, MsgTransferDelegation, MsgCancelUnbondingDelegation, };
|
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.MsgCancelUnbondingDelegation = exports.MsgBeginRedelegate = exports.MsgCreateValidator = exports.MsgEditValidator = exports.MsgUndelegate = exports.MsgDelegate = void 0;
|
|
6
|
+
exports.MsgCancelUnbondingDelegation = exports.MsgTransferDelegation = exports.MsgBeginRedelegate = exports.MsgCreateValidator = exports.MsgEditValidator = exports.MsgUndelegate = exports.MsgDelegate = void 0;
|
|
7
7
|
const MsgDelegate_js_1 = __importDefault(require("./msgs/MsgDelegate.js"));
|
|
8
8
|
exports.MsgDelegate = MsgDelegate_js_1.default;
|
|
9
9
|
const MsgUndelegate_js_1 = __importDefault(require("./msgs/MsgUndelegate.js"));
|
|
@@ -14,5 +14,7 @@ const MsgCreateValidator_js_1 = __importDefault(require("./msgs/MsgCreateValidat
|
|
|
14
14
|
exports.MsgCreateValidator = MsgCreateValidator_js_1.default;
|
|
15
15
|
const MsgBeginRedelegate_js_1 = __importDefault(require("./msgs/MsgBeginRedelegate.js"));
|
|
16
16
|
exports.MsgBeginRedelegate = MsgBeginRedelegate_js_1.default;
|
|
17
|
+
const MsgTransferDelegation_js_1 = __importDefault(require("./msgs/MsgTransferDelegation.js"));
|
|
18
|
+
exports.MsgTransferDelegation = MsgTransferDelegation_js_1.default;
|
|
17
19
|
const MsgCancelUnbondingDelegation_js_1 = __importDefault(require("./msgs/MsgCancelUnbondingDelegation.js"));
|
|
18
20
|
exports.MsgCancelUnbondingDelegation = MsgCancelUnbondingDelegation_js_1.default;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MsgBase } from '../../MsgBase.js';
|
|
2
|
+
import { CosmosBaseV1Beta1Coin, CosmosStakingV1Beta1Tx } from '@injectivelabs/core-proto-ts';
|
|
3
|
+
export declare namespace MsgTransferDelegation {
|
|
4
|
+
interface Params {
|
|
5
|
+
amount: {
|
|
6
|
+
denom: string;
|
|
7
|
+
amount: string;
|
|
8
|
+
};
|
|
9
|
+
injectiveAddress: string;
|
|
10
|
+
validatorAddress: string;
|
|
11
|
+
receiverAddress: string;
|
|
12
|
+
}
|
|
13
|
+
type Proto = CosmosStakingV1Beta1Tx.MsgTransferDelegation;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @category Messages
|
|
17
|
+
*/
|
|
18
|
+
export default class MsgTransferDelegation extends MsgBase<MsgTransferDelegation.Params, MsgTransferDelegation.Proto> {
|
|
19
|
+
static fromJSON(params: MsgTransferDelegation.Params): MsgTransferDelegation;
|
|
20
|
+
toProto(): CosmosStakingV1Beta1Tx.MsgTransferDelegation;
|
|
21
|
+
toData(): {
|
|
22
|
+
delegatorAddress: string;
|
|
23
|
+
validatorAddress: string;
|
|
24
|
+
receiverAddress: string;
|
|
25
|
+
amount: CosmosBaseV1Beta1Coin.Coin | undefined;
|
|
26
|
+
'@type': string;
|
|
27
|
+
};
|
|
28
|
+
toAmino(): {
|
|
29
|
+
type: string;
|
|
30
|
+
value: {
|
|
31
|
+
delegator_address: string;
|
|
32
|
+
validator_address: string;
|
|
33
|
+
receiver_address: string;
|
|
34
|
+
amount: CosmosBaseV1Beta1Coin.Coin | undefined;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
toWeb3Gw(): {
|
|
38
|
+
delegator_address: string;
|
|
39
|
+
validator_address: string;
|
|
40
|
+
receiver_address: string;
|
|
41
|
+
amount: CosmosBaseV1Beta1Coin.Coin | undefined;
|
|
42
|
+
'@type': string;
|
|
43
|
+
};
|
|
44
|
+
toDirectSign(): {
|
|
45
|
+
type: string;
|
|
46
|
+
message: CosmosStakingV1Beta1Tx.MsgTransferDelegation;
|
|
47
|
+
};
|
|
48
|
+
toBinary(): Uint8Array;
|
|
49
|
+
}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const MsgBase_js_1 = require("../../MsgBase.js");
|
|
7
|
+
const snakecase_keys_1 = __importDefault(require("snakecase-keys"));
|
|
8
|
+
const core_proto_ts_1 = require("@injectivelabs/core-proto-ts");
|
|
9
|
+
/**
|
|
10
|
+
* @category Messages
|
|
11
|
+
*/
|
|
12
|
+
class MsgTransferDelegation extends MsgBase_js_1.MsgBase {
|
|
13
|
+
static fromJSON(params) {
|
|
14
|
+
return new MsgTransferDelegation(params);
|
|
15
|
+
}
|
|
16
|
+
toProto() {
|
|
17
|
+
const { params } = this;
|
|
18
|
+
const coinAmount = core_proto_ts_1.CosmosBaseV1Beta1Coin.Coin.create();
|
|
19
|
+
coinAmount.denom = params.amount.denom;
|
|
20
|
+
coinAmount.amount = params.amount.amount;
|
|
21
|
+
const message = core_proto_ts_1.CosmosStakingV1Beta1Tx.MsgTransferDelegation.create();
|
|
22
|
+
message.delegatorAddress = params.injectiveAddress;
|
|
23
|
+
message.validatorAddress = params.validatorAddress;
|
|
24
|
+
message.receiverAddress = params.receiverAddress;
|
|
25
|
+
message.amount = coinAmount;
|
|
26
|
+
return core_proto_ts_1.CosmosStakingV1Beta1Tx.MsgTransferDelegation.fromPartial(message);
|
|
27
|
+
}
|
|
28
|
+
toData() {
|
|
29
|
+
const proto = this.toProto();
|
|
30
|
+
return {
|
|
31
|
+
'@type': '/cosmos.staking.v1beta1.MsgTransferDelegation',
|
|
32
|
+
...proto,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
toAmino() {
|
|
36
|
+
const proto = this.toProto();
|
|
37
|
+
const message = {
|
|
38
|
+
...(0, snakecase_keys_1.default)(proto),
|
|
39
|
+
};
|
|
40
|
+
return {
|
|
41
|
+
type: 'cosmos-sdk/MsgTransferDelegation',
|
|
42
|
+
value: message,
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
toWeb3Gw() {
|
|
46
|
+
const amino = this.toAmino();
|
|
47
|
+
const { value } = amino;
|
|
48
|
+
return {
|
|
49
|
+
'@type': '/cosmos.staking.v1beta1.MsgTransferDelegation',
|
|
50
|
+
...value,
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
toDirectSign() {
|
|
54
|
+
const proto = this.toProto();
|
|
55
|
+
return {
|
|
56
|
+
type: '/cosmos.staking.v1beta1.MsgTransferDelegation',
|
|
57
|
+
message: proto,
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
toBinary() {
|
|
61
|
+
return core_proto_ts_1.CosmosStakingV1Beta1Tx.MsgTransferDelegation.encode(this.toProto()).finish();
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
exports.default = MsgTransferDelegation;
|
|
@@ -512,6 +512,8 @@ const protoTypeToAminoType = (type) => {
|
|
|
512
512
|
return 'cosmos-sdk/MsgUndelegate';
|
|
513
513
|
case 'cosmos.staking.v1beta1.MsgBeginRedelegate':
|
|
514
514
|
return 'cosmos-sdk/MsgBeginRedelegate';
|
|
515
|
+
case 'cosmos.staking.v1beta1.MsgTransferDelegation':
|
|
516
|
+
return 'cosmos-sdk/MsgTransferDelegation';
|
|
515
517
|
case 'cosmos.staking.v1beta1.MsgCancelUnbondingDelegation':
|
|
516
518
|
return 'cosmos-sdk/MsgCancelUnbondingDelegation';
|
|
517
519
|
case 'cosmos.staking.v1beta1.MsgUpdateParams':
|
|
@@ -36,6 +36,7 @@ import MsgUnderwrite from './insurance/msgs/MsgUnderwrite.js';
|
|
|
36
36
|
import MsgSendToEth from './peggy/msgs/MsgSendToEth.js';
|
|
37
37
|
import MsgDelegate from './staking/msgs/MsgDelegate.js';
|
|
38
38
|
import MsgUndelegate from './staking/msgs/MsgUndelegate.js';
|
|
39
|
+
import MsgTransferDelegation from './staking/msgs/MsgTransferDelegation.js';
|
|
39
40
|
import MsgEditValidator from './staking/msgs/MsgEditValidator.js';
|
|
40
41
|
import MsgCreateValidator from './staking/msgs/MsgCreateValidator.js';
|
|
41
42
|
import MsgBeginRedelegate from './staking/msgs/MsgBeginRedelegate.js';
|
|
@@ -62,7 +63,7 @@ import { MsgSubmitProposal } from './gov/index.js';
|
|
|
62
63
|
/**
|
|
63
64
|
* @category Messages
|
|
64
65
|
*/
|
|
65
|
-
export type Msgs = MsgBid | MsgRevoke | MsgGrant | MsgAuthzExec | MsgSend | MsgMultiSend | MsgBatchUpdateOrders | MsgWithdrawDelegatorReward | MsgBatchCancelDerivativeOrders | MsgBatchCancelSpotOrders | MsgCancelDerivativeOrder | MsgCancelSpotOrder | MsgCreateDerivativeLimitOrder | MsgCreateDerivativeMarketOrder | MsgCreateSpotLimitOrder | MsgCreateSpotMarketOrder | MsgDeposit | MsgIncreasePositionMargin | MsgInstantSpotMarketLaunch | MsgWithdraw | MsgGovDeposit | MsgSubmitProposal | MsgVote | MsgTransfer | MsgCreateInsuranceFund | MsgRequestRedemption | MsgUnderwrite | MsgSendToEth | MsgDelegate | MsgUndelegate | MsgBeginRedelegate | MsgCancelUnbondingDelegation | MsgExecuteContract | MsgExecuteContractCompat | MsgMigrateContract | MsgUpdateAdmin | MsgExec | MsgInstantiateContract | MsgCreateBinaryOptionsLimitOrder | MsgCreateBinaryOptionsMarketOrder | MsgCancelBinaryOptionsOrder | MsgBatchCancelBinaryOptionsOrders | MsgWithdrawValidatorCommission | MsgEditValidator | MsgReclaimLockedFunds | MsgExternalTransfer | MsgStoreCode | MsgRewardsOptOut | MsgCreateValidator | MsgMint | MsgBurn | MsgChangeAdmin | MsgCreateDenom | MsgSetDenomMetadata | MsgGrantAllowance | MsgRevokeAllowance | MsgAdminUpdateBinaryOptionsMarket | MsgLiquidatePosition | MsgSignData | MsgGrantWithAuthorization | MsgAuthorizeStakeGrants;
|
|
66
|
+
export type Msgs = MsgBid | MsgRevoke | MsgGrant | MsgAuthzExec | MsgSend | MsgMultiSend | MsgBatchUpdateOrders | MsgWithdrawDelegatorReward | MsgBatchCancelDerivativeOrders | MsgBatchCancelSpotOrders | MsgCancelDerivativeOrder | MsgCancelSpotOrder | MsgCreateDerivativeLimitOrder | MsgCreateDerivativeMarketOrder | MsgCreateSpotLimitOrder | MsgCreateSpotMarketOrder | MsgDeposit | MsgIncreasePositionMargin | MsgInstantSpotMarketLaunch | MsgWithdraw | MsgGovDeposit | MsgSubmitProposal | MsgVote | MsgTransfer | MsgCreateInsuranceFund | MsgRequestRedemption | MsgUnderwrite | MsgSendToEth | MsgDelegate | MsgUndelegate | MsgBeginRedelegate | MsgTransferDelegation | MsgCancelUnbondingDelegation | MsgExecuteContract | MsgExecuteContractCompat | MsgMigrateContract | MsgUpdateAdmin | MsgExec | MsgInstantiateContract | MsgCreateBinaryOptionsLimitOrder | MsgCreateBinaryOptionsMarketOrder | MsgCancelBinaryOptionsOrder | MsgBatchCancelBinaryOptionsOrders | MsgWithdrawValidatorCommission | MsgEditValidator | MsgReclaimLockedFunds | MsgExternalTransfer | MsgStoreCode | MsgRewardsOptOut | MsgCreateValidator | MsgMint | MsgBurn | MsgChangeAdmin | MsgCreateDenom | MsgSetDenomMetadata | MsgGrantAllowance | MsgRevokeAllowance | MsgAdminUpdateBinaryOptionsMarket | MsgLiquidatePosition | MsgSignData | MsgGrantWithAuthorization | MsgAuthorizeStakeGrants;
|
|
66
67
|
/**
|
|
67
68
|
* @category Messages
|
|
68
69
|
*/
|
|
@@ -3,5 +3,6 @@ import MsgUndelegate from './msgs/MsgUndelegate.js';
|
|
|
3
3
|
import MsgEditValidator from './msgs/MsgEditValidator.js';
|
|
4
4
|
import MsgCreateValidator from './msgs/MsgCreateValidator.js';
|
|
5
5
|
import MsgBeginRedelegate from './msgs/MsgBeginRedelegate.js';
|
|
6
|
+
import MsgTransferDelegation from './msgs/MsgTransferDelegation.js';
|
|
6
7
|
import MsgCancelUnbondingDelegation from './msgs/MsgCancelUnbondingDelegation.js';
|
|
7
|
-
export { MsgDelegate, MsgUndelegate, MsgEditValidator, MsgCreateValidator, MsgBeginRedelegate, MsgCancelUnbondingDelegation, };
|
|
8
|
+
export { MsgDelegate, MsgUndelegate, MsgEditValidator, MsgCreateValidator, MsgBeginRedelegate, MsgTransferDelegation, MsgCancelUnbondingDelegation, };
|
|
@@ -3,5 +3,6 @@ import MsgUndelegate from './msgs/MsgUndelegate.js';
|
|
|
3
3
|
import MsgEditValidator from './msgs/MsgEditValidator.js';
|
|
4
4
|
import MsgCreateValidator from './msgs/MsgCreateValidator.js';
|
|
5
5
|
import MsgBeginRedelegate from './msgs/MsgBeginRedelegate.js';
|
|
6
|
+
import MsgTransferDelegation from './msgs/MsgTransferDelegation.js';
|
|
6
7
|
import MsgCancelUnbondingDelegation from './msgs/MsgCancelUnbondingDelegation.js';
|
|
7
|
-
export { MsgDelegate, MsgUndelegate, MsgEditValidator, MsgCreateValidator, MsgBeginRedelegate, MsgCancelUnbondingDelegation, };
|
|
8
|
+
export { MsgDelegate, MsgUndelegate, MsgEditValidator, MsgCreateValidator, MsgBeginRedelegate, MsgTransferDelegation, MsgCancelUnbondingDelegation, };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { MsgBase } from '../../MsgBase.js';
|
|
2
|
+
import { CosmosBaseV1Beta1Coin, CosmosStakingV1Beta1Tx } from '@injectivelabs/core-proto-ts';
|
|
3
|
+
export declare namespace MsgTransferDelegation {
|
|
4
|
+
interface Params {
|
|
5
|
+
amount: {
|
|
6
|
+
denom: string;
|
|
7
|
+
amount: string;
|
|
8
|
+
};
|
|
9
|
+
injectiveAddress: string;
|
|
10
|
+
validatorAddress: string;
|
|
11
|
+
receiverAddress: string;
|
|
12
|
+
}
|
|
13
|
+
type Proto = CosmosStakingV1Beta1Tx.MsgTransferDelegation;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* @category Messages
|
|
17
|
+
*/
|
|
18
|
+
export default class MsgTransferDelegation extends MsgBase<MsgTransferDelegation.Params, MsgTransferDelegation.Proto> {
|
|
19
|
+
static fromJSON(params: MsgTransferDelegation.Params): MsgTransferDelegation;
|
|
20
|
+
toProto(): CosmosStakingV1Beta1Tx.MsgTransferDelegation;
|
|
21
|
+
toData(): {
|
|
22
|
+
delegatorAddress: string;
|
|
23
|
+
validatorAddress: string;
|
|
24
|
+
receiverAddress: string;
|
|
25
|
+
amount: CosmosBaseV1Beta1Coin.Coin | undefined;
|
|
26
|
+
'@type': string;
|
|
27
|
+
};
|
|
28
|
+
toAmino(): {
|
|
29
|
+
type: string;
|
|
30
|
+
value: {
|
|
31
|
+
delegator_address: string;
|
|
32
|
+
validator_address: string;
|
|
33
|
+
receiver_address: string;
|
|
34
|
+
amount: CosmosBaseV1Beta1Coin.Coin | undefined;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
toWeb3Gw(): {
|
|
38
|
+
delegator_address: string;
|
|
39
|
+
validator_address: string;
|
|
40
|
+
receiver_address: string;
|
|
41
|
+
amount: CosmosBaseV1Beta1Coin.Coin | undefined;
|
|
42
|
+
'@type': string;
|
|
43
|
+
};
|
|
44
|
+
toDirectSign(): {
|
|
45
|
+
type: string;
|
|
46
|
+
message: CosmosStakingV1Beta1Tx.MsgTransferDelegation;
|
|
47
|
+
};
|
|
48
|
+
toBinary(): Uint8Array;
|
|
49
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { MsgBase } from '../../MsgBase.js';
|
|
2
|
+
import snakecaseKeys from 'snakecase-keys';
|
|
3
|
+
import { CosmosBaseV1Beta1Coin, CosmosStakingV1Beta1Tx, } from '@injectivelabs/core-proto-ts';
|
|
4
|
+
/**
|
|
5
|
+
* @category Messages
|
|
6
|
+
*/
|
|
7
|
+
export default class MsgTransferDelegation extends MsgBase {
|
|
8
|
+
static fromJSON(params) {
|
|
9
|
+
return new MsgTransferDelegation(params);
|
|
10
|
+
}
|
|
11
|
+
toProto() {
|
|
12
|
+
const { params } = this;
|
|
13
|
+
const coinAmount = CosmosBaseV1Beta1Coin.Coin.create();
|
|
14
|
+
coinAmount.denom = params.amount.denom;
|
|
15
|
+
coinAmount.amount = params.amount.amount;
|
|
16
|
+
const message = CosmosStakingV1Beta1Tx.MsgTransferDelegation.create();
|
|
17
|
+
message.delegatorAddress = params.injectiveAddress;
|
|
18
|
+
message.validatorAddress = params.validatorAddress;
|
|
19
|
+
message.receiverAddress = params.receiverAddress;
|
|
20
|
+
message.amount = coinAmount;
|
|
21
|
+
return CosmosStakingV1Beta1Tx.MsgTransferDelegation.fromPartial(message);
|
|
22
|
+
}
|
|
23
|
+
toData() {
|
|
24
|
+
const proto = this.toProto();
|
|
25
|
+
return {
|
|
26
|
+
'@type': '/cosmos.staking.v1beta1.MsgTransferDelegation',
|
|
27
|
+
...proto,
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
toAmino() {
|
|
31
|
+
const proto = this.toProto();
|
|
32
|
+
const message = {
|
|
33
|
+
...snakecaseKeys(proto),
|
|
34
|
+
};
|
|
35
|
+
return {
|
|
36
|
+
type: 'cosmos-sdk/MsgTransferDelegation',
|
|
37
|
+
value: message,
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
toWeb3Gw() {
|
|
41
|
+
const amino = this.toAmino();
|
|
42
|
+
const { value } = amino;
|
|
43
|
+
return {
|
|
44
|
+
'@type': '/cosmos.staking.v1beta1.MsgTransferDelegation',
|
|
45
|
+
...value,
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
toDirectSign() {
|
|
49
|
+
const proto = this.toProto();
|
|
50
|
+
return {
|
|
51
|
+
type: '/cosmos.staking.v1beta1.MsgTransferDelegation',
|
|
52
|
+
message: proto,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
toBinary() {
|
|
56
|
+
return CosmosStakingV1Beta1Tx.MsgTransferDelegation.encode(this.toProto()).finish();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -502,6 +502,8 @@ export const protoTypeToAminoType = (type) => {
|
|
|
502
502
|
return 'cosmos-sdk/MsgUndelegate';
|
|
503
503
|
case 'cosmos.staking.v1beta1.MsgBeginRedelegate':
|
|
504
504
|
return 'cosmos-sdk/MsgBeginRedelegate';
|
|
505
|
+
case 'cosmos.staking.v1beta1.MsgTransferDelegation':
|
|
506
|
+
return 'cosmos-sdk/MsgTransferDelegation';
|
|
505
507
|
case 'cosmos.staking.v1beta1.MsgCancelUnbondingDelegation':
|
|
506
508
|
return 'cosmos-sdk/MsgCancelUnbondingDelegation';
|
|
507
509
|
case 'cosmos.staking.v1beta1.MsgUpdateParams':
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@injectivelabs/sdk-ts",
|
|
3
3
|
"description": "SDK in TypeScript for building Injective applications in a browser, node, and react native environment.",
|
|
4
|
-
"version": "1.16.4
|
|
4
|
+
"version": "1.16.4",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"author": {
|
|
@@ -123,16 +123,16 @@
|
|
|
123
123
|
"@cosmjs/stargate": "^0.33.0",
|
|
124
124
|
"@injectivelabs/abacus-proto-ts": "1.14.0",
|
|
125
125
|
"@injectivelabs/core-proto-ts": "1.16.1",
|
|
126
|
-
"@injectivelabs/exceptions": "^1.16.4
|
|
126
|
+
"@injectivelabs/exceptions": "^1.16.4",
|
|
127
127
|
"@injectivelabs/grpc-web": "^0.0.1",
|
|
128
128
|
"@injectivelabs/grpc-web-node-http-transport": "^0.0.2",
|
|
129
129
|
"@injectivelabs/grpc-web-react-native-transport": "^0.0.2",
|
|
130
130
|
"@injectivelabs/indexer-proto-ts": "1.13.14",
|
|
131
131
|
"@injectivelabs/mito-proto-ts": "1.13.2",
|
|
132
|
-
"@injectivelabs/networks": "^1.16.4
|
|
132
|
+
"@injectivelabs/networks": "^1.16.4",
|
|
133
133
|
"@injectivelabs/olp-proto-ts": "1.13.4",
|
|
134
|
-
"@injectivelabs/ts-types": "^1.16.4
|
|
135
|
-
"@injectivelabs/utils": "^1.16.4
|
|
134
|
+
"@injectivelabs/ts-types": "^1.16.4",
|
|
135
|
+
"@injectivelabs/utils": "^1.16.4",
|
|
136
136
|
"@metamask/eth-sig-util": "^8.2.0",
|
|
137
137
|
"@noble/curves": "^1.8.1",
|
|
138
138
|
"@noble/hashes": "^1.7.1",
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
"shx": "^0.3.4",
|
|
152
152
|
"snakecase-keys": "^5.4.1"
|
|
153
153
|
},
|
|
154
|
-
"gitHead": "
|
|
154
|
+
"gitHead": "e997ae9a7255ecfd294fc0633e9da385f900fdda",
|
|
155
155
|
"typedoc": {
|
|
156
156
|
"entryPoint": "./src/index.ts",
|
|
157
157
|
"readmeFile": "./README.md",
|