Skip to content

Commit

Permalink
Merge pull request #22 from SundaeSwap-finance/calvin/update-withdraw
Browse files Browse the repository at this point in the history
Taste Test
  • Loading branch information
cjkoepke authored Oct 20, 2023
2 parents 9d217f4 + 8822ec3 commit 023dadf
Show file tree
Hide file tree
Showing 30 changed files with 1,576 additions and 284 deletions.
25 changes: 25 additions & 0 deletions docs/typescript/core/enums/Core.EPoolSearchType.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# Enumeration: EPoolSearchType

[Core](../modules/Core.md).EPoolSearchType

Defines the type of pool list to retrieve.

## Enumeration Members

### ALL

**ALL** = ``"pools"``

#### Defined in

[@types/queryprovider.ts:11](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L11)

___

### POPULAR

**POPULAR** = ``"poolsPopular"``

#### Defined in

[@types/queryprovider.ts:12](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L12)
12 changes: 6 additions & 6 deletions docs/typescript/core/interfaces/Core.IPoolData.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Asset data for the pool pair, Asset A

#### Defined in

[@types/queryprovider.ts:82](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L82)
[@types/queryprovider.ts:101](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L101)

___

Expand All @@ -26,7 +26,7 @@ Asset data for the pool pair, Asset B

#### Defined in

[@types/queryprovider.ts:84](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L84)
[@types/queryprovider.ts:103](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L103)

___

Expand All @@ -38,7 +38,7 @@ The pool fee represented as a string. i.e. 1% === "1" and .03% === "0.03"

#### Defined in

[@types/queryprovider.ts:78](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L78)
[@types/queryprovider.ts:97](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L97)

___

Expand All @@ -50,7 +50,7 @@ The unique identifier of the pool. Also returned directly via [findPoolIdent](Co

#### Defined in

[@types/queryprovider.ts:80](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L80)
[@types/queryprovider.ts:99](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L99)

___

Expand All @@ -62,7 +62,7 @@ The pool quantity of [assetA](Core.IPoolData.md#asseta)

#### Defined in

[@types/queryprovider.ts:86](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L86)
[@types/queryprovider.ts:105](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L105)

___

Expand All @@ -74,4 +74,4 @@ The pool quantity of [assetB](Core.IPoolData.md#assetb)

#### Defined in

[@types/queryprovider.ts:88](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L88)
[@types/queryprovider.ts:107](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L107)
4 changes: 2 additions & 2 deletions docs/typescript/core/interfaces/Core.IPoolDataAsset.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ POLICY_ID_HEX.ASSET_NAME_HEX

#### Defined in

[@types/queryprovider.ts:68](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L68)
[@types/queryprovider.ts:87](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L87)

___

Expand All @@ -32,4 +32,4 @@ The registered decimal places of the asset.

#### Defined in

[@types/queryprovider.ts:70](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L70)
[@types/queryprovider.ts:89](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L89)
4 changes: 2 additions & 2 deletions docs/typescript/core/interfaces/Core.IPoolQuery.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ The desired pool fee as a percentage string.

#### Defined in

[@types/queryprovider.ts:55](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L55)
[@types/queryprovider.ts:74](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L74)

___

Expand All @@ -37,4 +37,4 @@ The pool pair, as an array of [assetId](Core.IPoolDataAsset.md#assetid)

#### Defined in

[@types/queryprovider.ts:53](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L53)
[@types/queryprovider.ts:72](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L72)
39 changes: 36 additions & 3 deletions docs/typescript/core/interfaces/Core.IQueryProviderClass.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ Finds the associated UTXO data of an open order.

#### Defined in

[@types/queryprovider.ts:34](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L34)
[@types/queryprovider.ts:53](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L53)

___

Expand All @@ -56,9 +56,11 @@ Finds a matching pool on the SundaeSwap protocol.

`Promise`<[`IPoolData`](Core.IPoolData.md)\>

Returns the queried pool's data.

#### Defined in

[@types/queryprovider.ts:19](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L19)
[@types/queryprovider.ts:28](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L28)

___

Expand All @@ -82,6 +84,37 @@ Finds a matching pool on the SundaeSwap protocol and returns only the ident.

`Promise`<`string`\>

Returns queried pool's ident.

#### Defined in

[@types/queryprovider.ts:37](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L37)

___

### getAllPools

**getAllPools**: (`type?`: [`EPoolSearchType`](../enums/Core.EPoolSearchType.md), `query?`: `string`) => `Promise`<[`IPoolData`](Core.IPoolData.md)[]\>

#### Type declaration

▸ (`type?`, `query?`): `Promise`<[`IPoolData`](Core.IPoolData.md)[]\>

Retrieves all available pools' data.

##### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `type?` | [`EPoolSearchType`](../enums/Core.EPoolSearchType.md) | The type of search to perform. |
| `query?` | `string` | A string to use as your query. |

##### Returns

`Promise`<[`IPoolData`](Core.IPoolData.md)[]\>

Returns an array of IPoolData objects, each representing the data for an individual pool.

#### Defined in

[@types/queryprovider.ts:27](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L27)
[@types/queryprovider.ts:46](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/core/src/@types/queryprovider.ts#L46)
1 change: 1 addition & 0 deletions docs/typescript/core/modules/Core.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ const txHash = await sdk.swap( /** ... */ ).then(({ submit }) => submit());

## Enumerations

- [EPoolSearchType](../enums/Core.EPoolSearchType.md)
- [PoolCoin](../enums/Core.PoolCoin.md)

## Classes
Expand Down
106 changes: 106 additions & 0 deletions docs/typescript/taste-test/classes/AbstractTasteTest.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
# Class: AbstractTasteTest

Represents the abstract class that should be extended to implement
the functionality of the Taste Test features. This class provides
the structure for depositing, updating, and withdrawing operations.

**`Property`**

An instance of the Lucid class, representing the core functionality handler.

## Implemented by

- [`TasteTest`](TasteTest.md)

## Properties

### lucid

`Abstract` **lucid**: `Lucid`

Represents the Lucid instance used for core operations.

#### Defined in

[taste-test/src/lib/classes/AbstractTasteTest.class.ts:17](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/taste-test/src/lib/classes/AbstractTasteTest.class.ts#L17)

## Methods

### deposit

`Abstract` **deposit**(`args`): `Promise`<[`ITxBuilder`](../interfaces/ITxBuilder.md)<`unknown`, `unknown`\>\>

Initiates a deposit transaction. The specific implementation of this method
should handle the business logic associated with making a deposit, including
validations, transaction building, and error handling.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `args` | [`IDepositArgs`](../interfaces/IDepositArgs.md) | The arguments required for the deposit operation, including the amount, user credentials, and other transaction details. |

#### Returns

`Promise`<[`ITxBuilder`](../interfaces/ITxBuilder.md)<`unknown`, `unknown`\>\>

- Returns a promise that resolves with an
ITxBuilder instance, representing the constructed transaction for the deposit.

#### Defined in

[taste-test/src/lib/classes/AbstractTasteTest.class.ts:29](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/taste-test/src/lib/classes/AbstractTasteTest.class.ts#L29)

___

### update

`Abstract` **update**(`args`): `Promise`<[`ITxBuilder`](../interfaces/ITxBuilder.md)<`unknown`, `unknown`\>\>

Initiates an update transaction. This method is responsible for handling
the business logic necessary to update an existing record or transaction.
This could include changing the amount, modifying references, or other updates.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `args` | [`IUpdateArgs`](../interfaces/IUpdateArgs.md) | The arguments required for the update operation. This includes any fields that are updatable within the transaction and may include credentials for authorization. |

#### Returns

`Promise`<[`ITxBuilder`](../interfaces/ITxBuilder.md)<`unknown`, `unknown`\>\>

- Returns a promise that resolves with an
ITxBuilder instance, representing the constructed transaction for the update.

#### Defined in

[taste-test/src/lib/classes/AbstractTasteTest.class.ts:42](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/taste-test/src/lib/classes/AbstractTasteTest.class.ts#L42)

___

### withdraw

`Abstract` **withdraw**(`args`): `Promise`<[`ITxBuilder`](../interfaces/ITxBuilder.md)<`unknown`, `unknown`\>\>

Initiates a withdrawal transaction. This method should handle the logic
associated with withdrawing funds, including validations, constructing the
withdrawal transaction, and handling errors appropriately.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `args` | [`IWithdrawArgs`](../interfaces/IWithdrawArgs.md) | The arguments required for the withdrawal operation, including the amount to withdraw, user credentials, and other necessary details. |

#### Returns

`Promise`<[`ITxBuilder`](../interfaces/ITxBuilder.md)<`unknown`, `unknown`\>\>

- Returns a promise that resolves with an
ITxBuilder instance, representing the constructed transaction for the withdrawal.

#### Defined in

[taste-test/src/lib/classes/AbstractTasteTest.class.ts:54](https://github.com/SundaeSwap-finance/sundae-sdk/blob/main/packages/taste-test/src/lib/classes/AbstractTasteTest.class.ts#L54)
Loading

0 comments on commit 023dadf

Please sign in to comment.