1.0.0-beta.20 • Published 4 years ago

@wirelineio/wns-cli v1.0.0-beta.20

Weekly downloads
1
License
GPL-3.0
Repository
-
Last release
4 years ago

WNS CLI

These commands require wire CLI to be configured.

Get node status:

$ wire wns status
{
  "version": "0.3.0",
  "node": {
    "id": "f31006c3c9c56a3fc118661110c16a00eaef3635",
    "network": "wireline",
    "moniker": "Ashwins-MacBook-Pro-2.local"
  },
  "sync": {
    "latest_block_hash": "E2A7DF2DB9184EA505B78BEF84CE457AA349762ABA25E612CFF282926A5BA827",
    "latest_block_height": "3",
    "latest_block_time": "2020-04-07 10:34:42.702299 +0000 UTC",
    "catching_up": false
  },
  "validator": {
    "address": "258A5BA35D399BAD5D7129B95784A43167536AF4",
    "voting_power": "10000000"
  },
  "validators": [
    {
      "address": "258A5BA35D399BAD5D7129B95784A43167536AF4",
      "voting_power": "10000000",
      "proposer_priority": "0"
    }
  ],
  "num_peers": "0",
  "peers": [],
  "disk_usage": "124K"
}

Get account details:

$ wire wns account get --address cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094
[
  {
    "address": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "pubKey": "61rphyEC6tEq0pxTI2Sy97VlWCSZhA/PRaUfFlQjhQcpYfTfYtg=",
    "number": "0",
    "sequence": "2",
    "balance": [
      {
        "type": "uwire",
        "quantity": "89990000000000"
      }
    ]
  }
]

Send tokens:

$ wire wns tokens send --address cosmos1w5q7xy9sk8hqvlklftdfdkc3kgsd90cxlkwvty --type uwire --quantity 1000000000
[
  {
    "address": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "pubKey": "61rphyEC6tEq0pxTI2Sy97VlWCSZhA/PRaUfFlQjhQcpYfTfYtg=",
    "number": "0",
    "sequence": "3",
    "balance": [
      {
        "type": "uwire",
        "quantity": "89989000000000"
      }
    ]
  },
  {
    "address": "cosmos1w5q7xy9sk8hqvlklftdfdkc3kgsd90cxlkwvty",
    "pubKey": null,
    "number": "7",
    "sequence": "0",
    "balance": [
      {
        "type": "uwire",
        "quantity": "1000000000"
      }
    ]
  }
]

Create record (generic):

# protocol.yml
record:
    type: wrn:protocol
    name: example/chess-protocol
    version: 1.1.1
    displayName: chess-protocol

Publish record (see below for commands to create/query bonds):

$ wire wns record publish --filename protocol.yml --bond-id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3

Get record:

$ wire wns record get --id QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz
[
  {
    "id": "QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz",
    "type": "wrn:protocol",
    "name": "example/chess-protocol",
    "version": "1.1.1",
    "owners": [
      "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
    ],
    "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
    "createTime": "2020-04-07T10:38:10.044857000",
    "expiryTime": "2021-04-07T10:38:10.044857000",
    "attributes": {
      "displayName": "chess-protocol",
      "name": "example/chess-protocol",
      "type": "wrn:protocol",
      "version": "1.1.1"
    }
  }
]

List records:

$ wire wns record list
[
  {
    "id": "QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz",
    "type": "wrn:protocol",
    "name": "example/chess-protocol",
    "version": "1.1.1",
    "owners": [
      "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
    ],
    "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
    "createTime": "2020-04-07T10:38:10.044857000",
    "expiryTime": "2021-04-07T10:38:10.044857000",
    "attributes": {
      "displayName": "chess-protocol",
      "name": "example/chess-protocol",
      "type": "wrn:protocol",
      "version": "1.1.1"
    }
  }
]

Resolve record by ref:

$ wire wns record resolve wrn:protocol:example/chess-protocol#^1.0.0
[
    {
        "id": "QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz",
        "type": "wrn:protocol",
        "name": "example/chess-protocol",
        "version": "1.1.1",
        "owners": [
            "6ee3328f65c8566cd5451e49e97a767d10a8adf7"
        ],
        "bondId": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
        "createTime": "2020-04-07T10:38:10.044857000",
        "expiryTime": "2021-04-07T10:38:10.044857000",
        "attributes": {
            "version": "1.1.1",
            "displayName": "chess-protocol",
            "name": "example/chess-protocol",
            "type": "wrn:protocol"
        }
    }
]

Create bond:

$ wire wns bond create --type uwire --quantity 1000

List bonds:

$ wire wns bond list
[
  {
    "id": "288425db041a7dff6e06e966067625479ae80b29d4c36f9360634eb0cbe2961d",
    "owner": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "balance": [
      {
        "type": "uwire",
        "quantity": "1000"
      }
    ]
  },
  {
    "id": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
    "owner": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "balance": [
      {
        "type": "uwire",
        "quantity": "9999000000"
      }
    ]
  }
]

Get bond:

$ wire wns bond get --id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3
[
  {
    "id": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
    "owner": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "balance": [
      {
        "type": "uwire",
        "quantity": "9999000000"
      }
    ]
  }
]

Query bonds by owner:

$ wire wns bond list --owner cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094
[
  {
    "id": "288425db041a7dff6e06e966067625479ae80b29d4c36f9360634eb0cbe2961d",
    "owner": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "balance": [
      {
        "type": "uwire",
        "quantity": "1000"
      }
    ]
  },
  {
    "id": "8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3",
    "owner": "cosmos1wh8vvd0ymc5nt37h29z8kk2g2ays45ct2qu094",
    "balance": [
      {
        "type": "uwire",
        "quantity": "9999000000"
      }
    ]
  }
]

Refill bond:

$ wire wns bond refill --id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3 --type uwire --quantity 1000

Withdraw funds from bond:

$ wire wns bond withdraw --id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3 --type uwire --quantity 500

Cancel bond:

$ wire wns bond cancel --id 288425db041a7dff6e06e966067625479ae80b29d4c36f9360634eb0cbe2961d

Associate bond (with record):

$ wire wns bond associate --id QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz --bond-id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3

Disassociate bond (from record):

$ wire wns bond dissociate --id QmYDtNCKtTu6u6jaHaFAC5PWZXcj7fAmry6NoWwMaixFHz

Dissociate all records from bond:

$ wire wns bond records dissociate --bond-id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3

Reassociate records (switch bond):

$ wire wns bond records reassociate --old-bond-id 8e340dd7cf6fc91c27eeefce9cca1406c262e93fd6f3a4f3b1e99b01161fcef3 --new-bond-id 146b5ed7a2771ae2e6b323f334f1c2d1134fd7917eb72dea9c88457e912785ab
1.0.0-beta.68

4 years ago

1.0.0-beta.67

4 years ago

1.0.0-beta.66

4 years ago

1.0.0-beta.65

4 years ago

1.0.0-beta.64

4 years ago

1.0.0-beta.63

4 years ago

1.0.0-beta.62

4 years ago

1.0.0-beta.60

4 years ago

1.0.0-beta.61

4 years ago

1.0.0-beta.56

4 years ago

1.0.0-beta.59

4 years ago

1.0.0-beta.57

4 years ago

1.0.0-beta.58

4 years ago

1.0.0-beta.55

4 years ago

1.0.0-beta.54

4 years ago

1.0.0-beta.53

4 years ago

1.0.0-beta.52

4 years ago

1.0.0-beta.51

4 years ago

1.0.0-beta.49

4 years ago

1.0.0-beta.50

4 years ago

1.0.0-beta.48

4 years ago

1.0.0-beta.47

4 years ago

1.0.0-beta.44

4 years ago

1.0.0-beta.45

4 years ago

1.0.0-beta.43

4 years ago

1.0.0-beta.46

4 years ago

1.0.0-beta.42

4 years ago

1.0.0-beta.40

4 years ago

1.0.0-beta.41

4 years ago

1.0.0-beta.39

4 years ago

1.0.0-beta.37

4 years ago

1.0.0-beta.35

4 years ago

1.0.0-beta.34

4 years ago

1.0.0-beta.33

4 years ago

1.0.0-beta.31

4 years ago

1.0.0-beta.32

4 years ago

1.0.0-beta.30

4 years ago

1.0.0-beta.29

4 years ago

1.0.0-beta.28

4 years ago

1.0.0-beta.27

4 years ago

1.0.0-beta.26

4 years ago

1.0.0-beta.25

4 years ago

1.0.0-beta.24

4 years ago

1.0.0-beta.23

4 years ago

1.0.0-beta.22

4 years ago

1.0.0-beta.21

4 years ago

1.0.0-beta.20

4 years ago

1.0.0-beta.19

4 years ago

1.0.0-beta.16

4 years ago

1.0.0-beta.15

4 years ago

1.0.0-beta.14

4 years ago

1.0.0-beta.13

4 years ago

1.0.0-beta.11

4 years ago