-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #257 from neutron-org/feat/LIDO-68-query-siginig-info
feat: LIDO-68. Signing info query
- Loading branch information
Showing
3 changed files
with
342 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,11 +14,11 @@ git clone [email protected]:neutron-org/neutron.git | |
git clone [email protected]:neutron-org/neutron-query-relayer.git | ||
``` | ||
|
||
We use the Gaia network as a host network, so you need to clone it next to the neutron repos. We use v9.0.3 for the tests. | ||
We use the Gaia network as a host network, so you need to clone it next to the neutron repos. We use v13.0.0 for the tests. | ||
|
||
```shell | ||
git clone [email protected]:cosmos/gaia.git | ||
git checkout v9.0.3 | ||
git checkout v13.0.0 | ||
``` | ||
|
||
### 2. Prepare docker environment | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
import { BroadcastTx200ResponseTxResponse } from '@cosmos-client/core/cjs/openapi/api'; | ||
import { | ||
MsgDelegate, | ||
MsgUndelegate, | ||
} from '@neutron-org/neutronjsplus/dist/proto/cosmos_sdk/cosmos/staking/v1beta1/tx_pb'; | ||
import { | ||
packAnyMsg, | ||
WalletWrapper, | ||
} from '@neutron-org/neutronjsplus/dist/cosmos'; | ||
import Long from 'long'; | ||
|
||
export const msgDelegate = async ( | ||
wallet: WalletWrapper, | ||
delegatorAddress: string, | ||
validatorAddress: string, | ||
amount: string, | ||
): Promise<BroadcastTx200ResponseTxResponse> => { | ||
const msgDelegate = new MsgDelegate({ | ||
delegatorAddress, | ||
validatorAddress, | ||
amount: { denom: wallet.chain.denom, amount: amount }, | ||
}); | ||
const res = await wallet.execTx( | ||
{ | ||
gas_limit: Long.fromString('500000'), | ||
amount: [{ denom: wallet.chain.denom, amount: '5000' }], | ||
}, | ||
[packAnyMsg('/cosmos.staking.v1beta1.MsgDelegate', msgDelegate)], | ||
); | ||
return res?.tx_response; | ||
}; | ||
|
||
export const msgUndelegate = async ( | ||
wallet: WalletWrapper, | ||
delegatorAddress: string, | ||
validatorAddress: string, | ||
amount: string, | ||
): Promise<BroadcastTx200ResponseTxResponse> => { | ||
const msgUndelegate = new MsgUndelegate({ | ||
delegatorAddress, | ||
validatorAddress, | ||
amount: { denom: wallet.chain.denom, amount: amount }, | ||
}); | ||
const res = await wallet.execTx( | ||
{ | ||
gas_limit: Long.fromString('500000'), | ||
amount: [{ denom: wallet.chain.denom, amount: '5000' }], | ||
}, | ||
[packAnyMsg('/cosmos.staking.v1beta1.MsgUndelegate', msgUndelegate)], | ||
); | ||
return res?.tx_response; | ||
}; |
Oops, something went wrong.