Skip to content

Commit

Permalink
Updated with the lastest Hummingbot codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
alvaro-mota-funttastic committed Feb 6, 2024
1 parent 8942384 commit 23f5b00
Show file tree
Hide file tree
Showing 257 changed files with 64,141 additions and 10,378 deletions.
1 change: 1 addition & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
github: hummingbot
47 changes: 47 additions & 0 deletions .github/workflows/docker_build_latest
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Build and Push Docker image

on:
pull_request:
types: [closed]
branches:
- main

jobs:
build:
runs-on: ubuntu-latest
if: github.event.pull_request.merged == true
steps:
- name: Checkout code
uses: actions/[email protected]

- name: Set up QEMU
uses: docker/[email protected]

- name: Set up Docker Buildx
uses: docker/[email protected]
with:
version: latest

- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push
id: docker_build
uses: docker/[email protected]
with:
context: .
push: true
tags: hummingbot/gateway:latest
platforms: linux/amd64,linux/arm64
build-args: |
BRANCH=${{ github.ref }}
COMMIT=${{ github.sha }}
BUILD_DATE=$(date -u +'%Y-%m-%dT%H:%M:%SZ')
cache-from: type=registry,ref=hummingbot/gateway:latest
cache-to: type=inline

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
37 changes: 37 additions & 0 deletions .github/workflows/docker_build_tags
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
name: Build and push Docker images on release

on:
release:
types: [published, edited]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/[email protected]

- name: Set up Docker Buildx
uses: docker/[email protected]

- name: Login to DockerHub
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Extract tag name
id: get_tag
run: echo ::set-output name=VERSION::version-${GITHUB_REF#refs/tags/v}

- name: Build and push
uses: docker/[email protected]
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: hummingbot/gateway:${{ steps.get_tag.outputs.VERSION }}
17 changes: 1 addition & 16 deletions .github/workflows/workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -79,29 +79,14 @@ jobs:
cp -rf src/templates/* conf
sed -i 's|/home/gateway/conf/lists/|conf/lists/|g' ./conf/*.yml
sed -i 's/https:\/\/rpc.ankr.com\/eth_goerli/http:\/\/127.0.0.1:8545\//g' ./conf/ethereum.yml
sed -i 's/https:\/\/arbitrum-rinkeby.infura.io\/v3/http:\/\/127.0.0.1:8545\//g' ./conf/ethereum.yml
sed -i 's/https:\/\/rpc.ankr.com\/optimism/http:\/\/127.0.0.1:8545\//g' ./conf/ethereum.yml
sed -i 's/https:\/\/rpc.ankr.com\/avalanche/http:\/\/127.0.0.1:8545\//g' ./conf/avalanche.yml
sed -i 's/https:\/\/rpc.ankr.com\/avalanche_fuji/http:\/\/127.0.0.1:8545\//g' ./conf/avalanche.yml
sed -i 's/https:\/\/rpc.ankr.com\/polygon_mumbai/http:\/\/127.0.0.1:8545\//g' ./conf/polygon.yml
sed -i 's/https:\/\/rpc.ankr.com\/harmony/http:\/\/127.0.0.1:8545\//g' ./conf/harmony.yml
sed -i 's/https:\/\/api.s0.b.hmny.io/http:\/\/127.0.0.1:8545\//g' ./conf/harmony.yml
sed -i 's/https:\/\/rpc.ankr.com\/bsc/http:\/\/127.0.0.1:8545\//g' ./conf/binance-smart-chain.yml
sed -i 's/https:\/\/rpc.ankr.com\/bsc_testnet_chapel/http:\/\/127.0.0.1:8545\//g' ./conf/binance-smart-chain.yml
sed -i 's/https:\/\/cosmos-testnet-rpc.allthatnode.com:26657/http:\/\/127.0.0.1:8545\//g' ./conf/cosmos.yml
sed -i 's/https:\/\/cosmos-mainnet-rpc.allthatnode.com:26657/http:\/\/127.0.0.1:8545\//g' ./conf/cosmos.yml
sed -i 's/https:\/\/evm-t3.cronos.org/http:\/\/127.0.0.1:8545\//g' ./conf/cosmos.yml
sed -i 's/https:\/\/evm.cronos.org/http:\/\/127.0.0.1:8545\//g' ./conf/cosmos.yml
- name: Run unit test coverage
if: github.event_name == 'pull_request'
shell: bash
run: |
git fetch --all -q
git checkout -b $GITHUB_SHA
DIFF_FILES=`git diff --name-only origin/$GITHUB_BASE_REF ./src/`
./node_modules/.bin/jest --listTests --findRelatedTests ${DIFF_FILES//$'\n'/ }
NODE_OPTIONS=--max-old-space-size=10240 node ./node_modules/.bin/jest --runInBand --coverage --findRelatedTests ${DIFF_FILES//$'\n'/ }
NODE_OPTIONS=--max-old-space-size=10240 node ./node_modules/.bin/jest --runInBand --coverage ./test/
# git diff origin/$GITHUB_BASE_REF | yarn diff-test-coverage -c ./coverage/lcov.info -t lcov -b 50 -l 60

docker_build_and_push:
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,7 @@ package-lock.json

# VSCode
.vscode/
.history
.history

# Yarn
yarn-error.log
132 changes: 110 additions & 22 deletions docs/swagger/chain-routes.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,54 @@
paths:
/chain/nonce:
post:
/chain/config:
get:
tags:
- 'chain'
summary: 'Get the current nonce for the provided private key'
operationId: 'nonce'
consumes:
summary: 'Returns configuration options for a chain'
produces:
- 'application/json'
responses: '200'

/chain/status:
get:
tags:
- 'chain'
summary: 'Returns status of the chain'
produces:
- 'application/json'
responses: '200'

/chain/tokens:
get:
tags:
- 'chain'
summary: 'Returns a list of tokens available on a chain'
produces:
- 'application/json'
parameters:
- in: 'body'
name: 'body'
- in: 'query'
name: 'chain'
required: true
schema:
$ref: '#/definitions/NonceRequest'
type: 'string'
example: 'ethereum'
- in: 'query'
name: 'network'
required: true
type: 'string'
example: 'goerli'
- in: 'query'
name: 'tokenSymbols'
required: false
responses:
'200':
schema:
$ref: '#/definitions/NonceResponse'

/chain/nextNonce:
$ref: '#/definitions/TokensResponse'
/chain/allowances:
post:
tags:
- 'chain'
summary: 'Get the next nonce for the provided private key'
operationId: 'nonce'
summary: 'Get ERC20 allowances for an address on a chain'
operationId: 'allowances'
consumes:
- 'application/json'
produces:
Expand All @@ -35,18 +58,19 @@ paths:
name: 'body'
required: true
schema:
$ref: '#/definitions/NonceRequest'
$ref: '#/definitions/AllowancesRequest'
responses:
'200':
schema:
$ref: '#/definitions/NonceResponse'

/chain/allowances:
$ref: '#/definitions/AllowancesResponse'


/chain/balances:
post:
tags:
- 'chain'
summary: 'Get the ERC20 allowances for a spender on a given private key'
operationId: 'allowances'
summary: 'Get balances for an address on a chain'
operationId: 'balances'
consumes:
- 'application/json'
produces:
Expand All @@ -56,11 +80,12 @@ paths:
name: 'body'
required: true
schema:
$ref: '#/definitions/AllowancesRequest'
$ref: '#/definitions/BalancesRequest'
responses:
'200':
schema:
$ref: '#/definitions/AllowancesResponse'
$ref: '#/definitions/BalancesResponse'

/chain/approve:
post:
tags:
Expand Down Expand Up @@ -118,3 +143,66 @@ paths:
- 'application/json'
responses:
'200'

/chain/poll:
post:
tags:
- 'chain'
summary: 'Poll the status of a transaction on a chain'
operationId: 'poll'
consumes:
- 'application/json'
produces:
- 'application/json'
parameters:
- in: 'body'
name: 'body'
required: true
schema:
$ref: '#/definitions/PollRequest'
responses:
'200':
schema:
$ref: '#/definitions/PollResponse'

/chain/nonce:
post:
tags:
- 'chain'
summary: 'Get the current nonce for the provided private key'
operationId: 'nonce'
consumes:
- 'application/json'
produces:
- 'application/json'
parameters:
- in: 'body'
name: 'body'
required: true
schema:
$ref: '#/definitions/NonceRequest'
responses:
'200':
schema:
$ref: '#/definitions/NonceResponse'

/chain/nextNonce:
post:
tags:
- 'chain'
summary: 'Get the next nonce for the provided private key'
operationId: 'nonce'
consumes:
- 'application/json'
produces:
- 'application/json'
parameters:
- in: 'body'
name: 'body'
required: true
schema:
$ref: '#/definitions/NonceRequest'
responses:
'200':
schema:
$ref: '#/definitions/NonceResponse'
Loading

0 comments on commit 23f5b00

Please sign in to comment.