Skip to content

Instantly share code, notes, and snippets.

@takemiyamakoto
Last active May 13, 2017 10:46
Show Gist options
  • Save takemiyamakoto/3e1634c46a5489eed35d6e7a2387b37d to your computer and use it in GitHub Desktop.
Save takemiyamakoto/3e1634c46a5489eed35d6e7a2387b37d to your computer and use it in GitHub Desktop.
irohav1api.md

iroha-gateway

Endpoint(There are 17 endpoints)

GET /accounts

Request

Query

?(応相談)

Response

  • message string

  • code int

  • accounts [Account]

    Account
    pubKey: string (required)
    signatories: [string]
    quorum: ushort = 1

GET /accounts/{target}?creator=&is_committed=

Request

Path

  • target string (reuqired) acount's publickey

Query

  • craetor string (required) transaction creator's publickey
  • is_committed bool (optional) if this is true, get committed on ametsuchi

Response

  • message string

  • code int

  • account Account

    Account
    pubKey: string (required)
    signatories: [string]
    quorum: ushort = 1

PUT /accounts/{target}

Request

Path

  • target string (reuqired) acount's publickey

Body

  • alias string (required)
  • creator string (required) transaction creator's publickey
  • hash string (required) sha3_256(alias + "PUT/accounts" + creator + timestamp)
  • signature string (required)
  • timestamp int64 (required)

Response

  • message string
  • code int

DELETE /accounts/{target}

Request

Path

  • target string (reuqired) acount's publickey

Body

  • creator string (required) transaction creator's publickey
  • hash string (required) sha3_256("DELETE/accounts" + creator + timestamp)
  • signature string (required)
  • timestamp int64 (required)

Response

  • message string
  • code int

POST /accounts

Request

Body

  • creator string (required) transaction creator's publickey

  • hash string (required) sha3_256(account + "POST/accounts" + creator + timestamp)

  • signature string (required)

  • timestamp int64 (required)

  • account Account (required)

    Account
    pubKey: string (required)
    signatories: [string]
    quorum: ushort = 1

Response

  • message string
  • code int

GET /accounts/{target}/signatories?creator=&is_committed=

Request

Path

  • target string (reuqired) acount's publickey

Query

  • creator string (required) transaction creaotr's publickey
  • is_committed bool (optional) if this is true, get committed on ametsuchi

Response

  • message
  • code
  • signatories: [string]

POST /accounts/{target}/signatories

Request

Path

  • target string (reuqired) acount's publickey

Body

  • signatories: [string] signatories
  • creator string (required) transaction creator's publickey
  • hash string (required) sha3_256("POST/signatories" + creator + signatories + target + timestamp)
  • signature string (required)
  • timestamp int64 (required)

Response

  • message string
  • code int

DELETE /accounts/{target}/signatories/{sig}

Request

Path

  • target string (reuqired) acount's publickey
  • sig string (reuqired) signatory

Body

  • creator string (required) transaction creator's publickey
  • hash string (required) sha3_256("DELETE/signatories" + creator + sig + target + timestamp)
  • signature string (required)
  • timestamp int64 (required)

Response

  • message string
  • code int

PUT /acccounts/{target}/quorum

Request

Path

  • target string (reuqired) acount's publickey

Body

  • quorum int
  • creator string (required) transaction creator's publickey
  • hash string (required) sha3_256("PUT/quorum" + creator + target + timestamp + value)
  • signature string (required)
  • timestamp int64 (required)

Response

  • message string
  • code int

GET /assets/{asset-uri}?target=&creator=&is_committed=

Request

Path

  • asset-uri string asset's uri

Query

  • target: string (required) acount's publickey
  • creator: string (required) transaction creator's publickkey
  • is_committed bool (optional) if this is true, get committed on ametsuchi

Response

  • message: string (required)
  • code: Code (required)
  • assets: Asset

Asset
name string (required)
domain_name string (required)
ledger_name string (required)
description string

POST /assets

Request

Body

  • target string (required) account's publickey
  • asset Asset (required)
  • creator string (required) transaction creator's publickey
  • hash string (required) sha3_256(asset + "POST/assets" + creator + target + timestamp)
  • signature string (required)
  • timestamp int64 (required)

Asset
description string
domain_name string (required)
ledger_name string (required)
name string (required)

Response

  • message string
  • code int

PUT /assets/{asset-uri}

Request

Path

  • asset-uri string asset's uri

Body

  • description string asset's description
  • creator string (required) transaction creator's publickey
  • hash string (required) sha3_256(asset-uri + "PUT/assets" + creator + description + timestamp)
  • signature string (required)
  • timestamp int64 (required)

Response

  • message string
  • code int

DELETE /assets/{asset-uri}

Request

Path

  • asset-uri string asset's uri

Body

  • creator string (required) transaction creator's publickey
  • hash string (required) sha3_256(asset-uri + "DELETE/assets" + creator + timestamp)
  • signature string (required)
  • timestamp int64 (required)

Response

  • message string
  • code int

POST /assets/{asset-uri}/add

Request

Path

  • asset-uri (required) string asset's uri

Body

  • value string (required)
  • precision int (required)
  • target string (required) target account's publickey
  • creator string (required) transaction creator's publickey
  • hash string (required) sha3_256(asset-uri + "POST/assets/add" + creator + precision + target + timestamp + value)
  • signature string (required)
  • timestamp int64 (required)

Response

  • message string
  • code int

POST /assets/{asset-uri}/subtract

Request

Path

  • asset-uri (required) string asset's uri

Body

  • value string (required)
  • precision int (required)
  • target string (required) account's publickey
  • creator string (required) transaction creator's publickey
  • hash string (required) sha3_256(asset-uri + "POST/assets/subtract" + creator + precision + target + timestamp + value)
  • signature string (required)
  • timestamp int64 (required)

Response

  • message string
  • code int

POST /assets/{asset-uri}/transfer

Request

Path

  • asset-uri string asset's uri

Body

  • value string (required)
  • precision int (required)
  • creator string (required) transaction creator's publickey
  • sender string (required) sender's publickey
  • receiver string receiver's publickey
  • hash string (required) sha3_256(asset-uri + "POST/assets/transfer" + creator + precision + receiver + sender + timestamp + value)
  • signature string (required)
  • timestamp int64 (required)

Response

  • message string
  • code int

GET /transactions/{asset-uri}?target=&creator=&is_committed=

Request

Path

  • asset-uri string asset's uri

Query

  • target: string acount's publickey
  • creator string (required) transaction creator's publickey
  • is_committed bool (optional) if this is true, get committed on ametsuchi

Response

  • message string
  • code int
  • transactions: [Transaction]

Transaction
command: string (required) command type
creator: string (required) creator's publickey
hash: string (required) sha3_256(command + creator + timestamp)
signatures: [Signature] (required)
timestamp: int64

Signature
publicKey: string
signature: string
timestamp: int64

Model

Account

attribute type constraint description
pubkey string required account's public key
signatories [string] required signatories
quorum int required signatureの数

permissions

attribute type constraint description
root AccountPermissionRoot required
ledger [AccountPermissionLedger] required
domain [AccountPermissionDomain] required
asset [AccountPermissoinAsset] required

Asset

attribute type constraint description
name string required asset name
domain_name string required domain name to which asset belongs
ledger_name string required ledger name to which asset belongs
description string asset's description

Transaction

attribute type constraint description
command string required command type
creator string required creator's public key
hash string required sha3_256(command + creator + timestamp)
signatures [Signature] required signatures
timestamp int64 required linux timestamp

Signature

attribute type constraint description
public_key string required public key
signature string required sign(hash)
timestamp int64 required linux timestamp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment