Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Contracts deployment 20241219 #2951

Merged
merged 2 commits into from
Dec 23, 2024
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
6 changes: 3 additions & 3 deletions docs/sdk/python/human_protocol_sdk.encryption.encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Decrypts a message using the private key.
* **message** (`str`) – Armored message to decrypt
* **public_key** (`Optional`[`str`]) – Armored public key used for signature verification. Defaults to None.
* **Return type:**
`str`
`bytes`
* **Returns:**
Decrypted message
* **Example:**
Expand Down Expand Up @@ -94,7 +94,7 @@ Decrypts a message using the private key.
Signs a message using the private key.

* **Parameters:**
**message** (`str`) – Message to sign
**message** (`Union`[`str`, `bytes`]) – Message to sign
* **Return type:**
`str`
* **Returns:**
Expand Down Expand Up @@ -130,7 +130,7 @@ Signs a message using the private key.
Signs and encrypts a message using the private key and recipient’s public keys.

* **Parameters:**
* **message** (`str`) – Message to sign and encrypt
* **message** (`Union`[`str`, `bytes`]) – Message to sign and encrypt
* **public_keys** (`List`[`str`]) – List of armored public keys of the recipients
* **Return type:**
`str`
Expand Down
6 changes: 3 additions & 3 deletions docs/sdk/python/human_protocol_sdk.operator.operator_utils.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ print(

## Module

### *class* human_protocol_sdk.operator.operator_utils.LeaderData(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, url=None, job_types=None, registration_needed=None, registration_instructions=None, reputation_networks=None)
### *class* human_protocol_sdk.operator.operator_utils.LeaderData(chain_id, id, address, amount_staked, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, website=None, url=None, job_types=None, registration_needed=None, registration_instructions=None, reputation_networks=None)

Bases: `object`

#### \_\_init_\_(chain_id, id, address, amount_staked, amount_allocated, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, url=None, job_types=None, registration_needed=None, registration_instructions=None, reputation_networks=None)
#### \_\_init_\_(chain_id, id, address, amount_staked, amount_locked, locked_until_timestamp, amount_withdrawn, amount_slashed, reward, amount_jobs_processed, role=None, fee=None, public_key=None, webhook_url=None, website=None, url=None, job_types=None, registration_needed=None, registration_instructions=None, reputation_networks=None)

Initializes an LeaderData instance.

Expand All @@ -30,7 +30,6 @@ Initializes an LeaderData instance.
* **id** (`str`) – Identifier
* **address** (`str`) – Address
* **amount_staked** (`int`) – Amount staked
* **amount_allocated** (`int`) – Amount allocated
* **amount_locked** (`int`) – Amount locked
* **locked_until_timestamp** (`int`) – Locked until timestamp
* **amount_withdrawn** (`int`) – Amount withdrawn
Expand All @@ -41,6 +40,7 @@ Initializes an LeaderData instance.
* **fee** (`Optional`[`int`]) – Fee
* **public_key** (`Optional`[`str`]) – Public key
* **webhook_url** (`Optional`[`str`]) – Webhook url
* **website** (`Optional`[`str`]) – Website url
* **url** (`Optional`[`str`]) – Url
* **job_types** (`Optional`[`List`[`str`]]) – Job types
* **registration_needed** (`Optional`[`bool`]) – True
Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/typescript/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
**@human-protocol/sdk** • [**Docs**](modules.md)
**@human-protocol/sdk**

***

Expand Down
2 changes: 1 addition & 1 deletion docs/sdk/typescript/base/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@human-protocol/sdk**](../README.md) • **Docs**
[**@human-protocol/sdk**](../README.md)

***

Expand Down
16 changes: 10 additions & 6 deletions docs/sdk/typescript/base/classes/BaseEthersClient.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@human-protocol/sdk**](../../README.md) • **Docs**
[**@human-protocol/sdk**](../../README.md)

***

Expand Down Expand Up @@ -26,11 +26,15 @@ This class is used as a base class for other clients making on-chain calls.

#### Parameters

• **runner**: `ContractRunner`
##### runner

`ContractRunner`

The Signer or Provider object to interact with the Ethereum network

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

[`NetworkData`](../../types/type-aliases/NetworkData.md)

The network information required to connect to the contracts

Expand All @@ -40,7 +44,7 @@ The network information required to connect to the contracts

#### Defined in

[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)

## Properties

Expand All @@ -50,7 +54,7 @@ The network information required to connect to the contracts

#### Defined in

[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)

***

Expand All @@ -60,4 +64,4 @@ The network information required to connect to the contracts

#### Defined in

[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
2 changes: 1 addition & 1 deletion docs/sdk/typescript/encryption/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@human-protocol/sdk**](../README.md) • **Docs**
[**@human-protocol/sdk**](../README.md)

***

Expand Down
48 changes: 32 additions & 16 deletions docs/sdk/typescript/encryption/classes/Encryption.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@human-protocol/sdk**](../../README.md) • **Docs**
[**@human-protocol/sdk**](../../README.md)

***

Expand Down Expand Up @@ -55,7 +55,9 @@ Constructor for the Encryption class.

#### Parameters

• **privateKey**: `PrivateKey`
##### privateKey

`PrivateKey`

The private key.

Expand All @@ -65,29 +67,33 @@ The private key.

#### Defined in

[encryption.ts:52](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L52)
[encryption.ts:62](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L62)

## Methods

### decrypt()

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

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

#### Parameters

• **message**: `string`
##### message

`string`

Message to decrypt.

• **publicKey?**: `string`
##### publicKey?

`string`

Public key used to verify signature if needed. This is optional.

#### Returns

`Promise`\<`string`\>
`Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>

Message decrypted.

Expand Down Expand Up @@ -117,7 +123,7 @@ const resultMessage = await encription.decrypt('message');

#### Defined in

[encryption.ts:179](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L179)
[encryption.ts:190](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L190)

***

Expand All @@ -129,7 +135,9 @@ This function signs a message using the private key used to initialize the clien

#### Parameters

• **message**: `string`
##### message

`string`

Message to sign.

Expand All @@ -153,7 +161,7 @@ const resultMessage = await encription.sign('message');

#### Defined in

[encryption.ts:216](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L216)
[encryption.ts:247](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L247)

***

Expand All @@ -165,11 +173,15 @@ This function signs and encrypts a message using the private key used to initial

#### Parameters

• **message**: `string`
##### message

`MessageDataType`

Message to sign and encrypt.

• **publicKeys**: `string`[]
##### publicKeys

`string`[]

Array of public keys to use for encryption.

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

#### Defined in

[encryption.ts:128](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L128)
[encryption.ts:138](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L138)

***

Expand All @@ -230,11 +242,15 @@ Builds an Encryption instance by decrypting the private key from an encrypted pr

#### Parameters

• **privateKeyArmored**: `string`
##### privateKeyArmored

`string`

The encrypted private key in armored format.

• **passphrase?**: `string`
##### passphrase?

`string`

Optional: The passphrase for the private key.

Expand All @@ -246,4 +262,4 @@ Optional: The passphrase for the private key.

#### Defined in

[encryption.ts:63](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L63)
[encryption.ts:73](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L73)
48 changes: 33 additions & 15 deletions docs/sdk/typescript/encryption/classes/EncryptionUtils.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@human-protocol/sdk**](../../README.md) • **Docs**
[**@human-protocol/sdk**](../../README.md)

***

Expand Down Expand Up @@ -50,11 +50,15 @@ This function encrypts a message using the specified public keys.

#### Parameters

• **message**: `string`
##### message

`MessageDataType`

Message to encrypt.

• **publicKeys**: `string`[]
##### publicKeys

`string`[]

Array of public keys to use for encryption.

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

#### Defined in

[encryption.ts:421](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L421)
[encryption.ts:452](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L452)

***

Expand All @@ -111,15 +115,21 @@ This function generates a key pair for encryption and decryption.

#### Parameters

• **name**: `string`
##### name

`string`

Name for the key pair.

• **email**: `string`
##### email

`string`

Email for the key pair.

• **passphrase**: `string` = `''`
##### passphrase

`string` = `''`

Passphrase to encrypt the private key. Optional.

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

#### Defined in

[encryption.ts:359](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L359)
[encryption.ts:390](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L390)

***

Expand All @@ -166,7 +176,9 @@ This function gets signed data from a signed message.

#### Parameters

• **message**: `string`
##### message

`string`

Message.

Expand All @@ -186,7 +198,7 @@ const signedData = await EncriptionUtils.getSignedData('message');

#### Defined in

[encryption.ts:316](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L316)
[encryption.ts:347](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L347)

***

Expand All @@ -198,7 +210,9 @@ Verifies if a message appears to be encrypted with OpenPGP.

#### Parameters

• **message**: `string`
##### message

`string`

Message to verify.

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

#### Defined in

[encryption.ts:470](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L470)
[encryption.ts:502](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L502)

***

Expand All @@ -246,11 +260,15 @@ This function verifies the signature of a signed message using the public key.

#### Parameters

• **message**: `string`
##### message

`string`

Message to verify.

• **publicKey**: `string`
##### publicKey

`string`

Public key to verify that the message was sign by a specific source.

Expand Down Expand Up @@ -282,4 +300,4 @@ const result = await EncriptionUtils.verify('message', publicKey);

#### Defined in

[encryption.ts:283](https://github.com/humanprotocol/human-protocol/blob/2adb3114c920b5264832199f17e9531ba585c005/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L283)
[encryption.ts:314](https://github.com/humanprotocol/human-protocol/blob/d09ba07adfea005abceaa4b9fc19ef8d97dfa6cc/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L314)
2 changes: 1 addition & 1 deletion docs/sdk/typescript/enums/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[**@human-protocol/sdk**](../README.md) • **Docs**
[**@human-protocol/sdk**](../README.md)

***

Expand Down
Loading
Loading