Skip to content
Merged
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
25 changes: 25 additions & 0 deletions .changeset/olive-ideas-carry.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
---
"@human-protocol/sdk": minor
---

# Changelog

### Changed

- Relaxed several SDK return types (EscrowUtils, OperatorUtils, TransactionUtils, WorkerUtils) to allow `null` when a subgraph entity does not exist.

# How to upgrade

## TypeScript

### yarn

```bash
yarn upgrade @human-protocol/sdk
```

### npm

```bash
npm update @human-protocol/sdk
```
4 changes: 2 additions & 2 deletions .github/workflows/cd-cvat-exchange-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: PR check
run: |
Expand All @@ -44,7 +44,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cd-cvat-recording-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: PR check
run: |
Expand All @@ -45,7 +45,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cd-deploy-contracts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
MOONSCAN_API_KEY: ${{ secrets.MOONSCAN_API_KEY }}
AVALANCHE_API_KEY: ${{ secrets.AVALANCHE_API_KEY }}
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
with:
token: ${{ secrets.GH_TOKEN_CD_CONTRACTS }}
- uses: actions/setup-node@v4
Expand Down Expand Up @@ -126,7 +126,7 @@ jobs:
git stash --include-untracked
- name: Checkout develop
if: always() && steps.check_changes.outputs.changes == 'true'
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: develop
token: ${{ secrets.GH_TOKEN_CD_CONTRACTS }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cd-job-launcher-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: PR check
run: |
Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd-packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
name: Publish packages to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cd-python-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:
name: Publish Python SDK
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand All @@ -24,7 +24,7 @@ jobs:
- name: Build core package
run: yarn workspace @human-protocol/core build
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: "3.x"
- name: Install dependencies
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cd-reputation-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ jobs:
if: ${{ github.event_name == 'pull_request' }}
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: PR check
run: |
Expand All @@ -41,7 +41,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- uses: convictional/trigger-workflow-and-wait@v1.6.5
with:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cd-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
fail-fast: true
max-parallel: 3
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-dependency-review.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
dependency-review:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- uses: actions/checkout@v5
- name: Dependency Review
uses: actions/dependency-review-action@v4.7.2
uses: actions/dependency-review-action@v4.7.3
with:
show-openssf-scorecard: false
4 changes: 2 additions & 2 deletions .github/workflows/ci-lint-cvat-exchange-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
name: CVAT Exchange Oracle Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.4
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: '3.10'
cache: 'poetry'
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-lint-cvat-recording-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ jobs:
name: CVAT Recording Oracle Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: Install Poetry
uses: snok/install-poetry@v1
with:
version: 1.8.4
- uses: actions/setup-python@v5
- uses: actions/setup-python@v6
with:
python-version: '3.10'
cache: 'poetry'
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-core.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ jobs:
name: Core Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-cvat-exchange-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: CVAT Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: CVAT Exchange Oracle tests
working-directory: ./packages/examples/cvat/exchange-oracle
run: docker compose -f docker-compose.test.yml up --attach test --exit-code-from test
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-cvat-recording-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: CVAT Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- name: CVAT Recording Oracle tests
working-directory: ./packages/examples/cvat/recording-oracle
run: docker compose -f docker-compose.test.yml up --attach test --exit-code-from test
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-dashboard.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Dashboard Server Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-faucet-server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Faucet Server Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-test-fortune.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Fortune Exchange Oracle Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand All @@ -28,7 +28,7 @@ jobs:
name: Fortune Recording Oracle Tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-human-app.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Human App Server Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-job-launcher.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Job Launcher Server Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-node-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Node.js SDK Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci-test-python-sdk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
name: Python Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand All @@ -21,7 +21,7 @@ jobs:
- name: Build core package
run: yarn workspace @human-protocol/core build
- name: Set up Python 3.10
uses: actions/setup-python@v5
uses: actions/setup-python@v6
with:
python-version: '3.10'
- name: Install pipenv
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-reputation-oracle.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
name: Reputation Oracle Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-test-subgraph.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
# TODO: Use ubuntu-latest when graph binary is not failing on ubuntu 24.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v5
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
Expand Down
33 changes: 29 additions & 4 deletions docs/sdk/typescript/base/classes/BaseEthersClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Class: `abstract` BaseEthersClient

Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10)
Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/57c781c4208fceea534a5c18b81692eb57100170/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)

## Introduction

Expand All @@ -24,7 +24,7 @@ This class is used as a base class for other clients making on-chain calls.

> **new BaseEthersClient**(`runner`, `networkData`): `BaseEthersClient`

Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
Defined in: [base.ts:22](https://github.com/humanprotocol/human-protocol/blob/57c781c4208fceea534a5c18b81692eb57100170/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L22)

**BaseClient constructor**

Expand Down Expand Up @@ -52,12 +52,37 @@ The network information required to connect to the contracts

> **networkData**: [`NetworkData`](../../types/type-aliases/NetworkData.md)

Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
Defined in: [base.ts:14](https://github.com/humanprotocol/human-protocol/blob/57c781c4208fceea534a5c18b81692eb57100170/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L14)

***

### runner

> `protected` **runner**: `ContractRunner`

Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
Defined in: [base.ts:13](https://github.com/humanprotocol/human-protocol/blob/57c781c4208fceea534a5c18b81692eb57100170/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L13)

## Methods

### applyTxDefaults()

> `protected` **applyTxDefaults**(`txOptions`): `Overrides`

Defined in: [base.ts:35](https://github.com/humanprotocol/human-protocol/blob/57c781c4208fceea534a5c18b81692eb57100170/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L35)

Internal helper to enrich transaction overrides with network specific defaults.

Aurora networks use a fixed gas price. We always override any user provided
gasPrice with the canonical DEFAULT_AURORA_GAS_PRICE to avoid mismatches
or tx failures due to an unexpected value. For other networks the user
supplied fee parameters are left untouched.

#### Parameters

##### txOptions

`Overrides` = `{}`

#### Returns

`Overrides`
Loading
Loading