Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
portuu3 committed Feb 24, 2025
1 parent 06afdec commit 8b13e58
Show file tree
Hide file tree
Showing 78 changed files with 510 additions and 1,952 deletions.
7 changes: 0 additions & 7 deletions docs/sdk/python/human_protocol_sdk.constants.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,8 @@ Enum for KVStore keys

#### job_types *= 'job_types'*

<<<<<<< HEAD
=======
#### operator_name *= 'name'*

>>>>>>> develop
#### public_key *= 'public_key'*

#### public_key_hash *= 'public_key_hash'*
Expand All @@ -53,11 +50,7 @@ Enum for KVStore keys

#### website *= 'website'*

<<<<<<< HEAD
### *class* human_protocol_sdk.constants.OperatorCategory(value)
=======
### *class* human_protocol_sdk.constants.LeaderCategory(value)
>>>>>>> develop

Bases: `Enum`

Expand Down
9 changes: 0 additions & 9 deletions docs/sdk/python/human_protocol_sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,10 +129,7 @@
* [`KVStoreKeys.category`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.category)
* [`KVStoreKeys.fee`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.fee)
* [`KVStoreKeys.job_types`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.job_types)
<<<<<<< HEAD
=======
* [`KVStoreKeys.operator_name`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.operator_name)
>>>>>>> develop
* [`KVStoreKeys.public_key`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.public_key)
* [`KVStoreKeys.public_key_hash`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.public_key_hash)
* [`KVStoreKeys.registration_instructions`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.registration_instructions)
Expand All @@ -141,15 +138,9 @@
* [`KVStoreKeys.url`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.url)
* [`KVStoreKeys.webhook_url`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.webhook_url)
* [`KVStoreKeys.website`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.KVStoreKeys.website)
<<<<<<< HEAD
* [`OperatorCategory`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OperatorCategory)
* [`OperatorCategory.MACHINE_LEARNING`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OperatorCategory.MACHINE_LEARNING)
* [`OperatorCategory.MARKET_MAKING`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OperatorCategory.MARKET_MAKING)
=======
* [`LeaderCategory`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory)
* [`LeaderCategory.MACHINE_LEARNING`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory.MACHINE_LEARNING)
* [`LeaderCategory.MARKET_MAKING`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.LeaderCategory.MARKET_MAKING)
>>>>>>> develop
* [`OrderDirection`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection)
* [`OrderDirection.ASC`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection.ASC)
* [`OrderDirection.DESC`](human_protocol_sdk.constants.md#human_protocol_sdk.constants.OrderDirection.DESC)
Expand Down
4 changes: 1 addition & 3 deletions docs/sdk/typescript/base/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@

# base

## Index

### Classes
## Classes

- [BaseEthersClient](classes/BaseEthersClient.md)
28 changes: 6 additions & 22 deletions docs/sdk/typescript/base/classes/BaseEthersClient.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# Class: `abstract` BaseEthersClient

Defined in: [base.ts:10](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L10)

## Introduction

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

> **new BaseEthersClient**(`runner`, `networkData`): [`BaseEthersClient`](BaseEthersClient.md)
Defined in: [base.ts:20](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)

**BaseClient constructor**

#### Parameters
Expand All @@ -42,38 +46,18 @@ The network information required to connect to the contracts

[`BaseEthersClient`](BaseEthersClient.md)

#### Defined in

<<<<<<< HEAD
[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
=======
[base.ts:20](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L20)
>>>>>>> develop
## Properties

### networkData

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

<<<<<<< HEAD
[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
=======
[base.ts:12](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)
>>>>>>> develop
Defined in: [base.ts:12](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L12)

***

### runner

> `protected` **runner**: `ContractRunner`
#### Defined in

<<<<<<< HEAD
[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
=======
[base.ts:11](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
>>>>>>> develop
Defined in: [base.ts:11](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/base.ts#L11)
4 changes: 1 addition & 3 deletions docs/sdk/typescript/encryption/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

# encryption

## Index

### Classes
## Classes

- [Encryption](classes/Encryption.md)
- [EncryptionUtils](classes/EncryptionUtils.md)
52 changes: 12 additions & 40 deletions docs/sdk/typescript/encryption/classes/Encryption.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# Class: Encryption

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

## Introduction

Class for signing and decrypting messages.
Expand Down Expand Up @@ -51,6 +53,8 @@ const encryption = await Encryption.build(privateKey, passphrase);

> **new Encryption**(`privateKey`): [`Encryption`](Encryption.md)
Defined in: [encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66)

Constructor for the Encryption class.

#### Parameters
Expand All @@ -65,20 +69,14 @@ The private key.

[`Encryption`](Encryption.md)

#### Defined in

<<<<<<< HEAD
[encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66)
=======
[encryption.ts:66](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L66)
>>>>>>> develop
## Methods

### decrypt()

> **decrypt**(`message`, `publicKey`?): `Promise`\<`Uint8Array`\<`ArrayBufferLike`\>\>
Defined in: [encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/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.

#### Parameters
Expand Down Expand Up @@ -125,20 +123,14 @@ UYLqAQDfdym4kiUvKO1+REKASt0Gwykndl7hra9txqlUL5DXBQ===Vwgv
const resultMessage = await encryption.decrypt('message');
```

#### Defined in

<<<<<<< HEAD
[encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194)
=======
[encryption.ts:194](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L194)
>>>>>>> develop
***

### sign()

> **sign**(`message`): `Promise`\<`string`\>
Defined in: [encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251)

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

#### Parameters
Expand Down Expand Up @@ -167,20 +159,14 @@ const encryption = await Encryption.build(privateKey, passphrase);
const resultMessage = await encryption.sign('message');
```

#### Defined in

<<<<<<< HEAD
[encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251)
=======
[encryption.ts:251](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L251)
>>>>>>> develop
***

### signAndEncrypt()

> **signAndEncrypt**(`message`, `publicKeys`): `Promise`\<`string`\>
Defined in: [encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/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.

#### Parameters
Expand Down Expand Up @@ -240,20 +226,14 @@ const publicKeys = [publicKey1, publicKey2];
const resultMessage = await encryption.signAndEncrypt('message', publicKeys);
```

#### Defined in

<<<<<<< HEAD
[encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142)
=======
[encryption.ts:142](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L142)
>>>>>>> develop
***

### build()

> `static` **build**(`privateKeyArmored`, `passphrase`?): `Promise`\<[`Encryption`](Encryption.md)\>
Defined in: [encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/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.

#### Parameters
Expand All @@ -275,11 +255,3 @@ Optional: The passphrase for the private key.
`Promise`\<[`Encryption`](Encryption.md)\>

- The Encryption instance.

#### Defined in

<<<<<<< HEAD
[encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77)
=======
[encryption.ts:77](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L77)
>>>>>>> develop
52 changes: 12 additions & 40 deletions docs/sdk/typescript/encryption/classes/EncryptionUtils.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@

# Class: EncryptionUtils

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

## Introduction

Utility class for encryption-related operations.
Expand Down Expand Up @@ -46,6 +48,8 @@ const keyPair = await EncryptionUtils.generateKeyPair('Human', '[email protected]');

> `static` **encrypt**(`message`, `publicKeys`): `Promise`\<`string`\>
Defined in: [encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444)

This function encrypts a message using the specified public keys.

#### Parameters
Expand Down Expand Up @@ -101,20 +105,14 @@ const publicKeys = [publicKey1, publicKey2]
const result = await EncryptionUtils.encrypt('message', publicKeys);
```

#### Defined in

<<<<<<< HEAD
[encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444)
=======
[encryption.ts:444](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L444)
>>>>>>> develop
***

### generateKeyPair()

> `static` **generateKeyPair**(`name`, `email`, `passphrase`): `Promise`\<[`IKeyPair`](../../interfaces/interfaces/IKeyPair.md)\>
Defined in: [encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382)

This function generates a key pair for encryption and decryption.

#### Parameters
Expand Down Expand Up @@ -154,20 +152,14 @@ const passphrase = 'YOUR_PASSPHRASE';
const result = await EncryptionUtils.generateKeyPair(name, email, passphrase);
```

#### Defined in

<<<<<<< HEAD
[encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382)
=======
[encryption.ts:382](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L382)
>>>>>>> develop
***

### getSignedData()

> `static` **getSignedData**(`message`): `Promise`\<`string`\>
Defined in: [encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351)

This function gets signed data from a signed message.

#### Parameters
Expand All @@ -192,20 +184,14 @@ import { EncryptionUtils } from '@human-protocol/sdk';
const signedData = await EncryptionUtils.getSignedData('message');
```

#### Defined in

<<<<<<< HEAD
[encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351)
=======
[encryption.ts:351](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L351)
>>>>>>> develop
***

### isEncrypted()

> `static` **isEncrypted**(`message`): `boolean`
Defined in: [encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494)

Verifies if a message appears to be encrypted with OpenPGP.

#### Parameters
Expand Down Expand Up @@ -246,20 +232,14 @@ if (isEncrypted) {
}
```

#### Defined in

<<<<<<< HEAD
[encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494)
=======
[encryption.ts:494](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L494)
>>>>>>> develop
***

### verify()

> `static` **verify**(`message`, `publicKey`): `Promise`\<`boolean`\>
Defined in: [encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/06afdec15d4185a13ccdd98fd231f6651db0e480/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318)

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

#### Parameters
Expand Down Expand Up @@ -301,11 +281,3 @@ UYLqAQDfdym4kiUvKO1+REKASt0Gwykndl7hra9txqlUL5DXBQ===Vwgv

const result = await EncryptionUtils.verify('message', publicKey);
```

#### Defined in

<<<<<<< HEAD
[encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/9a36dcc76397ebaf05988194a5c5bf379999302c/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318)
=======
[encryption.ts:318](https://github.com/humanprotocol/human-protocol/blob/b718aa9d178d605c5b27fec98a4e6afa6f1db599/packages/sdk/typescript/human-protocol-sdk/src/encryption.ts#L318)
>>>>>>> develop
4 changes: 1 addition & 3 deletions docs/sdk/typescript/enums/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,7 @@

# enums

## Index

### Enumerations
## Enumerations

- [ChainId](enumerations/ChainId.md)
- [OperatorCategory](enumerations/OperatorCategory.md)
Expand Down
Loading

0 comments on commit 8b13e58

Please sign in to comment.