Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
node_modules
dist
.idea
test
sonar-project.properties
openapitools.json
vitest.Dockerfile
vitest.config.ts
Dockerfile
20 changes: 20 additions & 0 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
name: Test

on:
push:
branches:
- master
pull_request:
branches:
- master

jobs:
test:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
- run: npm ci
- run: npm run test
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,6 @@ log/
.vscode/
rosetta/bin/
cli-data/
__snapshots__/
logs
test/generated/
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Build thor in a stock Go builder container
ARG THOR_VERSION=v2.1.6
ARG THOR_VERSION=v2.2.1

FROM golang:1.22 AS builder
FROM golang:1.23 AS builder

WORKDIR /go/thor
RUN git clone https://github.com/vechain/thor.git /go/thor
Expand Down
121 changes: 40 additions & 81 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,63 +59,63 @@ Implementing Rosetta Data API of VeChainThor BlockChain

### Account

Method| Endpoint | Implemented | Description | Mode
---------|----------|---------|---------|---------
POST | /account/balance | Yes | Get an Account Balance | online
POST | /account/coins | No |
| Method | Endpoint | Implemented | Description | Mode |
|--------|------------------|-------------|------------------------|--------|
| POST | /account/balance | Yes | Get an Account Balance | online |
| POST | /account/coins | No | | |

### Block

Method| Endpoint | Implemented | Description | Mode
---------|----------|---------|---------|---------
POST | /block | Yes | Get a Block | online
POST | /block/transaction | Yes | Get a Block Transaction | online
| Method | Endpoint | Implemented | Description | Mode |
|--------|--------------------|-------------|-------------------------|--------|
| POST | /block | Yes | Get a Block | online |
| POST | /block/transaction | Yes | Get a Block Transaction | online |

### Call

Method| Endpoint | Implemented | Description | Mode
---------|----------|---------|---------|---------
POST | /call | No | |
| Method | Endpoint | Implemented | Description | Mode |
|--------|----------|-------------|-------------|------|
| POST | /call | No | | |

### Construction

Method| Endpoint | Implemented | Description | Mode
---------|----------|---------|---------|---------
POST | /construction/combine | Yes | Create Network Transaction from Signatures | online & offline
POST | /construction/derive | Yes | Derive an AccountIdentifier from a PublicKey | online & offline
POST | /construction/hash | Yes | Get the Hash of a Signed Transaction | online & offline
POST | /construction/metadata | Yes | Get Metadata for Transaction Construction | online
POST | /construction/parse | Yes | Parse a Transaction | online & offline
POST | /construction/payloads | Yes | Generate an Unsigned Transaction and Signing Payloads | online & offline
POST | /construction/preprocess | Yes | Create a Request to Fetch Metadata | online & offline
POST | /construction/submit | Yes | Submit a Signed Transaction | online
| Method | Endpoint | Implemented | Description | Mode |
|--------|--------------------------|-------------|-------------------------------------------------------|------------------|
| POST | /construction/combine | Yes | Create Network Transaction from Signatures | online & offline |
| POST | /construction/derive | Yes | Derive an AccountIdentifier from a PublicKey | online & offline |
| POST | /construction/hash | Yes | Get the Hash of a Signed Transaction | online & offline |
| POST | /construction/metadata | Yes | Get Metadata for Transaction Construction | online |
| POST | /construction/parse | Yes | Parse a Transaction | online & offline |
| POST | /construction/payloads | Yes | Generate an Unsigned Transaction and Signing Payloads | online & offline |
| POST | /construction/preprocess | Yes | Create a Request to Fetch Metadata | online & offline |
| POST | /construction/submit | Yes | Submit a Signed Transaction | online |

### Events

Method| Endpoint | Implemented | Description | Mode
---------|----------|---------|---------|---------
POST | /events/blocks | Yes | [INDEXER] Get a range of BlockEvents | online
| Method | Endpoint | Implemented | Description | Mode |
|--------|----------------|-------------|--------------------------------------|--------|
| POST | /events/blocks | Yes | [INDEXER] Get a range of BlockEvents | online |

### Mempool

Method| Endpoint | Implemented | Description | Mode
---------|----------|---------|---------|---------
POST | /construction/metadata | No | Node API no support
POST | /construction/submit | No | Node API no support
| Method | Endpoint | Implemented | Description | Mode |
|--------|------------------------|-------------|---------------------|------|
| POST | /construction/metadata | No | Node API no support | |
| POST | /construction/submit | No | Node API no support | |

### Network

Method| Endpoint | Implemented | Description | Mode
---------|----------|---------|---------|---------
POST | /network/list | Yes | Get List of Available Networks | online & offline
POST | /network/options | Yes | Get Network Options | online & offline
POST | /network/status | Yes | Get Network Status | online
| Method | Endpoint | Implemented | Description | Mode |
|--------|------------------|-------------|--------------------------------|------------------|
| POST | /network/list | Yes | Get List of Available Networks | online & offline |
| POST | /network/options | Yes | Get Network Options | online & offline |
| POST | /network/status | Yes | Get Network Status | online |

### Search

Method| Endpoint | Implemented | Description | Mode
---------|----------|---------|---------|---------
POST | /search/transactions | Yes | [INDEXER] Search for Transactions | online
| Method | Endpoint | Implemented | Description | Mode |
|--------|----------------------|-------------|-----------------------------------|--------|
| POST | /search/transactions | Yes | [INDEXER] Search for Transactions | online |

## About Fee Delegation (VIP191)

Expand Down Expand Up @@ -175,28 +175,6 @@ Create a VIP191 payload, add `FeeDelegation` operation to operations, `account`
},
"metadata": {}
}
},
{
"operation_identifier": {
"index": 0,
"network_index": 2
},
"type": "FeeDelegation",
"status": "None",
"account": {
"address": "0x4251630dc820e90a5a6d14d79cac7acb93917983"
},
"amount": {
"value": "-210000000000000000",
"currency": {
"symbol": "VTHO",
"decimals": 18,
"metadata": {
"contractAddress": "0x0000000000000000000000000000456E65726779"
}
},
"metadata": {}
}
}
]
}
Expand Down Expand Up @@ -262,6 +240,9 @@ call the /construction/payloads Api.
"blockchain": "vechainthor",
"network": "test"
},
"metadata": {
"fee_delagator_account": "0x87AA2B76f29583E4A9095DBb6029A9C41994E25B"
},
"operations": [
{
"operation_identifier": {
Expand Down Expand Up @@ -300,28 +281,6 @@ call the /construction/payloads Api.
},
"metadata": {}
}
},
{
"operation_identifier": {
"index": 0,
"network_index": 2
},
"type": "FeeDelegation",
"status": "None",
"account": {
"address": "0x4251630dc820e90a5a6d14d79cac7acb93917983"
},
"amount": {
"value": "-210000000000000000",
"currency": {
"symbol": "VTHO",
"decimals": 18,
"metadata": {
"contractAddress": "0x0000000000000000000000000000456E65726779"
}
},
"metadata": {}
}
}
],
"metadata": {
Expand Down Expand Up @@ -400,4 +359,4 @@ the api will return `unsigned_transaction` and `payloads`.
}
]
}
```
```
7 changes: 7 additions & 0 deletions openapitools.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "7.10.0"
}
}
Loading
Loading