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
13 changes: 13 additions & 0 deletions .changeset/config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
{
"$schema": "https://unpkg.com/@changesets/config@3.1.1/schema.json",
"commit": false,
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"changelog": false,
"bumpVersionsWithWorkspaceProtocolOnly": true,
"privatePackages": {
"version": false,
"tag": false
}
}
30 changes: 0 additions & 30 deletions .github/workflows/cd-core.yaml

This file was deleted.

26 changes: 0 additions & 26 deletions .github/workflows/cd-logger.yaml

This file was deleted.

45 changes: 0 additions & 45 deletions .github/workflows/cd-node-sdk.yaml

This file was deleted.

38 changes: 38 additions & 0 deletions .github/workflows/cd-packages.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Publish packages

permissions:
contents: write # needed to push tags

on:
push:
branches:
- main

jobs:
publish:
name: Publish packages to NPM
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version-file: .nvmrc
cache: yarn
- name: Install dependencies
run: yarn install --immutable
# If there is no new version for dependency package (e.g. core)
# then `prepack` is not called for it during publish step
# and it's not built. As a result dependant package (e.g. sdk)
# don't have its dependency and can't be build as well,
# so we have to build all deps in their topological order first.
- name: Build packages
run: yarn workspaces foreach --all --no-private -pt run build
- name: Publish packages
run: yarn workspaces foreach --all --no-private -pt npm publish --tolerate-republish --json | tee publish.log
env:
SKIP_PREPACK: true
YARN_NPM_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
- name: Tag published packages
run: node scripts/tag-published-packages.mjs publish.log
- name: Push created tags
run: git push origin --tags
6 changes: 5 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@ yarn-error.log*
# OS
.DS_Store

# Artifacts
build
dist
*.tsbuildinfo
hardhat-dependency-compiler
package.tgz

# cache
# Cache
cache

# Ignore developer-only local files
.local
3 changes: 0 additions & 3 deletions .prettierignore

This file was deleted.

724 changes: 359 additions & 365 deletions .yarn/releases/yarn-4.9.1.cjs → .yarn/releases/yarn-4.9.4.cjs

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
yarnPath: .yarn/releases/yarn-4.9.1.cjs
yarnPath: .yarn/releases/yarn-4.9.4.cjs

nodeLinker: node-modules

npmPublishAccess: public
11 changes: 11 additions & 0 deletions docs/sdk/python/human_protocol_sdk.kvstore.kvstore_client.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,17 @@ Initializes a KVStore instance.
* **web3** (`Web3`) – The Web3 object
* **gas_limit** (`Optional`[`int`]) – (Optional) Gas limit for transactions

#### get(address, key)

Gets the value of a key-value pair in the contract.
:type address: `str`
:param address: The Ethereum address associated with the key-value pair
:type key: `str`
:param key: The key of the key-value pair to get
:rtype: `str`
:return: The value of the key-value pair if it exists
:example:

#### set(\*args, \*\*kwargs)

#### set_bulk(\*args, \*\*kwargs)
Expand Down
1 change: 1 addition & 0 deletions docs/sdk/python/human_protocol_sdk.kvstore.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ This module allows the contract interaction with the key value storage on chain.
* [Module](human_protocol_sdk.kvstore.kvstore_client.md#module)
* [`KVStoreClient`](human_protocol_sdk.kvstore.kvstore_client.md#human_protocol_sdk.kvstore.kvstore_client.KVStoreClient)
* [`KVStoreClient.__init__()`](human_protocol_sdk.kvstore.kvstore_client.md#human_protocol_sdk.kvstore.kvstore_client.KVStoreClient.__init__)
* [`KVStoreClient.get()`](human_protocol_sdk.kvstore.kvstore_client.md#human_protocol_sdk.kvstore.kvstore_client.KVStoreClient.get)
* [`KVStoreClient.set()`](human_protocol_sdk.kvstore.kvstore_client.md#human_protocol_sdk.kvstore.kvstore_client.KVStoreClient.set)
* [`KVStoreClient.set_bulk()`](human_protocol_sdk.kvstore.kvstore_client.md#human_protocol_sdk.kvstore.kvstore_client.KVStoreClient.set_bulk)
* [`KVStoreClient.set_file_url_and_hash()`](human_protocol_sdk.kvstore.kvstore_client.md#human_protocol_sdk.kvstore.kvstore_client.KVStoreClient.set_file_url_and_hash)
Expand Down
8 changes: 4 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/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10)
Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10)

## 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/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)

**BaseClient constructor**

Expand Down Expand Up @@ -52,12 +52,12 @@ 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/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)

***

### runner

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

Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
12 changes: 6 additions & 6 deletions docs/sdk/typescript/encryption/classes/Encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Class: Encryption

Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58)
Defined in: [encryption.ts:58](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L58)

## Introduction

Expand Down Expand Up @@ -53,7 +53,7 @@ const encryption = await Encryption.build(privateKey, passphrase);

> **new Encryption**(`privateKey`): `Encryption`

Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66)
Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66)

Constructor for the Encryption class.

Expand All @@ -75,7 +75,7 @@ The private key.

> **decrypt**(`message`, `publicKey?`): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>

Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194)
Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194)

This function decrypts messages using the private key. In addition, the public key can be added for signature verification.

Expand Down Expand Up @@ -129,7 +129,7 @@ const resultMessage = await encryption.decrypt('message');

> **sign**(`message`): `Promise`\<`string`\>

Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251)
Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251)

This function signs a message using the private key used to initialize the client.

Expand Down Expand Up @@ -165,7 +165,7 @@ const resultMessage = await encryption.sign('message');

> **signAndEncrypt**(`message`, `publicKeys`): `Promise`\<`string`\>

Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142)
Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142)

This function signs and encrypts a message using the private key used to initialize the client and the specified public keys.

Expand Down Expand Up @@ -232,7 +232,7 @@ const resultMessage = await encryption.signAndEncrypt('message', publicKeys);

> `static` **build**(`privateKeyArmored`, `passphrase?`): `Promise`\<`Encryption`\>

Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77)
Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77)

Builds an Encryption instance by decrypting the private key from an encrypted private key and passphrase.

Expand Down
12 changes: 6 additions & 6 deletions docs/sdk/typescript/encryption/classes/EncryptionUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

# Class: EncryptionUtils

Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290)
Defined in: [encryption.ts:290](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L290)

## Introduction

Expand Down Expand Up @@ -48,7 +48,7 @@ const keyPair = await EncryptionUtils.generateKeyPair('Human', 'human@hmt.ai');

> `static` **encrypt**(`message`, `publicKeys`): `Promise`\<`string`\>

Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444)
Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444)

This function encrypts a message using the specified public keys.

Expand Down Expand Up @@ -111,7 +111,7 @@ const result = await EncryptionUtils.encrypt('message', publicKeys);

> `static` **generateKeyPair**(`name`, `email`, `passphrase`): `Promise`\<[`IKeyPair`](../../interfaces/interfaces/IKeyPair.md)\>

Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382)
Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382)

This function generates a key pair for encryption and decryption.

Expand Down Expand Up @@ -158,7 +158,7 @@ const result = await EncryptionUtils.generateKeyPair(name, email, passphrase);

> `static` **getSignedData**(`message`): `Promise`\<`string`\>

Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351)
Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351)

This function gets signed data from a signed message.

Expand Down Expand Up @@ -190,7 +190,7 @@ const signedData = await EncryptionUtils.getSignedData('message');

> `static` **isEncrypted**(`message`): `boolean`

Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494)
Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494)

Verifies if a message appears to be encrypted with OpenPGP.

Expand Down Expand Up @@ -238,7 +238,7 @@ if (isEncrypted) {

> `static` **verify**(`message`, `publicKey`): `Promise`\<`boolean`\>

Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/5b6e90353814741f056deb2914334a3c4fbc279d/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318)
Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/8c6afbe01e352b593635124b575731df11c509c7/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318)

This function verifies the signature of a signed message using the public key.

Expand Down
Loading
Loading