Compare commits
4 Commits
main
...
laconic-de
Author | SHA1 | Date | |
---|---|---|---|
e6dc638aa7 | |||
094a3d4383 | |||
decc59784a | |||
9a201d85b5 |
@ -1 +0,0 @@
|
|||||||
TEST_ACCOUNT=
|
|
3
.gitignore
vendored
3
.gitignore
vendored
@ -4,7 +4,6 @@ dist/*
|
|||||||
out
|
out
|
||||||
|
|
||||||
config.yml
|
config.yml
|
||||||
.env
|
|
||||||
*~
|
*~
|
||||||
|
|
||||||
.idea
|
.idea
|
428
README.md
428
README.md
@ -1,149 +1,45 @@
|
|||||||
# laconic-registry-client
|
# laconic-cns-client
|
||||||
|
|
||||||
CLI utility written in TS, used to interact with laconicd. Depends on [registry-sdk](https://git.vdb.to/cerc-io/registry-sdk).
|
CLI utility written in TS, used to interact with laconicd. Depends on [laconic-sdk](https://github.com/cerc-io/laconic-sdk).
|
||||||
|
|
||||||
## Install
|
|
||||||
|
|
||||||
* Add `.npmrc` file in desired project to resolve package
|
|
||||||
|
|
||||||
```bash
|
|
||||||
@cerc-io:registry=https://git.vdb.to/api/packages/cerc-io/npm/
|
|
||||||
```
|
|
||||||
|
|
||||||
This will set the registry for `cerc-io` scoped packages in the project
|
|
||||||
|
|
||||||
* Install the CLI using package manager
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn add @cerc-io/laconic-registry-cli
|
|
||||||
```
|
|
||||||
|
|
||||||
* For installing CLI globally add `.npmrc` file above in home directory and run
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn global add @cerc-io/laconic-registry-cli
|
|
||||||
```
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
* Run `yarn` to install all dependencies.
|
* Run `yarn` to install all dependencies.
|
||||||
|
|
||||||
* Run `yarn build`.
|
|
||||||
|
|
||||||
* Create a `config.yml` file from [config.example.yml](./config.example.yml) file.
|
* Create a `config.yml` file from [config.example.yml](./config.example.yml) file.
|
||||||
|
|
||||||
* Add CLI cmd to path
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export PATH="$PWD/bin:$PATH"
|
|
||||||
```
|
|
||||||
|
|
||||||
## Account Setup
|
## Account Setup
|
||||||
|
|
||||||
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 ./init.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
Registering records in registry requires an account. To get account private key run:
|
Registering records in CNS requires an account. To get account private key run:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe
|
$ laconicd keys export mykey --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
|
||||||
|
|
||||||
* Gas and fees in `cosmos-sdk`:
|
https://docs.evmos.org/users/basics/gas.html
|
||||||
* <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`:
|
|
||||||
|
|
||||||
```bash
|
* Transactions require `gas`, set to the maximum value the transaction is allowed to consume.
|
||||||
fees = gas * gasPrice
|
* Typically, validators also require transaction `fees` to be provided to allow the transaction into the mempool.
|
||||||
```
|
|
||||||
|
|
||||||
* Typically, validators / full nodes set `min-gas-prices` to only allow txs providing minimum amount of fees
|
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.
|
||||||
* 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)
|
|
||||||
|
|
||||||
When using the `auto` fees calculation, the gas estimation by tx simulation is typically multiplied by a multiplier
|
Example:
|
||||||
* As such, following `gas`, `fees` and `gasPrice` combinations can be used in `laconic-registry-cli`:
|
|
||||||
* Gas set, fees set to `Xalnt`:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Example
|
$ laconic cns bond create --type aphoton --quantity 1000000000 --gas 200000 --fees 200000aphoton
|
||||||
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
|
||||||
|
|
||||||
@ -152,7 +48,7 @@ These commands require a `config.yml` file present in the current working direct
|
|||||||
Get node status:
|
Get node status:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry status
|
$ laconic cns status
|
||||||
{
|
{
|
||||||
"version": "0.3.0",
|
"version": "0.3.0",
|
||||||
"node": {
|
"node": {
|
||||||
@ -186,16 +82,16 @@ laconic registry status
|
|||||||
Get account details:
|
Get account details:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry account get --address laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k
|
$ laconic cns account get --address ethm133y09mveksh76uc99h4rl38nd033tk4e3y2z52
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"address": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
"address": "ethm133y09mveksh76uc99h4rl38nd033tk4e3y2z52",
|
||||||
"pubKey": "A2BeFMnq4h0v5/hP+trvQbCtVWwGGYNSHWRJ7Ae60biS",
|
"pubKey": "A2BeFMnq4h0v5/hP+trvQbCtVWwGGYNSHWRJ7Ae60biS",
|
||||||
"number": "0",
|
"number": "0",
|
||||||
"sequence": "37",
|
"sequence": "37",
|
||||||
"balance": [
|
"balance": [
|
||||||
{
|
{
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "89998999999999991999799300"
|
"quantity": "89998999999999991999799300"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -206,62 +102,33 @@ laconic registry account get --address laconic15za32wly5exgcrt2zfr8php4ya49n5y7m
|
|||||||
Send tokens:
|
Send tokens:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry tokens send --address laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k --type alnt --quantity 1000000000
|
$ laconic cns tokens send --address ethm1vc62ysqu504at932jjq8pwrqgjt67rx6ggn5yu --type aphoton --quantity 1000000000
|
||||||
{
|
[
|
||||||
"tx": {
|
{
|
||||||
"hash": "977152CBE474613E1BBAFEF286F12134829FAF3C9E7C8349149DE3E687B816FC",
|
"address": "ethm1lfekr7gvqtnhpp2kwdc6u2n569cqsp4ww0m4y8",
|
||||||
"height": 343369,
|
"pubKey": "A68/q7/xazFzNj+rrvE07ALxkMgqw1ugL35VECkWAYvt",
|
||||||
"index": 0,
|
"number": "0",
|
||||||
"code": 0,
|
"sequence": "16",
|
||||||
"log": "",
|
"balance": [
|
||||||
"sender": "laconic1pmuxrcnuhhf8qdllzuf2ctj2tnwwcg6yswqnyd",
|
{
|
||||||
"recipient": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
"type": "aphoton",
|
||||||
"amount": "1000000000alnt"
|
"quantity": "99998999999999997973999700"
|
||||||
|
}
|
||||||
|
]
|
||||||
},
|
},
|
||||||
"accounts": [
|
{
|
||||||
{
|
"address": "ethm1vc62ysqu504at932jjq8pwrqgjt67rx6ggn5yu",
|
||||||
"address": "laconic1pmuxrcnuhhf8qdllzuf2ctj2tnwwcg6yswqnyd",
|
"pubKey": null,
|
||||||
"pubKey": "A68/q7/xazFzNj+rrvE07ALxkMgqw1ugL35VECkWAYvt",
|
"number": "12",
|
||||||
"number": "0",
|
"sequence": "0",
|
||||||
"sequence": "16",
|
"balance": [
|
||||||
"balance": [
|
{
|
||||||
{
|
"type": "aphoton",
|
||||||
"type": "alnt",
|
"quantity": "1000000000"
|
||||||
"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):
|
||||||
@ -280,7 +147,7 @@ record:
|
|||||||
Publish record (see below for commands to create/query bonds):
|
Publish record (see below for commands to create/query bonds):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry record publish --filename watcher.yml --bond-id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --gas 250000 --fees 250000alnt
|
$ laconic cns record publish --filename watcher.yml --bond-id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --gas 250000
|
||||||
|
|
||||||
{ id: 'bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba' }
|
{ id: 'bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba' }
|
||||||
```
|
```
|
||||||
@ -288,7 +155,7 @@ laconic registry record publish --filename watcher.yml --bond-id 58508984500aa2e
|
|||||||
Get record:
|
Get record:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry record get --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba
|
$ laconic cns record get --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba",
|
"id": "bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba",
|
||||||
@ -329,19 +196,19 @@ laconic registry record get --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf27
|
|||||||
List records:
|
List records:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry record list
|
$ laconic cns record list
|
||||||
```
|
```
|
||||||
|
|
||||||
Reserve authority:
|
Reserve authority:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry authority reserve laconic
|
$ laconic cns authority reserve laconic
|
||||||
```
|
```
|
||||||
|
|
||||||
Check authority information:
|
Check authority information:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry authority whois laconic
|
$ laconic cns authority whois laconic
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"ownerAddress": "",
|
"ownerAddress": "",
|
||||||
@ -353,20 +220,20 @@ laconic registry authority whois laconic
|
|||||||
"auction": {
|
"auction": {
|
||||||
"id": "0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48",
|
"id": "0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48",
|
||||||
"status": "commit",
|
"status": "commit",
|
||||||
"ownerAddress": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
"ownerAddress": "ethm1lfekr7gvqtnhpp2kwdc6u2n569cqsp4ww0m4y8",
|
||||||
"createTime": "2022-04-26T11:43:45.679728594",
|
"createTime": "2022-04-26T11:43:45.679728594",
|
||||||
"commitsEndTime": "2022-04-26T11:44:45.679728594",
|
"commitsEndTime": "2022-04-26T11:44:45.679728594",
|
||||||
"revealsEndTime": "2022-04-26T11:45:45.679728594",
|
"revealsEndTime": "2022-04-26T11:45:45.679728594",
|
||||||
"commitFee": {
|
"commitFee": {
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "1000000"
|
"quantity": "1000000"
|
||||||
},
|
},
|
||||||
"revealFee": {
|
"revealFee": {
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "1000000"
|
"quantity": "1000000"
|
||||||
},
|
},
|
||||||
"minimumBid": {
|
"minimumBid": {
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "5000000"
|
"quantity": "5000000"
|
||||||
},
|
},
|
||||||
"winnerAddress": "",
|
"winnerAddress": "",
|
||||||
@ -387,25 +254,25 @@ laconic registry authority whois laconic
|
|||||||
Get authority auction info:
|
Get authority auction info:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry auction get 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48
|
$ laconic cns auction get 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48",
|
"id": "0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48",
|
||||||
"status": "commit",
|
"status": "commit",
|
||||||
"ownerAddress": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
"ownerAddress": "ethm1lfekr7gvqtnhpp2kwdc6u2n569cqsp4ww0m4y8",
|
||||||
"createTime": "2022-04-26T11:42:05.256059269",
|
"createTime": "2022-04-26T11:42:05.256059269",
|
||||||
"commitsEndTime": "2022-04-26T11:44:45.679728594",
|
"commitsEndTime": "2022-04-26T11:44:45.679728594",
|
||||||
"revealsEndTime": "2022-04-26T11:45:45.679728594",
|
"revealsEndTime": "2022-04-26T11:45:45.679728594",
|
||||||
"commitFee": {
|
"commitFee": {
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "1000000"
|
"quantity": "1000000"
|
||||||
},
|
},
|
||||||
"revealFee": {
|
"revealFee": {
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "1000000"
|
"quantity": "1000000"
|
||||||
},
|
},
|
||||||
"minimumBid": {
|
"minimumBid": {
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "5000000"
|
"quantity": "5000000"
|
||||||
},
|
},
|
||||||
"winnerAddress": "",
|
"winnerAddress": "",
|
||||||
@ -425,7 +292,7 @@ laconic registry auction get 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d246
|
|||||||
Commit an auction bid:
|
Commit an auction bid:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry auction bid commit 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48 25000000 alnt
|
$ laconic cns auction bid commit 0294fb2e3659c347b53a6faf4bef041fd934f0f3ab13df6d2468d5d63abacd48 25000000 aphoton
|
||||||
|
|
||||||
Reveal file: ./out/bafyreiay2rccax64yn4ljhvzvm3jkbebvzheyucuma5jlbpzpzd5i5gjuy.json
|
Reveal file: ./out/bafyreiay2rccax64yn4ljhvzvm3jkbebvzheyucuma5jlbpzpzd5i5gjuy.json
|
||||||
```
|
```
|
||||||
@ -433,49 +300,37 @@ 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 cns 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 cns 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 cns 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 cns authority reserve kube.laconic --owner ethm1vc62ysqu504at932jjq8pwrqgjt67rx6ggn5yu
|
||||||
```
|
|
||||||
|
|
||||||
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 cns name set crn://laconic/watcher/erc20 bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba
|
||||||
```
|
```
|
||||||
|
|
||||||
Lookup name information:
|
Lookup name information:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry name lookup lrn://laconic/watcher/erc20
|
$ laconic cns name lookup crn://laconic/watcher/erc20
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"latest": {
|
"latest": {
|
||||||
@ -489,7 +344,7 @@ laconic registry name lookup lrn://laconic/watcher/erc20
|
|||||||
Resolve name:
|
Resolve name:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry name resolve lrn://laconic/watcher/erc20
|
$ laconic cns name resolve crn://laconic/watcher/erc20
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba",
|
"id": "bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba",
|
||||||
@ -530,9 +385,9 @@ laconic registry name resolve lrn://laconic/watcher/erc20
|
|||||||
Delete name:
|
Delete name:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry name delete lrn://laconic/watcher/erc20
|
$ laconic cns name delete crn://laconic/watcher/erc20
|
||||||
|
|
||||||
laconic registry name resolve lrn://laconic/watcher/erc20
|
$ laconic cns name resolve crn://laconic/watcher/erc20
|
||||||
[
|
[
|
||||||
null
|
null
|
||||||
]
|
]
|
||||||
@ -541,30 +396,30 @@ laconic registry name resolve lrn://laconic/watcher/erc20
|
|||||||
Create bond:
|
Create bond:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry bond create --type alnt --quantity 1000
|
$ laconic cns bond create --type aphoton --quantity 1000
|
||||||
```
|
```
|
||||||
|
|
||||||
List bonds:
|
List bonds:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry bond list
|
$ laconic cns bond list
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785",
|
"id": "58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785",
|
||||||
"owner": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
"owner": "ethm1lfekr7gvqtnhpp2kwdc6u2n569cqsp4ww0m4y8",
|
||||||
"balance": [
|
"balance": [
|
||||||
{
|
{
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "698000000"
|
"quantity": "698000000"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0",
|
"id": "5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0",
|
||||||
"owner": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
"owner": "ethm1lfekr7gvqtnhpp2kwdc6u2n569cqsp4ww0m4y8",
|
||||||
"balance": [
|
"balance": [
|
||||||
{
|
{
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "1000"
|
"quantity": "1000"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -575,14 +430,14 @@ laconic registry bond list
|
|||||||
Get bond:
|
Get bond:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry bond get --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785
|
$ laconic cns bond get --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785",
|
"id": "58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785",
|
||||||
"owner": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
"owner": "ethm1lfekr7gvqtnhpp2kwdc6u2n569cqsp4ww0m4y8",
|
||||||
"balance": [
|
"balance": [
|
||||||
{
|
{
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "691000000"
|
"quantity": "691000000"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -593,24 +448,24 @@ laconic registry bond get --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361
|
|||||||
Query bonds by owner:
|
Query bonds by owner:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry bond list --owner laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k
|
$ laconic cns bond list --owner ethm1lfekr7gvqtnhpp2kwdc6u2n569cqsp4ww0m4y8
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
"id": "58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785",
|
"id": "58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785",
|
||||||
"owner": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
"owner": "ethm1lfekr7gvqtnhpp2kwdc6u2n569cqsp4ww0m4y8",
|
||||||
"balance": [
|
"balance": [
|
||||||
{
|
{
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "684000000"
|
"quantity": "684000000"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"id": "5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0",
|
"id": "5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0",
|
||||||
"owner": "laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7k",
|
"owner": "ethm1lfekr7gvqtnhpp2kwdc6u2n569cqsp4ww0m4y8",
|
||||||
"balance": [
|
"balance": [
|
||||||
{
|
{
|
||||||
"type": "alnt",
|
"type": "aphoton",
|
||||||
"quantity": "1000"
|
"quantity": "1000"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
@ -621,145 +476,42 @@ laconic registry bond list --owner laconic15za32wly5exgcrt2zfr8php4ya49n5y7masu7
|
|||||||
Refill bond:
|
Refill bond:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry bond refill --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type alnt --quantity 1000
|
$ laconic cns bond refill --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type aphoton --quantity 1000
|
||||||
```
|
```
|
||||||
|
|
||||||
Withdraw funds from bond:
|
Withdraw funds from bond:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry bond withdraw --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type alnt --quantity 500
|
$ laconic cns bond withdraw --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785 --type aphoton --quantity 500
|
||||||
```
|
```
|
||||||
|
|
||||||
Cancel bond:
|
Cancel bond:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry bond cancel --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785
|
$ laconic cns bond cancel --id 58508984500aa2ed18e059fa8203b40fbc9828e3bfa195361335c4e4524c4785
|
||||||
```
|
```
|
||||||
|
|
||||||
Associate bond (with record):
|
Associate bond (with record):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry bond associate --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba --bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0
|
$ laconic cns bond associate --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba --bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0
|
||||||
```
|
```
|
||||||
|
|
||||||
Disassociate bond (from record):
|
Disassociate bond (from record):
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
laconic registry bond dissociate --id bafyreic3auqajvgszh3vfjsouew2rsctswukc346dmlf273ln4g6iyyhba
|
$ laconic cns 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 cns 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 cns bond records reassociate --old-bond-id 5c40abd336ae1561f2a1b55be73b12f5a083080bf879b4c9288d182d238badb0 --new-bond-id 3e11c61f179897e4b12e9b63de35d36f88ac146755e7a28ce0bcdd07cf3a03ae
|
||||||
```
|
```
|
||||||
|
|
||||||
Create a `provider` auction:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic registry auction create --kind provider --commits-duration 60 --reveals-duration 60 --denom alnt --commit-fee 1000 --reveal-fee 1000 --max-price 100000 --num-providers 5
|
|
||||||
|
|
||||||
{"auctionId":"73c5fa4b91bb973641ccbb6901a8404745fb8793c95485b00d5a791e6b6c1630"}
|
|
||||||
|
|
||||||
# Set auction id in a variable
|
|
||||||
AUCTION=
|
|
||||||
```
|
|
||||||
|
|
||||||
Commit an auction bid:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic registry auction bid commit $AUCTION 25000 alnt
|
|
||||||
|
|
||||||
{"reveal_file":"/home/user/laconic-registry-cli/out/bafyreiai5upey4562ont54pe7m3buiphtd6n3q2vr5lxdcj3gpyklbbgvy.json"}
|
|
||||||
```
|
|
||||||
|
|
||||||
Reveal an auction bid:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic registry auction bid reveal $AUCTION /home/user/laconic-registry-cli/out/bafyreiai5upey4562ont54pe7m3buiphtd6n3q2vr5lxdcj3gpyklbbgvy.json
|
|
||||||
|
|
||||||
{"success": true}
|
|
||||||
```
|
|
||||||
|
|
||||||
Check the auction state on completion:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic registry auction get $AUCTION
|
|
||||||
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": "b66b74048fc360de6a926123b760e6485276d90ad2274b5386c02664cd04bace",
|
|
||||||
"kind": "provider",
|
|
||||||
"status": "completed",
|
|
||||||
"ownerAddress": "laconic1maqfgs93hnvzqh5mfj9kxt4e3n27vhd0w7emrx",
|
|
||||||
"createTime": "2024-09-17T09:51:48.605610628",
|
|
||||||
"commitsEndTime": "2024-09-17T09:52:48.605610628",
|
|
||||||
"revealsEndTime": "2024-09-17T09:53:48.605610628",
|
|
||||||
"commitFee": {
|
|
||||||
"type": "alnt",
|
|
||||||
"quantity": 1000
|
|
||||||
},
|
|
||||||
"revealFee": {
|
|
||||||
"type": "alnt",
|
|
||||||
"quantity": 1000
|
|
||||||
},
|
|
||||||
"minimumBid": {
|
|
||||||
"type": "",
|
|
||||||
"quantity": 0
|
|
||||||
},
|
|
||||||
"winnerAddresses": [
|
|
||||||
"laconic13qrlfkgl02wgwpw0n4j8kswygwnukphy92249r"
|
|
||||||
],
|
|
||||||
"winnerBids": [
|
|
||||||
{
|
|
||||||
"type": "alnt",
|
|
||||||
"quantity": 25000
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"winnerPrice": {
|
|
||||||
"type": "alnt",
|
|
||||||
"quantity": 25000
|
|
||||||
},
|
|
||||||
"maxPrice": {
|
|
||||||
"type": "alnt",
|
|
||||||
"quantity": 100000
|
|
||||||
},
|
|
||||||
"numProviders": 5,
|
|
||||||
"bids": [
|
|
||||||
{
|
|
||||||
"bidderAddress": "laconic13qrlfkgl02wgwpw0n4j8kswygwnukphy92249r",
|
|
||||||
"status": "reveal",
|
|
||||||
"commitHash": "bafyreifjkhiakayvvaasnsw7ufaax54ncow4xuycqnox7hxay34c6yod7a",
|
|
||||||
"commitTime": "2024-09-17T09:52:03.665761945",
|
|
||||||
"revealTime": "2024-09-17T09:53:00.904061323",
|
|
||||||
"commitFee": {
|
|
||||||
"type": "alnt",
|
|
||||||
"quantity": 1000
|
|
||||||
},
|
|
||||||
"revealFee": {
|
|
||||||
"type": "alnt",
|
|
||||||
"quantity": 1000
|
|
||||||
},
|
|
||||||
"bidAmount": {
|
|
||||||
"type": "alnt",
|
|
||||||
"quantity": 25000
|
|
||||||
}
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
Release provider winning funds:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic registry auction release-funds $AUCTION
|
|
||||||
|
|
||||||
{"success": true}
|
|
||||||
```
|
|
||||||
|
@ -1,10 +1,7 @@
|
|||||||
services:
|
services:
|
||||||
registry:
|
cns:
|
||||||
rpcEndpoint: 'http://localhost:26657'
|
restEndpoint: 'http://localhost:1317'
|
||||||
gqlEndpoint: 'http://localhost:9473/api'
|
gqlEndpoint: 'http://localhost:9473/api'
|
||||||
userKey:
|
userKey:
|
||||||
bondId:
|
bondId:
|
||||||
chainId: laconic_9000-1
|
chainId: laconic_9000-1
|
||||||
gas: 200000
|
|
||||||
fees: 200000alnt
|
|
||||||
gasPrice:
|
|
||||||
|
120
demo/README.md
120
demo/README.md
@ -1,120 +0,0 @@
|
|||||||
# Registry Demo
|
|
||||||
|
|
||||||
## Setup
|
|
||||||
|
|
||||||
* Install laconic CLI globally:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# In laconic-registry-cli repo root
|
|
||||||
yarn && yarn build
|
|
||||||
yarn global add file:$PWD
|
|
||||||
```
|
|
||||||
|
|
||||||
* Run the laconicd chain:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# In laconci2d repo
|
|
||||||
make install
|
|
||||||
./scripts/init.sh clean
|
|
||||||
```
|
|
||||||
|
|
||||||
* Create and populate `config.yml` following [config.example.yml](./config.example.yml):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# In laconic-registry-cli repo root
|
|
||||||
cp config.example.yml config.yml
|
|
||||||
|
|
||||||
# Update the gas value in config.yml
|
|
||||||
# gas: 500000
|
|
||||||
# fees: 500000alnt
|
|
||||||
|
|
||||||
# Get user private key
|
|
||||||
laconicd keys export alice --unarmored-hex --unsafe --keyring-backend test --home ~/.laconicd
|
|
||||||
|
|
||||||
# Set the output as 'userKey' in config.yml
|
|
||||||
# userKey: <ALICE_PRIVATE_KEY>
|
|
||||||
|
|
||||||
# Create a bond
|
|
||||||
laconic --config config.yml registry bond create --type alnt --quantity 100000000000
|
|
||||||
|
|
||||||
# Get the bond id
|
|
||||||
laconic --config config.yml registry bond list | jq -r '.[].id'
|
|
||||||
|
|
||||||
# Set the output as 'bondId' in config.yml
|
|
||||||
# bondId: <BOND_ID>
|
|
||||||
```
|
|
||||||
|
|
||||||
## Run
|
|
||||||
|
|
||||||
* Publish records:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# Publishes records and corresponding 'deployment' records from given directory
|
|
||||||
|
|
||||||
# In laconic-registry-cli repo root
|
|
||||||
# Use records dir path for '--records' as required
|
|
||||||
yarn ts-node demo/scripts/publish-records.ts --config config.yml --records <RECORDS_DIR>
|
|
||||||
```
|
|
||||||
|
|
||||||
### Example
|
|
||||||
|
|
||||||
* Query for `azimuth-watcher` deployment(s):
|
|
||||||
|
|
||||||
* Find the `WatcherRecord` for `azimuth-watcher`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
WATCHER_RECORD_ID=$(laconic registry record list --all --type WatcherRecord --name azimuth-watcher | jq -r '.[].id')
|
|
||||||
```
|
|
||||||
|
|
||||||
* Find corresponding deployment(s):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic registry record list --all --type WatcherDeploymentRecord watcher $WATCHER_RECORD_ID
|
|
||||||
|
|
||||||
# Get the deployment URL(s)
|
|
||||||
laconic registry record list --all --type WatcherDeploymentRecord watcher $WATCHER_RECORD_ID | jq -r '.[].attributes.url'
|
|
||||||
|
|
||||||
# Expected output:
|
|
||||||
https://azimuth-watcher-endpoint.example.com
|
|
||||||
```
|
|
||||||
|
|
||||||
* Query for `sushiswap-v3-subgraph` deployment(s):
|
|
||||||
|
|
||||||
* Find the `SubgraphRecord` for `sushiswap-v3-subgraph`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
SUBGRAPH_RECORD_ID=$(laconic registry record list --all --type SubgraphRecord --name sushiswap-v3-subgraph | jq -r '.[].id')
|
|
||||||
```
|
|
||||||
|
|
||||||
* Find corresponding deployment(s):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic registry record list --all --type SubgraphDeploymentRecord subgraph $SUBGRAPH_RECORD_ID
|
|
||||||
|
|
||||||
# Get the deployment URL(s)
|
|
||||||
laconic registry record list --all --type SubgraphDeploymentRecord subgraph $SUBGRAPH_RECORD_ID | jq -r '.[].attributes.url'
|
|
||||||
|
|
||||||
# Expected output:
|
|
||||||
# https://sushiswap-v3-subgraph-endpoint.example.com
|
|
||||||
```
|
|
||||||
|
|
||||||
* Query for `geth` service deployment(s):
|
|
||||||
|
|
||||||
* Find the `ServiceRecord` for `geth`:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
SERVICE_RECORD_ID=$(laconic registry record list --all --type ServiceRecord --name geth | jq -r '.[].id')
|
|
||||||
```
|
|
||||||
|
|
||||||
* Find corresponding deployment(s):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconic registry record list --all --type ServiceDeploymentRecord service $SERVICE_RECORD_ID
|
|
||||||
|
|
||||||
# Get the deployment URL(s)
|
|
||||||
laconic registry record list --all --type ServiceDeploymentRecord service $SERVICE_RECORD_ID | jq -r '.[].attributes.url'
|
|
||||||
|
|
||||||
# Expected output:
|
|
||||||
# https://geth-rpc-endpoint-1.example.com
|
|
||||||
# https://geth-rpc-endpoint-2.example.com
|
|
||||||
```
|
|
@ -1,219 +0,0 @@
|
|||||||
import yargs from 'yargs';
|
|
||||||
import fs from 'fs';
|
|
||||||
import path from 'path';
|
|
||||||
import yaml from 'js-yaml';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { hideBin } from 'yargs/helpers';
|
|
||||||
|
|
||||||
import { StdFee } from '@cosmjs/stargate';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getGasAndFees, getConnectionInfo, txOutput } from '../../src/util';
|
|
||||||
|
|
||||||
enum RecordType {
|
|
||||||
RepositoryRecord = 'RepositoryRecord',
|
|
||||||
ServiceRecord = 'ServiceRecord',
|
|
||||||
StackRecord = 'StackRecord',
|
|
||||||
SubgraphRecord = 'SubgraphRecord',
|
|
||||||
WatcherRecord = 'WatcherRecord',
|
|
||||||
}
|
|
||||||
|
|
||||||
const recordTypeToRecordField = new Map<string, string>([
|
|
||||||
[RecordType.WatcherRecord, 'watcher'],
|
|
||||||
[RecordType.SubgraphRecord, 'subgraph'],
|
|
||||||
[RecordType.ServiceRecord, 'service']
|
|
||||||
]);
|
|
||||||
|
|
||||||
let registry: Registry;
|
|
||||||
let fee: any;
|
|
||||||
let userKey: string;
|
|
||||||
let bondId: string;
|
|
||||||
|
|
||||||
async function main () {
|
|
||||||
const argv = getArgs();
|
|
||||||
const { records: recordsDir, config } = argv;
|
|
||||||
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(config as string);
|
|
||||||
|
|
||||||
if (registryConfig.userKey == null) {
|
|
||||||
throw new Error('userKey not set in config');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (registryConfig.bondId == null) {
|
|
||||||
throw new Error('bondId not set in config');
|
|
||||||
}
|
|
||||||
|
|
||||||
let rpcEndpoint, gqlEndpoint, chainId: string;
|
|
||||||
({ rpcEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, registryConfig));
|
|
||||||
|
|
||||||
registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
|
||||||
fee = getGasAndFees(argv, registryConfig);
|
|
||||||
|
|
||||||
await processDir(path.resolve(recordsDir));
|
|
||||||
}
|
|
||||||
|
|
||||||
async function processDir (directoryPath: string): Promise<void> {
|
|
||||||
const files = fs.readdirSync(directoryPath);
|
|
||||||
|
|
||||||
const dirHasRecords = await publishRecordsFromDir(directoryPath);
|
|
||||||
if (dirHasRecords) {
|
|
||||||
// Skip further recursion in the current dir
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Recursively iterate through subdirectories
|
|
||||||
for (let i = 0; i < files.length; i++) {
|
|
||||||
const file = files[i];
|
|
||||||
const filePath = path.join(directoryPath, file);
|
|
||||||
|
|
||||||
if (fs.statSync(filePath).isDirectory()) {
|
|
||||||
await processDir(filePath);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
async function publishRecordsFromDir (recordsDir: string): Promise<boolean> {
|
|
||||||
// List record files
|
|
||||||
const files = fs.readdirSync(recordsDir);
|
|
||||||
const recordFiles = files.filter(file => ['.json', '.yaml', '.yml'].includes(path.extname(file).toLowerCase()));
|
|
||||||
|
|
||||||
if (recordFiles.length === 0) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Read record from each JSON file
|
|
||||||
console.log('**************************************');
|
|
||||||
console.log(`Publishing records from ${recordsDir}`);
|
|
||||||
|
|
||||||
let recordType;
|
|
||||||
for (let i = 0; i < recordFiles.length; i++) {
|
|
||||||
const file = recordFiles[i];
|
|
||||||
|
|
||||||
const filePath = path.resolve(recordsDir, file);
|
|
||||||
const record = await readRecord(filePath);
|
|
||||||
|
|
||||||
// Publish record
|
|
||||||
const result = await publishRecord(userKey, bondId, fee, record);
|
|
||||||
|
|
||||||
console.log(`Published record ${file}`);
|
|
||||||
txOutput(result, JSON.stringify(result, undefined, 2), '', false);
|
|
||||||
|
|
||||||
recordType = record.type;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Check if deployment record files exist
|
|
||||||
const deploymentRecordsDir = path.resolve(recordsDir, 'deployments');
|
|
||||||
if (!fs.existsSync(deploymentRecordsDir) || !fs.statSync(deploymentRecordsDir).isDirectory()) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
console.log('--------------------------------------');
|
|
||||||
console.log(`Publishing deployment records from ${deploymentRecordsDir}`);
|
|
||||||
|
|
||||||
// List record files
|
|
||||||
const deploymentFiles = fs.readdirSync(deploymentRecordsDir);
|
|
||||||
const deploymentJsonFiles = deploymentFiles.filter(file => path.extname(file).toLowerCase() === '.json');
|
|
||||||
|
|
||||||
for (let i = 0; i < deploymentJsonFiles.length; i++) {
|
|
||||||
const file = deploymentJsonFiles[i];
|
|
||||||
|
|
||||||
const filePath = path.resolve(deploymentRecordsDir, file);
|
|
||||||
const deploymentRecord = await readRecord(filePath);
|
|
||||||
|
|
||||||
// Find record using name and given type
|
|
||||||
const recordName = deploymentRecord.name;
|
|
||||||
assert(recordType, 'recordType could not be resolved');
|
|
||||||
const queryResult = await registry.queryRecords({ type: recordType, name: recordName }, true);
|
|
||||||
if (queryResult.length === 0) {
|
|
||||||
throw new Error(`Record not found, type: ${recordType}, name: ${recordName}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assume the first query result
|
|
||||||
const recordId = queryResult[0].id;
|
|
||||||
|
|
||||||
// Set record field to record id
|
|
||||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
|
||||||
deploymentRecord[recordTypeToRecordField.get(recordType)!] = recordId;
|
|
||||||
|
|
||||||
// Publish record
|
|
||||||
const deploymentResult = await registry.setRecord({ privateKey: userKey, record: deploymentRecord, bondId }, userKey, fee);
|
|
||||||
|
|
||||||
console.log(`Published record ${file}`);
|
|
||||||
txOutput(deploymentResult, JSON.stringify(deploymentResult, undefined, 2), '', false);
|
|
||||||
}
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function readRecord (filePath: string): Promise<any> {
|
|
||||||
let record;
|
|
||||||
try {
|
|
||||||
const fileExt = path.extname(filePath).toLowerCase();
|
|
||||||
const data = fs.readFileSync(filePath, 'utf8');
|
|
||||||
|
|
||||||
if (fileExt === '.json') {
|
|
||||||
// JSON file
|
|
||||||
record = JSON.parse(data);
|
|
||||||
} else {
|
|
||||||
// YAML file
|
|
||||||
({ record } = await yaml.load(data) as any);
|
|
||||||
|
|
||||||
// Convert sub-objects (other than arrays) to a JSON automatically.
|
|
||||||
for (const [k, v] of Object.entries(record)) {
|
|
||||||
if (v && typeof v === 'object' && !Array.isArray(v)) {
|
|
||||||
record[k] = JSON.stringify(v);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
} catch (err) {
|
|
||||||
console.error(`Error reading file ${filePath}:`, err);
|
|
||||||
}
|
|
||||||
|
|
||||||
return record;
|
|
||||||
}
|
|
||||||
|
|
||||||
async function publishRecord (userKey: string, bondId: string, fee: StdFee, record: any): Promise<any> {
|
|
||||||
// Replace repository URL with record id (if type is one of RecordType)
|
|
||||||
if (record.repository && Object.values(RecordType).includes(record.type)) {
|
|
||||||
const repoUrl = record.repository;
|
|
||||||
|
|
||||||
const queryResult = await registry.queryRecords({ type: RecordType.RepositoryRecord, url: repoUrl }, true);
|
|
||||||
if (queryResult.length === 0) {
|
|
||||||
throw new Error(`Record not found, type: ${RecordType.RepositoryRecord}, url: ${repoUrl}`);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assume the first query result
|
|
||||||
const repoRecordId = queryResult[0].id;
|
|
||||||
|
|
||||||
// Replace repository URL with the repo record id
|
|
||||||
record.repository = repoRecordId;
|
|
||||||
}
|
|
||||||
|
|
||||||
return registry.setRecord({ privateKey: userKey, record, bondId }, userKey, fee);
|
|
||||||
}
|
|
||||||
|
|
||||||
function getArgs (): any {
|
|
||||||
return yargs(hideBin(process.argv)).parserConfiguration({
|
|
||||||
'parse-numbers': false
|
|
||||||
}).usage('Usage: $0 [options]')
|
|
||||||
.option('config', {
|
|
||||||
alias: 'c',
|
|
||||||
describe: 'Config',
|
|
||||||
type: 'string',
|
|
||||||
demandOption: true
|
|
||||||
})
|
|
||||||
.option('records', {
|
|
||||||
alias: 'r',
|
|
||||||
describe: 'Records dir path',
|
|
||||||
type: 'string',
|
|
||||||
demandOption: true
|
|
||||||
})
|
|
||||||
.help().argv;
|
|
||||||
}
|
|
||||||
|
|
||||||
main()
|
|
||||||
.catch(err => {
|
|
||||||
console.error(err);
|
|
||||||
})
|
|
||||||
.finally(() => {
|
|
||||||
console.log('Done');
|
|
||||||
});
|
|
@ -2,22 +2,21 @@ services:
|
|||||||
laconicd:
|
laconicd:
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
image: cerc/laconicd:local
|
image: cerc/laconicd:local
|
||||||
command: ["bash", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
command: ["sh", "/docker-entrypoint-scripts.d/create-fixturenet.sh"]
|
||||||
environment:
|
environment:
|
||||||
- TEST_AUCTION_ENABLED
|
- TEST_AUCTION_ENABLED
|
||||||
- TEST_REGISTRY_EXPIRY
|
- TEST_REGISTRY_EXPIRY
|
||||||
- LOGLEVEL
|
- LOGLEVEL
|
||||||
volumes:
|
volumes:
|
||||||
- ./laconicd/scripts/init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
- ./laconicd/init.sh:/docker-entrypoint-scripts.d/create-fixturenet.sh
|
||||||
healthcheck:
|
healthcheck:
|
||||||
test: ["CMD", "curl", "-v", "http://127.0.0.1", "6060"]
|
test: ["CMD", "curl", "-v", "http://127.0.0.1:6060"]
|
||||||
interval: 1s
|
interval: 1s
|
||||||
timeout: 5s
|
timeout: 5s
|
||||||
retries: 30
|
retries: 30
|
||||||
ports:
|
ports:
|
||||||
- "9473:9473"
|
- "9473:9473"
|
||||||
- "1317:1317"
|
- "1317:1317"
|
||||||
- "26657:26657"
|
|
||||||
|
|
||||||
cli-test-runner:
|
cli-test-runner:
|
||||||
image: cerc/laconic-registry-cli:local
|
image: cerc/laconic-registry-cli:local
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@cerc-io/laconic-registry-cli",
|
"name": "@cerc-io/laconic-registry-cli",
|
||||||
"version": "0.2.10",
|
"version": "0.1.13",
|
||||||
"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": "",
|
||||||
@ -25,12 +25,10 @@
|
|||||||
"husky": "^9.0.2",
|
"husky": "^9.0.2",
|
||||||
"jest": "29.0.0",
|
"jest": "29.0.0",
|
||||||
"ts-jest": "^29.0.2",
|
"ts-jest": "^29.0.2",
|
||||||
"ts-node": "^10.2.1",
|
|
||||||
"typescript": "^4.6.3"
|
"typescript": "^4.6.3"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@cerc-io/registry-sdk": "^0.2.11",
|
"@cerc-io/laconic-sdk": "^0.1.16",
|
||||||
"@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",
|
||||||
@ -47,4 +45,4 @@
|
|||||||
"bin": {
|
"bin": {
|
||||||
"laconic": "bin/laconic"
|
"laconic": "bin/laconic"
|
||||||
}
|
}
|
||||||
}
|
}
|
28
src/cmds/cns-cmds/account-cmds/get.ts
Normal file
28
src/cmds/cns-cmds/account-cmds/get.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Account, Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'get';
|
||||||
|
|
||||||
|
export const desc = 'Get account.';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
let address = argv.address as string;
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
if (!address && privateKey) {
|
||||||
|
address = new Account(Buffer.from(privateKey, 'hex')).getCosmosAddress();
|
||||||
|
}
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const result = await registry.getAccounts([address]);
|
||||||
|
|
||||||
|
queryOutput(result, argv.output);
|
||||||
|
};
|
@ -1,11 +1,11 @@
|
|||||||
import { Arguments } from 'yargs';
|
import { Arguments } from 'yargs';
|
||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import path from 'path';
|
import path from 'path';
|
||||||
import { Account, createBid, Registry } from '@cerc-io/registry-sdk';
|
import { Account, createBid, Registry } from '@cerc-io/laconic-sdk';
|
||||||
import { ensureDir } from 'fs-extra';
|
import { ensureDir } from 'fs-extra';
|
||||||
import fs from 'fs';
|
import fs from 'fs';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../../util';
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../../util';
|
||||||
|
|
||||||
const OUT_DIR = 'out';
|
const OUT_DIR = 'out';
|
||||||
|
|
||||||
@ -21,16 +21,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(quantity, 'Invalid token quantity.');
|
assert(quantity, 'Invalid token quantity.');
|
||||||
assert(denom, 'Invalid token type.');
|
assert(denom, 'Invalid token type.');
|
||||||
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(argv.config as string);
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
const account = new Account(Buffer.from(privateKey, 'hex'));
|
const account = new Account(Buffer.from(privateKey, 'hex'));
|
||||||
await account.init();
|
const bidderAddress = account.formattedCosmosAddress;
|
||||||
const bidderAddress = account.address;
|
|
||||||
const bidAmount = `${quantity}${denom}`;
|
const bidAmount = `${quantity}${denom}`;
|
||||||
const { reveal, commitHash } = await createBid(chainId, auctionId, bidderAddress, bidAmount);
|
const { reveal, commitHash } = await createBid(chainId, auctionId, bidderAddress, bidAmount);
|
||||||
|
|
||||||
@ -40,9 +39,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 gasPrice = getGasPrice(argv, registryConfig);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
|
|
||||||
const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee);
|
const result = await registry.commitBid({ auctionId, commitHash }, privateKey, fee);
|
||||||
const revealFile = `{"reveal_file":"${revealFilePath}"}`;
|
const revealFile = `{"reveal_file":"${revealFilePath}"}`;
|
34
src/cmds/cns-cmds/auction-cmds/bid-cmds/reveal.ts
Normal file
34
src/cmds/cns-cmds/auction-cmds/bid-cmds/reveal.ts
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import path from 'path';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
import fs from 'fs';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../../util';
|
||||||
|
|
||||||
|
export const command = 'reveal [auction-id] [file-path]';
|
||||||
|
|
||||||
|
export const desc = 'Reveal auction bid.';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const auctionId = argv.auctionId as string;
|
||||||
|
const filePath = argv.filePath as string;
|
||||||
|
assert(auctionId, 'Invalid auction ID.');
|
||||||
|
assert(filePath, 'Invalid reveal file path.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
|
||||||
|
const reveal = fs.readFileSync(path.resolve(filePath));
|
||||||
|
const result = await registry.revealBid({ auctionId, reveal: reveal.toString('hex') }, privateKey, fee);
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
25
src/cmds/cns-cmds/auction-cmds/get.ts
Normal file
25
src/cmds/cns-cmds/auction-cmds/get.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'get [id]';
|
||||||
|
|
||||||
|
export const desc = 'Get auction information.';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const { id, config } = argv;
|
||||||
|
assert(id, 'Invalid auction ID.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const result = await registry.getAuctionsByIds([id as string]);
|
||||||
|
|
||||||
|
queryOutput(result, argv.output);
|
||||||
|
};
|
30
src/cmds/cns-cmds/authority-cmds/bond-cmds/set.ts
Normal file
30
src/cmds/cns-cmds/authority-cmds/bond-cmds/set.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../../util';
|
||||||
|
|
||||||
|
export const command = 'set [name] [bond-id]';
|
||||||
|
|
||||||
|
export const desc = 'Set bond for authority.';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const name = argv.name as string;
|
||||||
|
const bondId = argv.bondId as string;
|
||||||
|
assert(name, 'Invalid authority name.');
|
||||||
|
assert(bondId, 'Invalid Bond ID.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee);
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
36
src/cmds/cns-cmds/authority-cmds/reserve.ts
Normal file
36
src/cmds/cns-cmds/authority-cmds/reserve.ts
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'reserve [name]';
|
||||||
|
|
||||||
|
export const desc = 'Reserve authority/name.';
|
||||||
|
|
||||||
|
export const builder = {
|
||||||
|
owner: {
|
||||||
|
type: 'string',
|
||||||
|
default: ''
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const name = argv.name as string;
|
||||||
|
const owner = argv.owner as string;
|
||||||
|
assert(name, 'Invalid authority name.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.reserveAuthority({ name, owner }, privateKey, fee);
|
||||||
|
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
@ -1,6 +1,6 @@
|
|||||||
import { Arguments } from 'yargs';
|
import { Arguments } from 'yargs';
|
||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
@ -12,13 +12,13 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const name = argv.name as string;
|
const name = argv.name as string;
|
||||||
assert(name, 'Invalid authority name.');
|
assert(name, 'Invalid authority name.');
|
||||||
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(argv.config as string);
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const result = await registry.lookupAuthorities([name], true);
|
const result = await registry.lookupAuthorities([name], true);
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
queryOutput(result, argv.output);
|
35
src/cmds/cns-cmds/bond-cmds/associate.ts
Normal file
35
src/cmds/cns-cmds/bond-cmds/associate.ts
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'associate';
|
||||||
|
|
||||||
|
export const desc = 'Associate record with bond.';
|
||||||
|
|
||||||
|
export const builder = {
|
||||||
|
'bond-id': {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const id = argv.id as string;
|
||||||
|
const bondId = argv.bondId as string;
|
||||||
|
assert(id, 'Invalid Record ID.');
|
||||||
|
assert(bondId, 'Invalid Bond ID.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.associateBond({ recordId: id, bondId }, privateKey, fee);
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
27
src/cmds/cns-cmds/bond-cmds/cancel.ts
Normal file
27
src/cmds/cns-cmds/bond-cmds/cancel.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'cancel';
|
||||||
|
|
||||||
|
export const desc = 'Cancel bond.';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const id = argv.id as string;
|
||||||
|
assert(id, 'Invalid Bond ID.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.cancelBond({ id }, privateKey, fee);
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
@ -1,9 +1,8 @@
|
|||||||
import { Arguments } from 'yargs';
|
import { Arguments } from 'yargs';
|
||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-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';
|
||||||
|
|
||||||
@ -26,17 +25,15 @@ export const handler = async (argv: Arguments) => {
|
|||||||
assert(denom, 'Invalid Type.');
|
assert(denom, 'Invalid Type.');
|
||||||
assert(amount, 'Invalid Quantity.');
|
assert(amount, 'Invalid Quantity.');
|
||||||
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(config as string);
|
const { services: { cns: cnsConfig } } = getConfig(config as string);
|
||||||
const { rpcEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, registryConfig);
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
assert(privateKey, 'Invalid Transaction Key.');
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
const gasPrice = getGasPrice(argv, registryConfig);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
|
||||||
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);
|
||||||
const jsonString = `{"bondId":"${bondId}"}`;
|
const jsonString = `{"bondId":"${bondId}"}`;
|
27
src/cmds/cns-cmds/bond-cmds/dissociate.ts
Normal file
27
src/cmds/cns-cmds/bond-cmds/dissociate.ts
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'dissociate';
|
||||||
|
|
||||||
|
export const desc = 'Dissociate record from bond.';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const id = argv.id as string;
|
||||||
|
assert(id, 'Invalid Record ID.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.dissociateBond({ recordId: id }, privateKey, fee);
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
26
src/cmds/cns-cmds/bond-cmds/get.ts
Normal file
26
src/cmds/cns-cmds/bond-cmds/get.ts
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'get';
|
||||||
|
|
||||||
|
export const desc = 'Get bond.';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const { id, config } = argv;
|
||||||
|
console.assert(id, 'Bond Id is required.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
|
||||||
|
const result = await registry.getBondsByIds([id as string]);
|
||||||
|
|
||||||
|
queryOutput(result, argv.output);
|
||||||
|
};
|
30
src/cmds/cns-cmds/bond-cmds/list.ts
Normal file
30
src/cmds/cns-cmds/bond-cmds/list.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'list';
|
||||||
|
|
||||||
|
export const desc = 'List bonds.';
|
||||||
|
|
||||||
|
export const builder = {
|
||||||
|
owner: {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
|
||||||
|
const { owner } = argv;
|
||||||
|
const result = await registry.queryBonds({ owner });
|
||||||
|
|
||||||
|
queryOutput(result, argv.output);
|
||||||
|
};
|
33
src/cmds/cns-cmds/bond-cmds/records-cmds/dissociate.ts
Normal file
33
src/cmds/cns-cmds/bond-cmds/records-cmds/dissociate.ts
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../../util';
|
||||||
|
|
||||||
|
export const command = 'dissociate';
|
||||||
|
|
||||||
|
export const desc = 'Dissociate all records from bond.';
|
||||||
|
|
||||||
|
export const builder = {
|
||||||
|
'bond-id': {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const bondId = argv.bondId as string;
|
||||||
|
assert(bondId, 'Invalid Bond ID.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.dissociateRecords({ bondId }, privateKey, fee);
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
38
src/cmds/cns-cmds/bond-cmds/records-cmds/reassociate.ts
Normal file
38
src/cmds/cns-cmds/bond-cmds/records-cmds/reassociate.ts
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../../util';
|
||||||
|
|
||||||
|
export const command = 'reassociate';
|
||||||
|
|
||||||
|
export const desc = 'Reassociate records with new bond.';
|
||||||
|
|
||||||
|
export const builder = {
|
||||||
|
'old-bond-id': {
|
||||||
|
type: 'string'
|
||||||
|
},
|
||||||
|
'new-bond-id': {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const oldBondId = argv.oldBondId as string;
|
||||||
|
const newBondId = argv.newBondId as string;
|
||||||
|
assert(oldBondId, 'Invalid Old Bond ID.');
|
||||||
|
assert(newBondId, 'Invalid New Bond ID.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.reassociateRecords({ oldBondId, newBondId }, privateKey, fee);
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
41
src/cmds/cns-cmds/bond-cmds/refill.ts
Normal file
41
src/cmds/cns-cmds/bond-cmds/refill.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'refill';
|
||||||
|
|
||||||
|
export const desc = 'Refill bond.';
|
||||||
|
|
||||||
|
export const builder = {
|
||||||
|
type: {
|
||||||
|
type: 'string'
|
||||||
|
},
|
||||||
|
quantity: {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const denom = argv.type as string;
|
||||||
|
const amount = argv.quantity as string;
|
||||||
|
const id = argv.id as string;
|
||||||
|
|
||||||
|
assert(id, 'Invalid Bond ID.');
|
||||||
|
assert(denom, 'Invalid Type.');
|
||||||
|
assert(amount, 'Invalid Quantity.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.refillBond({ id, denom, amount }, privateKey, fee);
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
41
src/cmds/cns-cmds/bond-cmds/withdraw.ts
Normal file
41
src/cmds/cns-cmds/bond-cmds/withdraw.ts
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'withdraw';
|
||||||
|
|
||||||
|
export const desc = 'Withdraw funds from bond.';
|
||||||
|
|
||||||
|
export const builder = {
|
||||||
|
type: {
|
||||||
|
type: 'string'
|
||||||
|
},
|
||||||
|
quantity: {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const denom = argv.type as string;
|
||||||
|
const amount = argv.quantity as string;
|
||||||
|
const id = argv.id as string;
|
||||||
|
|
||||||
|
assert(id, 'Invalid Bond ID.');
|
||||||
|
assert(denom, 'Invalid Type.');
|
||||||
|
assert(amount, 'Invalid Quantity.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.withdrawBond({ id, denom, amount }, privateKey, fee);
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
28
src/cmds/cns-cmds/name-cmds/delete.ts
Normal file
28
src/cmds/cns-cmds/name-cmds/delete.ts
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'delete [name]';
|
||||||
|
|
||||||
|
export const desc = 'Delete name (remove name to record ID mapping).';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const name = argv.name as string;
|
||||||
|
assert(name, 'Invalid Name.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.deleteName({ crn: name }, privateKey, fee);
|
||||||
|
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
@ -1,6 +1,6 @@
|
|||||||
import { Arguments } from 'yargs';
|
import { Arguments } from 'yargs';
|
||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
@ -18,13 +18,13 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const name = argv.name as string;
|
const name = argv.name as string;
|
||||||
assert(name, 'Invalid Name.');
|
assert(name, 'Invalid Name.');
|
||||||
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(argv.config as string);
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
const registry = new Registry(gqlEndpoint, restEndpoint, 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);
|
@ -1,6 +1,6 @@
|
|||||||
import { Arguments } from 'yargs';
|
import { Arguments } from 'yargs';
|
||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
@ -12,13 +12,13 @@ export const handler = async (argv: Arguments) => {
|
|||||||
const name = argv.name as string;
|
const name = argv.name as string;
|
||||||
assert(name, 'Invalid Name.');
|
assert(name, 'Invalid Name.');
|
||||||
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(argv.config as string);
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
const registry = new Registry(gqlEndpoint, restEndpoint, 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);
|
30
src/cmds/cns-cmds/name-cmds/set.ts
Normal file
30
src/cmds/cns-cmds/name-cmds/set.ts
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, txOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'set [name] [id]';
|
||||||
|
|
||||||
|
export const desc = 'Set name (create name to record ID mapping).';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const name = argv.name as string;
|
||||||
|
const id = argv.id as string;
|
||||||
|
assert(name, 'Invalid Name.');
|
||||||
|
assert(id, 'Invalid Record ID.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.setName({ crn: name, cid: id }, privateKey, fee);
|
||||||
|
|
||||||
|
const success = `{"success":${result.code === 0}}`;
|
||||||
|
txOutput(result, success, argv.output, argv.verbose);
|
||||||
|
};
|
25
src/cmds/cns-cmds/record-cmds/get.ts
Normal file
25
src/cmds/cns-cmds/record-cmds/get.ts
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'get';
|
||||||
|
|
||||||
|
export const desc = 'Get record.';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const { id, config } = argv;
|
||||||
|
assert(id, 'Invalid Record ID.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const result = await registry.getRecordsByIds([id as string]);
|
||||||
|
|
||||||
|
queryOutput(result, argv.output);
|
||||||
|
};
|
@ -1,6 +1,6 @@
|
|||||||
import { Arguments } from 'yargs';
|
import { Arguments } from 'yargs';
|
||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
||||||
|
|
||||||
@ -24,23 +24,13 @@ 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: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
const { rpcEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, registryConfig);
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
const { type, name, bondId, owner, all, refs, limit, offset } = argv;
|
const { type, name, bondId, owner, all } = argv;
|
||||||
const filters: any = {};
|
const filters: any = {};
|
||||||
|
|
||||||
const filterArgs = argv._.slice(3);
|
const filterArgs = argv._.slice(3);
|
||||||
@ -48,13 +38,13 @@ export const handler = async (argv: Arguments) => {
|
|||||||
filters[String(filterArgs[i]).replace(/^-+/, '')] = filterArgs[i + 1];
|
filters[String(filterArgs[i]).replace(/^-+/, '')] = filterArgs[i + 1];
|
||||||
}
|
}
|
||||||
|
|
||||||
assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
|
||||||
let result = await registry.queryRecords({ ...filters, type, name }, all as boolean, refs as boolean, limit as number, offset as number);
|
let result = await registry.queryRecords({ ...filters, type, name }, all as boolean);
|
||||||
|
|
||||||
// Apply ex post filters.
|
// Apply ex post filters.
|
||||||
if (bondId) {
|
if (bondId) {
|
@ -2,9 +2,9 @@ import { Arguments } from 'yargs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import yaml from 'js-yaml';
|
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/laconic-sdk';
|
||||||
|
|
||||||
import { getConfig, getGasAndFees, getConnectionInfo, getGasPrice, txOutput } from '../../../util';
|
import { getConfig, getGasAndFees, getConnectionInfo, txOutput } from '../../../util';
|
||||||
|
|
||||||
export const command = 'publish';
|
export const command = 'publish';
|
||||||
|
|
||||||
@ -18,14 +18,14 @@ export const builder = {
|
|||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
export const handler = async (argv: Arguments) => {
|
||||||
const { txKey, filename, config } = argv;
|
const { txKey, filename, config } = argv;
|
||||||
const { services: { registry: registryConfig } } = getConfig(config as string);
|
const { services: { cns: cnsConfig } } = getConfig(config as string);
|
||||||
const { rpcEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, registryConfig);
|
const { restEndpoint, gqlEndpoint, userKey, bondId, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
|
||||||
assert(rpcEndpoint, 'Invalid registry RPC endpoint.');
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
assert(gqlEndpoint, 'Invalid registry GQL endpoint.');
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
assert(userKey, 'Invalid User Key.');
|
assert(userKey, 'Invalid User Key.');
|
||||||
assert(bondId, 'Invalid Bond ID.');
|
assert(bondId, 'Invalid Bond ID.');
|
||||||
assert(chainId, 'Invalid registry Chain ID.');
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
let file = null;
|
let file = null;
|
||||||
if (filename) {
|
if (filename) {
|
||||||
@ -43,11 +43,9 @@ export const handler = async (argv: Arguments) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const gasPrice = getGasPrice(argv, registryConfig);
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
const result = await registry.setRecord({ privateKey: userKey, record, bondId }, txKey as string, fee);
|
||||||
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
txOutput(result, JSON.stringify(result.data, undefined, 2), argv.output, argv.verbose);
|
||||||
const result = await registry.setRecord({ privateKey: userKey, record, bondId }, txKey || userKey, fee);
|
|
||||||
|
|
||||||
txOutput(result, JSON.stringify(result, undefined, 2), argv.output, argv.verbose);
|
|
||||||
};
|
};
|
22
src/cmds/cns-cmds/status.ts
Normal file
22
src/cmds/cns-cmds/status.ts
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo } from '../../util';
|
||||||
|
|
||||||
|
export const command = 'status';
|
||||||
|
|
||||||
|
export const desc = 'Get CNS status.';
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const { services: { cns } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, chainId } = getConnectionInfo(argv, cns);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
|
||||||
|
const result = await registry.getStatus();
|
||||||
|
console.log(JSON.stringify(result, undefined, 2));
|
||||||
|
};
|
44
src/cmds/cns-cmds/tokens-cmds/send.ts
Normal file
44
src/cmds/cns-cmds/tokens-cmds/send.ts
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import { Arguments } from 'yargs';
|
||||||
|
import assert from 'assert';
|
||||||
|
import { Account, Registry } from '@cerc-io/laconic-sdk';
|
||||||
|
|
||||||
|
import { getConfig, getConnectionInfo, getGasAndFees, queryOutput } from '../../../util';
|
||||||
|
|
||||||
|
export const command = 'send';
|
||||||
|
|
||||||
|
export const desc = 'Send tokens.';
|
||||||
|
|
||||||
|
export const builder = {
|
||||||
|
type: {
|
||||||
|
type: 'string'
|
||||||
|
},
|
||||||
|
quantity: {
|
||||||
|
type: 'string'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
export const handler = async (argv: Arguments) => {
|
||||||
|
const destinationAddress = argv.address as string;
|
||||||
|
const denom = argv.type as string;
|
||||||
|
const amount = argv.quantity as string;
|
||||||
|
|
||||||
|
assert(destinationAddress, 'Invalid Address.');
|
||||||
|
assert(denom, 'Invalid Type.');
|
||||||
|
assert(amount, 'Invalid Quantity.');
|
||||||
|
|
||||||
|
const { services: { cns: cnsConfig } } = getConfig(argv.config as string);
|
||||||
|
const { restEndpoint, gqlEndpoint, privateKey, chainId } = getConnectionInfo(argv, cnsConfig);
|
||||||
|
assert(restEndpoint, 'Invalid CNS REST endpoint.');
|
||||||
|
assert(gqlEndpoint, 'Invalid CNS GQL endpoint.');
|
||||||
|
assert(privateKey, 'Invalid Transaction Key.');
|
||||||
|
assert(chainId, 'Invalid CNS Chain ID.');
|
||||||
|
|
||||||
|
const account = new Account(Buffer.from(privateKey, 'hex'));
|
||||||
|
const fromAddress = account.formattedCosmosAddress;
|
||||||
|
|
||||||
|
const registry = new Registry(gqlEndpoint, restEndpoint, chainId);
|
||||||
|
const fee = getGasAndFees(argv, cnsConfig);
|
||||||
|
await registry.sendCoins({ denom, amount, destinationAddress }, privateKey, fee);
|
||||||
|
const result = await registry.getAccounts([fromAddress, destinationAddress]);
|
||||||
|
queryOutput(result, argv.output);
|
||||||
|
};
|
@ -1,8 +1,8 @@
|
|||||||
import yargs from 'yargs';
|
import yargs from 'yargs';
|
||||||
|
|
||||||
export const command = 'registry';
|
export const command = 'cns';
|
||||||
|
|
||||||
export const desc = 'Registry tools';
|
export const desc = 'CNS tools';
|
||||||
|
|
||||||
exports.builder = (yargs: yargs.Argv) => {
|
exports.builder = (yargs: yargs.Argv) => {
|
||||||
return yargs
|
return yargs
|
||||||
@ -15,10 +15,9 @@ 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('cns-cmds')
|
||||||
.demandCommand()
|
.demandCommand()
|
||||||
.help();
|
.help();
|
||||||
};
|
};
|
@ -1,30 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Account, Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'get';
|
|
||||||
|
|
||||||
export const desc = 'Get account.';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
let address = argv.address as string;
|
|
||||||
|
|
||||||
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(chainId, 'Invalid registry Chain ID.');
|
|
||||||
|
|
||||||
if (!address && privateKey) {
|
|
||||||
const account = new Account(Buffer.from(privateKey, 'hex'));
|
|
||||||
await account.init();
|
|
||||||
address = account.address;
|
|
||||||
}
|
|
||||||
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId });
|
|
||||||
const result = await registry.getAccounts([address]);
|
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
|
||||||
};
|
|
@ -1,35 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import path from 'path';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
import fs from 'fs';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../../util';
|
|
||||||
|
|
||||||
export const command = 'reveal [auction-id] [file-path]';
|
|
||||||
|
|
||||||
export const desc = 'Reveal auction bid.';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const auctionId = argv.auctionId as string;
|
|
||||||
const filePath = argv.filePath as string;
|
|
||||||
assert(auctionId, 'Invalid auction ID.');
|
|
||||||
assert(filePath, 'Invalid reveal file path.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
|
|
||||||
const reveal = fs.readFileSync(path.resolve(filePath));
|
|
||||||
const result = await registry.revealBid({ auctionId, reveal: reveal.toString('hex') }, privateKey, fee);
|
|
||||||
const success = '{"success": true}';
|
|
||||||
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,106 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
|
|
||||||
import { AUCTION_KIND_PROVIDER, AUCTION_KIND_VICKREY, Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'create';
|
|
||||||
|
|
||||||
export const desc = 'Create auction.';
|
|
||||||
|
|
||||||
export const builder = {
|
|
||||||
kind: {
|
|
||||||
type: 'string',
|
|
||||||
describe: 'Auction kind (vickrey | provider)'
|
|
||||||
},
|
|
||||||
'commits-duration': {
|
|
||||||
type: 'string',
|
|
||||||
describe: 'Duration for bid commit phase in seconds'
|
|
||||||
},
|
|
||||||
'reveals-duration': {
|
|
||||||
type: 'string',
|
|
||||||
describe: 'Duration for bid reveal phase in seconds'
|
|
||||||
},
|
|
||||||
denom: {
|
|
||||||
type: 'string',
|
|
||||||
describe: 'Denom to use'
|
|
||||||
},
|
|
||||||
'commit-fee': {
|
|
||||||
type: 'string',
|
|
||||||
describe: 'Fee for committing a bid to the auction'
|
|
||||||
},
|
|
||||||
'reveal-fee': {
|
|
||||||
type: 'string',
|
|
||||||
describe: 'Fee for revealing a bid in the auction'
|
|
||||||
},
|
|
||||||
'minimum-bid': {
|
|
||||||
type: 'string',
|
|
||||||
default: 0,
|
|
||||||
describe: 'Minimum bid amount (only for vickrey auction)'
|
|
||||||
},
|
|
||||||
'max-price': {
|
|
||||||
type: 'string',
|
|
||||||
default: 0,
|
|
||||||
describe: 'Max acceptable bid price (only for provider auction)'
|
|
||||||
},
|
|
||||||
'num-providers': {
|
|
||||||
type: 'number',
|
|
||||||
describe: 'Number ofdesired providers (only for provider auction)'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const { config } = argv;
|
|
||||||
|
|
||||||
const kind = argv.kind as string;
|
|
||||||
const validAuctionKinds = [AUCTION_KIND_VICKREY, AUCTION_KIND_PROVIDER];
|
|
||||||
assert(validAuctionKinds.includes(kind), `Invalid auction kind, has to be one of ${validAuctionKinds}.`);
|
|
||||||
|
|
||||||
if (kind === AUCTION_KIND_VICKREY) {
|
|
||||||
assert(argv.minimumBid, 'Invalid minimum bid.');
|
|
||||||
assert(!argv.maxPrice, `Max price can only be used with ${AUCTION_KIND_PROVIDER} auction.`);
|
|
||||||
assert(!argv.numProviders, `Num providers can only be used with ${AUCTION_KIND_PROVIDER} auction.`);
|
|
||||||
} else if (kind === AUCTION_KIND_PROVIDER) {
|
|
||||||
assert(argv.maxPrice, 'Invalid max price.');
|
|
||||||
assert(argv.numProviders, 'Invalid num providers.');
|
|
||||||
assert(!argv.minimumBid, `Minimum bid can only be used with ${AUCTION_KIND_VICKREY} auction.`);
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(argv.commitsDuration, 'Invalid commits duration.');
|
|
||||||
assert(argv.revealsDuration, 'Invalid reveals duration.');
|
|
||||||
assert(argv.commitFee, 'Invalid commit fee.');
|
|
||||||
assert(argv.revealFee, 'Invalid reveal fee.');
|
|
||||||
|
|
||||||
const commitsDuration = argv.commitsDuration as string;
|
|
||||||
const revealsDuration = argv.revealsDuration as string;
|
|
||||||
|
|
||||||
const denom = argv.denom as string;
|
|
||||||
const commitFee = argv.commitFee as string;
|
|
||||||
const revealFee = argv.revealFee as string;
|
|
||||||
const minimumBid = argv.minimumBid as string;
|
|
||||||
const maxPrice = argv.maxPrice as string;
|
|
||||||
const numProviders = argv.numProviders as number;
|
|
||||||
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
|
|
||||||
let result: any;
|
|
||||||
if (kind === AUCTION_KIND_VICKREY) {
|
|
||||||
result = await registry.createAuction({ commitsDuration, revealsDuration, denom, commitFee, revealFee, minimumBid }, privateKey, fee);
|
|
||||||
} else {
|
|
||||||
result = await registry.createProviderAuction({ commitsDuration, revealsDuration, denom, commitFee, revealFee, maxPrice, numProviders }, privateKey, fee);
|
|
||||||
}
|
|
||||||
|
|
||||||
const jsonString = `{"auctionId":"${result.auction?.id}"}`;
|
|
||||||
txOutput(result, jsonString, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,25 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'get [id]';
|
|
||||||
|
|
||||||
export const desc = 'Get auction information.';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const { id, config } = argv;
|
|
||||||
assert(id, 'Invalid auction ID.');
|
|
||||||
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(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.getAuctionsByIds([id as string]);
|
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
|
||||||
};
|
|
@ -1,34 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
|
|
||||||
import { Account, Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'release-funds [auction-id]';
|
|
||||||
|
|
||||||
export const desc = 'Release funds of provider auction winners.';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const auctionId = argv.auctionId as string;
|
|
||||||
assert(auctionId, 'Invalid auction ID.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
|
|
||||||
const result = await registry.releaseFunds({ auctionId }, privateKey, fee);
|
|
||||||
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,31 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../../util';
|
|
||||||
|
|
||||||
export const command = 'set [name] [bond-id]';
|
|
||||||
|
|
||||||
export const desc = 'Set bond for authority.';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const name = argv.name as string;
|
|
||||||
const bondId = argv.bondId as string;
|
|
||||||
assert(name, 'Invalid authority name.');
|
|
||||||
assert(bondId, 'Invalid Bond ID.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.setAuthorityBond({ name, bondId }, privateKey, fee);
|
|
||||||
const success = '{"success": true}';
|
|
||||||
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,29 +0,0 @@
|
|||||||
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);
|
|
||||||
};
|
|
@ -1,37 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'reserve [name]';
|
|
||||||
|
|
||||||
export const desc = 'Reserve authority/name.';
|
|
||||||
|
|
||||||
export const builder = {
|
|
||||||
owner: {
|
|
||||||
type: 'string',
|
|
||||||
default: ''
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const name = argv.name as string;
|
|
||||||
const owner = argv.owner as string;
|
|
||||||
assert(name, 'Invalid authority name.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.reserveAuthority({ name, owner }, privateKey, fee);
|
|
||||||
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,36 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'associate';
|
|
||||||
|
|
||||||
export const desc = 'Associate record with bond.';
|
|
||||||
|
|
||||||
export const builder = {
|
|
||||||
'bond-id': {
|
|
||||||
type: 'string'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const id = argv.id as string;
|
|
||||||
const bondId = argv.bondId as string;
|
|
||||||
assert(id, 'Invalid Record ID.');
|
|
||||||
assert(bondId, 'Invalid Bond ID.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.associateBond({ recordId: id, bondId }, privateKey, fee);
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,28 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'cancel';
|
|
||||||
|
|
||||||
export const desc = 'Cancel bond.';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const id = argv.id as string;
|
|
||||||
assert(id, 'Invalid Bond ID.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.cancelBond({ id }, privateKey, fee);
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,28 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'dissociate';
|
|
||||||
|
|
||||||
export const desc = 'Dissociate record from bond.';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const id = argv.id as string;
|
|
||||||
assert(id, 'Invalid Record ID.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.dissociateBond({ recordId: id }, privateKey, fee);
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,26 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'get';
|
|
||||||
|
|
||||||
export const desc = 'Get bond.';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const { id, config } = argv;
|
|
||||||
console.assert(id, 'Bond Id is required.');
|
|
||||||
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(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.getBondsByIds([id as string]);
|
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
|
||||||
};
|
|
@ -1,37 +0,0 @@
|
|||||||
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 bonds.';
|
|
||||||
|
|
||||||
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 });
|
|
||||||
|
|
||||||
let result: any;
|
|
||||||
|
|
||||||
const { owner } = argv;
|
|
||||||
if (owner) {
|
|
||||||
const [bondsByOwnerResult] = await registry.queryBondsByOwners([String(owner)]);
|
|
||||||
result = bondsByOwnerResult.bonds;
|
|
||||||
} else {
|
|
||||||
result = await registry.queryBonds();
|
|
||||||
}
|
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
|
||||||
};
|
|
@ -1,34 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../../util';
|
|
||||||
|
|
||||||
export const command = 'dissociate';
|
|
||||||
|
|
||||||
export const desc = 'Dissociate all records from bond.';
|
|
||||||
|
|
||||||
export const builder = {
|
|
||||||
'bond-id': {
|
|
||||||
type: 'string'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const bondId = argv.bondId as string;
|
|
||||||
assert(bondId, 'Invalid Bond ID.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.dissociateRecords({ bondId }, privateKey, fee);
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,39 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../../util';
|
|
||||||
|
|
||||||
export const command = 'reassociate';
|
|
||||||
|
|
||||||
export const desc = 'Reassociate records with new bond.';
|
|
||||||
|
|
||||||
export const builder = {
|
|
||||||
'old-bond-id': {
|
|
||||||
type: 'string'
|
|
||||||
},
|
|
||||||
'new-bond-id': {
|
|
||||||
type: 'string'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const oldBondId = argv.oldBondId as string;
|
|
||||||
const newBondId = argv.newBondId as string;
|
|
||||||
assert(oldBondId, 'Invalid Old Bond ID.');
|
|
||||||
assert(newBondId, 'Invalid New Bond ID.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.reassociateRecords({ oldBondId, newBondId }, privateKey, fee);
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,42 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'refill';
|
|
||||||
|
|
||||||
export const desc = 'Refill bond.';
|
|
||||||
|
|
||||||
export const builder = {
|
|
||||||
type: {
|
|
||||||
type: 'string'
|
|
||||||
},
|
|
||||||
quantity: {
|
|
||||||
type: 'string'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const denom = argv.type as string;
|
|
||||||
const amount = argv.quantity as string;
|
|
||||||
const id = argv.id as string;
|
|
||||||
|
|
||||||
assert(id, 'Invalid Bond ID.');
|
|
||||||
assert(denom, 'Invalid Type.');
|
|
||||||
assert(amount, 'Invalid Quantity.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.refillBond({ id, denom, amount }, privateKey, fee);
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,42 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'withdraw';
|
|
||||||
|
|
||||||
export const desc = 'Withdraw funds from bond.';
|
|
||||||
|
|
||||||
export const builder = {
|
|
||||||
type: {
|
|
||||||
type: 'string'
|
|
||||||
},
|
|
||||||
quantity: {
|
|
||||||
type: 'string'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const denom = argv.type as string;
|
|
||||||
const amount = argv.quantity as string;
|
|
||||||
const id = argv.id as string;
|
|
||||||
|
|
||||||
assert(id, 'Invalid Bond ID.');
|
|
||||||
assert(denom, 'Invalid Type.');
|
|
||||||
assert(amount, 'Invalid Quantity.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.withdrawBond({ id, denom, amount }, privateKey, fee);
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,29 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'delete [name]';
|
|
||||||
|
|
||||||
export const desc = 'Delete name (remove name to record ID mapping).';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const name = argv.name as string;
|
|
||||||
assert(name, 'Invalid Name.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.deleteName({ lrn: name }, privateKey, fee);
|
|
||||||
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,31 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, getGasAndFees, getGasPrice, txOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'set [name] [id]';
|
|
||||||
|
|
||||||
export const desc = 'Set name (create name to record ID mapping).';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const name = argv.name as string;
|
|
||||||
const id = argv.id as string;
|
|
||||||
assert(name, 'Invalid Name.');
|
|
||||||
assert(id, 'Invalid Record ID.');
|
|
||||||
|
|
||||||
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 gasPrice = getGasPrice(argv, registryConfig);
|
|
||||||
const registry = new Registry(gqlEndpoint, rpcEndpoint, { chainId, gasPrice });
|
|
||||||
const fee = getGasAndFees(argv, registryConfig);
|
|
||||||
const result = await registry.setName({ lrn: name, cid: id }, privateKey, fee);
|
|
||||||
|
|
||||||
const success = '{"success": true}';
|
|
||||||
txOutput(result, success, argv.output, argv.verbose);
|
|
||||||
};
|
|
@ -1,25 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo, queryOutput } from '../../../util';
|
|
||||||
|
|
||||||
export const command = 'get';
|
|
||||||
|
|
||||||
export const desc = 'Get record.';
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const { id, config } = argv;
|
|
||||||
assert(id, 'Invalid Record ID.');
|
|
||||||
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(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.getRecordsByIds([id as string]);
|
|
||||||
|
|
||||||
queryOutput(result, argv.output);
|
|
||||||
};
|
|
@ -1,22 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
import { Registry } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import { getConfig, getConnectionInfo } from '../../util';
|
|
||||||
|
|
||||||
export const command = 'status';
|
|
||||||
|
|
||||||
export const desc = 'Get registry status.';
|
|
||||||
|
|
||||||
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.getStatus();
|
|
||||||
console.log(JSON.stringify(result, undefined, 2));
|
|
||||||
};
|
|
@ -1,54 +0,0 @@
|
|||||||
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,78 +0,0 @@
|
|||||||
import { Arguments } from 'yargs';
|
|
||||||
import assert from 'assert';
|
|
||||||
|
|
||||||
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 desc = 'Send tokens.';
|
|
||||||
|
|
||||||
export const builder = {
|
|
||||||
type: {
|
|
||||||
type: 'string'
|
|
||||||
},
|
|
||||||
quantity: {
|
|
||||||
type: 'string'
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
export const handler = async (argv: Arguments) => {
|
|
||||||
const destinationAddress = argv.address as string;
|
|
||||||
const denom = argv.type as string;
|
|
||||||
const amount = argv.quantity as string;
|
|
||||||
|
|
||||||
assert(destinationAddress, 'Invalid Address.');
|
|
||||||
assert(denom, 'Invalid Type.');
|
|
||||||
assert(amount, 'Invalid Quantity.');
|
|
||||||
|
|
||||||
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 fromAddress = account.address;
|
|
||||||
|
|
||||||
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 txResponse: DeliverTxResponse = await laconicClient.sendTokens(
|
|
||||||
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);
|
|
||||||
};
|
|
@ -26,5 +26,4 @@ yargs(hideBin(process.argv))
|
|||||||
.commandDir('cmds')
|
.commandDir('cmds')
|
||||||
.demandCommand()
|
.demandCommand()
|
||||||
.help()
|
.help()
|
||||||
.alias('h', 'help')
|
|
||||||
.argv;
|
.argv;
|
||||||
|
1
src/types/common/main.d.ts
vendored
1
src/types/common/main.d.ts
vendored
@ -1 +0,0 @@
|
|||||||
declare module 'lodash-clean';
|
|
@ -1,6 +0,0 @@
|
|||||||
{
|
|
||||||
"name": "common",
|
|
||||||
"version": "0.1.0",
|
|
||||||
"license": "AGPL-3.0",
|
|
||||||
"typings": "main.d.ts"
|
|
||||||
}
|
|
@ -2,21 +2,15 @@ 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, gasPrice } = argv;
|
const { server, userKey, bondId, txKey, chainId, fees, gas } = argv;
|
||||||
|
|
||||||
const result = {
|
const result = {
|
||||||
...config,
|
...config,
|
||||||
userKey: stripHexPrefix(config.userKey),
|
|
||||||
...clean({ server, userKey, bondId, txKey, chainId }),
|
...clean({ server, userKey, bondId, txKey, chainId }),
|
||||||
privateKey: stripHexPrefix(txKey || userKey || config.userKey),
|
privateKey: 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;
|
|
||||||
}
|
|
||||||
|
@ -1,17 +1,21 @@
|
|||||||
/* eslint-disable @typescript-eslint/no-unused-vars */
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
||||||
|
import assert from 'assert';
|
||||||
import { Arguments } from 'yargs';
|
import { Arguments } from 'yargs';
|
||||||
|
|
||||||
import { parseGasAndFees, getGasPrice as registryGetGasPrice } from '@cerc-io/registry-sdk';
|
export const parseGasAndFees = (gas: string, fees = '') => {
|
||||||
import { StdFee, GasPrice } from '@cosmjs/stargate';
|
assert(gas, 'Invalid gas.');
|
||||||
|
|
||||||
export const getGasAndFees = (argv: Arguments, config: any = {}): StdFee | number | undefined => {
|
const [{ amount, denom }] = fees.trim().split(',')
|
||||||
|
.map(fee => fee.trim().split(/(\d+)/))
|
||||||
|
.filter(([_, amount, denom]) => (denom && amount))
|
||||||
|
.map(([_, amount, denom]) => ({ denom, amount }));
|
||||||
|
|
||||||
|
return { amount, denom, gas };
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getGasAndFees = (argv: Arguments, config: any = {}) => {
|
||||||
return parseGasAndFees(
|
return parseGasAndFees(
|
||||||
argv.gas || config.gas,
|
String(argv.gas || config.gas),
|
||||||
argv.fees || config.fees
|
String(argv.fees || config.fees)
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getGasPrice = (argv: Arguments, config: any = {}): GasPrice | undefined => {
|
|
||||||
const gasPriceString = argv.gasPrice || config.gasPrice;
|
|
||||||
return registryGetGasPrice(gasPriceString);
|
|
||||||
};
|
|
||||||
|
@ -1,34 +0,0 @@
|
|||||||
# Run CLI tests
|
|
||||||
|
|
||||||
* Follow the project `Setup` and `Account Setup` from root [README](./../README.md)
|
|
||||||
|
|
||||||
* Add laconic cmd to path
|
|
||||||
|
|
||||||
```bash
|
|
||||||
export PATH="$PWD/bin:$PATH"
|
|
||||||
```
|
|
||||||
|
|
||||||
* Create a .env file using [.env.example](./.env.example):
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cp .env.example .env
|
|
||||||
```
|
|
||||||
|
|
||||||
* Get account address of test account:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
laconicd keys list --keyring-backend test
|
|
||||||
|
|
||||||
# - address: laconic10er85pyd7ukw732e88fzv7k0jq205764hye2dx
|
|
||||||
# name: alice
|
|
||||||
# pubkey: '{"@type":"/cosmos.crypto.secp256k1.PubKey","key":"AsDoWlNIr3W013pOiwmopaB/SaWQj6r3g56xb2d9GxYK"}'
|
|
||||||
# type: local
|
|
||||||
```
|
|
||||||
|
|
||||||
Use the `address` field from the result and assign it in `TEST_ACCOUNT` field of `.env` file
|
|
||||||
|
|
||||||
* Run CLI tests:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
yarn test
|
|
||||||
```
|
|
620
test/cli.test.ts
620
test/cli.test.ts
@ -2,8 +2,6 @@ import fs from 'fs';
|
|||||||
import assert from 'assert';
|
import assert from 'assert';
|
||||||
import { spawnSync } from 'child_process';
|
import { spawnSync } from 'child_process';
|
||||||
|
|
||||||
import { AUCTION_KIND_PROVIDER, AUCTION_KIND_VICKREY } from '@cerc-io/registry-sdk';
|
|
||||||
|
|
||||||
import {
|
import {
|
||||||
CHAIN_ID,
|
CHAIN_ID,
|
||||||
TOKEN_TYPE,
|
TOKEN_TYPE,
|
||||||
@ -17,10 +15,7 @@ import {
|
|||||||
getRecordObj,
|
getRecordObj,
|
||||||
getAuthorityObj,
|
getAuthorityObj,
|
||||||
getAuctionObj,
|
getAuctionObj,
|
||||||
getBidObj,
|
getBidObj
|
||||||
updateGasAndFeesConfig,
|
|
||||||
AUCTION_STATUS,
|
|
||||||
getFeesConfig
|
|
||||||
} from './helpers';
|
} from './helpers';
|
||||||
|
|
||||||
describe('Test laconic CLI commands', () => {
|
describe('Test laconic CLI commands', () => {
|
||||||
@ -36,8 +31,8 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(errorOutput).toContain('laconic <command>');
|
expect(errorOutput).toContain('laconic <command>');
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry', async () => {
|
test('laconic cns', async () => {
|
||||||
const result = spawnSync('laconic', ['registry']);
|
const result = spawnSync('laconic', ['cns']);
|
||||||
expect(result.status).toBe(1);
|
expect(result.status).toBe(1);
|
||||||
|
|
||||||
const output = result.stdout.toString().trim();
|
const output = result.stdout.toString().trim();
|
||||||
@ -45,39 +40,39 @@ describe('Test laconic CLI commands', () => {
|
|||||||
|
|
||||||
// Expect error with usage string
|
// Expect error with usage string
|
||||||
expect(output).toBe('');
|
expect(output).toBe('');
|
||||||
expect(errorOutput).toContain('laconic registry');
|
expect(errorOutput).toContain('laconic cns');
|
||||||
expect(errorOutput).toContain('Registry tools');
|
expect(errorOutput).toContain('CNS tools');
|
||||||
expect(errorOutput).toContain('Commands:');
|
expect(errorOutput).toContain('Commands:');
|
||||||
});
|
});
|
||||||
|
|
||||||
// TODO: Break up tests into separate files
|
// TODO: Break up tests into separate files
|
||||||
// TODO: Add tests for registry commands with all available flags
|
// TODO: Add tests for CNS commands with all available flags
|
||||||
|
|
||||||
describe('laconic registry commands', () => {
|
describe('laconic CNS commands', () => {
|
||||||
const testAccount = process.env.TEST_ACCOUNT;
|
const testAccount = process.env.TEST_ACCOUNT;
|
||||||
assert(testAccount, 'TEST_ACCOUNT not set in env');
|
assert(testAccount, 'TEST_ACCOUNT not set in env');
|
||||||
const testAccount2 = 'laconic1pmuxrcnuhhf8qdllzuf2ctj2tnwwcg6yswqnyd';
|
const testAccount2 = 'ethm1vc62ysqu504at932jjq8pwrqgjt67rx6ggn5yu';
|
||||||
const initialAccountBalance = Number('1000000000000000000000000000000');
|
const initialAccountBalance = Number('100000000000000000000000000');
|
||||||
|
|
||||||
const testAuthorityName = 'laconic';
|
const testAuthorityName = 'laconic';
|
||||||
const testRecordFilePath = 'test/data/watcher-record.yml';
|
const testRecordFilePath = 'test/data/watcher-record.yml';
|
||||||
let testAuctionId: string, testRecordId: string, testRecordBondId: string;
|
let testAuctionId: string, testRecordId: string, testRecordBondId: string;
|
||||||
|
|
||||||
test('laconic registry status', async () => {
|
test('laconic cns status', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'status']);
|
const result = spawnSync('laconic', ['cns', 'status']);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expect output object to have registry status props
|
// Expect output object to have CNS status props
|
||||||
expect(outputObj).toHaveProperty('version');
|
expect(outputObj).toHaveProperty('version');
|
||||||
expect(outputObj).toHaveProperty('node');
|
expect(outputObj).toHaveProperty('node');
|
||||||
expect(outputObj).toHaveProperty('node.network', CHAIN_ID);
|
expect(outputObj).toHaveProperty('node.network', CHAIN_ID);
|
||||||
expect(outputObj).toHaveProperty('sync');
|
expect(outputObj).toHaveProperty('sync');
|
||||||
expect(Number(outputObj.sync.latestBlockHeight)).toBeGreaterThan(0);
|
expect(Number(outputObj.sync.latest_block_height)).toBeGreaterThan(0);
|
||||||
expect(outputObj).toHaveProperty('validator');
|
expect(outputObj).toHaveProperty('validator');
|
||||||
expect(outputObj).toHaveProperty('validators');
|
expect(outputObj).toHaveProperty('validators');
|
||||||
expect(outputObj).toHaveProperty('numPeers');
|
expect(outputObj).toHaveProperty('num_peers');
|
||||||
expect(outputObj).toHaveProperty('peers');
|
expect(outputObj).toHaveProperty('peers');
|
||||||
expect(outputObj).toHaveProperty('diskUsage');
|
expect(outputObj).toHaveProperty('disk_usage');
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Bond operations', () => {
|
describe('Bond operations', () => {
|
||||||
@ -85,9 +80,8 @@ describe('Test laconic CLI commands', () => {
|
|||||||
let bondBalance = 1000000000;
|
let bondBalance = 1000000000;
|
||||||
let bondId: string;
|
let bondId: string;
|
||||||
|
|
||||||
test('laconic registry bond create --type <type> --quantity <quantity> --gas <gas> --fees <fees>', async () => {
|
test('laconic cns bond create --type <type> --quantity <quantity> --gas <gas> --fees <fees>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'create', '--type', TOKEN_TYPE, '--quantity', bondBalance.toString(), '--gas', '200000', '--fees', `200000${TOKEN_TYPE}`]);
|
const result = spawnSync('laconic', ['cns', 'bond', 'create', '--type', TOKEN_TYPE, '--quantity', bondBalance.toString(), '--gas', '200000', '--fees', `200000${TOKEN_TYPE}`]);
|
||||||
|
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expect output object to have resultant bond id
|
// Expect output object to have resultant bond id
|
||||||
@ -96,8 +90,8 @@ describe('Test laconic CLI commands', () => {
|
|||||||
bondId = outputObj.bondId;
|
bondId = outputObj.bondId;
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry bond list', async () => {
|
test('laconic cns bond list', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'list']);
|
const result = spawnSync('laconic', ['cns', 'bond', 'list']);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected bond
|
// Expected bond
|
||||||
@ -107,8 +101,8 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(outputObj[0]).toEqual(expectedBond);
|
expect(outputObj[0]).toEqual(expectedBond);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry bond list --owner <owner_address>', async () => {
|
test('laconic cns bond list --owner <owner_address>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'list', '--owner', bondOwner]);
|
const result = spawnSync('laconic', ['cns', 'bond', 'list', '--owner', bondOwner]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected bond
|
// Expected bond
|
||||||
@ -118,8 +112,8 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(outputObj[0]).toEqual(expectedBond);
|
expect(outputObj[0]).toEqual(expectedBond);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry bond get --id <bond_id>', async () => {
|
test('laconic cns bond get --id <bond_id>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'get', '--id', bondId]);
|
const result = spawnSync('laconic', ['cns', 'bond', 'get', '--id', bondId]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected bond
|
// Expected bond
|
||||||
@ -129,18 +123,18 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(outputObj[0]).toEqual(expectedBond);
|
expect(outputObj[0]).toEqual(expectedBond);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry bond refill --id <bond_id> --type <type> --quantity <quantity>', async () => {
|
test('laconic cns bond refill --id <bond_id> --type <type> --quantity <quantity>', async () => {
|
||||||
const bondRefillAmount = 1000;
|
const bondRefillAmount = 1000;
|
||||||
bondBalance += bondRefillAmount;
|
bondBalance += bondRefillAmount;
|
||||||
|
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'refill', '--id', bondId, '--type', TOKEN_TYPE, '--quantity', bondRefillAmount.toString()]);
|
const result = spawnSync('laconic', ['cns', 'bond', 'refill', '--id', bondId, '--type', TOKEN_TYPE, '--quantity', bondRefillAmount.toString()]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
|
|
||||||
// Check updated bond
|
// Check updated bond
|
||||||
const bondResult = spawnSync('laconic', ['registry', 'bond', 'get', '--id', bondId]);
|
const bondResult = spawnSync('laconic', ['cns', 'bond', 'get', '--id', bondId]);
|
||||||
const bondOutputObj = checkResultAndRetrieveOutput(bondResult);
|
const bondOutputObj = checkResultAndRetrieveOutput(bondResult);
|
||||||
|
|
||||||
// Expected bond
|
// Expected bond
|
||||||
@ -150,18 +144,18 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(bondOutputObj[0]).toEqual(expectedBond);
|
expect(bondOutputObj[0]).toEqual(expectedBond);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry bond withdraw --id <bond_id> --type <type> --quantity <quantity>', async () => {
|
test('laconic cns bond withdraw --id <bond_id> --type <type> --quantity <quantity>', async () => {
|
||||||
const bondWithdrawAmount = 500;
|
const bondWithdrawAmount = 500;
|
||||||
bondBalance -= bondWithdrawAmount;
|
bondBalance -= bondWithdrawAmount;
|
||||||
|
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'withdraw', '--id', bondId, '--type', TOKEN_TYPE, '--quantity', bondWithdrawAmount.toString()]);
|
const result = spawnSync('laconic', ['cns', 'bond', 'withdraw', '--id', bondId, '--type', TOKEN_TYPE, '--quantity', bondWithdrawAmount.toString()]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
|
|
||||||
// Check updated bond
|
// Check updated bond
|
||||||
const bondResult = spawnSync('laconic', ['registry', 'bond', 'get', '--id', bondId]);
|
const bondResult = spawnSync('laconic', ['cns', 'bond', 'get', '--id', bondId]);
|
||||||
const bondOutputObj = checkResultAndRetrieveOutput(bondResult);
|
const bondOutputObj = checkResultAndRetrieveOutput(bondResult);
|
||||||
|
|
||||||
// Expected bond
|
// Expected bond
|
||||||
@ -172,28 +166,28 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(bondOutputObj[0]).toEqual(expectedBond);
|
expect(bondOutputObj[0]).toEqual(expectedBond);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry bond cancel --id <bond_id>', async () => {
|
test('laconic cns bond cancel --id <bond_id>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'cancel', '--id', bondId]);
|
const result = spawnSync('laconic', ['cns', 'bond', 'cancel', '--id', bondId]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
|
|
||||||
// Check updated bond
|
// Check updated bond
|
||||||
const bondResult = spawnSync('laconic', ['registry', 'bond', 'get', '--id', bondId]);
|
const bondResult = spawnSync('laconic', ['cns', 'bond', 'get', '--id', bondId]);
|
||||||
const bondOutputObj = checkResultAndRetrieveOutput(bondResult);
|
const bondOutputObj = checkResultAndRetrieveOutput(bondResult);
|
||||||
|
|
||||||
// Expect empty object
|
// Expect empty object
|
||||||
expect(bondOutputObj.length).toEqual(1);
|
expect(bondOutputObj.length).toEqual(1);
|
||||||
expect(bondOutputObj[0]).toEqual(null);
|
expect(bondOutputObj[0]).toEqual({ id: '', owner: '', balance: [] });
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Account and tokens operations', () => {
|
describe('Account and tokens operations', () => {
|
||||||
let balanceBeforeSend: number;
|
let balanceBeforeSend: number;
|
||||||
|
|
||||||
test('laconic registry account get --address <account_address>', async () => {
|
test('laconic cns account get --address <account_address>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'account', 'get', '--address', testAccount]);
|
const result = spawnSync('laconic', ['cns', 'account', 'get', '--address', testAccount]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected account
|
// Expected account
|
||||||
@ -209,11 +203,11 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(balanceBeforeSend).toBeLessThan(initialAccountBalance);
|
expect(balanceBeforeSend).toBeLessThan(initialAccountBalance);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry tokens send --address <account_address> --type <token_type> --quantity <quantity>', async () => {
|
test('laconic cns tokens send --address <account_address> --type <token_type> --quantity <quantity>', async () => {
|
||||||
const sendAmount = 1000000000;
|
const sendAmount = 1000000000;
|
||||||
const balanceAfterSend = balanceBeforeSend - sendAmount;
|
const balanceAfterSend = balanceBeforeSend - sendAmount;
|
||||||
|
|
||||||
const result = spawnSync('laconic', ['registry', 'tokens', 'send', '--address', testAccount2, '--type', TOKEN_TYPE, '--quantity', sendAmount.toString()]);
|
const result = spawnSync('laconic', ['cns', 'tokens', 'send', '--address', testAccount2, '--type', TOKEN_TYPE, '--quantity', sendAmount.toString()]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected acconts
|
// Expected acconts
|
||||||
@ -222,41 +216,20 @@ describe('Test laconic CLI commands', () => {
|
|||||||
getAccountObj({ address: testAccount2, balance: sendAmount })
|
getAccountObj({ address: testAccount2, balance: sendAmount })
|
||||||
];
|
];
|
||||||
|
|
||||||
expect(outputObj.tx.code).toEqual(0);
|
expect(outputObj.length).toEqual(2);
|
||||||
expect(outputObj.tx.amount).toEqual(`${sendAmount}${TOKEN_TYPE}`);
|
expect(outputObj).toMatchObject(expectedAccounts);
|
||||||
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);
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Record operations', () => {
|
describe('Record operations', () => {
|
||||||
const gas = 250000;
|
const gas = 250000;
|
||||||
const fees = `250000${TOKEN_TYPE}`;
|
|
||||||
const bondBalance = 1000000000;
|
const bondBalance = 1000000000;
|
||||||
|
|
||||||
test('laconic registry record publish --filename <record_file> --bond-id <bond_id> --gas <gas> --fees <fees>', async () => {
|
test('laconic cns record publish --filename <record_file> --bond-id <bond_id> --gas <gas>', async () => {
|
||||||
// Create a new bond to be associated with the record
|
// Create a new bond to be associated with the record
|
||||||
({ bondId: testRecordBondId } = createBond(bondBalance));
|
({ bondId: testRecordBondId } = createBond(bondBalance));
|
||||||
const result = spawnSync('laconic', ['registry', 'record', 'publish', '--filename', testRecordFilePath, '--bond-id', testRecordBondId, '--gas', gas.toString(), '--fees', fees]);
|
|
||||||
|
const result = spawnSync('laconic', ['cns', 'record', 'publish', '--filename', testRecordFilePath, '--bond-id', testRecordBondId, '--gas', gas.toString()]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expect output object to resultant bond id
|
// Expect output object to resultant bond id
|
||||||
@ -265,8 +238,8 @@ describe('Test laconic CLI commands', () => {
|
|||||||
testRecordId = outputObj.id;
|
testRecordId = outputObj.id;
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry record list', async () => {
|
test('laconic cns record list', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'record', 'list']);
|
const result = spawnSync('laconic', ['cns', 'record', 'list']);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected record
|
// Expected record
|
||||||
@ -280,8 +253,8 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(outputObj[0].owners.length).toEqual(1);
|
expect(outputObj[0].owners.length).toEqual(1);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry record get --id <record_id>', async () => {
|
test('laconic cns record get --id <record_id>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'record', 'get', '--id', testRecordId]);
|
const result = spawnSync('laconic', ['cns', 'record', 'get', '--id', testRecordId]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected record
|
// Expected record
|
||||||
@ -294,14 +267,14 @@ describe('Test laconic CLI commands', () => {
|
|||||||
describe('Bond records operations', () => {
|
describe('Bond records operations', () => {
|
||||||
let testRecordBondId2: string;
|
let testRecordBondId2: string;
|
||||||
|
|
||||||
test('laconic registry bond dissociate --id <record_id>', async () => {
|
test('laconic cns bond dissociate --id <record_id>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'dissociate', '--id', testRecordId]);
|
const result = spawnSync('laconic', ['cns', 'bond', 'dissociate', '--id', testRecordId]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
|
|
||||||
const recordResult = spawnSync('laconic', ['registry', 'record', 'get', '--id', testRecordId]);
|
const recordResult = spawnSync('laconic', ['cns', 'record', 'get', '--id', testRecordId]);
|
||||||
const recordOutputObj = checkResultAndRetrieveOutput(recordResult);
|
const recordOutputObj = checkResultAndRetrieveOutput(recordResult);
|
||||||
|
|
||||||
// Expected record
|
// Expected record
|
||||||
@ -311,17 +284,17 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(recordOutputObj[0]).toMatchObject(expectedRecord);
|
expect(recordOutputObj[0]).toMatchObject(expectedRecord);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry bond associate --id <record_id> --bond-id <bond_id>', async () => {
|
test('laconic cns bond associate --id <record_id> --bond-id <bond_id>', async () => {
|
||||||
// Create a new bond to be associated with the record
|
// Create a new bond to be associated with the record
|
||||||
({ bondId: testRecordBondId2 } = createBond(bondBalance));
|
({ bondId: testRecordBondId2 } = createBond(bondBalance));
|
||||||
|
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'associate', '--id', testRecordId, '--bond-id', testRecordBondId2]);
|
const result = spawnSync('laconic', ['cns', 'bond', 'associate', '--id', testRecordId, '--bond-id', testRecordBondId2]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
|
|
||||||
const recordResult = spawnSync('laconic', ['registry', 'record', 'get', '--id', testRecordId]);
|
const recordResult = spawnSync('laconic', ['cns', 'record', 'get', '--id', testRecordId]);
|
||||||
const recordOutputObj = checkResultAndRetrieveOutput(recordResult);
|
const recordOutputObj = checkResultAndRetrieveOutput(recordResult);
|
||||||
|
|
||||||
// Expected record
|
// Expected record
|
||||||
@ -331,14 +304,14 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(recordOutputObj[0]).toMatchObject(expectedRecord);
|
expect(recordOutputObj[0]).toMatchObject(expectedRecord);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry bond records reassociate --old-bond-id <old_bond_id> --new-bond-id <new_bond_id>', async () => {
|
test('laconic cns bond records reassociate --old-bond-id <old_bond_id> --new-bond-id <new_bond_id>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'records', 'reassociate', '--old-bond-id', testRecordBondId2, '--new-bond-id', testRecordBondId]);
|
const result = spawnSync('laconic', ['cns', 'bond', 'records', 'reassociate', '--old-bond-id', testRecordBondId2, '--new-bond-id', testRecordBondId]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
|
|
||||||
const recordResult = spawnSync('laconic', ['registry', 'record', 'get', '--id', testRecordId]);
|
const recordResult = spawnSync('laconic', ['cns', 'record', 'get', '--id', testRecordId]);
|
||||||
const recordOutputObj = checkResultAndRetrieveOutput(recordResult);
|
const recordOutputObj = checkResultAndRetrieveOutput(recordResult);
|
||||||
|
|
||||||
// Expected record
|
// Expected record
|
||||||
@ -351,17 +324,18 @@ describe('Test laconic CLI commands', () => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
describe('Name authority operations (pre auction)', () => {
|
describe('Name authority operations (pre auction)', () => {
|
||||||
test('laconic registry authority reserve <authority_name>', async () => {
|
test('laconic cns authority reserve <authority_name>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'authority', 'reserve', testAuthorityName]);
|
const result = spawnSync('laconic', ['cns', 'authority', 'reserve', testAuthorityName]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expect result
|
// Expect result
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry authority whois <authority_name>', async () => {
|
test('laconic cns authority whois <authority_name>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'authority', 'whois', testAuthorityName]);
|
const result = spawnSync('laconic', ['cns', 'authority', 'whois', testAuthorityName]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected authority (still in auction)
|
// Expected authority (still in auction)
|
||||||
const expectedAuthority = getAuthorityObj({ owner: '', status: 'auction', auction: getAuctionObj({ owner: testAccount }) });
|
const expectedAuthority = getAuthorityObj({ owner: '', status: 'auction', auction: getAuctionObj({ owner: testAccount }) });
|
||||||
|
|
||||||
@ -374,12 +348,12 @@ describe('Test laconic CLI commands', () => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Authority auction operations', () => {
|
describe('Auction operations', () => {
|
||||||
const bidAmount = 25000000;
|
const bidAmount = 25000000;
|
||||||
let bidRevealFilePath: string;
|
let bidRevealFilePath: string;
|
||||||
|
|
||||||
test('laconic registry auction get <auction_id>', async () => {
|
test('laconic cns auction get <auction_id>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'auction', 'get', testAuctionId]);
|
const result = spawnSync('laconic', ['cns', 'auction', 'get', testAuctionId]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected auction (still in commit stage)
|
// Expected auction (still in commit stage)
|
||||||
@ -389,8 +363,8 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(outputObj[0]).toMatchObject(expectedAuction);
|
expect(outputObj[0]).toMatchObject(expectedAuction);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry auction bid commit <auction_id> <quantity> <type>', async () => {
|
test('laconic cns auction bid commit <auction_id> <quantity> <type>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'auction', 'bid', 'commit', testAuctionId, bidAmount.toString(), TOKEN_TYPE]);
|
const result = spawnSync('laconic', ['cns', 'auction', 'bid', 'commit', testAuctionId, bidAmount.toString(), TOKEN_TYPE]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
@ -399,11 +373,11 @@ describe('Test laconic CLI commands', () => {
|
|||||||
bidRevealFilePath = outputObj.reveal_file;
|
bidRevealFilePath = outputObj.reveal_file;
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry auction bid reveal <auction_id> <file_path>', async () => {
|
test('laconic cns auction bid reveal <auction_id> <file_path>', async () => {
|
||||||
// Wait for auction commits duration (60s)
|
// Wait for auction commits duration (60s)
|
||||||
await delay(AUCTION_COMMIT_DURATION * 1000);
|
await delay(AUCTION_COMMIT_DURATION * 1000);
|
||||||
|
|
||||||
const auctionResult = spawnSync('laconic', ['registry', 'auction', 'get', testAuctionId]);
|
const auctionResult = spawnSync('laconic', ['cns', 'auction', 'get', testAuctionId]);
|
||||||
const auctionOutputObj = checkResultAndRetrieveOutput(auctionResult);
|
const auctionOutputObj = checkResultAndRetrieveOutput(auctionResult);
|
||||||
|
|
||||||
const expectedAuction = getAuctionObj({ owner: testAccount, status: 'reveal' });
|
const expectedAuction = getAuctionObj({ owner: testAccount, status: 'reveal' });
|
||||||
@ -413,7 +387,7 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(auctionOutputObj[0].bids[0]).toMatchObject(expectedBid);
|
expect(auctionOutputObj[0].bids[0]).toMatchObject(expectedBid);
|
||||||
|
|
||||||
// Reveal bid
|
// Reveal bid
|
||||||
const result = spawnSync('laconic', ['registry', 'auction', 'bid', 'reveal', testAuctionId, bidRevealFilePath]);
|
const result = spawnSync('laconic', ['cns', 'auction', 'bid', 'reveal', testAuctionId, bidRevealFilePath]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
@ -424,7 +398,7 @@ describe('Test laconic CLI commands', () => {
|
|||||||
chainId: CHAIN_ID,
|
chainId: CHAIN_ID,
|
||||||
auctionId: testAuctionId,
|
auctionId: testAuctionId,
|
||||||
bidderAddress: testAccount,
|
bidderAddress: testAccount,
|
||||||
bidAmount: `${bidAmount}alnt`
|
bidAmount: `${bidAmount}aphoton`
|
||||||
});
|
});
|
||||||
}, (AUCTION_COMMIT_DURATION + 5) * 1000);
|
}, (AUCTION_COMMIT_DURATION + 5) * 1000);
|
||||||
});
|
});
|
||||||
@ -433,11 +407,11 @@ describe('Test laconic CLI commands', () => {
|
|||||||
const testSubAuthorityName = 'echo.laconic';
|
const testSubAuthorityName = 'echo.laconic';
|
||||||
const testSubAuthorityName2 = 'kube.laconic';
|
const testSubAuthorityName2 = 'kube.laconic';
|
||||||
|
|
||||||
test('laconic registry authority whois <authority_name>', async () => {
|
test('laconic cns authority whois <authority_name>', async () => {
|
||||||
// Wait for auction reveals duration (60s)
|
// Wait for auction reveals duration (60s)
|
||||||
await delay(AUCTION_REVEAL_DURATION * 1000);
|
await delay(AUCTION_REVEAL_DURATION * 1000);
|
||||||
|
|
||||||
const result = spawnSync('laconic', ['registry', 'authority', 'whois', testAuthorityName]);
|
const result = spawnSync('laconic', ['cns', 'authority', 'whois', testAuthorityName]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected authority (active)
|
// Expected authority (active)
|
||||||
@ -447,19 +421,19 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(outputObj[0]).toMatchObject(expectedAuthority);
|
expect(outputObj[0]).toMatchObject(expectedAuthority);
|
||||||
}, (AUCTION_REVEAL_DURATION + 5) * 1000);
|
}, (AUCTION_REVEAL_DURATION + 5) * 1000);
|
||||||
|
|
||||||
test('laconic registry authority bond set laconic <bond_id>', async () => {
|
test('laconic cns authority bond set laconic <bond_id>', async () => {
|
||||||
// Create a new bond to be set on the authority
|
// Create a new bond to be set on the authority
|
||||||
const bondBalance = 1000000000;
|
const bondBalance = 1000000000;
|
||||||
const { bondId } = createBond(bondBalance);
|
const { bondId } = createBond(bondBalance);
|
||||||
|
|
||||||
const result = spawnSync('laconic', ['registry', 'authority', 'bond', 'set', testAuthorityName, bondId]);
|
const result = spawnSync('laconic', ['cns', 'authority', 'bond', 'set', testAuthorityName, bondId]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
|
|
||||||
// Check updated authority
|
// Check updated authority
|
||||||
const authorityResult = spawnSync('laconic', ['registry', 'authority', 'whois', testAuthorityName]);
|
const authorityResult = spawnSync('laconic', ['cns', 'authority', 'whois', testAuthorityName]);
|
||||||
const authorityOutputObj = checkResultAndRetrieveOutput(authorityResult);
|
const authorityOutputObj = checkResultAndRetrieveOutput(authorityResult);
|
||||||
|
|
||||||
// Expected authority (active with bond)
|
// Expected authority (active with bond)
|
||||||
@ -469,15 +443,15 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(authorityOutputObj[0]).toMatchObject(expectedAuthority);
|
expect(authorityOutputObj[0]).toMatchObject(expectedAuthority);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry authority reserve <sub_authority> (same owner)', async () => {
|
test('laconic cns authority reserve <sub_authority> (same owner)', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'authority', 'reserve', testSubAuthorityName]);
|
const result = spawnSync('laconic', ['cns', 'authority', 'reserve', testSubAuthorityName]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
|
|
||||||
// Check updated authority
|
// Check updated authority
|
||||||
const authorityResult = spawnSync('laconic', ['registry', 'authority', 'whois', testSubAuthorityName]);
|
const authorityResult = spawnSync('laconic', ['cns', 'authority', 'whois', testSubAuthorityName]);
|
||||||
const authorityOutputObj = checkResultAndRetrieveOutput(authorityResult);
|
const authorityOutputObj = checkResultAndRetrieveOutput(authorityResult);
|
||||||
|
|
||||||
// Expected authority (active with bond)
|
// Expected authority (active with bond)
|
||||||
@ -487,15 +461,15 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(authorityOutputObj[0]).toMatchObject(expectedAuthority);
|
expect(authorityOutputObj[0]).toMatchObject(expectedAuthority);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry authority reserve <sub_authority> --owner <owner_address> (different owner)', async () => {
|
test('laconic cns authority reserve <sub_authority> --owner <owner_address> (different owner)', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'authority', 'reserve', testSubAuthorityName2, '--owner', testAccount2]);
|
const result = spawnSync('laconic', ['cns', 'authority', 'reserve', testSubAuthorityName2, '--owner', testAccount2]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
|
|
||||||
// Check updated authority
|
// Check updated authority
|
||||||
const authorityResult = spawnSync('laconic', ['registry', 'authority', 'whois', testSubAuthorityName2]);
|
const authorityResult = spawnSync('laconic', ['cns', 'authority', 'whois', testSubAuthorityName2]);
|
||||||
const authorityOutputObj = checkResultAndRetrieveOutput(authorityResult);
|
const authorityOutputObj = checkResultAndRetrieveOutput(authorityResult);
|
||||||
|
|
||||||
// Expected authority (active with bond)
|
// Expected authority (active with bond)
|
||||||
@ -504,62 +478,21 @@ 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', () => {
|
||||||
const testName = 'lrn://laconic/watcher/erc20';
|
const testName = 'crn://laconic/watcher/erc20';
|
||||||
|
|
||||||
test('laconic registry name set <name> <record_id>', async () => {
|
test('laconic cns name set <name> <record_id>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'name', 'set', testName, testRecordId]);
|
const result = spawnSync('laconic', ['cns', 'name', 'set', testName, testRecordId]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry name lookup <name>', async () => {
|
test('laconic cns name lookup <name>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'name', 'lookup', testName]);
|
const result = spawnSync('laconic', ['cns', 'name', 'lookup', testName]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
@ -567,8 +500,8 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(outputObj[0]).toMatchObject({ latest: { id: testRecordId } });
|
expect(outputObj[0]).toMatchObject({ latest: { id: testRecordId } });
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry name resolve <name>', async () => {
|
test('laconic cns name resolve <name>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'name', 'resolve', testName]);
|
const result = spawnSync('laconic', ['cns', 'name', 'resolve', testName]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected resolved record
|
// Expected resolved record
|
||||||
@ -578,391 +511,18 @@ describe('Test laconic CLI commands', () => {
|
|||||||
expect(outputObj[0]).toMatchObject(expectedRecord);
|
expect(outputObj[0]).toMatchObject(expectedRecord);
|
||||||
});
|
});
|
||||||
|
|
||||||
test('laconic registry name delete <name>', async () => {
|
test('laconic cns name delete <name>', async () => {
|
||||||
const result = spawnSync('laconic', ['registry', 'name', 'delete', testName]);
|
const result = spawnSync('laconic', ['cns', 'name', 'delete', testName]);
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
const outputObj = checkResultAndRetrieveOutput(result);
|
||||||
|
|
||||||
// Expected output
|
// Expected output
|
||||||
expect(outputObj).toEqual({ success: true });
|
expect(outputObj).toEqual({ success: true });
|
||||||
|
|
||||||
// Check that name doesn't resolve
|
// Check that name doesn't resolve
|
||||||
const resolveResult = spawnSync('laconic', ['registry', 'name', 'resolve', testName]);
|
const resolveResult = spawnSync('laconic', ['cns', 'name', 'resolve', testName]);
|
||||||
const resolveOutputObj = checkResultAndRetrieveOutput(resolveResult);
|
const resolveOutputObj = checkResultAndRetrieveOutput(resolveResult);
|
||||||
expect(resolveOutputObj.length).toEqual(0);
|
expect(resolveOutputObj.length).toEqual(0);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('Vickrey Auction operations', () => {
|
|
||||||
const commitFee = 1000;
|
|
||||||
const revealFee = 1000;
|
|
||||||
const minimumBid = 100000;
|
|
||||||
|
|
||||||
const bidAmount = 25000000;
|
|
||||||
let bidRevealFilePath: string;
|
|
||||||
|
|
||||||
test('laconic registry auction create --kind <kind> --commits-duration <commits_duration> --reveals-duration <reveals_duration> --denom <denom> --commit-fee <commit_fee> --reveal-fee <reveal_fee> --minimum-bid <minimum_bid>', async () => {
|
|
||||||
const createAuctionResult = spawnSync('laconic', [
|
|
||||||
'registry',
|
|
||||||
'auction',
|
|
||||||
'create',
|
|
||||||
'--kind', AUCTION_KIND_VICKREY,
|
|
||||||
'--commits-duration', AUCTION_COMMIT_DURATION.toString(),
|
|
||||||
'--reveals-duration', AUCTION_REVEAL_DURATION.toString(),
|
|
||||||
'--denom', TOKEN_TYPE,
|
|
||||||
'--commit-fee', commitFee.toString(),
|
|
||||||
'--reveal-fee', revealFee.toString(),
|
|
||||||
'--minimum-bid', minimumBid.toString()
|
|
||||||
]);
|
|
||||||
const outputObj = checkResultAndRetrieveOutput(createAuctionResult);
|
|
||||||
|
|
||||||
expect(outputObj).toHaveProperty('auctionId');
|
|
||||||
|
|
||||||
testAuctionId = outputObj.auctionId;
|
|
||||||
const getAuctionResult = spawnSync('laconic', ['registry', 'auction', 'get', '--id', testAuctionId]);
|
|
||||||
const auctionOutputObj = checkResultAndRetrieveOutput(getAuctionResult);
|
|
||||||
|
|
||||||
const expectedAuctionObjPartial = {
|
|
||||||
kind: AUCTION_KIND_VICKREY,
|
|
||||||
status: AUCTION_STATUS.COMMIT,
|
|
||||||
ownerAddress: testAccount,
|
|
||||||
commitFee: { quantity: commitFee },
|
|
||||||
revealFee: { quantity: revealFee },
|
|
||||||
minimumBid: { quantity: minimumBid },
|
|
||||||
winnerAddresses: [],
|
|
||||||
winnerBids: [],
|
|
||||||
maxPrice: { quantity: 0 },
|
|
||||||
numProviders: 0,
|
|
||||||
bids: []
|
|
||||||
};
|
|
||||||
expect(auctionOutputObj[0]).toMatchObject(expectedAuctionObjPartial);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('laconic registry auction bid commit <auction_id> <quantity> <type>', async () => {
|
|
||||||
const result = spawnSync('laconic', ['registry', 'auction', 'bid', 'commit', testAuctionId, bidAmount.toString(), TOKEN_TYPE]);
|
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
|
||||||
|
|
||||||
// Expected output
|
|
||||||
expect(outputObj.reveal_file).toBeDefined();
|
|
||||||
|
|
||||||
bidRevealFilePath = outputObj.reveal_file;
|
|
||||||
});
|
|
||||||
|
|
||||||
test('laconic registry auction bid reveal <auction_id> <file_path>', async () => {
|
|
||||||
// Wait for auction commits duration (60s)
|
|
||||||
await delay(AUCTION_COMMIT_DURATION * 1000);
|
|
||||||
|
|
||||||
let auctionResult = spawnSync('laconic', ['registry', 'auction', 'get', testAuctionId]);
|
|
||||||
let auctionOutputObj = checkResultAndRetrieveOutput(auctionResult);
|
|
||||||
|
|
||||||
const expectedAuctionObjPartial = {
|
|
||||||
status: AUCTION_STATUS.REVEAL,
|
|
||||||
ownerAddress: testAccount,
|
|
||||||
winnerAddresses: [],
|
|
||||||
winnerBids: [],
|
|
||||||
bids: [{
|
|
||||||
bidderAddress: testAccount,
|
|
||||||
status: AUCTION_STATUS.COMMIT,
|
|
||||||
bidAmount: { quantity: 0 }
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
expect(auctionOutputObj[0]).toMatchObject(expectedAuctionObjPartial);
|
|
||||||
|
|
||||||
// Reveal bid
|
|
||||||
const result = spawnSync('laconic', ['registry', 'auction', 'bid', 'reveal', testAuctionId, bidRevealFilePath]);
|
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
|
||||||
|
|
||||||
// Expected output
|
|
||||||
expect(outputObj).toEqual({ success: true });
|
|
||||||
|
|
||||||
const revealObject = JSON.parse(fs.readFileSync(bidRevealFilePath, 'utf8'));
|
|
||||||
expect(revealObject).toMatchObject({
|
|
||||||
chainId: CHAIN_ID,
|
|
||||||
auctionId: testAuctionId,
|
|
||||||
bidderAddress: testAccount,
|
|
||||||
bidAmount: `${bidAmount}${TOKEN_TYPE}`
|
|
||||||
});
|
|
||||||
|
|
||||||
// Get auction with revealed bid
|
|
||||||
auctionResult = spawnSync('laconic', ['registry', 'auction', 'get', testAuctionId]);
|
|
||||||
auctionOutputObj = checkResultAndRetrieveOutput(auctionResult);
|
|
||||||
|
|
||||||
const expectedAuctionObjPartialOnBidReveal = {
|
|
||||||
status: AUCTION_STATUS.REVEAL,
|
|
||||||
winnerAddresses: [],
|
|
||||||
bids: [{
|
|
||||||
bidderAddress: testAccount,
|
|
||||||
status: AUCTION_STATUS.REVEAL,
|
|
||||||
bidAmount: { quantity: bidAmount }
|
|
||||||
}]
|
|
||||||
};
|
|
||||||
expect(auctionOutputObj[0]).toMatchObject(expectedAuctionObjPartialOnBidReveal);
|
|
||||||
}, (AUCTION_COMMIT_DURATION + 5) * 1000);
|
|
||||||
|
|
||||||
test('laconic registry auction get <auction_id>', async () => {
|
|
||||||
// Wait for auction reveals duration (60s)
|
|
||||||
await delay(AUCTION_REVEAL_DURATION * 1000);
|
|
||||||
|
|
||||||
const auctionResult = spawnSync('laconic', ['registry', 'auction', 'get', testAuctionId]);
|
|
||||||
const auctionOutputObj = checkResultAndRetrieveOutput(auctionResult);
|
|
||||||
|
|
||||||
const expectedAuctionObjPartial = {
|
|
||||||
status: AUCTION_STATUS.COMPLETED,
|
|
||||||
ownerAddress: testAccount,
|
|
||||||
winnerAddresses: [testAccount],
|
|
||||||
winnerBids: [{ quantity: bidAmount }],
|
|
||||||
winnerPrice: { quantity: bidAmount }
|
|
||||||
};
|
|
||||||
expect(auctionOutputObj[0]).toMatchObject(expectedAuctionObjPartial);
|
|
||||||
}, (AUCTION_COMMIT_DURATION + 5) * 1000);
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('Provider Auction operations', () => {
|
|
||||||
const txFees = getFeesConfig();
|
|
||||||
|
|
||||||
const commitFee = 1000;
|
|
||||||
const revealFee = 1000;
|
|
||||||
const maxPrice = 1000000;
|
|
||||||
const numProviders = 2;
|
|
||||||
const bidderInitialBlanace = 1000000000;
|
|
||||||
testAuctionId = '5e9dd5501e965f25db4fa62635d0ce5f6c59d73ab1a2ea999f8c5bf2f6fb6350';
|
|
||||||
|
|
||||||
const bidderAccounts = [
|
|
||||||
{
|
|
||||||
privateKey: 'f40f8e2c9ba70595b6d1cf3bcc47ba539e7d6ad2bcdb16e26c1e369378fd5a55',
|
|
||||||
address: 'laconic13cd6ntlcf5y0zmafg6wf96y6vsnq46xagpmjtc',
|
|
||||||
bidAmount: 25000
|
|
||||||
},
|
|
||||||
{
|
|
||||||
privateKey: '2c70e81c285e12f196837911aa258b11dff7e4189fc0f11e28cb228956807881',
|
|
||||||
address: 'laconic15x7sw49w3x2pahjlr48hunp5gpr7hm54eg3f8h',
|
|
||||||
bidAmount: 25300
|
|
||||||
},
|
|
||||||
{
|
|
||||||
privateKey: '1d3a47900e1a5980b171419ac700e779330bc0f85389a4113ff608ca314e25bb',
|
|
||||||
address: 'laconic1lkgay8ejvcwmngj3jua2ancdxxkukecz7hty89',
|
|
||||||
bidAmount: 25200
|
|
||||||
}
|
|
||||||
];
|
|
||||||
const winnerAccounts = [bidderAccounts[0], bidderAccounts[2]];
|
|
||||||
const winnerPrice = bidderAccounts[2].bidAmount;
|
|
||||||
|
|
||||||
const bidRevealFilePaths: string[] = [];
|
|
||||||
|
|
||||||
beforeAll(() => {
|
|
||||||
// Fund all bidder accounts
|
|
||||||
bidderAccounts.forEach(account => {
|
|
||||||
spawnSync('laconic', ['registry', 'tokens', 'send', '--address', account.address, '--type', TOKEN_TYPE, '--quantity', bidderInitialBlanace.toString()]);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
test('laconic registry auction create --kind <kind> --commits-duration <commits_duration> --reveals-duration <reveals_duration> --denom <denom> --commit-fee <commit_fee> --reveal-fee <reveal_fee> --max-price <max_price> --num-providers <num_providers>', async () => {
|
|
||||||
const createAuctionResult = spawnSync('laconic', [
|
|
||||||
'registry',
|
|
||||||
'auction',
|
|
||||||
'create',
|
|
||||||
'--kind', AUCTION_KIND_PROVIDER,
|
|
||||||
'--commits-duration', AUCTION_COMMIT_DURATION.toString(),
|
|
||||||
'--reveals-duration', AUCTION_REVEAL_DURATION.toString(),
|
|
||||||
'--denom', TOKEN_TYPE,
|
|
||||||
'--commit-fee', commitFee.toString(),
|
|
||||||
'--reveal-fee', revealFee.toString(),
|
|
||||||
'--max-price', maxPrice.toString(),
|
|
||||||
'--num-providers', numProviders.toString()
|
|
||||||
]);
|
|
||||||
|
|
||||||
const outputObj = checkResultAndRetrieveOutput(createAuctionResult);
|
|
||||||
|
|
||||||
expect(outputObj).toHaveProperty('auctionId');
|
|
||||||
|
|
||||||
testAuctionId = outputObj.auctionId;
|
|
||||||
const getAuctionResult = spawnSync('laconic', ['registry', 'auction', 'get', '--id', testAuctionId]);
|
|
||||||
const auctionOutputObj = checkResultAndRetrieveOutput(getAuctionResult);
|
|
||||||
|
|
||||||
const expectedAuctionObjPartial = {
|
|
||||||
kind: AUCTION_KIND_PROVIDER,
|
|
||||||
status: AUCTION_STATUS.COMMIT,
|
|
||||||
ownerAddress: testAccount,
|
|
||||||
commitFee: { quantity: commitFee },
|
|
||||||
revealFee: { quantity: revealFee },
|
|
||||||
minimumBid: { quantity: 0 },
|
|
||||||
winnerAddresses: [],
|
|
||||||
winnerBids: [],
|
|
||||||
maxPrice: { quantity: maxPrice },
|
|
||||||
numProviders: numProviders,
|
|
||||||
bids: []
|
|
||||||
};
|
|
||||||
expect(auctionOutputObj[0]).toMatchObject(expectedAuctionObjPartial);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('laconic registry auction bid commit <auction_id> <quantity> <type>', async () => {
|
|
||||||
for (const bidderAccount of bidderAccounts) {
|
|
||||||
const result = spawnSync('laconic', ['registry', 'auction', 'bid', 'commit', testAuctionId, bidderAccount.bidAmount.toString(), TOKEN_TYPE, '--txKey', bidderAccount.privateKey]);
|
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
|
||||||
|
|
||||||
// Expected output
|
|
||||||
expect(outputObj.reveal_file).toBeDefined();
|
|
||||||
|
|
||||||
bidRevealFilePaths.push(outputObj.reveal_file);
|
|
||||||
}
|
|
||||||
|
|
||||||
const auctionResult = spawnSync('laconic', ['registry', 'auction', 'get', testAuctionId]);
|
|
||||||
const auctionOutputObj = checkResultAndRetrieveOutput(auctionResult);
|
|
||||||
|
|
||||||
const expectedBids = bidderAccounts.map(account => ({
|
|
||||||
bidderAddress: account.address,
|
|
||||||
status: AUCTION_STATUS.COMMIT,
|
|
||||||
bidAmount: { quantity: 0 }
|
|
||||||
}));
|
|
||||||
const expectedAuctionObjPartial = {
|
|
||||||
status: AUCTION_STATUS.COMMIT,
|
|
||||||
ownerAddress: testAccount,
|
|
||||||
winnerAddresses: [],
|
|
||||||
winnerBids: [],
|
|
||||||
bids: expectedBids
|
|
||||||
};
|
|
||||||
expect(auctionOutputObj[0]).toMatchObject(expectedAuctionObjPartial);
|
|
||||||
});
|
|
||||||
|
|
||||||
test('laconic registry auction bid reveal <auction_id> <file_path>', async () => {
|
|
||||||
// Wait for auction commits duration (60s)
|
|
||||||
await delay(AUCTION_COMMIT_DURATION * 1000);
|
|
||||||
|
|
||||||
// Reveal bid
|
|
||||||
for (let i = 0; i < bidderAccounts.length; i++) {
|
|
||||||
const result = spawnSync('laconic', ['registry', 'auction', 'bid', 'reveal', testAuctionId, bidRevealFilePaths[i], '--txKey', bidderAccounts[i].privateKey]);
|
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
|
||||||
|
|
||||||
// Expected output
|
|
||||||
expect(outputObj).toEqual({ success: true });
|
|
||||||
|
|
||||||
const revealObject = JSON.parse(fs.readFileSync(bidRevealFilePaths[i], 'utf8'));
|
|
||||||
expect(revealObject).toMatchObject({
|
|
||||||
chainId: CHAIN_ID,
|
|
||||||
auctionId: testAuctionId,
|
|
||||||
bidderAddress: bidderAccounts[i].address,
|
|
||||||
bidAmount: `${bidderAccounts[i].bidAmount}${TOKEN_TYPE}`
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
// Get auction with revealed bid
|
|
||||||
const auctionResult = spawnSync('laconic', ['registry', 'auction', 'get', testAuctionId]);
|
|
||||||
const auctionOutputObj = checkResultAndRetrieveOutput(auctionResult);
|
|
||||||
|
|
||||||
const expectedBids = bidderAccounts.map(account => ({
|
|
||||||
bidderAddress: account.address,
|
|
||||||
status: AUCTION_STATUS.REVEAL,
|
|
||||||
bidAmount: { quantity: account.bidAmount }
|
|
||||||
}));
|
|
||||||
const expectedAuctionObjPartialOnBidReveal = {
|
|
||||||
status: AUCTION_STATUS.REVEAL,
|
|
||||||
winnerAddresses: [],
|
|
||||||
bids: expectedBids
|
|
||||||
};
|
|
||||||
expect(auctionOutputObj[0]).toMatchObject(expectedAuctionObjPartialOnBidReveal);
|
|
||||||
}, (AUCTION_COMMIT_DURATION + 60) * 1000);
|
|
||||||
|
|
||||||
test('laconic registry auction get <auction_id>', async () => {
|
|
||||||
// Wait for auction reveals duration (60s)
|
|
||||||
await delay(AUCTION_REVEAL_DURATION * 1000);
|
|
||||||
|
|
||||||
const auctionResult = spawnSync('laconic', ['registry', 'auction', 'get', testAuctionId]);
|
|
||||||
const auctionOutputObj = checkResultAndRetrieveOutput(auctionResult);
|
|
||||||
|
|
||||||
const expectedWinnerAddresses = winnerAccounts.map(account => account.address);
|
|
||||||
const expectedWinnerBids = winnerAccounts.map(account => ({ quantity: account.bidAmount }));
|
|
||||||
|
|
||||||
const expectedAuctionObjPartial = {
|
|
||||||
status: AUCTION_STATUS.COMPLETED,
|
|
||||||
ownerAddress: testAccount,
|
|
||||||
winnerAddresses: expectedWinnerAddresses,
|
|
||||||
winnerBids: expectedWinnerBids,
|
|
||||||
winnerPrice: { quantity: winnerPrice },
|
|
||||||
fundsReleased: false
|
|
||||||
};
|
|
||||||
expect(auctionOutputObj[0]).toMatchObject(expectedAuctionObjPartial);
|
|
||||||
}, (AUCTION_REVEAL_DURATION + 5) * 1000);
|
|
||||||
|
|
||||||
test('laconic registry auction release-funds <auction_id>', async () => {
|
|
||||||
const result = spawnSync('laconic', ['registry', 'auction', 'release-funds', testAuctionId]);
|
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
|
||||||
|
|
||||||
expect(outputObj).toEqual({ success: true });
|
|
||||||
|
|
||||||
const auctionResult = spawnSync('laconic', ['registry', 'auction', 'get', testAuctionId]);
|
|
||||||
const auctionOutputObj = checkResultAndRetrieveOutput(auctionResult);
|
|
||||||
|
|
||||||
const expectedAuctionObjPartial = {
|
|
||||||
status: AUCTION_STATUS.COMPLETED,
|
|
||||||
ownerAddress: testAccount,
|
|
||||||
fundsReleased: true
|
|
||||||
};
|
|
||||||
expect(auctionOutputObj[0]).toMatchObject(expectedAuctionObjPartial);
|
|
||||||
|
|
||||||
const expectedBalances = [
|
|
||||||
bidderInitialBlanace - (commitFee) - (2 * txFees) + winnerPrice,
|
|
||||||
bidderInitialBlanace - (commitFee) - (2 * txFees),
|
|
||||||
bidderInitialBlanace - (commitFee) - (2 * txFees) + winnerPrice
|
|
||||||
];
|
|
||||||
|
|
||||||
for (let i = 0; i < bidderAccounts.length; i++) {
|
|
||||||
const result = spawnSync('laconic', ['registry', 'account', 'get', '--address', bidderAccounts[i].address]);
|
|
||||||
const outputObj = checkResultAndRetrieveOutput(result);
|
|
||||||
|
|
||||||
// Expected account
|
|
||||||
const expectedAccount = getAccountObj({ address: bidderAccounts[i].address, balance: expectedBalances[i] });
|
|
||||||
|
|
||||||
expect(outputObj.length).toEqual(1);
|
|
||||||
expect(outputObj[0]).toMatchObject(expectedAccount);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
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,22 +1,9 @@
|
|||||||
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 { Arguments } from 'yargs';
|
|
||||||
|
|
||||||
import { StdFee } from '@cosmjs/stargate';
|
|
||||||
|
|
||||||
import { getConfig, getGasAndFees } 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 = 'aphoton';
|
||||||
export const CONFIG_FILE = 'config.yml';
|
|
||||||
|
|
||||||
export enum AUCTION_STATUS {
|
|
||||||
COMMIT = 'commit',
|
|
||||||
REVEAL = 'reveal',
|
|
||||||
COMPLETED = 'completed'
|
|
||||||
}
|
|
||||||
|
|
||||||
export const AUCTION_FEES = {
|
export const AUCTION_FEES = {
|
||||||
commit: 1000000,
|
commit: 1000000,
|
||||||
@ -27,10 +14,6 @@ export const AUCTION_COMMIT_DURATION = 60; // 60s
|
|||||||
export const AUCTION_REVEAL_DURATION = 60; // 60s
|
export const AUCTION_REVEAL_DURATION = 60; // 60s
|
||||||
|
|
||||||
export function checkResultAndRetrieveOutput (result: SpawnSyncReturns<Buffer>): any {
|
export function checkResultAndRetrieveOutput (result: SpawnSyncReturns<Buffer>): any {
|
||||||
if (result.status !== 0) {
|
|
||||||
console.log('stderr', result.stderr.toString().trim());
|
|
||||||
}
|
|
||||||
|
|
||||||
expect(result.status).toBe(0);
|
expect(result.status).toBe(0);
|
||||||
|
|
||||||
const errorOutput = result.stderr.toString().trim();
|
const errorOutput = result.stderr.toString().trim();
|
||||||
@ -38,11 +21,12 @@ export function checkResultAndRetrieveOutput (result: SpawnSyncReturns<Buffer>):
|
|||||||
|
|
||||||
const output = result.stdout.toString().trim();
|
const output = result.stdout.toString().trim();
|
||||||
expect(output.length).toBeGreaterThan(0);
|
expect(output.length).toBeGreaterThan(0);
|
||||||
|
|
||||||
return JSON.parse(output);
|
return JSON.parse(output);
|
||||||
}
|
}
|
||||||
|
|
||||||
export function createBond (quantity: number): { bondId: string } {
|
export function createBond (quantity: number): { bondId: string } {
|
||||||
const result = spawnSync('laconic', ['registry', 'bond', 'create', '--type', TOKEN_TYPE, '--quantity', quantity.toString(), '--gas', '200000', '--fees', `200000${TOKEN_TYPE}`]);
|
const result = spawnSync('laconic', ['cns', 'bond', 'create', '--type', TOKEN_TYPE, '--quantity', quantity.toString(), '--gas', '200000', '--fees', `200000${TOKEN_TYPE}`]);
|
||||||
const output = result.stdout.toString().trim();
|
const output = result.stdout.toString().trim();
|
||||||
|
|
||||||
return JSON.parse(output);
|
return JSON.parse(output);
|
||||||
@ -109,8 +93,7 @@ export function getAuctionObj (params: { owner: string, status?: string }): any
|
|||||||
type: TOKEN_TYPE,
|
type: TOKEN_TYPE,
|
||||||
quantity: AUCTION_FEES.minimumBid
|
quantity: AUCTION_FEES.minimumBid
|
||||||
},
|
},
|
||||||
winnerAddresses: [],
|
winnerAddress: ''
|
||||||
winnerBids: []
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -136,38 +119,3 @@ 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 getFeesConfig (): number {
|
|
||||||
const { services: { registry: registryConfig } } = getConfig(CONFIG_FILE);
|
|
||||||
const fee = getGasAndFees({} as Arguments, registryConfig);
|
|
||||||
return Number((fee as StdFee).amount[0].amount);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function updateGasAndFeesConfig (gas?: string | null, fees?: string | null, gasPrice?: string | null): void {
|
|
||||||
const config = getConfig(path.resolve(CONFIG_FILE));
|
|
||||||
|
|
||||||
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(CONFIG_FILE, yaml.dump(config), 'utf8');
|
|
||||||
} catch (e) {
|
|
||||||
console.error('Error writing config file:', e);
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
@ -1,34 +1,33 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
set -e
|
set -e
|
||||||
set -u
|
|
||||||
|
|
||||||
# Wait for the laconid endpoint to come up
|
# Wait for the laconid endpoint to come up
|
||||||
docker compose exec laconicd sh -c "curl --retry 10 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
|
docker compose exec laconicd sh -c "curl --retry 20 --retry-delay 3 --retry-connrefused http://127.0.0.1:9473/api"
|
||||||
|
|
||||||
# Get the key from laconicd
|
# Get the key from laconicd
|
||||||
laconicd_key=$(yes | docker compose exec laconicd laconicd keys export alice --keyring-backend test --unarmored-hex --unsafe)
|
laconicd_key=$(yes | docker compose exec laconicd laconicd keys export mykey --unarmored-hex --unsafe)
|
||||||
|
|
||||||
# Get the fixturenet account address
|
# Get the fixturenet account address
|
||||||
laconicd_account_address=$(docker compose exec laconicd laconicd keys list --keyring-backend test | awk '/- address:/ {print $3}')
|
laconicd_account_address=$(docker compose exec laconicd laconicd keys list | awk '/- address:/ {print $3}')
|
||||||
|
|
||||||
# Set parameters for the test suite
|
# Set parameters for the test suite
|
||||||
cosmos_chain_id=laconic_9000-1
|
cosmos_chain_id=laconic_9000-1
|
||||||
laconicd_rpc_endpoint=http://127.0.0.1:26657
|
laconicd_rest_endpoint=http://127.0.0.1:1317
|
||||||
laconicd_gql_endpoint=http://127.0.0.1:9473/api
|
laconicd_gql_endpoint=http://127.0.0.1:9473/api
|
||||||
|
|
||||||
# Create the required config
|
# Create the required config
|
||||||
config_file="config.yml"
|
config_file="config.yml"
|
||||||
config=$(cat <<EOL
|
config=$(cat <<EOL
|
||||||
services:
|
services:
|
||||||
registry:
|
cns:
|
||||||
rpcEndpoint: $laconicd_rpc_endpoint
|
restEndpoint: $laconicd_rest_endpoint
|
||||||
gqlEndpoint: $laconicd_gql_endpoint
|
gqlEndpoint: $laconicd_gql_endpoint
|
||||||
userKey: $laconicd_key
|
userKey: $laconicd_key
|
||||||
bondId:
|
bondId:
|
||||||
chainId: $cosmos_chain_id
|
chainId: $cosmos_chain_id
|
||||||
gas: 200000
|
gas: 200000
|
||||||
fees: 200000alnt
|
fees: 200000aphoton
|
||||||
EOL
|
EOL
|
||||||
)
|
)
|
||||||
echo "$config" > "$config_file"
|
echo "$config" > "$config_file"
|
||||||
|
@ -30,10 +30,7 @@
|
|||||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||||
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
// "rootDirs": [], /* Allow multiple folders to be treated as one when resolving modules. */
|
||||||
"typeRoots": [
|
// "typeRoots": [], /* Specify multiple folders that act like `./node_modules/@types`. */
|
||||||
"node_modules/@types",
|
|
||||||
"src/types"
|
|
||||||
],
|
|
||||||
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
// "types": [], /* Specify type package names to be included without being referenced in a source file. */
|
||||||
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
// "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */
|
||||||
// "resolveJsonModule": true, /* Enable importing .json files */
|
// "resolveJsonModule": true, /* Enable importing .json files */
|
||||||
|
576
yarn.lock
576
yarn.lock
@ -302,18 +302,14 @@
|
|||||||
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.11":
|
"@cerc-io/laconic-sdk@^0.1.16":
|
||||||
version "0.2.11"
|
version "0.1.16"
|
||||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fregistry-sdk/-/0.2.11/registry-sdk-0.2.11.tgz#019b792c68f440f2cfca5af2f49e1205bb33ba72"
|
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Flaconic-sdk/-/0.1.16/laconic-sdk-0.1.16.tgz#53f12a32f156a177987f89e727eb5f16743df7db"
|
||||||
integrity sha512-IipqJzaBQEXMNH6yWFG2E/o0U6IAXw35PBMHx6QIboVu/sMNLIsWy1P8MmR8C8xYsmHOhgXLsC4hYSeFMXrqFw==
|
integrity sha512-wu6k711qHPxowgyzAmjxz8i/ZTGxW+4sHf9WQ+0hW/E9PlR3Gn8OIsN3J8tvY45wvNdKKR3bm+7w/byyYLRF9A==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@cosmjs/amino" "^0.28.1"
|
"@cosmjs/amino" "^0.28.1"
|
||||||
"@cosmjs/crypto" "^0.28.1"
|
"@cosmjs/crypto" "^0.28.1"
|
||||||
"@cosmjs/encoding" "^0.28.1"
|
"@cosmjs/encoding" "^0.28.1"
|
||||||
"@cosmjs/launchpad" "^0.27.1"
|
|
||||||
"@cosmjs/proto-signing" "^0.32.2"
|
|
||||||
"@cosmjs/stargate" "^0.32.2"
|
|
||||||
"@cosmjs/tendermint-rpc" "^0.32.2"
|
|
||||||
"@ipld/dag-cbor" "^7.0.1"
|
"@ipld/dag-cbor" "^7.0.1"
|
||||||
"@ipld/dag-json" "^8.0.9"
|
"@ipld/dag-json" "^8.0.9"
|
||||||
"@metamask/eth-sig-util" "^4.0.0"
|
"@metamask/eth-sig-util" "^4.0.0"
|
||||||
@ -327,9 +323,11 @@
|
|||||||
bip39 "^3.0.4"
|
bip39 "^3.0.4"
|
||||||
canonical-json "^0.0.4"
|
canonical-json "^0.0.4"
|
||||||
ethers "^5.6.2"
|
ethers "^5.6.2"
|
||||||
|
evmosjs "^0.2.5"
|
||||||
graphql.js "^0.6.8"
|
graphql.js "^0.6.8"
|
||||||
js-sha256 "^0.9.0"
|
js-sha256 "^0.9.0"
|
||||||
js-yaml "^3.14.1"
|
js-yaml "^3.14.1"
|
||||||
|
jsonschema "^1.4.0"
|
||||||
lodash "^4.17.21"
|
lodash "^4.17.21"
|
||||||
multiformats "^9.5.4"
|
multiformats "^9.5.4"
|
||||||
node-yaml "^4.0.1"
|
node-yaml "^4.0.1"
|
||||||
@ -337,24 +335,6 @@
|
|||||||
semver "^7.3.5"
|
semver "^7.3.5"
|
||||||
tiny-secp256k1 "^1.1.6"
|
tiny-secp256k1 "^1.1.6"
|
||||||
|
|
||||||
"@confio/ics23@^0.6.8":
|
|
||||||
version "0.6.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/@confio/ics23/-/ics23-0.6.8.tgz#2a6b4f1f2b7b20a35d9a0745bb5a446e72930b3d"
|
|
||||||
integrity sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==
|
|
||||||
dependencies:
|
|
||||||
"@noble/hashes" "^1.0.0"
|
|
||||||
protobufjs "^6.8.8"
|
|
||||||
|
|
||||||
"@cosmjs/amino@0.27.1":
|
|
||||||
version "0.27.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.27.1.tgz#0910256b5aecd794420bb5f7319d98fc63252fa1"
|
|
||||||
integrity sha512-w56ar/nK9+qlvWDpBPRmD0Blk2wfkkLqRi1COs1x7Ll1LF0AtkIBUjbRKplENLbNovK0T3h+w8bHiFm+GBGQOA==
|
|
||||||
dependencies:
|
|
||||||
"@cosmjs/crypto" "0.27.1"
|
|
||||||
"@cosmjs/encoding" "0.27.1"
|
|
||||||
"@cosmjs/math" "0.27.1"
|
|
||||||
"@cosmjs/utils" "0.27.1"
|
|
||||||
|
|
||||||
"@cosmjs/amino@^0.28.1":
|
"@cosmjs/amino@^0.28.1":
|
||||||
version "0.28.4"
|
version "0.28.4"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.28.4.tgz#9315f6876dba80148cf715ced44d1dc7a9b68b94"
|
resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.28.4.tgz#9315f6876dba80148cf715ced44d1dc7a9b68b94"
|
||||||
@ -365,42 +345,6 @@
|
|||||||
"@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":
|
|
||||||
version "0.32.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.32.3.tgz#b81d4a2b8d61568431a1afcd871e1344a19d97ff"
|
|
||||||
integrity sha512-G4zXl+dJbqrz1sSJ56H/25l5NJEk/pAPIr8piAHgbXYw88OdAOlpA26PQvk2IbSN/rRgVbvlLTNgX2tzz1dyUA==
|
|
||||||
dependencies:
|
|
||||||
"@cosmjs/crypto" "^0.32.3"
|
|
||||||
"@cosmjs/encoding" "^0.32.3"
|
|
||||||
"@cosmjs/math" "^0.32.3"
|
|
||||||
"@cosmjs/utils" "^0.32.3"
|
|
||||||
|
|
||||||
"@cosmjs/crypto@0.27.1":
|
|
||||||
version "0.27.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.27.1.tgz#271c853089a3baf3acd6cf0b2122fd49f8815743"
|
|
||||||
integrity sha512-vbcxwSt99tIYJg8Spp00wc3zx72qx+pY3ozGuBN8gAvySnagK9dQ/jHwtWQWdammmdD6oW+75WfIHZ+gNa+Ybg==
|
|
||||||
dependencies:
|
|
||||||
"@cosmjs/encoding" "0.27.1"
|
|
||||||
"@cosmjs/math" "0.27.1"
|
|
||||||
"@cosmjs/utils" "0.27.1"
|
|
||||||
bip39 "^3.0.2"
|
|
||||||
bn.js "^5.2.0"
|
|
||||||
elliptic "^6.5.3"
|
|
||||||
js-sha3 "^0.8.0"
|
|
||||||
libsodium-wrappers "^0.7.6"
|
|
||||||
ripemd160 "^2.0.2"
|
|
||||||
sha.js "^2.4.11"
|
|
||||||
|
|
||||||
"@cosmjs/crypto@0.28.4", "@cosmjs/crypto@^0.28.1":
|
"@cosmjs/crypto@0.28.4", "@cosmjs/crypto@^0.28.1":
|
||||||
version "0.28.4"
|
version "0.28.4"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.28.4.tgz#b2f1ccb9edee7d357ed1dcd92bdb61f6a1ca06d3"
|
resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.28.4.tgz#b2f1ccb9edee7d357ed1dcd92bdb61f6a1ca06d3"
|
||||||
@ -414,41 +358,6 @@
|
|||||||
elliptic "^6.5.3"
|
elliptic "^6.5.3"
|
||||||
libsodium-wrappers "^0.7.6"
|
libsodium-wrappers "^0.7.6"
|
||||||
|
|
||||||
"@cosmjs/crypto@^0.32.3":
|
|
||||||
version "0.32.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.32.3.tgz#787f8e659709678722068ee1ddf379f65051a25e"
|
|
||||||
integrity sha512-niQOWJHUtlJm2GG4F00yGT7sGPKxfUwz+2qQ30uO/E3p58gOusTcH2qjiJNVxb8vScYJhFYFqpm/OA/mVqoUGQ==
|
|
||||||
dependencies:
|
|
||||||
"@cosmjs/encoding" "^0.32.3"
|
|
||||||
"@cosmjs/math" "^0.32.3"
|
|
||||||
"@cosmjs/utils" "^0.32.3"
|
|
||||||
"@noble/hashes" "^1"
|
|
||||||
bn.js "^5.2.0"
|
|
||||||
elliptic "^6.5.4"
|
|
||||||
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":
|
|
||||||
version "0.27.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.27.1.tgz#3cd5bc0af743485eb2578cdb08cfa84c86d610e1"
|
|
||||||
integrity sha512-rayLsA0ojHeniaRfWWcqSsrE/T1rl1gl0OXVNtXlPwLJifKBeLEefGbOUiAQaT0wgJ8VNGBazVtAZBpJidfDhw==
|
|
||||||
dependencies:
|
|
||||||
base64-js "^1.3.0"
|
|
||||||
bech32 "^1.1.4"
|
|
||||||
readonly-date "^1.0.0"
|
|
||||||
|
|
||||||
"@cosmjs/encoding@0.28.4", "@cosmjs/encoding@^0.28.1":
|
"@cosmjs/encoding@0.28.4", "@cosmjs/encoding@^0.28.1":
|
||||||
version "0.28.4"
|
version "0.28.4"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.28.4.tgz#ea39eb4c27ebf7b35e62e9898adae189b86d0da7"
|
resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.28.4.tgz#ea39eb4c27ebf7b35e62e9898adae189b86d0da7"
|
||||||
@ -458,52 +367,6 @@
|
|||||||
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":
|
|
||||||
version "0.32.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.32.3.tgz#e245ff511fe4a0df7ba427b5187aab69e3468e5b"
|
|
||||||
integrity sha512-p4KF7hhv8jBQX3MkB3Defuhz/W0l3PwWVYU2vkVuBJ13bJcXyhU9nJjiMkaIv+XP+W2QgRceqNNgFUC5chNR7w==
|
|
||||||
dependencies:
|
|
||||||
base64-js "^1.3.0"
|
|
||||||
bech32 "^1.1.4"
|
|
||||||
readonly-date "^1.0.0"
|
|
||||||
|
|
||||||
"@cosmjs/json-rpc@^0.32.3":
|
|
||||||
version "0.32.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.32.3.tgz#ccffdd7f722cecfab6daaa7463843b92f5d25355"
|
|
||||||
integrity sha512-JwFRWZa+Y95KrAG8CuEbPVOSnXO2uMSEBcaAB/FBU3Mo4jQnDoUjXvt3vwtFWxfAytrWCn1I4YDFaOAinnEG/Q==
|
|
||||||
dependencies:
|
|
||||||
"@cosmjs/stream" "^0.32.3"
|
|
||||||
xstream "^11.14.0"
|
|
||||||
|
|
||||||
"@cosmjs/launchpad@^0.27.1":
|
|
||||||
version "0.27.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/launchpad/-/launchpad-0.27.1.tgz#b6f1995748be96560f5f01e84d3ff907477dda77"
|
|
||||||
integrity sha512-DcFwGD/z5PK8CzO2sojDxa+Be9EIEtRZb2YawgVnw2Ht/p5FlNv+OVo8qlishpBdalXEN7FvQ1dVeDFEe9TuJw==
|
|
||||||
dependencies:
|
|
||||||
"@cosmjs/amino" "0.27.1"
|
|
||||||
"@cosmjs/crypto" "0.27.1"
|
|
||||||
"@cosmjs/encoding" "0.27.1"
|
|
||||||
"@cosmjs/math" "0.27.1"
|
|
||||||
"@cosmjs/utils" "0.27.1"
|
|
||||||
axios "^0.21.2"
|
|
||||||
fast-deep-equal "^3.1.3"
|
|
||||||
|
|
||||||
"@cosmjs/math@0.27.1":
|
|
||||||
version "0.27.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.27.1.tgz#be78857b008ffc6b1ed6fecaa1c4cd5bc38c07d7"
|
|
||||||
integrity sha512-cHWVjmfIjtRc7f80n7x+J5k8pe+vTVTQ0lA82tIxUgqUvgS6rogPP/TmGtTiZ4+NxWxd11DUISY6gVpr18/VNQ==
|
|
||||||
dependencies:
|
|
||||||
bn.js "^5.2.0"
|
|
||||||
|
|
||||||
"@cosmjs/math@0.28.4":
|
"@cosmjs/math@0.28.4":
|
||||||
version "0.28.4"
|
version "0.28.4"
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.28.4.tgz#ddc35b69fa1ffeaf5928f70d4c2faf9284627d84"
|
resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.28.4.tgz#ddc35b69fa1ffeaf5928f70d4c2faf9284627d84"
|
||||||
@ -511,115 +374,11 @@
|
|||||||
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":
|
|
||||||
version "0.32.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.32.3.tgz#16e4256f4da507b9352327da12ae64056a2ba6c9"
|
|
||||||
integrity sha512-amumUtZs8hCCnV+lSBaJIiZkGabQm22QGg/IotYrhcmoOEOjt82n7hMNlNXRs7V6WLMidGrGYcswB5zcmp0Meg==
|
|
||||||
dependencies:
|
|
||||||
bn.js "^5.2.0"
|
|
||||||
|
|
||||||
"@cosmjs/proto-signing@^0.32.2":
|
|
||||||
version "0.32.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.32.3.tgz#91ae149b747d18666a6ccc924165b306431f7c0d"
|
|
||||||
integrity sha512-kSZ0ZUY0DwcRT0NcIn2HkadH4NKlwjfZgbLj1ABwh/4l0RgeT84QCscZCu63tJYq3K6auwqTiZSZERwlO4/nbg==
|
|
||||||
dependencies:
|
|
||||||
"@cosmjs/amino" "^0.32.3"
|
|
||||||
"@cosmjs/crypto" "^0.32.3"
|
|
||||||
"@cosmjs/encoding" "^0.32.3"
|
|
||||||
"@cosmjs/math" "^0.32.3"
|
|
||||||
"@cosmjs/utils" "^0.32.3"
|
|
||||||
cosmjs-types "^0.9.0"
|
|
||||||
|
|
||||||
"@cosmjs/socket@^0.32.3":
|
|
||||||
version "0.32.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.32.3.tgz#fa5c36bf58e87c0ad865d6318ecb0f8d9c89a28a"
|
|
||||||
integrity sha512-F2WwNmaUPdZ4SsH6Uyreq3wQk7jpaEkb3wfOP951f5Jt6HCW/PxbxhKzHkAAf6+Sqks6SPhkbWoE8XaZpjL2KA==
|
|
||||||
dependencies:
|
|
||||||
"@cosmjs/stream" "^0.32.3"
|
|
||||||
isomorphic-ws "^4.0.1"
|
|
||||||
ws "^7"
|
|
||||||
xstream "^11.14.0"
|
|
||||||
|
|
||||||
"@cosmjs/stargate@^0.32.2":
|
|
||||||
version "0.32.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.32.2.tgz#73718c5c6a3ae138682ee9987333d911eca22a13"
|
|
||||||
integrity sha512-AsJa29fT7Jd4xt9Ai+HMqhyj7UQu7fyYKdXj/8+/9PD74xe6lZSYhQPcitUmMLJ1ckKPgXSk5Dd2LbsQT0IhZg==
|
|
||||||
dependencies:
|
|
||||||
"@confio/ics23" "^0.6.8"
|
|
||||||
"@cosmjs/amino" "^0.32.2"
|
|
||||||
"@cosmjs/encoding" "^0.32.2"
|
|
||||||
"@cosmjs/math" "^0.32.2"
|
|
||||||
"@cosmjs/proto-signing" "^0.32.2"
|
|
||||||
"@cosmjs/stream" "^0.32.2"
|
|
||||||
"@cosmjs/tendermint-rpc" "^0.32.2"
|
|
||||||
"@cosmjs/utils" "^0.32.2"
|
|
||||||
cosmjs-types "^0.9.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":
|
|
||||||
version "0.32.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.32.3.tgz#7522579aaf18025d322c2f33d6fb7573220395d6"
|
|
||||||
integrity sha512-J2zVWDojkynYifAUcRmVczzmp6STEpyiAARq0rSsviqjreGIfspfuws/8rmkPa6qQBZvpQOBQCm2HyZZwYplIw==
|
|
||||||
dependencies:
|
|
||||||
xstream "^11.14.0"
|
|
||||||
|
|
||||||
"@cosmjs/tendermint-rpc@^0.32.2":
|
|
||||||
version "0.32.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.32.3.tgz#f0406b9f0233e588fb924dca8c614972f9038aff"
|
|
||||||
integrity sha512-xeprW+VR9xKGstqZg0H/KBZoUp8/FfFyS9ljIUTLM/UINjP2MhiwncANPS2KScfJVepGufUKk0/phHUeIBSEkw==
|
|
||||||
dependencies:
|
|
||||||
"@cosmjs/crypto" "^0.32.3"
|
|
||||||
"@cosmjs/encoding" "^0.32.3"
|
|
||||||
"@cosmjs/json-rpc" "^0.32.3"
|
|
||||||
"@cosmjs/math" "^0.32.3"
|
|
||||||
"@cosmjs/socket" "^0.32.3"
|
|
||||||
"@cosmjs/stream" "^0.32.3"
|
|
||||||
"@cosmjs/utils" "^0.32.3"
|
|
||||||
axios "^1.6.0"
|
|
||||||
readonly-date "^1.0.0"
|
|
||||||
xstream "^11.14.0"
|
|
||||||
|
|
||||||
"@cosmjs/utils@0.27.1":
|
|
||||||
version "0.27.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.27.1.tgz#1c8efde17256346ef142a3bd15158ee4055470e2"
|
|
||||||
integrity sha512-VG7QPDiMUzVPxRdJahDV8PXxVdnuAHiIuG56hldV4yPnOz/si/DLNd7VAUUA5923b6jS1Hhev0Hr6AhEkcxBMg==
|
|
||||||
|
|
||||||
"@cosmjs/utils@0.28.4":
|
"@cosmjs/utils@0.28.4":
|
||||||
version "0.28.4"
|
version "0.28.4"
|
||||||
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":
|
|
||||||
version "0.32.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.32.3.tgz#5dcaee6dd7cc846cdc073e9a7a7f63242f5f7e31"
|
|
||||||
integrity sha512-WCZK4yksj2hBDz4w7xFZQTRZQ/RJhBX26uFHmmQFIcNUUVAihrLO+RerqJgk0dZqC42wstM9pEUQGtPmLcIYvg==
|
|
||||||
|
|
||||||
"@cspotcode/source-map-support@^0.8.0":
|
|
||||||
version "0.8.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz#00629c35a688e05a88b1cda684fb9d5e73f000a1"
|
|
||||||
integrity sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==
|
|
||||||
dependencies:
|
|
||||||
"@jridgewell/trace-mapping" "0.3.9"
|
|
||||||
|
|
||||||
"@eslint-community/eslint-utils@^4.2.0":
|
"@eslint-community/eslint-utils@^4.2.0":
|
||||||
version "4.4.0"
|
version "4.4.0"
|
||||||
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
|
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59"
|
||||||
@ -1244,11 +1003,6 @@
|
|||||||
"@jridgewell/sourcemap-codec" "^1.4.10"
|
"@jridgewell/sourcemap-codec" "^1.4.10"
|
||||||
"@jridgewell/trace-mapping" "^0.3.9"
|
"@jridgewell/trace-mapping" "^0.3.9"
|
||||||
|
|
||||||
"@jridgewell/resolve-uri@^3.0.3":
|
|
||||||
version "3.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz#7a0ee601f60f99a20c7c7c5ff0c80388c1189bd6"
|
|
||||||
integrity sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==
|
|
||||||
|
|
||||||
"@jridgewell/resolve-uri@^3.1.0":
|
"@jridgewell/resolve-uri@^3.1.0":
|
||||||
version "3.1.1"
|
version "3.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721"
|
resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.1.tgz#c08679063f279615a3326583ba3a90d1d82cc721"
|
||||||
@ -1264,14 +1018,6 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
|
resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32"
|
||||||
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
|
integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg==
|
||||||
|
|
||||||
"@jridgewell/trace-mapping@0.3.9":
|
|
||||||
version "0.3.9"
|
|
||||||
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz#6534fd5933a53ba7cbf3a17615e273a0d1273ff9"
|
|
||||||
integrity sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==
|
|
||||||
dependencies:
|
|
||||||
"@jridgewell/resolve-uri" "^3.0.3"
|
|
||||||
"@jridgewell/sourcemap-codec" "^1.4.10"
|
|
||||||
|
|
||||||
"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9":
|
"@jridgewell/trace-mapping@^0.3.12", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.18", "@jridgewell/trace-mapping@^0.3.9":
|
||||||
version "0.3.22"
|
version "0.3.22"
|
||||||
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c"
|
resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.22.tgz#72a621e5de59f5f1ef792d0793a82ee20f645e4c"
|
||||||
@ -1296,11 +1042,6 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.0.0.tgz#d5e38bfbdaba174805a4e649f13be9a9ed3351ae"
|
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.0.0.tgz#d5e38bfbdaba174805a4e649f13be9a9ed3351ae"
|
||||||
integrity sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==
|
integrity sha512-DZVbtY62kc3kkBtMHqwCOfXrT/hnoORy5BJ4+HU1IR59X0KWAOqsfzQPcUl/lQLlG7qXbe/fZ3r/emxtAl+sqg==
|
||||||
|
|
||||||
"@noble/hashes@^1.0.0", "@noble/hashes@^1.2.0":
|
|
||||||
version "1.4.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.4.0.tgz#45814aa329f30e4fe0ba49426f49dfccdd066426"
|
|
||||||
integrity sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==
|
|
||||||
|
|
||||||
"@nodelib/fs.scandir@2.1.5":
|
"@nodelib/fs.scandir@2.1.5":
|
||||||
version "2.1.5"
|
version "2.1.5"
|
||||||
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
|
resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5"
|
||||||
@ -1327,59 +1068,6 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@octetstream/promisify/-/promisify-2.0.2.tgz#29ac3bd7aefba646db670227f895d812c1a19615"
|
resolved "https://registry.yarnpkg.com/@octetstream/promisify/-/promisify-2.0.2.tgz#29ac3bd7aefba646db670227f895d812c1a19615"
|
||||||
integrity sha512-7XHoRB61hxsz8lBQrjC1tq/3OEIgpvGWg6DKAdwi7WRzruwkmsdwmOoUXbU4Dtd4RSOMDwed0SkP3y8UlMt1Bg==
|
integrity sha512-7XHoRB61hxsz8lBQrjC1tq/3OEIgpvGWg6DKAdwi7WRzruwkmsdwmOoUXbU4Dtd4RSOMDwed0SkP3y8UlMt1Bg==
|
||||||
|
|
||||||
"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2":
|
|
||||||
version "1.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf"
|
|
||||||
integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==
|
|
||||||
|
|
||||||
"@protobufjs/base64@^1.1.2":
|
|
||||||
version "1.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735"
|
|
||||||
integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==
|
|
||||||
|
|
||||||
"@protobufjs/codegen@^2.0.4":
|
|
||||||
version "2.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb"
|
|
||||||
integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==
|
|
||||||
|
|
||||||
"@protobufjs/eventemitter@^1.1.0":
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70"
|
|
||||||
integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==
|
|
||||||
|
|
||||||
"@protobufjs/fetch@^1.1.0":
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45"
|
|
||||||
integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==
|
|
||||||
dependencies:
|
|
||||||
"@protobufjs/aspromise" "^1.1.1"
|
|
||||||
"@protobufjs/inquire" "^1.1.0"
|
|
||||||
|
|
||||||
"@protobufjs/float@^1.0.2":
|
|
||||||
version "1.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1"
|
|
||||||
integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==
|
|
||||||
|
|
||||||
"@protobufjs/inquire@^1.1.0":
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089"
|
|
||||||
integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==
|
|
||||||
|
|
||||||
"@protobufjs/path@^1.1.2":
|
|
||||||
version "1.1.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d"
|
|
||||||
integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==
|
|
||||||
|
|
||||||
"@protobufjs/pool@^1.1.0":
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54"
|
|
||||||
integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==
|
|
||||||
|
|
||||||
"@protobufjs/utf8@^1.1.0":
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570"
|
|
||||||
integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==
|
|
||||||
|
|
||||||
"@sinclair/typebox@^0.27.8":
|
"@sinclair/typebox@^0.27.8":
|
||||||
version "0.27.8"
|
version "0.27.8"
|
||||||
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e"
|
resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.27.8.tgz#6667fac16c436b5434a387a34dedb013198f6e6e"
|
||||||
@ -1449,26 +1137,6 @@
|
|||||||
link-module-alias "^1.2.0"
|
link-module-alias "^1.2.0"
|
||||||
shx "^0.3.4"
|
shx "^0.3.4"
|
||||||
|
|
||||||
"@tsconfig/node10@^1.0.7":
|
|
||||||
version "1.0.11"
|
|
||||||
resolved "https://registry.yarnpkg.com/@tsconfig/node10/-/node10-1.0.11.tgz#6ee46400685f130e278128c7b38b7e031ff5b2f2"
|
|
||||||
integrity sha512-DcRjDCujK/kCk/cUe8Xz8ZSpm8mS3mNNpta+jGCA6USEDfktlNvm1+IuZ9eTcDbNk41BHwpHHeW+N1lKCz4zOw==
|
|
||||||
|
|
||||||
"@tsconfig/node12@^1.0.7":
|
|
||||||
version "1.0.11"
|
|
||||||
resolved "https://registry.yarnpkg.com/@tsconfig/node12/-/node12-1.0.11.tgz#ee3def1f27d9ed66dac6e46a295cffb0152e058d"
|
|
||||||
integrity sha512-cqefuRsh12pWyGsIoBKJA9luFu3mRxCA+ORZvA4ktLSzIuCUtWVxGIuXigEwO5/ywWFMZ2QEGKWvkZG1zDMTag==
|
|
||||||
|
|
||||||
"@tsconfig/node14@^1.0.0":
|
|
||||||
version "1.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/@tsconfig/node14/-/node14-1.0.3.tgz#e4386316284f00b98435bf40f72f75a09dabf6c1"
|
|
||||||
integrity sha512-ysT8mhdixWK6Hw3i1V2AeRqZ5WfXg1G43mqoYlM2nc6388Fq5jcXyr5mRsqViLx/GJYdoL0bfXD8nmF+Zn/Iow==
|
|
||||||
|
|
||||||
"@tsconfig/node16@^1.0.2":
|
|
||||||
version "1.0.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/@tsconfig/node16/-/node16-1.0.4.tgz#0b92dcc0cc1c81f6f306a381f28e31b1a56536e9"
|
|
||||||
integrity sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==
|
|
||||||
|
|
||||||
"@types/babel__core@^7.1.14":
|
"@types/babel__core@^7.1.14":
|
||||||
version "7.20.5"
|
version "7.20.5"
|
||||||
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017"
|
resolved "https://registry.yarnpkg.com/@types/babel__core/-/babel__core-7.20.5.tgz#3df15f27ba85319caa07ba08d0721889bb39c017"
|
||||||
@ -1575,11 +1243,6 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2"
|
resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.182.tgz#05301a4d5e62963227eaafe0ce04dd77c54ea5c2"
|
||||||
integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==
|
integrity sha512-/THyiqyQAP9AfARo4pF+aCGcyiQ94tX/Is2I7HofNRqoYLgN1PBoOWu2/zTA5zMxzP5EFutMtWtGAFRKUe961Q==
|
||||||
|
|
||||||
"@types/long@^4.0.1":
|
|
||||||
version "4.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a"
|
|
||||||
integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==
|
|
||||||
|
|
||||||
"@types/node@*", "@types/node@^17.0.21", "@types/node@^17.0.25":
|
"@types/node@*", "@types/node@^17.0.21", "@types/node@^17.0.25":
|
||||||
version "17.0.25"
|
version "17.0.25"
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.25.tgz#527051f3c2f77aa52e5dc74e45a3da5fb2301448"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.25.tgz#527051f3c2f77aa52e5dc74e45a3da5fb2301448"
|
||||||
@ -1595,13 +1258,6 @@
|
|||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a"
|
resolved "https://registry.yarnpkg.com/@types/node/-/node-11.11.6.tgz#df929d1bb2eee5afdda598a41930fe50b43eaa6a"
|
||||||
integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==
|
integrity sha512-Exw4yUWMBXM3X+8oqzJNRqZSwUAaS4+7NdvHqQuFi/d+synz++xmX3QIf+BFqneW8N31R8Ky+sikfZUXq07ggQ==
|
||||||
|
|
||||||
"@types/node@>=13.7.0":
|
|
||||||
version "20.11.28"
|
|
||||||
resolved "https://registry.yarnpkg.com/@types/node/-/node-20.11.28.tgz#4fd5b2daff2e580c12316e457473d68f15ee6f66"
|
|
||||||
integrity sha512-M/GPWVS2wLkSkNHVeLkrF2fD5Lx5UC4PxA0uZcKc6QqbIQUJyW1jVjueJYi1z8n0I5PxYrtpnPnWglE+y9A0KA==
|
|
||||||
dependencies:
|
|
||||||
undici-types "~5.26.4"
|
|
||||||
|
|
||||||
"@types/pbkdf2@^3.0.0":
|
"@types/pbkdf2@^3.0.0":
|
||||||
version "3.1.0"
|
version "3.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1"
|
resolved "https://registry.yarnpkg.com/@types/pbkdf2/-/pbkdf2-3.1.0.tgz#039a0e9b67da0cdc4ee5dab865caa6b267bb66b1"
|
||||||
@ -1739,12 +1395,7 @@ acorn-jsx@^5.3.2:
|
|||||||
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
|
resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937"
|
||||||
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
|
integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==
|
||||||
|
|
||||||
acorn-walk@^8.1.1:
|
acorn@^8.9.0:
|
||||||
version "8.3.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/acorn-walk/-/acorn-walk-8.3.2.tgz#7703af9415f1b6db9315d6895503862e231d34aa"
|
|
||||||
integrity sha512-cjkyv4OtNCIeqhHrfS81QWXoCBPExR/J62oyEqepVw8WaQeSqpW2uhuLPh1m9eWhDuOo/jUXVTlifvesOWp/4A==
|
|
||||||
|
|
||||||
acorn@^8.4.1, acorn@^8.9.0:
|
|
||||||
version "8.11.3"
|
version "8.11.3"
|
||||||
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a"
|
resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.11.3.tgz#71e0b14e13a4ec160724b38fb7b0f233b1b81d7a"
|
||||||
integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==
|
integrity sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==
|
||||||
@ -1803,11 +1454,6 @@ anymatch@^3.0.3:
|
|||||||
normalize-path "^3.0.0"
|
normalize-path "^3.0.0"
|
||||||
picomatch "^2.0.4"
|
picomatch "^2.0.4"
|
||||||
|
|
||||||
arg@^4.1.0:
|
|
||||||
version "4.1.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/arg/-/arg-4.1.3.tgz#269fc7ad5b8e42cb63c896d5666017261c144089"
|
|
||||||
integrity sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==
|
|
||||||
|
|
||||||
argparse@^1.0.7:
|
argparse@^1.0.7:
|
||||||
version "1.0.10"
|
version "1.0.10"
|
||||||
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
|
resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911"
|
||||||
@ -1888,23 +1534,11 @@ arraybuffer.prototype.slice@^1.0.2:
|
|||||||
is-array-buffer "^3.0.2"
|
is-array-buffer "^3.0.2"
|
||||||
is-shared-array-buffer "^1.0.2"
|
is-shared-array-buffer "^1.0.2"
|
||||||
|
|
||||||
asynckit@^0.4.0:
|
|
||||||
version "0.4.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
|
|
||||||
integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==
|
|
||||||
|
|
||||||
available-typed-arrays@^1.0.5:
|
available-typed-arrays@^1.0.5:
|
||||||
version "1.0.5"
|
version "1.0.5"
|
||||||
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7"
|
resolved "https://registry.yarnpkg.com/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz#92f95616501069d07d10edb2fc37d3e1c65123b7"
|
||||||
integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==
|
integrity sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==
|
||||||
|
|
||||||
axios@^0.21.2:
|
|
||||||
version "0.21.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575"
|
|
||||||
integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==
|
|
||||||
dependencies:
|
|
||||||
follow-redirects "^1.14.0"
|
|
||||||
|
|
||||||
axios@^0.26.1:
|
axios@^0.26.1:
|
||||||
version "0.26.1"
|
version "0.26.1"
|
||||||
resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9"
|
resolved "https://registry.yarnpkg.com/axios/-/axios-0.26.1.tgz#1ede41c51fcf51bbbd6fd43669caaa4f0495aaa9"
|
||||||
@ -1912,15 +1546,6 @@ axios@^0.26.1:
|
|||||||
dependencies:
|
dependencies:
|
||||||
follow-redirects "^1.14.8"
|
follow-redirects "^1.14.8"
|
||||||
|
|
||||||
axios@^1.6.0:
|
|
||||||
version "1.6.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.8.tgz#66d294951f5d988a00e87a0ffb955316a619ea66"
|
|
||||||
integrity sha512-v/ZHtJDU39mDpyBoFVkETcd/uNdxrWRrg3bKpOKzXFA6Bvqopts6ALSMU3y6ijYxbw2B+wPrIv46egTzJXCLGQ==
|
|
||||||
dependencies:
|
|
||||||
follow-redirects "^1.15.6"
|
|
||||||
form-data "^4.0.0"
|
|
||||||
proxy-from-env "^1.1.0"
|
|
||||||
|
|
||||||
babel-jest@^29.7.0:
|
babel-jest@^29.7.0:
|
||||||
version "29.7.0"
|
version "29.7.0"
|
||||||
resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5"
|
resolved "https://registry.yarnpkg.com/babel-jest/-/babel-jest-29.7.0.tgz#f4369919225b684c56085998ac63dbd05be020d5"
|
||||||
@ -2032,13 +1657,6 @@ bip32@3.0.1:
|
|||||||
typeforce "^1.11.5"
|
typeforce "^1.11.5"
|
||||||
wif "^2.0.6"
|
wif "^2.0.6"
|
||||||
|
|
||||||
bip39@^3.0.2:
|
|
||||||
version "3.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.1.0.tgz#c55a418deaf48826a6ceb34ac55b3ee1577e18a3"
|
|
||||||
integrity sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==
|
|
||||||
dependencies:
|
|
||||||
"@noble/hashes" "^1.2.0"
|
|
||||||
|
|
||||||
bip39@^3.0.4:
|
bip39@^3.0.4:
|
||||||
version "3.0.4"
|
version "3.0.4"
|
||||||
resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0"
|
resolved "https://registry.yarnpkg.com/bip39/-/bip39-3.0.4.tgz#5b11fed966840b5e1b8539f0f54ab6392969b2a0"
|
||||||
@ -2285,13 +1903,6 @@ color-name@~1.1.4:
|
|||||||
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
|
||||||
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
|
||||||
|
|
||||||
combined-stream@^1.0.8:
|
|
||||||
version "1.0.8"
|
|
||||||
resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
|
|
||||||
integrity sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==
|
|
||||||
dependencies:
|
|
||||||
delayed-stream "~1.0.0"
|
|
||||||
|
|
||||||
concat-map@0.0.1:
|
concat-map@0.0.1:
|
||||||
version "0.0.1"
|
version "0.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b"
|
||||||
@ -2302,11 +1913,6 @@ convert-source-map@^2.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a"
|
resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-2.0.0.tgz#4b560f649fc4e918dd0ab75cf4961e8bc882d82a"
|
||||||
integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==
|
integrity sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==
|
||||||
|
|
||||||
cosmjs-types@^0.9.0:
|
|
||||||
version "0.9.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.9.0.tgz#c3bc482d28c7dfa25d1445093fdb2d9da1f6cfcc"
|
|
||||||
integrity sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ==
|
|
||||||
|
|
||||||
create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0:
|
create-hash@^1.1.0, create-hash@^1.1.2, create-hash@^1.2.0:
|
||||||
version "1.2.0"
|
version "1.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196"
|
resolved "https://registry.yarnpkg.com/create-hash/-/create-hash-1.2.0.tgz#889078af11a63756bcfb59bd221996be3a9ef196"
|
||||||
@ -2343,11 +1949,6 @@ create-jest@^29.7.0:
|
|||||||
jest-util "^29.7.0"
|
jest-util "^29.7.0"
|
||||||
prompts "^2.0.1"
|
prompts "^2.0.1"
|
||||||
|
|
||||||
create-require@^1.1.0:
|
|
||||||
version "1.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/create-require/-/create-require-1.1.1.tgz#c1d7e8f1e5f6cfc9ff65f9cd352d37348756c333"
|
|
||||||
integrity sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==
|
|
||||||
|
|
||||||
cross-spawn@^7.0.2, cross-spawn@^7.0.3:
|
cross-spawn@^7.0.2, cross-spawn@^7.0.3:
|
||||||
version "7.0.3"
|
version "7.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
|
resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6"
|
||||||
@ -2417,11 +2018,6 @@ define-properties@^1.1.3, define-properties@^1.2.0, define-properties@^1.2.1:
|
|||||||
has-property-descriptors "^1.0.0"
|
has-property-descriptors "^1.0.0"
|
||||||
object-keys "^1.1.1"
|
object-keys "^1.1.1"
|
||||||
|
|
||||||
delayed-stream@~1.0.0:
|
|
||||||
version "1.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
|
|
||||||
integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==
|
|
||||||
|
|
||||||
detect-newline@^3.0.0:
|
detect-newline@^3.0.0:
|
||||||
version "3.1.0"
|
version "3.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"
|
resolved "https://registry.yarnpkg.com/detect-newline/-/detect-newline-3.1.0.tgz#576f5dfc63ae1a192ff192d8ad3af6308991b651"
|
||||||
@ -2437,11 +2033,6 @@ diff-sequences@^29.6.3:
|
|||||||
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921"
|
resolved "https://registry.yarnpkg.com/diff-sequences/-/diff-sequences-29.6.3.tgz#4deaf894d11407c51efc8418012f9e70b84ea921"
|
||||||
integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==
|
integrity sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==
|
||||||
|
|
||||||
diff@^4.0.1:
|
|
||||||
version "4.0.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/diff/-/diff-4.0.2.tgz#60f3aecb89d5fae520c11aa19efc2bb982aade7d"
|
|
||||||
integrity sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==
|
|
||||||
|
|
||||||
dir-glob@^3.0.1:
|
dir-glob@^3.0.1:
|
||||||
version "3.0.1"
|
version "3.0.1"
|
||||||
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
|
resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f"
|
||||||
@ -2878,6 +2469,20 @@ ethjs-util@0.1.6, ethjs-util@^0.1.6:
|
|||||||
is-hex-prefixed "1.0.0"
|
is-hex-prefixed "1.0.0"
|
||||||
strip-hex-prefix "1.0.0"
|
strip-hex-prefix "1.0.0"
|
||||||
|
|
||||||
|
evmosjs@^0.2.5:
|
||||||
|
version "0.2.5"
|
||||||
|
resolved "https://registry.yarnpkg.com/evmosjs/-/evmosjs-0.2.5.tgz#a7c7de2a4ea5ea3f00a835dc1bd61aa2b690adbf"
|
||||||
|
integrity sha512-fs6VOgGKyhUeH8sveqxrGzwR3rkld9F3bQ2jQoNO1viUqCXQuHw9KuUHPnC13H4RXOPAV0Q4Ff/rg88kM3rPhA==
|
||||||
|
dependencies:
|
||||||
|
"@tharsis/address-converter" "^0.1.7"
|
||||||
|
"@tharsis/eip712" "^0.2.1"
|
||||||
|
"@tharsis/proto" "^0.1.16"
|
||||||
|
"@tharsis/provider" "^0.2.4"
|
||||||
|
"@tharsis/transactions" "^0.2.2"
|
||||||
|
"@types/node" "^17.0.21"
|
||||||
|
link-module-alias "^1.2.0"
|
||||||
|
shx "^0.3.4"
|
||||||
|
|
||||||
evp_bytestokey@^1.0.3:
|
evp_bytestokey@^1.0.3:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02"
|
resolved "https://registry.yarnpkg.com/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz#7fcbdb198dc71959432efe13842684e0525acb02"
|
||||||
@ -3006,11 +2611,6 @@ flatted@^3.2.9:
|
|||||||
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf"
|
resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.9.tgz#7eb4c67ca1ba34232ca9d2d93e9886e611ad7daf"
|
||||||
integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==
|
integrity sha512-36yxDn5H7OFZQla0/jFJmbIKTdZAQHngCedGxiMmpNfEZM0sdEeT+WczLQrjK6D7o2aiyLYDnkw0R3JK0Qv1RQ==
|
||||||
|
|
||||||
follow-redirects@^1.14.0, follow-redirects@^1.15.6:
|
|
||||||
version "1.15.6"
|
|
||||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.6.tgz#7f815c0cda4249c74ff09e95ef97c23b5fd0399b"
|
|
||||||
integrity sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==
|
|
||||||
|
|
||||||
follow-redirects@^1.14.8:
|
follow-redirects@^1.14.8:
|
||||||
version "1.14.9"
|
version "1.14.9"
|
||||||
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7"
|
resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.9.tgz#dd4ea157de7bfaf9ea9b3fbd85aa16951f78d8d7"
|
||||||
@ -3023,15 +2623,6 @@ for-each@^0.3.3:
|
|||||||
dependencies:
|
dependencies:
|
||||||
is-callable "^1.1.3"
|
is-callable "^1.1.3"
|
||||||
|
|
||||||
form-data@^4.0.0:
|
|
||||||
version "4.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452"
|
|
||||||
integrity sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==
|
|
||||||
dependencies:
|
|
||||||
asynckit "^0.4.0"
|
|
||||||
combined-stream "^1.0.8"
|
|
||||||
mime-types "^2.1.12"
|
|
||||||
|
|
||||||
fs-extra@^10.1.0:
|
fs-extra@^10.1.0:
|
||||||
version "10.1.0"
|
version "10.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
|
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-10.1.0.tgz#02873cfbc4084dde127eaa5f9905eef2325d1abf"
|
||||||
@ -3164,7 +2755,7 @@ globals@^13.19.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
type-fest "^0.20.2"
|
type-fest "^0.20.2"
|
||||||
|
|
||||||
globalthis@^1.0.1, globalthis@^1.0.3:
|
globalthis@^1.0.3:
|
||||||
version "1.0.3"
|
version "1.0.3"
|
||||||
resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf"
|
resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf"
|
||||||
integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==
|
integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==
|
||||||
@ -3529,11 +3120,6 @@ isexe@^2.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10"
|
||||||
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
|
integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==
|
||||||
|
|
||||||
isomorphic-ws@^4.0.1:
|
|
||||||
version "4.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc"
|
|
||||||
integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==
|
|
||||||
|
|
||||||
istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0:
|
istanbul-lib-coverage@^3.0.0, istanbul-lib-coverage@^3.2.0:
|
||||||
version "3.2.2"
|
version "3.2.2"
|
||||||
resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756"
|
resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.2.tgz#2d166c4b0644d43a39f04bf6c2edd1e585f31756"
|
||||||
@ -3975,7 +3561,7 @@ js-sha256@^0.9.0:
|
|||||||
resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966"
|
resolved "https://registry.yarnpkg.com/js-sha256/-/js-sha256-0.9.0.tgz#0b89ac166583e91ef9123644bd3c5334ce9d0966"
|
||||||
integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==
|
integrity sha512-sga3MHh9sgQN2+pJ9VYZ+1LPwXOxuBJBA5nrR5/ofPfuiJBE2hnjsaN8se8JznOmGLN2p49Pe5U/ttafcs/apA==
|
||||||
|
|
||||||
js-sha3@0.8.0, js-sha3@^0.8.0:
|
js-sha3@0.8.0:
|
||||||
version "0.8.0"
|
version "0.8.0"
|
||||||
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840"
|
resolved "https://registry.yarnpkg.com/js-sha3/-/js-sha3-0.8.0.tgz#b9b7a5da73afad7dedd0f8c463954cbde6818840"
|
||||||
integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==
|
integrity sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==
|
||||||
@ -4046,6 +3632,11 @@ jsonfile@^6.0.1:
|
|||||||
optionalDependencies:
|
optionalDependencies:
|
||||||
graceful-fs "^4.1.6"
|
graceful-fs "^4.1.6"
|
||||||
|
|
||||||
|
jsonschema@^1.4.0:
|
||||||
|
version "1.4.0"
|
||||||
|
resolved "https://registry.yarnpkg.com/jsonschema/-/jsonschema-1.4.0.tgz#1afa34c4bc22190d8e42271ec17ac8b3404f87b2"
|
||||||
|
integrity sha512-/YgW6pRMr6M7C+4o8kS+B/2myEpHCrxO4PEWnqJNBFMjn7EWXqlQ4tGwL6xTHeRplwuZmcAncdvfOad1nT2yMw==
|
||||||
|
|
||||||
junk@3.1.0:
|
junk@3.1.0:
|
||||||
version "3.1.0"
|
version "3.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/junk/-/junk-3.1.0.tgz#31499098d902b7e98c5d9b9c80f43457a88abfa1"
|
resolved "https://registry.yarnpkg.com/junk/-/junk-3.1.0.tgz#31499098d902b7e98c5d9b9c80f43457a88abfa1"
|
||||||
@ -4085,18 +3676,6 @@ levn@^0.4.1:
|
|||||||
prelude-ls "^1.2.1"
|
prelude-ls "^1.2.1"
|
||||||
type-check "~0.4.0"
|
type-check "~0.4.0"
|
||||||
|
|
||||||
libsodium-sumo@^0.7.13:
|
|
||||||
version "0.7.13"
|
|
||||||
resolved "https://registry.yarnpkg.com/libsodium-sumo/-/libsodium-sumo-0.7.13.tgz#533b97d2be44b1277e59c1f9f60805978ac5542d"
|
|
||||||
integrity sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ==
|
|
||||||
|
|
||||||
libsodium-wrappers-sumo@^0.7.11:
|
|
||||||
version "0.7.13"
|
|
||||||
resolved "https://registry.yarnpkg.com/libsodium-wrappers-sumo/-/libsodium-wrappers-sumo-0.7.13.tgz#a33aea845a0bb56db067548f04feba28c730ab8e"
|
|
||||||
integrity sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ==
|
|
||||||
dependencies:
|
|
||||||
libsodium-sumo "^0.7.13"
|
|
||||||
|
|
||||||
libsodium-wrappers@^0.7.6:
|
libsodium-wrappers@^0.7.6:
|
||||||
version "0.7.10"
|
version "0.7.10"
|
||||||
resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz#13ced44cacb0fc44d6ac9ce67d725956089ce733"
|
resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz#13ced44cacb0fc44d6ac9ce67d725956089ce733"
|
||||||
@ -4157,11 +3736,6 @@ lodash@^4.17.21:
|
|||||||
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
|
||||||
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
|
||||||
|
|
||||||
long@^4.0.0:
|
|
||||||
version "4.0.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
|
|
||||||
integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==
|
|
||||||
|
|
||||||
lru-cache@^5.1.1:
|
lru-cache@^5.1.1:
|
||||||
version "5.1.1"
|
version "5.1.1"
|
||||||
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
|
resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920"
|
||||||
@ -4183,7 +3757,7 @@ make-dir@^4.0.0:
|
|||||||
dependencies:
|
dependencies:
|
||||||
semver "^7.5.3"
|
semver "^7.5.3"
|
||||||
|
|
||||||
make-error@1.x, make-error@^1.1.1:
|
make-error@1.x:
|
||||||
version "1.3.6"
|
version "1.3.6"
|
||||||
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
|
resolved "https://registry.yarnpkg.com/make-error/-/make-error-1.3.6.tgz#2eb2e37ea9b67c4891f684a1394799af484cf7a2"
|
||||||
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
|
integrity sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==
|
||||||
@ -4222,18 +3796,6 @@ micromatch@^4.0.4:
|
|||||||
braces "^3.0.2"
|
braces "^3.0.2"
|
||||||
picomatch "^2.3.1"
|
picomatch "^2.3.1"
|
||||||
|
|
||||||
mime-db@1.52.0:
|
|
||||||
version "1.52.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.52.0.tgz#bbabcdc02859f4987301c856e3387ce5ec43bf70"
|
|
||||||
integrity sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==
|
|
||||||
|
|
||||||
mime-types@^2.1.12:
|
|
||||||
version "2.1.35"
|
|
||||||
resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.35.tgz#381a871b62a734450660ae3deee44813f70d959a"
|
|
||||||
integrity sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==
|
|
||||||
dependencies:
|
|
||||||
mime-db "1.52.0"
|
|
||||||
|
|
||||||
mimic-fn@^2.1.0:
|
mimic-fn@^2.1.0:
|
||||||
version "2.1.0"
|
version "2.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
|
resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b"
|
||||||
@ -4557,30 +4119,6 @@ prompts@^2.0.1:
|
|||||||
kleur "^3.0.3"
|
kleur "^3.0.3"
|
||||||
sisteransi "^1.0.5"
|
sisteransi "^1.0.5"
|
||||||
|
|
||||||
protobufjs@^6.8.8:
|
|
||||||
version "6.11.4"
|
|
||||||
resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.4.tgz#29a412c38bf70d89e537b6d02d904a6f448173aa"
|
|
||||||
integrity sha512-5kQWPaJHi1WoCpjTGszzQ32PG2F4+wRY6BmAT4Vfw56Q2FZ4YZzK20xUYQH4YkfehY1e6QSICrJquM6xXZNcrw==
|
|
||||||
dependencies:
|
|
||||||
"@protobufjs/aspromise" "^1.1.2"
|
|
||||||
"@protobufjs/base64" "^1.1.2"
|
|
||||||
"@protobufjs/codegen" "^2.0.4"
|
|
||||||
"@protobufjs/eventemitter" "^1.1.0"
|
|
||||||
"@protobufjs/fetch" "^1.1.0"
|
|
||||||
"@protobufjs/float" "^1.0.2"
|
|
||||||
"@protobufjs/inquire" "^1.1.0"
|
|
||||||
"@protobufjs/path" "^1.1.2"
|
|
||||||
"@protobufjs/pool" "^1.1.0"
|
|
||||||
"@protobufjs/utf8" "^1.1.0"
|
|
||||||
"@types/long" "^4.0.1"
|
|
||||||
"@types/node" ">=13.7.0"
|
|
||||||
long "^4.0.0"
|
|
||||||
|
|
||||||
proxy-from-env@^1.1.0:
|
|
||||||
version "1.1.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2"
|
|
||||||
integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==
|
|
||||||
|
|
||||||
punycode@^2.1.0:
|
punycode@^2.1.0:
|
||||||
version "2.3.1"
|
version "2.3.1"
|
||||||
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
|
resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.1.tgz#027422e2faec0b25e1549c3e1bd8309b9133b6e5"
|
||||||
@ -4710,7 +4248,7 @@ ripemd160-min@0.0.6:
|
|||||||
resolved "https://registry.yarnpkg.com/ripemd160-min/-/ripemd160-min-0.0.6.tgz#a904b77658114474d02503e819dcc55853b67e62"
|
resolved "https://registry.yarnpkg.com/ripemd160-min/-/ripemd160-min-0.0.6.tgz#a904b77658114474d02503e819dcc55853b67e62"
|
||||||
integrity sha512-+GcJgQivhs6S9qvLogusiTcS9kQUfgR75whKuy5jIhuiOfQuJ8fjqxV6EGD5duH1Y/FawFUMtMhyeq3Fbnib8A==
|
integrity sha512-+GcJgQivhs6S9qvLogusiTcS9kQUfgR75whKuy5jIhuiOfQuJ8fjqxV6EGD5duH1Y/FawFUMtMhyeq3Fbnib8A==
|
||||||
|
|
||||||
ripemd160@^2.0.0, ripemd160@^2.0.1, ripemd160@^2.0.2:
|
ripemd160@^2.0.0, ripemd160@^2.0.1:
|
||||||
version "2.0.2"
|
version "2.0.2"
|
||||||
resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c"
|
resolved "https://registry.yarnpkg.com/ripemd160/-/ripemd160-2.0.2.tgz#a1c1a6f624751577ba5d07914cbc92850585890c"
|
||||||
integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==
|
integrity sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==
|
||||||
@ -4814,7 +4352,7 @@ setimmediate@^1.0.5:
|
|||||||
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
|
resolved "https://registry.yarnpkg.com/setimmediate/-/setimmediate-1.0.5.tgz#290cbb232e306942d7d7ea9b83732ab7856f8285"
|
||||||
integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=
|
integrity sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=
|
||||||
|
|
||||||
sha.js@^2.4.0, sha.js@^2.4.11, sha.js@^2.4.8:
|
sha.js@^2.4.0, sha.js@^2.4.8:
|
||||||
version "2.4.11"
|
version "2.4.11"
|
||||||
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7"
|
resolved "https://registry.yarnpkg.com/sha.js/-/sha.js-2.4.11.tgz#37a5cf0b81ecbc6943de109ba2960d1b26584ae7"
|
||||||
integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==
|
integrity sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==
|
||||||
@ -5018,11 +4556,6 @@ supports-preserve-symlinks-flag@^1.0.0:
|
|||||||
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
|
resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09"
|
||||||
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
|
integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w==
|
||||||
|
|
||||||
symbol-observable@^2.0.3:
|
|
||||||
version "2.0.3"
|
|
||||||
resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-2.0.3.tgz#5b521d3d07a43c351055fa43b8355b62d33fd16a"
|
|
||||||
integrity sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==
|
|
||||||
|
|
||||||
test-exclude@^6.0.0:
|
test-exclude@^6.0.0:
|
||||||
version "6.0.0"
|
version "6.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"
|
resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e"
|
||||||
@ -5079,25 +4612,6 @@ ts-jest@^29.0.2:
|
|||||||
semver "^7.5.3"
|
semver "^7.5.3"
|
||||||
yargs-parser "^21.0.1"
|
yargs-parser "^21.0.1"
|
||||||
|
|
||||||
ts-node@^10.2.1:
|
|
||||||
version "10.9.2"
|
|
||||||
resolved "https://registry.yarnpkg.com/ts-node/-/ts-node-10.9.2.tgz#70f021c9e185bccdca820e26dc413805c101c71f"
|
|
||||||
integrity sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==
|
|
||||||
dependencies:
|
|
||||||
"@cspotcode/source-map-support" "^0.8.0"
|
|
||||||
"@tsconfig/node10" "^1.0.7"
|
|
||||||
"@tsconfig/node12" "^1.0.7"
|
|
||||||
"@tsconfig/node14" "^1.0.0"
|
|
||||||
"@tsconfig/node16" "^1.0.2"
|
|
||||||
acorn "^8.4.1"
|
|
||||||
acorn-walk "^8.1.1"
|
|
||||||
arg "^4.1.0"
|
|
||||||
create-require "^1.1.0"
|
|
||||||
diff "^4.0.1"
|
|
||||||
make-error "^1.1.1"
|
|
||||||
v8-compile-cache-lib "^3.0.1"
|
|
||||||
yn "3.1.1"
|
|
||||||
|
|
||||||
tsconfig-paths@^3.15.0:
|
tsconfig-paths@^3.15.0:
|
||||||
version "3.15.0"
|
version "3.15.0"
|
||||||
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4"
|
resolved "https://registry.yarnpkg.com/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz#5299ec605e55b1abb23ec939ef15edaf483070d4"
|
||||||
@ -5211,11 +4725,6 @@ unbox-primitive@^1.0.2:
|
|||||||
has-symbols "^1.0.3"
|
has-symbols "^1.0.3"
|
||||||
which-boxed-primitive "^1.0.2"
|
which-boxed-primitive "^1.0.2"
|
||||||
|
|
||||||
undici-types@~5.26.4:
|
|
||||||
version "5.26.5"
|
|
||||||
resolved "https://registry.yarnpkg.com/undici-types/-/undici-types-5.26.5.tgz#bcd539893d00b56e964fd2657a4866b221a65617"
|
|
||||||
integrity sha512-JlCMO+ehdEIKqlFxk6IfVoAUVmgz7cU7zD/h9XZ0qzeosSHmUJVOzSQvvYSYWXkFXC+IfLKSIffhv0sVZup6pA==
|
|
||||||
|
|
||||||
universalify@^2.0.0:
|
universalify@^2.0.0:
|
||||||
version "2.0.0"
|
version "2.0.0"
|
||||||
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
|
resolved "https://registry.yarnpkg.com/universalify/-/universalify-2.0.0.tgz#75a4984efedc4b08975c5aeb73f530d02df25717"
|
||||||
@ -5241,11 +4750,6 @@ util-deprecate@^1.0.1:
|
|||||||
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
|
||||||
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
|
||||||
|
|
||||||
v8-compile-cache-lib@^3.0.1:
|
|
||||||
version "3.0.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz#6336e8d71965cb3d35a1bbb7868445a7c05264bf"
|
|
||||||
integrity sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==
|
|
||||||
|
|
||||||
v8-to-istanbul@^9.0.1:
|
v8-to-istanbul@^9.0.1:
|
||||||
version "9.2.0"
|
version "9.2.0"
|
||||||
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz#2ed7644a245cddd83d4e087b9b33b3e62dfd10ad"
|
resolved "https://registry.yarnpkg.com/v8-to-istanbul/-/v8-to-istanbul-9.2.0.tgz#2ed7644a245cddd83d4e087b9b33b3e62dfd10ad"
|
||||||
@ -5325,19 +4829,6 @@ ws@7.4.6:
|
|||||||
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c"
|
resolved "https://registry.yarnpkg.com/ws/-/ws-7.4.6.tgz#5654ca8ecdeee47c33a9a4bf6d28e2be2980377c"
|
||||||
integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==
|
integrity sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==
|
||||||
|
|
||||||
ws@^7:
|
|
||||||
version "7.5.9"
|
|
||||||
resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591"
|
|
||||||
integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==
|
|
||||||
|
|
||||||
xstream@^11.14.0:
|
|
||||||
version "11.14.0"
|
|
||||||
resolved "https://registry.yarnpkg.com/xstream/-/xstream-11.14.0.tgz#2c071d26b18310523b6877e86b4e54df068a9ae5"
|
|
||||||
integrity sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw==
|
|
||||||
dependencies:
|
|
||||||
globalthis "^1.0.1"
|
|
||||||
symbol-observable "^2.0.3"
|
|
||||||
|
|
||||||
y18n@^5.0.5:
|
y18n@^5.0.5:
|
||||||
version "5.0.8"
|
version "5.0.8"
|
||||||
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
|
resolved "https://registry.yarnpkg.com/y18n/-/y18n-5.0.8.tgz#7f4934d0f7ca8c56f95314939ddcd2dd91ce1d55"
|
||||||
@ -5389,11 +4880,6 @@ yargs@^17.4.1:
|
|||||||
y18n "^5.0.5"
|
y18n "^5.0.5"
|
||||||
yargs-parser "^21.0.0"
|
yargs-parser "^21.0.0"
|
||||||
|
|
||||||
yn@3.1.1:
|
|
||||||
version "3.1.1"
|
|
||||||
resolved "https://registry.yarnpkg.com/yn/-/yn-3.1.1.tgz#1e87401a09d767c1d5eab26a6e4c185182d2eb50"
|
|
||||||
integrity sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==
|
|
||||||
|
|
||||||
yocto-queue@^0.1.0:
|
yocto-queue@^0.1.0:
|
||||||
version "0.1.0"
|
version "0.1.0"
|
||||||
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|
resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b"
|
||||||
|
Loading…
Reference in New Issue
Block a user