Compare commits
7
Commits
v0.2.2
...
release-v0.2.8
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
86259b35a6 | ||
|
|
cf4bf5ed42 | ||
|
|
6055da62c7 | ||
|
|
aa46032bda | ||
|
|
c67961869b | ||
|
|
acd4791355 | ||
|
|
30654bb0ef |
@@ -4,7 +4,7 @@ CLI utility written in TS, used to interact with laconicd. Depends on [registry-
|
|||||||
|
|
||||||
## Install
|
## Install
|
||||||
|
|
||||||
- Add `.npmrc` file in desired project to resolve package
|
* Add `.npmrc` file in desired project to resolve package
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
@cerc-io:registry=https://git.vdb.to/api/packages/cerc-io/npm/
|
@cerc-io:registry=https://git.vdb.to/api/packages/cerc-io/npm/
|
||||||
@@ -12,13 +12,13 @@ CLI utility written in TS, used to interact with laconicd. Depends on [registry-
|
|||||||
|
|
||||||
This will set the registry for `cerc-io` scoped packages in the project
|
This will set the registry for `cerc-io` scoped packages in the project
|
||||||
|
|
||||||
- Install the CLI using package manager
|
* Install the CLI using package manager
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn add @cerc-io/laconic-registry-cli
|
yarn add @cerc-io/laconic-registry-cli
|
||||||
```
|
```
|
||||||
|
|
||||||
- For installing CLI globally add `.npmrc` file above in home directory and run
|
* For installing CLI globally add `.npmrc` file above in home directory and run
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
yarn global add @cerc-io/laconic-registry-cli
|
yarn global add @cerc-io/laconic-registry-cli
|
||||||
@@ -42,7 +42,7 @@ CLI utility written in TS, used to interact with laconicd. Depends on [registry-
|
|||||||
|
|
||||||
Run the chain:
|
Run the chain:
|
||||||
|
|
||||||
- In laconicd repo run:
|
* In laconicd repo run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
TEST_AUCTION_ENABLED=true ./scripts/init.sh clean
|
TEST_AUCTION_ENABLED=true ./scripts/init.sh clean
|
||||||
@@ -54,22 +54,96 @@ Registering records in registry requires an account. To get account private key
|
|||||||
laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe
|
laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe
|
||||||
```
|
```
|
||||||
|
|
||||||
In `config.yml` file assign the account private key to `userKey`.
|
In `config.yml` file assign the account private key to `userKey`:
|
||||||
|
|
||||||
|
```yml
|
||||||
|
services:
|
||||||
|
registry:
|
||||||
|
..
|
||||||
|
userKey: "<user-key>"
|
||||||
|
..
|
||||||
|
```
|
||||||
|
|
||||||
## Gas and Fees
|
## Gas and Fees
|
||||||
|
|
||||||
https://docs.evmos.org/users/basics/gas.html
|
* Gas and fees in `cosmos-sdk`:
|
||||||
|
* <https://docs.cosmos.network/v0.50/learn/beginner/gas-fees>
|
||||||
|
* `gas` is a special unit that is used to track the consumption of resources during execution of a transaction
|
||||||
|
* The maximum value a tx is allowed to consume can be capped by setting `gas` in the config
|
||||||
|
* `fees` have to be paid by sender to allow the transaction into the mempool and is calculated using `gasPrice`:
|
||||||
|
|
||||||
* Transactions require `gas`, set to the maximum value the transaction is allowed to consume.
|
```bash
|
||||||
* Typically, validators also require transaction `fees` to be provided to allow the transaction into the mempool.
|
fees = gas * gasPrice
|
||||||
|
```
|
||||||
|
|
||||||
The `gas` and `fees` can be set to some default values in the config, and can be overriden for each command using the `--gas` and `--fees` arguments.
|
* Typically, validators / full nodes set `min-gas-prices` to only allow txs providing minimum amount of fees
|
||||||
|
* Using `cosmjs`, there are two ways max fees amount can be given for a tx:
|
||||||
|
* Either by specifying `fees` and `gas` (in which case `fees` should be >= `gas` * `min-gas-price`)
|
||||||
|
* Or by specifying a `gasPrice` (in which case `gasPrice` should be >= `min-gas-price` set by the node and fees is `auto` calculated by simulating the tx)
|
||||||
|
|
||||||
Example:
|
When using the `auto` fees calculation, the gas estimation by tx simulation is typically multiplied by a multiplier
|
||||||
|
* As such, following `gas`, `fees` and `gasPrice` combinations can be used in `laconic-registry-cli`:
|
||||||
|
* Gas set, fees set to `Xalnt`:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry bond create --type alnt --quantity 100000000000 --gas 200000 --fees 200000alnt
|
# Example
|
||||||
```
|
gas: 500000
|
||||||
|
fees: 500000alnt
|
||||||
|
gasPrice:
|
||||||
|
```
|
||||||
|
|
||||||
|
* `gasPrice` config ignored
|
||||||
|
* tx rejected if given `fees` < `gas` * `min-gas-price` set by the node
|
||||||
|
* tx fails mid-execution if it runs out of given `gas`
|
||||||
|
* Fees not set, gas price set to `Xalnt`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Example
|
||||||
|
gas:
|
||||||
|
fees:
|
||||||
|
gasPrice: 1alnt
|
||||||
|
```
|
||||||
|
|
||||||
|
* `gas` config ignored
|
||||||
|
* uses `auto` fee calculation using gas estimation with [default multiplier](https://git.vdb.to/cerc-io/registry-sdk/src/branch/main/src/constants.ts) value from `registry-sdk`
|
||||||
|
* tx rejected if given `gasPrice` < `min-gas-price` set by the node
|
||||||
|
* tx fails mid-execution if it runs out of calculated gas
|
||||||
|
* Fees set to a `X` (without `alnt` suffix), gas price set to `Yalnt`:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Example
|
||||||
|
gas:
|
||||||
|
fees: 1.8
|
||||||
|
gasPrice: 1alnt
|
||||||
|
```
|
||||||
|
|
||||||
|
* `gas` config ignored
|
||||||
|
* uses `auto` fee calculation using gas estimation with `fees` as the multiplier
|
||||||
|
* tx rejected if given `gasPrice` < `min-gas-price` set by the node
|
||||||
|
* tx fails mid-execution if it runs out of calculated gas, can be retried with a higher gas estimation multiplier (`fees`)
|
||||||
|
* Fees and gas price both not set:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Example
|
||||||
|
gas:
|
||||||
|
fees:
|
||||||
|
gasPrice:
|
||||||
|
```
|
||||||
|
|
||||||
|
* `gas` config ignored
|
||||||
|
* uses `auto` fee calculation using gas estimation
|
||||||
|
* throws error:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
Gas price must be set in the client options when auto gas is used.
|
||||||
|
```
|
||||||
|
|
||||||
|
* The `gas`, `fees` and `gasPrice` can be set to some default values in the config as shown above, and can be overriden for each command using the `--gas`, `--fees` and `--gasPrice` arguments:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Example:
|
||||||
|
laconic registry bond create --type alnt --quantity 100000000000 --gas 200000 --fees 200000alnt
|
||||||
|
```
|
||||||
|
|
||||||
## Operations
|
## Operations
|
||||||
|
|
||||||
@@ -133,32 +207,61 @@ Send tokens:
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry tokens send --address laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k --type alnt --quantity 1000000000
|
$ laconic registry tokens send --address laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k --type alnt --quantity 1000000000
|
||||||
[
|
{
|
||||||
{
|
"tx": {
|
||||||
"address": "laconic1pmuxrcnuhhf8qdllzuf2ctj2tnwwcg6yswqnyd",
|
"hash": "977152CBE474613E1BBAFEF286F12134829FAF3C9E7C8349149DE3E687B816FC",
|
||||||
"pubKey": "A68/q7/xazFzNj+rrvE07ALxkMgqw1ugL35VECkWAYvt",
|
"height": 343369,
|
||||||
"number": "0",
|
"index": 0,
|
||||||
"sequence": "16",
|
"code": 0,
|
||||||
"balance": [
|
"log": "",
|
||||||
{
|
"sender": "laconic1pmuxrcnuhhf8qdllzuf2ctj2tnwwcg6yswqnyd",
|
||||||
"type": "alnt",
|
"recipient": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
||||||
"quantity": "99998999999999997973999700"
|
"amount": "1000000000alnt"
|
||||||
}
|
|
||||||
]
|
|
||||||
},
|
},
|
||||||
{
|
"accounts": [
|
||||||
"address": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
{
|
||||||
"pubKey": null,
|
"address": "laconic1pmuxrcnuhhf8qdllzuf2ctj2tnwwcg6yswqnyd",
|
||||||
"number": "12",
|
"pubKey": "A68/q7/xazFzNj+rrvE07ALxkMgqw1ugL35VECkWAYvt",
|
||||||
"sequence": "0",
|
"number": "0",
|
||||||
"balance": [
|
"sequence": "16",
|
||||||
{
|
"balance": [
|
||||||
"type": "alnt",
|
{
|
||||||
"quantity": "1000000000"
|
"type": "alnt",
|
||||||
}
|
"quantity": "99998999999999997973999700"
|
||||||
]
|
}
|
||||||
}
|
]
|
||||||
]
|
},
|
||||||
|
{
|
||||||
|
"address": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
||||||
|
"pubKey": null,
|
||||||
|
"number": "12",
|
||||||
|
"sequence": "0",
|
||||||
|
"balance": [
|
||||||
|
{
|
||||||
|
"type": "alnt",
|
||||||
|
"quantity": "1000000000"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
Get token TX details:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
$ laconic registry tokens gettx --hash 977152CBE474613E1BBAFEF286F12134829FAF3C9E7C8349149DE3E687B816FC
|
||||||
|
{
|
||||||
|
"hash": "977152CBE474613E1BBAFEF286F12134829FAF3C9E7C8349149DE3E687B816FC",
|
||||||
|
"height": 343369,
|
||||||
|
"index": 0,
|
||||||
|
"code": 0,
|
||||||
|
"log": "",
|
||||||
|
"sender": "laconic1pmuxrcnuhhf8qdllzuf2ctj2tnwwcg6yswqnyd",
|
||||||
|
"recipient": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
||||||
|
"amount": "1000000000alnt",
|
||||||
|
"raw": "0A91010A8E010A1C2F636F736D6F732E62616E6B2E763162657461312E4D736753656E64126E0A2E6C61636F6E696331347763303777613372377270707275343367396A786B7A68716E686D76666D34646765793673122E6C61636F6E6963317971706337637966657470676D71746B6B30756B657675676561617539703063776D6A6C73751A0C0A04616C6E7412043130303012680A500A460A1F2F636F736D6F732E63727970746F2E736563703235366B312E5075624B657912230A2102F3A1D077638F9FD828C4CF126FE82E0BE98388083F5BC1E1DD4D84132AEBFF8112040A020801185A12140A0E0A04616C6E7412063430303030301080B5181A4088DF7BA4B63EA68E185AB2887C9EC29EBC4158874BC037816B8494AD36D3B2433B5223CECC336D4624BB7FEF4DBB4A8B5F4707ACD8E55443312009E9473DF821"
|
||||||
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
Create record (generic):
|
Create record (generic):
|
||||||
@@ -226,13 +329,13 @@ $ laconic registry record get --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf
|
|||||||
List records:
|
List records:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry record list
|
laconic registry record list
|
||||||
```
|
```
|
||||||
|
|
||||||
Reserve authority:
|
Reserve authority:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry authority reserve laconic
|
laconic registry authority reserve laconic
|
||||||
```
|
```
|
||||||
|
|
||||||
Check authority information:
|
Check authority information:
|
||||||
@@ -330,31 +433,43 @@ Reveal file: ./out/bafyreiay2rccax64yn4ljhvzvm3jkbebvzheyucuma5jlbpzpzd5i5gjuy.j
|
|||||||
Reveal an auction bid:
|
Reveal an auction bid:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry auction bid reveal 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48 ./out/bafyreiay2rccax64yn4ljhvzvm3jkbebvzheyucuma5jlbpzpzd5i5gjuy.json
|
laconic registry auction bid reveal 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48 ./out/bafyreiay2rccax64yn4ljhvzvm3jkbebvzheyucuma5jlbpzpzd5i5gjuy.json
|
||||||
```
|
```
|
||||||
|
|
||||||
Set authority bond (after winning auction):
|
Set authority bond (after winning auction):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry authority bond set laconic 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785
|
laconic registry authority bond set laconic 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785
|
||||||
```
|
```
|
||||||
|
|
||||||
Create sub-authority (same owner as parent authority):
|
Create sub-authority (same owner as parent authority):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry authority reserve echo.laconic
|
laconic registry authority reserve echo.laconic
|
||||||
```
|
```
|
||||||
|
|
||||||
Create sub-authority (custom owner for sub-authority):
|
Create sub-authority (custom owner for sub-authority):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry authority reserve kube.laconic --owner laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k
|
laconic registry authority reserve kube.laconic --owner laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k
|
||||||
|
```
|
||||||
|
|
||||||
|
Get all the authorities:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic registry authority list
|
||||||
|
```
|
||||||
|
|
||||||
|
Get all the authorities by owner:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
laconic registry authority list --owner laconic1zayjut6pd4xy9dguut56v55hktzmeq6r777hmd
|
||||||
```
|
```
|
||||||
|
|
||||||
Set name:
|
Set name:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry name set lrn://laconic/watcher/erc20 bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba
|
laconic registry name set lrn://laconic/watcher/erc20 bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba
|
||||||
```
|
```
|
||||||
|
|
||||||
Lookup name information:
|
Lookup name information:
|
||||||
@@ -426,7 +541,7 @@ $ laconic registry name resolve lrn://laconic/watcher/erc20
|
|||||||
Create bond:
|
Create bond:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry bond create --type alnt --quantity 1000
|
laconic registry bond create --type alnt --quantity 1000
|
||||||
```
|
```
|
||||||
|
|
||||||
List bonds:
|
List bonds:
|
||||||
@@ -506,41 +621,41 @@ $ laconic registry bond list --owner laconic15za32wly5exgcrt2zfr8php4ya49n5y7mas
|
|||||||
Refill bond:
|
Refill bond:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry bond refill --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type alnt --quantity 1000
|
laconic registry bond refill --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type alnt --quantity 1000
|
||||||
```
|
```
|
||||||
|
|
||||||
Withdraw funds from bond:
|
Withdraw funds from bond:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry bond withdraw --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type alnt --quantity 500
|
laconic registry bond withdraw --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type alnt --quantity 500
|
||||||
```
|
```
|
||||||
|
|
||||||
Cancel bond:
|
Cancel bond:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry bond cancel --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785
|
laconic registry bond cancel --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785
|
||||||
```
|
```
|
||||||
|
|
||||||
Associate bond (with record):
|
Associate bond (with record):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry bond associate --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba --bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0
|
laconic registry bond associate --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba --bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0
|
||||||
```
|
```
|
||||||
|
|
||||||
Disassociate bond (from record):
|
Disassociate bond (from record):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry bond dissociate --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba
|
laconic registry bond dissociate --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba
|
||||||
```
|
```
|
||||||
|
|
||||||
Dissociate all records from bond:
|
Dissociate all records from bond:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry bond records dissociate --bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0
|
laconic registry bond records dissociate --bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0
|
||||||
```
|
```
|
||||||
|
|
||||||
Reassociate records (switch bond):
|
Reassociate records (switch bond):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
$ laconic registry bond records reassociate --old-bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0 --new-bond-id 3e11c61f179897e4b12e9b63de35d36f88ac146755e7a28ce0bcdd07cf3a03ae
|
laconic registry bond records reassociate --old-bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0 --new-bond-id 3e11c61f179897e4b12e9b63de35d36f88ac146755e7a28ce0bcdd07cf3a03ae
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -7,3 +7,4 @@ services:
|
|||||||
chainId: laconic_9000-1
|
chainId: laconic_9000-1
|
||||||
gas: 200000
|
gas: 200000
|
||||||
fees: 200000alnt
|
fees: 200000alnt
|
||||||
|
gasPrice:
|
||||||
|
|||||||
@@ -26,6 +26,7 @@
|
|||||||
|
|
||||||
# Update the gas value in config.yml
|
# Update the gas value in config.yml
|
||||||
# gas: 500000
|
# gas: 500000
|
||||||
|
# fees: 500000alnt
|
||||||
|
|
||||||
# Get user private key
|
# Get user private key
|
||||||
laconicd keys export alice --unarmored-hex --unsafe --keyring-backend test --home ~/.laconicd
|
laconicd keys export alice --unarmored-hex --unsafe --keyring-backend test --home ~/.laconicd
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ async function main () {
|
|||||||
let rpcEndpoint, gqlEndpoint, chainId: string;
|
let rpcEndpoint, gqlEndpoint, chainId: string;
|
||||||
({ rpcEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, registryConfig));
|
({ rpcEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, registryConfig));
|
||||||
|
|
||||||
registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
fee = getGasAndFees(argv, registryConfig);
|
fee = getGasAndFees(argv, registryConfig);
|
||||||
|
|
||||||
await processDir(path.resolve(recordsDir));
|
await processDir(path.resolve(recordsDir));
|
||||||
|
|||||||
+3
-2
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@cerc-io/laconic-registry-cli",
|
"name": "@cerc-io/laconic-registry-cli",
|
||||||
"version": "0.2.2",
|
"version": "0.2.8",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": "git@github.com:cerc-io/laconic-registry-cli.git",
|
"repository": "git@github.com:cerc-io/laconic-registry-cli.git",
|
||||||
"author": "",
|
"author": "",
|
||||||
@@ -29,7 +29,8 @@
|
|||||||
"typescript": "^4.6.3"
|
"typescript": "^4.6.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cerc-io/registry-sdk": "^0.2.5",
|
"@cerc-io/registry-sdk": "^0.2.9",
|
||||||
|
"@cosmjs/stargate": "^0.32.2",
|
||||||
"fs-extra": "^10.1.0",
|
"fs-extra": "^10.1.0",
|
||||||
"js-yaml": "^3.14.1",
|
"js-yaml": "^3.14.1",
|
||||||
"lodash": "^4.17.21",
|
"lodash": "^4.17.21",
|
||||||
|
|||||||
@@ -18,10 +18,12 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
if (!address && privateKey) {
|
if (!address && privateKey) {
|
||||||
address = new Account(Buffer.from(privateKey, 'hex')).address;
|
const account = new Account(Buffer.from(privateKey, 'hex'));
|
||||||
|
await account.init();
|
||||||
|
address = account.address;
|
||||||
}
|
}
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
const result = await registry.getAccounts([address]);
|
const result = await registry.getAccounts([address]);
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
queryOutput(result, argv.output);
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import { Account, createBid, Registry } from '@cerc-io/registry-sdk';
|
|||||||
import { ensureDir } from 'fs-extra';
|
import { ensureDir } from 'fs-extra';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../../util';
|
||||||
|
|
||||||
const OUT_DIR = 'out';
|
const OUT_DIR = 'out';
|
||||||
|
|
||||||
@@ -40,7 +40,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
await ensureDir(outDirPath);
|
await ensureDir(outDirPath);
|
||||||
fs.writeFileSync(revealFilePath, JSON.stringify(reveal, undefined, 2));
|
fs.writeFileSync(revealFilePath, JSON.stringify(reveal, undefined, 2));
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
|
|
||||||
const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee);
|
const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee);
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import path from 'path';
|
|||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../../util';
|
||||||
|
|
||||||
export const command = 'reveal [auction-id] [file-path]';
|
export const command = 'reveal [auction-id] [file-path]';
|
||||||
|
|
||||||
@@ -23,7 +23,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
|
|
||||||
const reveal = fs.readFileSync(path.resolve(filePath));
|
const reveal = fs.readFileSync(path.resolve(filePath));
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
const result = await registry.getAuctionsByIds([id as string]);
|
const result = await registry.getAuctionsByIds([id as string]);
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
queryOutput(result, argv.output);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../../util';
|
||||||
|
|
||||||
export const command = 'set [name] [bond-id]';
|
export const command = 'set [name] [bond-id]';
|
||||||
|
|
||||||
@@ -21,7 +21,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee);
|
const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee);
|
||||||
const success = '{"success": true}';
|
const success = '{"success": true}';
|
||||||
|
|||||||
@@ -0,0 +1,29 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
|
||||||
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'list';
|
||||||
|
|
||||||
|
export const desc = 'List authorities (optionally by owner).';
|
||||||
|
|
||||||
|
export const builder = {
|
||||||
|
owner: {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const { services: { registry: registryConfig } } = getConfig(argv.config as string);
|
||||||
|
const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
|
||||||
|
assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
|
const result = await registry.getAuthorities(argv.owner as string);
|
||||||
|
|
||||||
|
queryOutput(result, argv.output);
|
||||||
|
};
|
||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'reserve [name]';
|
export const command = 'reserve [name]';
|
||||||
|
|
||||||
@@ -27,7 +27,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.reserveAuthority({ name, owner }, privateKey, fee);
|
const result = await registry.reserveAuthority({ name, owner }, privateKey, fee);
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
const result = await registry.lookupAuthorities([name], true);
|
const result = await registry.lookupAuthorities([name], true);
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
queryOutput(result, argv.output);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'associate';
|
export const command = 'associate';
|
||||||
|
|
||||||
@@ -27,7 +27,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.associateBond({ recordId: id, bondId }, privateKey, fee);
|
const result = await registry.associateBond({ recordId: id, bondId }, privateKey, fee);
|
||||||
const success = '{"success": true}';
|
const success = '{"success": true}';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'cancel';
|
export const command = 'cancel';
|
||||||
|
|
||||||
@@ -19,7 +19,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.cancelBond({ id }, privateKey, fee);
|
const result = await registry.cancelBond({ id }, privateKey, fee);
|
||||||
const success = '{"success": true}';
|
const success = '{"success": true}';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'create';
|
export const command = 'create';
|
||||||
|
|
||||||
@@ -32,7 +32,9 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const bondId = await registry.getNextBondId(privateKey);
|
const bondId = await registry.getNextBondId(privateKey);
|
||||||
const result = await registry.createBond({ denom, amount }, privateKey, fee);
|
const result = await registry.createBond({ denom, amount }, privateKey, fee);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'dissociate';
|
export const command = 'dissociate';
|
||||||
|
|
||||||
@@ -19,7 +19,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.dissociateBond({ recordId: id }, privateKey, fee);
|
const result = await registry.dissociateBond({ recordId: id }, privateKey, fee);
|
||||||
const success = '{"success": true}';
|
const success = '{"success": true}';
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
|
|
||||||
const result = await registry.getBondsByIds([id as string]);
|
const result = await registry.getBondsByIds([id as string]);
|
||||||
|
|
||||||
|
|||||||
@@ -21,10 +21,17 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
|
|
||||||
|
let result: any;
|
||||||
|
|
||||||
const { owner } = argv;
|
const { owner } = argv;
|
||||||
const result = await registry.queryBonds({ owner });
|
if (owner) {
|
||||||
|
const [bondsByOwnerResult] = await registry.queryBondsByOwners([String(owner)]);
|
||||||
|
result = bondsByOwnerResult.bonds;
|
||||||
|
} else {
|
||||||
|
result = await registry.queryBonds();
|
||||||
|
}
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
queryOutput(result, argv.output);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../../util';
|
||||||
|
|
||||||
export const command = 'dissociate';
|
export const command = 'dissociate';
|
||||||
|
|
||||||
@@ -25,7 +25,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.dissociateRecords({ bondId }, privateKey, fee);
|
const result = await registry.dissociateRecords({ bondId }, privateKey, fee);
|
||||||
const success = '{"success": true}';
|
const success = '{"success": true}';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../../util';
|
||||||
|
|
||||||
export const command = 'reassociate';
|
export const command = 'reassociate';
|
||||||
|
|
||||||
@@ -30,7 +30,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.reassociateRecords({ oldBondId, newBondId }, privateKey, fee);
|
const result = await registry.reassociateRecords({ oldBondId, newBondId }, privateKey, fee);
|
||||||
const success = '{"success": true}';
|
const success = '{"success": true}';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'refill';
|
export const command = 'refill';
|
||||||
|
|
||||||
@@ -33,7 +33,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.refillBond({ id, denom, amount }, privateKey, fee);
|
const result = await registry.refillBond({ id, denom, amount }, privateKey, fee);
|
||||||
const success = '{"success": true}';
|
const success = '{"success": true}';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'withdraw';
|
export const command = 'withdraw';
|
||||||
|
|
||||||
@@ -33,7 +33,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.withdrawBond({ id, denom, amount }, privateKey, fee);
|
const result = await registry.withdrawBond({ id, denom, amount }, privateKey, fee);
|
||||||
const success = '{"success": true}';
|
const success = '{"success": true}';
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'delete [name]';
|
export const command = 'delete [name]';
|
||||||
|
|
||||||
@@ -19,7 +19,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.deleteName({ lrn: name }, privateKey, fee);
|
const result = await registry.deleteName({ lrn: name }, privateKey, fee);
|
||||||
|
|
||||||
|
|||||||
@@ -24,7 +24,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
const result = await registry.lookupNames([name], argv.history as boolean);
|
const result = await registry.lookupNames([name], argv.history as boolean);
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
queryOutput(result, argv.output);
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
|
|
||||||
let result = await registry.resolveNames([name]);
|
let result = await registry.resolveNames([name]);
|
||||||
result = result.filter((v: any) => v);
|
result = result.filter((v: any) => v);
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'set [name] [id]';
|
export const command = 'set [name] [id]';
|
||||||
|
|
||||||
@@ -21,7 +21,8 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.setName({ lrn: name, cid: id }, privateKey, fee);
|
const result = await registry.setName({ lrn: name, cid: id }, privateKey, fee);
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
const result = await registry.getRecordsByIds([id as string]);
|
const result = await registry.getRecordsByIds([id as string]);
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
queryOutput(result, argv.output);
|
||||||
|
|||||||
@@ -24,13 +24,23 @@ export const builder = {
|
|||||||
all: {
|
all: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
default: false
|
default: false
|
||||||
|
},
|
||||||
|
refs: {
|
||||||
|
type: 'boolean',
|
||||||
|
default: false
|
||||||
|
},
|
||||||
|
limit: {
|
||||||
|
type: 'number'
|
||||||
|
},
|
||||||
|
offset: {
|
||||||
|
type: 'number'
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
export const handler = async (argv: Arguments) => {
|
||||||
const { services: { registry: registryConfig } } = getConfig(argv.config as string);
|
const { services: { registry: registryConfig } } = getConfig(argv.config as string);
|
||||||
const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
|
const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
|
||||||
const { type, name, bondId, owner, all } = argv;
|
const { type, name, bondId, owner, all, refs, limit, offset } = argv;
|
||||||
const filters: any = {};
|
const filters: any = {};
|
||||||
|
|
||||||
const filterArgs = argv._.slice(3);
|
const filterArgs = argv._.slice(3);
|
||||||
@@ -42,9 +52,9 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
|
|
||||||
let result = await registry.queryRecords({ ...filters, type, name }, all as boolean);
|
let result = await registry.queryRecords({ ...filters, type, name }, all as boolean, refs as boolean, limit as number, offset as number);
|
||||||
|
|
||||||
// Apply ex post filters.
|
// Apply ex post filters.
|
||||||
if (bondId) {
|
if (bondId) {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import yaml from 'js-yaml';
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
import { getConfig, getGasAndFees, getConnectionInfo, txOutput } from '../../../util';
|
import { getConfig, getGasAndFees, getConnectionInfo, getGasPrice, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'publish';
|
export const command = 'publish';
|
||||||
|
|
||||||
@@ -43,7 +43,9 @@ export const handler = async (argv: Arguments) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
const result = await registry.setRecord({ privateKey: userKey, record, bondId }, txKey || userKey, fee);
|
const result = await registry.setRecord({ privateKey: userKey, record, bondId }, txKey || userKey, fee);
|
||||||
|
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
|
|
||||||
const result = await registry.getStatus();
|
const result = await registry.getStatus();
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
|
|||||||
@@ -0,0 +1,54 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Account, Registry } from '@cerc-io/registry-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
import { IndexedTx } from '@cosmjs/stargate/build/stargateclient';
|
||||||
|
|
||||||
|
export const command = 'gettx';
|
||||||
|
|
||||||
|
export const desc = 'Get token transfer tx info.';
|
||||||
|
|
||||||
|
export const builder = {
|
||||||
|
hash: {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const hash = argv.hash as string;
|
||||||
|
|
||||||
|
assert(hash, 'Invalid tx hash.');
|
||||||
|
|
||||||
|
const { services: { registry: registryConfig } } = getConfig(argv.config as string);
|
||||||
|
const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
|
||||||
|
assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid registry Chain ID.');
|
||||||
|
|
||||||
|
const account = new Account(Buffer.from(privateKey, 'hex'));
|
||||||
|
await account.init();
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
||||||
|
const laconicClient = await registry.getLaconicClient(account);
|
||||||
|
|
||||||
|
const txResponse: IndexedTx | null = await laconicClient.getTx(hash);
|
||||||
|
if (txResponse) {
|
||||||
|
const transfer = txResponse.events.find(e => e.type === 'transfer' ? e.attributes.find(a => a.key === 'msg_index') : null);
|
||||||
|
const output = {
|
||||||
|
hash: txResponse.hash,
|
||||||
|
height: txResponse.height,
|
||||||
|
index: txResponse.txIndex,
|
||||||
|
code: txResponse.code,
|
||||||
|
log: txResponse.rawLog,
|
||||||
|
sender: transfer?.attributes.find(a => a.key === 'sender')?.value,
|
||||||
|
recipient: transfer?.attributes.find(a => a.key === 'recipient')?.value,
|
||||||
|
amount: transfer?.attributes.find(a => a.key === 'amount')?.value,
|
||||||
|
raw: Buffer.from(txResponse.tx).toString('hex').toUpperCase()
|
||||||
|
};
|
||||||
|
queryOutput(output, argv.output);
|
||||||
|
} else {
|
||||||
|
queryOutput(null, argv.output);
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
import { Arguments } from 'yargs';
|
import { Arguments } from 'yargs';
|
||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Account, Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, queryOutput } from '../../../util';
|
import { Account, Registry, DEFAULT_GAS_ESTIMATION_MULTIPLIER } from '@cerc-io/registry-sdk';
|
||||||
|
import { DeliverTxResponse } from '@cosmjs/stargate';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, queryOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'send';
|
export const command = 'send';
|
||||||
|
|
||||||
@@ -37,9 +39,40 @@ export const handler = async (argv: Arguments) => {
|
|||||||
await account.init();
|
await account.init();
|
||||||
const fromAddress = account.address;
|
const fromAddress = account.address;
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, chainId);
|
const gasPrice = getGasPrice(argv, registryConfig);
|
||||||
|
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
||||||
|
const laconicClient = await registry.getLaconicClient(account);
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
const fee = getGasAndFees(argv, registryConfig);
|
||||||
await registry.sendCoins({ denom, amount, destinationAddress }, privateKey, fee);
|
|
||||||
const result = await registry.getAccounts([fromAddress, destinationAddress]);
|
const txResponse: DeliverTxResponse = await laconicClient.sendTokens(
|
||||||
queryOutput(result, argv.output);
|
account.address,
|
||||||
|
destinationAddress,
|
||||||
|
[
|
||||||
|
{
|
||||||
|
denom,
|
||||||
|
amount
|
||||||
|
}
|
||||||
|
],
|
||||||
|
fee || DEFAULT_GAS_ESTIMATION_MULTIPLIER);
|
||||||
|
|
||||||
|
assert(txResponse.code === 0, `TX Failed - Hash: ${txResponse.transactionHash}, Code: ${txResponse.code}, Message: ${txResponse.rawLog}`);
|
||||||
|
|
||||||
|
const transfer = txResponse.events.find(e => e.type === 'transfer' ? e.attributes.find(a => a.key === 'msg_index') : null);
|
||||||
|
const accountResponse = await registry.getAccounts([fromAddress, destinationAddress]);
|
||||||
|
|
||||||
|
const output = {
|
||||||
|
tx: {
|
||||||
|
hash: txResponse.transactionHash,
|
||||||
|
height: txResponse.height,
|
||||||
|
index: txResponse.txIndex,
|
||||||
|
code: txResponse.code,
|
||||||
|
log: txResponse.rawLog,
|
||||||
|
sender: transfer?.attributes.find(a => a.key === 'sender')?.value,
|
||||||
|
recipient: transfer?.attributes.find(a => a.key === 'recipient')?.value,
|
||||||
|
amount: transfer?.attributes.find(a => a.key === 'amount')?.value
|
||||||
|
},
|
||||||
|
accounts: accountResponse
|
||||||
|
};
|
||||||
|
|
||||||
|
queryOutput(output, argv.output);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,8 @@ exports.builder = (yargs: yargs.Argv) => {
|
|||||||
id: { type: 'string' },
|
id: { type: 'string' },
|
||||||
address: { type: 'string' },
|
address: { type: 'string' },
|
||||||
gas: { type: 'string' },
|
gas: { type: 'string' },
|
||||||
fees: { type: 'string' }
|
fees: { type: 'string' },
|
||||||
|
gasPrice: { type: 'string' }
|
||||||
})
|
})
|
||||||
.commandDir('registry-cmds')
|
.commandDir('registry-cmds')
|
||||||
.demandCommand()
|
.demandCommand()
|
||||||
|
|||||||
@@ -26,4 +26,5 @@ yargs(hideBin(process.argv))
|
|||||||
.commandDir('cmds')
|
.commandDir('cmds')
|
||||||
.demandCommand()
|
.demandCommand()
|
||||||
.help()
|
.help()
|
||||||
|
.alias('h', 'help')
|
||||||
.argv;
|
.argv;
|
||||||
|
|||||||
+9
-3
@@ -2,15 +2,21 @@ import { Arguments } from 'yargs';
|
|||||||
import clean from 'lodash-clean';
|
import clean from 'lodash-clean';
|
||||||
|
|
||||||
export const getConnectionInfo = (argv: Arguments, config: any) => {
|
export const getConnectionInfo = (argv: Arguments, config: any) => {
|
||||||
const { server, userKey, bondId, txKey, chainId, fees, gas } = argv;
|
const { server, userKey, bondId, txKey, chainId, fees, gas, gasPrice } = argv;
|
||||||
|
|
||||||
const result = {
|
const result = {
|
||||||
...config,
|
...config,
|
||||||
|
userKey: stripHexPrefix(config.userKey),
|
||||||
...clean({ server, userKey, bondId, txKey, chainId }),
|
...clean({ server, userKey, bondId, txKey, chainId }),
|
||||||
privateKey: txKey || userKey || config.userKey,
|
privateKey: stripHexPrefix(txKey || userKey || config.userKey),
|
||||||
gas: String(gas || config.gas),
|
gas: String(gas || config.gas),
|
||||||
fees: String(fees || config.fees)
|
fees: String(fees || config.fees),
|
||||||
|
gasPrice: String(gasPrice || config.gasPrice)
|
||||||
};
|
};
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
function stripHexPrefix (hex: string): string {
|
||||||
|
return hex && hex.startsWith('0x') ? hex.slice(2) : hex;
|
||||||
|
}
|
||||||
|
|||||||
+24
-11
@@ -2,23 +2,36 @@
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Arguments } from 'yargs';
|
import { Arguments } from 'yargs';
|
||||||
|
|
||||||
export const parseGasAndFees = (gas: string, fees = '') => {
|
import { StdFee, GasPrice, parseCoins } from '@cosmjs/stargate';
|
||||||
|
|
||||||
|
export const parseGasAndFees = (gas?: string, fees?: string): StdFee | number | undefined => {
|
||||||
|
// If fees is not given or a number, treat it as a gas estimation multiplier
|
||||||
|
if (fees === null || fees === undefined) {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
|
const isFeesANumber = !isNaN(Number(fees));
|
||||||
|
if (isFeesANumber) {
|
||||||
|
return Number(fees);
|
||||||
|
}
|
||||||
|
|
||||||
|
// If fees is not a gas estimation multiplier, gas is required
|
||||||
assert(gas, 'Invalid gas.');
|
assert(gas, 'Invalid gas.');
|
||||||
|
|
||||||
const [{ amount, denom }] = fees.trim().split(',')
|
|
||||||
.map(fee => fee.trim().split(/(\d+)/))
|
|
||||||
.filter(([_, amount, denom]) => (denom && amount))
|
|
||||||
.map(([_, amount, denom]) => ({ denom, amount }));
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
amount: [{ denom, amount }],
|
amount: parseCoins(String(fees)),
|
||||||
gas
|
gas: String(gas)
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getGasAndFees = (argv: Arguments, config: any = {}) => {
|
export const getGasAndFees = (argv: Arguments, config: any = {}): StdFee | number | undefined => {
|
||||||
return parseGasAndFees(
|
return parseGasAndFees(
|
||||||
String(argv.gas || config.gas),
|
argv.gas || config.gas,
|
||||||
String(argv.fees || config.fees)
|
argv.fees || config.fees
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const getGasPrice = (argv: Arguments, config: any = {}): GasPrice | undefined => {
|
||||||
|
const gasPriceString = argv.gasPrice || config.gasPrice;
|
||||||
|
return gasPriceString != null ? GasPrice.fromString(String(gasPriceString)) : undefined;
|
||||||
|
};
|
||||||
|
|||||||
+113
-3
@@ -15,7 +15,8 @@ import {
|
|||||||
getRecordObj,
|
getRecordObj,
|
||||||
getAuthorityObj,
|
getAuthorityObj,
|
||||||
getAuctionObj,
|
getAuctionObj,
|
||||||
getBidObj
|
getBidObj,
|
||||||
|
updateGasAndFeesConfig
|
||||||
} from './helpers';
|
} from './helpers';
|
||||||
|
|
||||||
describe('Test laconic CLI commands', () => {
|
describe('Test laconic CLI commands', () => {
|
||||||
@@ -217,8 +218,28 @@ describe('Test laconic CLI commands', () => {
|
|||||||
getAccountObj({ address: testAccount2, balance: sendAmount })
|
getAccountObj({ address: testAccount2, balance: sendAmount })
|
||||||
];
|
];
|
||||||
|
|
||||||
expect(outputObj.length).toEqual(2);
|
expect(outputObj.tx.code).toEqual(0);
|
||||||
expect(outputObj).toMatchObject(expectedAccounts);
|
expect(outputObj.tx.amount).toEqual(`${sendAmount}${TOKEN_TYPE}`);
|
||||||
|
expect(outputObj.tx.sender).toEqual(testAccount);
|
||||||
|
expect(outputObj.tx.recipient).toEqual(testAccount2);
|
||||||
|
expect(outputObj.accounts.length).toEqual(2);
|
||||||
|
expect(outputObj.accounts).toMatchObject(expectedAccounts);
|
||||||
|
});
|
||||||
|
test('laconic registry tokens gettx --hash <hash>', async () => {
|
||||||
|
const sendAmount = 1000000000;
|
||||||
|
|
||||||
|
const sendResult = spawnSync('laconic', ['registry', 'tokens', 'send', '--address', testAccount2, '--type', TOKEN_TYPE, '--quantity', sendAmount.toString()]);
|
||||||
|
const sendOutput = checkResultAndRetrieveOutput(sendResult);
|
||||||
|
expect(sendOutput.tx.code).toEqual(0);
|
||||||
|
|
||||||
|
const gettxResult = spawnSync('laconic', ['registry', 'tokens', 'gettx', '--hash', sendOutput.tx.hash]);
|
||||||
|
const gettxOutput = checkResultAndRetrieveOutput(gettxResult);
|
||||||
|
|
||||||
|
expect(gettxOutput.hash).toEqual(sendOutput.tx.hash);
|
||||||
|
expect(gettxOutput.code).toEqual(0);
|
||||||
|
expect(gettxOutput.amount).toEqual(`${sendAmount}${TOKEN_TYPE}`);
|
||||||
|
expect(gettxOutput.sender).toEqual(testAccount);
|
||||||
|
expect(gettxOutput.recipient).toEqual(testAccount2);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -478,6 +499,47 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(authorityOutputObj.length).toEqual(1);
|
expect(authorityOutputObj.length).toEqual(1);
|
||||||
expect(authorityOutputObj[0]).toMatchObject(expectedAuthority);
|
expect(authorityOutputObj[0]).toMatchObject(expectedAuthority);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test('laconic registry authority list', async () => {
|
||||||
|
const result = spawnSync('laconic', ['registry', 'authority', 'list']);
|
||||||
|
const authoritiesOutputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
|
// Expected authorities
|
||||||
|
const expectedAuthorities = [
|
||||||
|
{ name: 'echo.laconic', entry: { ownerAddress: testAccount, status: 'active' } },
|
||||||
|
{ name: 'kube.laconic', entry: { ownerAddress: testAccount2, status: 'active' } },
|
||||||
|
{ name: 'laconic', entry: { ownerAddress: testAccount, status: 'active' } }
|
||||||
|
];
|
||||||
|
|
||||||
|
// Expected output
|
||||||
|
expect(authoritiesOutputObj.length).toEqual(3);
|
||||||
|
expect(authoritiesOutputObj).toMatchObject(expectedAuthorities);
|
||||||
|
});
|
||||||
|
|
||||||
|
test('laconic registry authority list --owner <owner_address>', async () => {
|
||||||
|
let result = spawnSync('laconic', ['registry', 'authority', 'list', '--owner', testAccount]);
|
||||||
|
const authoritiesByOwner1 = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
|
// Expected output
|
||||||
|
const expectedAuthoritiesByOwner1 = [
|
||||||
|
{ name: 'echo.laconic', entry: { ownerAddress: testAccount, status: 'active' } },
|
||||||
|
{ name: 'laconic', entry: { ownerAddress: testAccount, status: 'active' } }
|
||||||
|
];
|
||||||
|
|
||||||
|
expect(authoritiesByOwner1.length).toEqual(2);
|
||||||
|
expect(authoritiesByOwner1).toMatchObject(expectedAuthoritiesByOwner1);
|
||||||
|
|
||||||
|
result = spawnSync('laconic', ['registry', 'authority', 'list', '--owner', testAccount2]);
|
||||||
|
const authoritiesByOwner2 = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
|
// Expected output
|
||||||
|
const expectedAuthoritiesByOwner2 = [
|
||||||
|
{ name: 'kube.laconic', entry: { ownerAddress: testAccount2, status: 'active' } }
|
||||||
|
];
|
||||||
|
|
||||||
|
expect(authoritiesByOwner2.length).toEqual(1);
|
||||||
|
expect(authoritiesByOwner2).toMatchObject(expectedAuthoritiesByOwner2);
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Name operations', () => {
|
describe('Name operations', () => {
|
||||||
@@ -524,5 +586,53 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(resolveOutputObj.length).toEqual(0);
|
expect(resolveOutputObj.length).toEqual(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('Gas and fees config', () => {
|
||||||
|
const bondAmount = 1000;
|
||||||
|
|
||||||
|
test('gas set, fees set to Xalnt', async () => {
|
||||||
|
// gasPrice not set
|
||||||
|
const result = spawnSync('laconic', ['registry', 'bond', 'create', '--type', TOKEN_TYPE, '--quantity', bondAmount.toString()]);
|
||||||
|
|
||||||
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
expect(outputObj.bondId).toBeDefined();
|
||||||
|
|
||||||
|
// gasPrice set (lower than min gas price)
|
||||||
|
updateGasAndFeesConfig(undefined, undefined, '0.00001alnt');
|
||||||
|
const result1 = spawnSync('laconic', ['registry', 'bond', 'create', '--type', TOKEN_TYPE, '--quantity', bondAmount.toString()]);
|
||||||
|
|
||||||
|
const outputObj1 = checkResultAndRetrieveOutput(result1);
|
||||||
|
expect(outputObj1.bondId).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('gas not set, fees not set, gasPrice set', async () => {
|
||||||
|
updateGasAndFeesConfig(null, null, '1alnt');
|
||||||
|
const result = spawnSync('laconic', ['registry', 'bond', 'create', '--type', TOKEN_TYPE, '--quantity', bondAmount.toString()]);
|
||||||
|
|
||||||
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
expect(outputObj.bondId).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('gas not set, fees set without token suffix, gasPrice set', async () => {
|
||||||
|
updateGasAndFeesConfig(null, '1.8', '1alnt');
|
||||||
|
const result = spawnSync('laconic', ['registry', 'bond', 'create', '--type', TOKEN_TYPE, '--quantity', bondAmount.toString()]);
|
||||||
|
|
||||||
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
expect(outputObj.bondId).toBeDefined();
|
||||||
|
});
|
||||||
|
|
||||||
|
test('gas not set, fees not set, gasPrice not set', async () => {
|
||||||
|
updateGasAndFeesConfig(null, null, null);
|
||||||
|
const result = spawnSync('laconic', ['registry', 'bond', 'create', '--type', TOKEN_TYPE, '--quantity', bondAmount.toString()]);
|
||||||
|
|
||||||
|
expect(result.status).toBe(1);
|
||||||
|
|
||||||
|
const output = result.stdout.toString().trim();
|
||||||
|
const errorOutput = result.stderr.toString().trim();
|
||||||
|
|
||||||
|
expect(output).toBe('');
|
||||||
|
expect(errorOutput).toContain('Gas price must be set in the client options when auto gas is used.');
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -1,7 +1,10 @@
|
|||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
import path from 'path';
|
||||||
import yaml from 'js-yaml';
|
import yaml from 'js-yaml';
|
||||||
import { SpawnSyncReturns, spawnSync } from 'child_process';
|
import { SpawnSyncReturns, spawnSync } from 'child_process';
|
||||||
|
|
||||||
|
import { getConfig } from '../src/util';
|
||||||
|
|
||||||
export const CHAIN_ID = 'laconic_9000-1';
|
export const CHAIN_ID = 'laconic_9000-1';
|
||||||
export const TOKEN_TYPE = 'alnt';
|
export const TOKEN_TYPE = 'alnt';
|
||||||
|
|
||||||
@@ -118,3 +121,33 @@ export function getBidObj (params: { bidder: string, status?: string }): any {
|
|||||||
export async function delay (ms: number): Promise<any> {
|
export async function delay (ms: number): Promise<any> {
|
||||||
return new Promise((resolve) => setTimeout(resolve, ms));
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function updateGasAndFeesConfig (gas?: string | null, fees?: string | null, gasPrice?: string | null): void {
|
||||||
|
const configFilePath = './config.yml';
|
||||||
|
const config = getConfig(path.resolve(configFilePath));
|
||||||
|
|
||||||
|
if (gas) {
|
||||||
|
config.services.registry.gas = gas;
|
||||||
|
} else if (gas === null) {
|
||||||
|
delete config.services.registry.gas;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (fees) {
|
||||||
|
config.services.registry.fees = fees;
|
||||||
|
} else if (fees === null) {
|
||||||
|
delete config.services.registry.fees;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (gasPrice) {
|
||||||
|
config.services.registry.gasPrice = gasPrice;
|
||||||
|
} else if (gasPrice === null) {
|
||||||
|
delete config.services.registry.gasPrice;
|
||||||
|
}
|
||||||
|
|
||||||
|
try {
|
||||||
|
fs.writeFileSync(configFilePath, yaml.dump(config), 'utf8');
|
||||||
|
} catch (e) {
|
||||||
|
console.error('Error writing config file:', e);
|
||||||
|
throw e;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -302,10 +302,10 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
|
||||||
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==
|
||||||
|
|
||||||
"@cerc-io/registry-sdk@^0.2.5":
|
"@cerc-io/registry-sdk@^0.2.9":
|
||||||
version "0.2.5"
|
version "0.2.9"
|
||||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.5/registry-sdk-0.2.5.tgz#9ca19fecb2923520dd6a19946c309ecb2ec780a2"
|
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.9/registry-sdk-0.2.9.tgz#da0645d30a1975bf6c0869dff4ab51fafd73c6ed"
|
||||||
integrity sha512-/KXAYf9gStaX/rRBMCEeDCexEIpTOFHeHzMK9B3xfCT+SyYZE9WC9GpX299LzBYJKKPsb0/JvnDfip9S1igJtA==
|
integrity sha512-ZLlYa2yNvd19mA2MYr7qW0fFkouOxK5w8EzsIYXUm+YokLZXCaiUIUjvDtnebPppLZDPqNUjxJrNFC70wBhT0A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@cosmjs/amino" "^0.28.1"
|
"@cosmjs/amino" "^0.28.1"
|
||||||
"@cosmjs/crypto" "^0.28.1"
|
"@cosmjs/crypto" "^0.28.1"
|
||||||
@@ -365,6 +365,16 @@
|
|||||||
"@cosmjs/math" "0.28.4"
|
"@cosmjs/math" "0.28.4"
|
||||||
"@cosmjs/utils" "0.28.4"
|
"@cosmjs/utils" "0.28.4"
|
||||||
|
|
||||||
|
"@cosmjs/amino@^0.32.2":
|
||||||
|
version "0.32.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.4.tgz#3908946c0394e6d431694c8992c5147079a1c860"
|
||||||
|
integrity sha512-zKYOt6hPy8obIFtLie/xtygCkH9ZROiQ12UHfKsOkWaZfPQUvVbtgmu6R4Kn1tFLI/SRkw7eqhaogmW/3NYu/Q==
|
||||||
|
dependencies:
|
||||||
|
"@cosmjs/crypto" "^0.32.4"
|
||||||
|
"@cosmjs/encoding" "^0.32.4"
|
||||||
|
"@cosmjs/math" "^0.32.4"
|
||||||
|
"@cosmjs/utils" "^0.32.4"
|
||||||
|
|
||||||
"@cosmjs/amino@^0.32.3":
|
"@cosmjs/amino@^0.32.3":
|
||||||
version "0.32.3"
|
version "0.32.3"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.3.tgz#b81d4a2b8d61568431a1afcd871e1344a19d97ff"
|
resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.3.tgz#b81d4a2b8d61568431a1afcd871e1344a19d97ff"
|
||||||
@@ -417,6 +427,19 @@
|
|||||||
elliptic "^6.5.4"
|
elliptic "^6.5.4"
|
||||||
libsodium-wrappers-sumo "^0.7.11"
|
libsodium-wrappers-sumo "^0.7.11"
|
||||||
|
|
||||||
|
"@cosmjs/crypto@^0.32.4":
|
||||||
|
version "0.32.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.4.tgz#5d29633b661eaf092ddb3e7ea6299cfd6f4507a2"
|
||||||
|
integrity sha512-zicjGU051LF1V9v7bp8p7ovq+VyC91xlaHdsFOTo2oVry3KQikp8L/81RkXmUIT8FxMwdx1T7DmFwVQikcSDIw==
|
||||||
|
dependencies:
|
||||||
|
"@cosmjs/encoding" "^0.32.4"
|
||||||
|
"@cosmjs/math" "^0.32.4"
|
||||||
|
"@cosmjs/utils" "^0.32.4"
|
||||||
|
"@noble/hashes" "^1"
|
||||||
|
bn.js "^5.2.0"
|
||||||
|
elliptic "^6.5.4"
|
||||||
|
libsodium-wrappers-sumo "^0.7.11"
|
||||||
|
|
||||||
"@cosmjs/encoding@0.27.1":
|
"@cosmjs/encoding@0.27.1":
|
||||||
version "0.27.1"
|
version "0.27.1"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.27.1.tgz#3cd5bc0af743485eb2578cdb08cfa84c86d610e1"
|
resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.27.1.tgz#3cd5bc0af743485eb2578cdb08cfa84c86d610e1"
|
||||||
@@ -435,6 +458,15 @@
|
|||||||
bech32 "^1.1.4"
|
bech32 "^1.1.4"
|
||||||
readonly-date "^1.0.0"
|
readonly-date "^1.0.0"
|
||||||
|
|
||||||
|
"@cosmjs/encoding@^0.32.2", "@cosmjs/encoding@^0.32.4":
|
||||||
|
version "0.32.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.4.tgz#646e0e809f7f4f1414d8fa991fb0ffe6c633aede"
|
||||||
|
integrity sha512-tjvaEy6ZGxJchiizzTn7HVRiyTg1i4CObRRaTRPknm5EalE13SV+TCHq38gIDfyUeden4fCuaBVEdBR5+ti7Hw==
|
||||||
|
dependencies:
|
||||||
|
base64-js "^1.3.0"
|
||||||
|
bech32 "^1.1.4"
|
||||||
|
readonly-date "^1.0.0"
|
||||||
|
|
||||||
"@cosmjs/encoding@^0.32.3":
|
"@cosmjs/encoding@^0.32.3":
|
||||||
version "0.32.3"
|
version "0.32.3"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.3.tgz#e245ff511fe4a0df7ba427b5187aab69e3468e5b"
|
resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.3.tgz#e245ff511fe4a0df7ba427b5187aab69e3468e5b"
|
||||||
@@ -479,6 +511,13 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
bn.js "^5.2.0"
|
bn.js "^5.2.0"
|
||||||
|
|
||||||
|
"@cosmjs/math@^0.32.2", "@cosmjs/math@^0.32.4":
|
||||||
|
version "0.32.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.4.tgz#87ac9eadc06696e30a30bdb562a495974bfd0a1a"
|
||||||
|
integrity sha512-++dqq2TJkoB8zsPVYCvrt88oJWsy1vMOuSOKcdlnXuOA/ASheTJuYy4+oZlTQ3Fr8eALDLGGPhJI02W2HyAQaw==
|
||||||
|
dependencies:
|
||||||
|
bn.js "^5.2.0"
|
||||||
|
|
||||||
"@cosmjs/math@^0.32.3":
|
"@cosmjs/math@^0.32.3":
|
||||||
version "0.32.3"
|
version "0.32.3"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.3.tgz#16e4256f4da507b9352327da12ae64056a2ba6c9"
|
resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.3.tgz#16e4256f4da507b9352327da12ae64056a2ba6c9"
|
||||||
@@ -486,7 +525,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
bn.js "^5.2.0"
|
bn.js "^5.2.0"
|
||||||
|
|
||||||
"@cosmjs/proto-signing@^0.32.2", "@cosmjs/proto-signing@^0.32.3":
|
"@cosmjs/proto-signing@^0.32.2":
|
||||||
version "0.32.3"
|
version "0.32.3"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.3.tgz#91ae149b747d18666a6ccc924165b306431f7c0d"
|
resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.3.tgz#91ae149b747d18666a6ccc924165b306431f7c0d"
|
||||||
integrity sha512-kSZ0ZUY0DwcRT0NcIn2HkadH4NKlwjfZgbLj1ABwh/4l0RgeT84QCscZCu63tJYq3K6auwqTiZSZERwlO4/nbg==
|
integrity sha512-kSZ0ZUY0DwcRT0NcIn2HkadH4NKlwjfZgbLj1ABwh/4l0RgeT84QCscZCu63tJYq3K6auwqTiZSZERwlO4/nbg==
|
||||||
@@ -509,21 +548,28 @@
|
|||||||
xstream "^11.14.0"
|
xstream "^11.14.0"
|
||||||
|
|
||||||
"@cosmjs/stargate@^0.32.2":
|
"@cosmjs/stargate@^0.32.2":
|
||||||
version "0.32.3"
|
version "0.32.2"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.3.tgz#5a92b222ada960ebecea72cc9f366370763f4b66"
|
resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.2.tgz#73718c5c6a3ae138682ee9987333d911eca22a13"
|
||||||
integrity sha512-OQWzO9YWKerUinPIxrO1MARbe84XkeXJAW0lyMIjXIEikajuXZ+PwftiKA5yA+8OyditVmHVLtPud6Pjna2s5w==
|
integrity sha512-AsJa29fT7Jd4xt9Ai+HMqhyj7UQu7fyYKdXj/8+/9PD74xe6lZSYhQPcitUmMLJ1ckKPgXSk5Dd2LbsQT0IhZg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@confio/ics23" "^0.6.8"
|
"@confio/ics23" "^0.6.8"
|
||||||
"@cosmjs/amino" "^0.32.3"
|
"@cosmjs/amino" "^0.32.2"
|
||||||
"@cosmjs/encoding" "^0.32.3"
|
"@cosmjs/encoding" "^0.32.2"
|
||||||
"@cosmjs/math" "^0.32.3"
|
"@cosmjs/math" "^0.32.2"
|
||||||
"@cosmjs/proto-signing" "^0.32.3"
|
"@cosmjs/proto-signing" "^0.32.2"
|
||||||
"@cosmjs/stream" "^0.32.3"
|
"@cosmjs/stream" "^0.32.2"
|
||||||
"@cosmjs/tendermint-rpc" "^0.32.3"
|
"@cosmjs/tendermint-rpc" "^0.32.2"
|
||||||
"@cosmjs/utils" "^0.32.3"
|
"@cosmjs/utils" "^0.32.2"
|
||||||
cosmjs-types "^0.9.0"
|
cosmjs-types "^0.9.0"
|
||||||
xstream "^11.14.0"
|
xstream "^11.14.0"
|
||||||
|
|
||||||
|
"@cosmjs/stream@^0.32.2":
|
||||||
|
version "0.32.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.4.tgz#83e1f2285807467c56d9ea0e1113f79d9fa63802"
|
||||||
|
integrity sha512-Gih++NYHEiP+oyD4jNEUxU9antoC0pFSg+33Hpp0JlHwH0wXhtD3OOKnzSfDB7OIoEbrzLJUpEjOgpCp5Z+W3A==
|
||||||
|
dependencies:
|
||||||
|
xstream "^11.14.0"
|
||||||
|
|
||||||
"@cosmjs/stream@^0.32.3":
|
"@cosmjs/stream@^0.32.3":
|
||||||
version "0.32.3"
|
version "0.32.3"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.3.tgz#7522579aaf18025d322c2f33d6fb7573220395d6"
|
resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.3.tgz#7522579aaf18025d322c2f33d6fb7573220395d6"
|
||||||
@@ -531,7 +577,7 @@
|
|||||||
dependencies:
|
dependencies:
|
||||||
xstream "^11.14.0"
|
xstream "^11.14.0"
|
||||||
|
|
||||||
"@cosmjs/tendermint-rpc@^0.32.2", "@cosmjs/tendermint-rpc@^0.32.3":
|
"@cosmjs/tendermint-rpc@^0.32.2":
|
||||||
version "0.32.3"
|
version "0.32.3"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.3.tgz#f0406b9f0233e588fb924dca8c614972f9038aff"
|
resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.3.tgz#f0406b9f0233e588fb924dca8c614972f9038aff"
|
||||||
integrity sha512-xeprW+VR9xKGstqZg0H/KBZoUp8/FfFyS9ljIUTLM/UINjP2MhiwncANPS2KScfJVepGufUKk0/phHUeIBSEkw==
|
integrity sha512-xeprW+VR9xKGstqZg0H/KBZoUp8/FfFyS9ljIUTLM/UINjP2MhiwncANPS2KScfJVepGufUKk0/phHUeIBSEkw==
|
||||||
@@ -557,6 +603,11 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.28.4.tgz#ecbc72458cdaffa6eeef572bc691502b3151330f"
|
resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.28.4.tgz#ecbc72458cdaffa6eeef572bc691502b3151330f"
|
||||||
integrity sha512-lb3TU6833arPoPZF8HTeG9V418CpurvqH5Aa/ls0I0wYdPDEMO6622+PQNQhQ8Vw8Az2MXoSyc8jsqrgawT84Q==
|
integrity sha512-lb3TU6833arPoPZF8HTeG9V418CpurvqH5Aa/ls0I0wYdPDEMO6622+PQNQhQ8Vw8Az2MXoSyc8jsqrgawT84Q==
|
||||||
|
|
||||||
|
"@cosmjs/utils@^0.32.2", "@cosmjs/utils@^0.32.4":
|
||||||
|
version "0.32.4"
|
||||||
|
resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.4.tgz#a9a717c9fd7b1984d9cefdd0ef6c6f254060c671"
|
||||||
|
integrity sha512-D1Yc+Zy8oL/hkUkFUL/bwxvuDBzRGpc4cF7/SkdhxX4iHpSLgdOuTt1mhCh9+kl6NQREy9t7SYZ6xeW5gFe60w==
|
||||||
|
|
||||||
"@cosmjs/utils@^0.32.3":
|
"@cosmjs/utils@^0.32.3":
|
||||||
version "0.32.3"
|
version "0.32.3"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31"
|
resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31"
|
||||||
|
|||||||
Reference in New Issue
Block a user