Skip to content

Commit

Permalink
feat: expose full request message to listeners (#20)
Browse files Browse the repository at this point in the history
* feat: expose full message details to listeners

* feat: expose error entities

* docs: update docs to reflect new listners
  • Loading branch information
kieranroneill authored Apr 11, 2024
1 parent 010737c commit f65962f
Show file tree
Hide file tree
Showing 26 changed files with 327 additions and 179 deletions.
36 changes: 18 additions & 18 deletions docs/api-reference/avm-web-client.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -92,9 +92,9 @@ import TOCInline from '@theme/TOCInline';
#### Parameters

| Name | Type | Required | Default | Description |
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`result`?: [`IDisableResult`](types#idisableresult) \| `null`, `error`?: [`IBaseError`](types#ibaseerror) \| `null`) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |
| Name | Type | Required | Default | Description |
|----------|----------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`options`: [`IAVMWebClientListenerOptions`](types#iavmwebclientlisteneroptions)) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |


### `onDiscover(listener)`
Expand All @@ -103,9 +103,9 @@ import TOCInline from '@theme/TOCInline';
#### Parameters

| Name | Type | Required | Default | Description |
|----------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`result`?: [`IDiscoverResult`](types#idiscoverresult) \| `null`, `error`?: [`IBaseError`](types#ibaseerror) \| `null`) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |
| Name | Type | Required | Default | Description |
|----------|----------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`options`: [`IAVMWebClientListenerOptions`](types#iavmwebclientlisteneroptions)) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |

#### Returns

Expand All @@ -119,9 +119,9 @@ import TOCInline from '@theme/TOCInline';
#### Parameters

| Name | Type | Required | Default | Description |
|----------|--------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`result`?: [`IEnableResult`](types#ienableresult) \| `null`, `error`?: [`IBaseError`](types#ibaseerror) \| `null`) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |
| Name | Type | Required | Default | Description |
|----------|----------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`options`: [`IAVMWebClientListenerOptions`](types#iavmwebclientlisteneroptions)) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |

#### Returns

Expand All @@ -135,9 +135,9 @@ import TOCInline from '@theme/TOCInline';
#### Parameters

| Name | Type | Required | Default | Description |
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`result`?: [`IPostTransactionsResult`](types#iposttransactionsresult) \| `null`, `error`?: [`IBaseError`](types#ibaseerror) \| `null`) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |
| Name | Type | Required | Default | Description |
|----------|----------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`options`: [`IAVMWebClientListenerOptions`](types#iavmwebclientlisteneroptions)) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |

#### Returns

Expand All @@ -151,19 +151,19 @@ import TOCInline from '@theme/TOCInline';
#### Parameters

| Name | Type | Required | Default | Description |
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`result`?: [`IPostTransactionsResult`](types#iposttransactionsresult) \| `null`, `error`?: [`IBaseError`](types#ibaseerror) \| `null`) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |
| Name | Type | Required | Default | Description |
|----------|----------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`options`: [`IAVMWebClientListenerOptions`](types#iavmwebclientlisteneroptions)) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |

### `onSignTransactions(listener)`

> Listens to `sign_transactions` messages sent from providers. This will replace any previous set listeners. If null is supplied, the listener will be removed.
#### Parameters

| Name | Type | Required | Default | Description |
|----------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`result`?: [`ISignTransactionsResult`](types#isigntransactionsresult) \| `null`, `error`?: [`IBaseError`](types#ibaseerror) \| `null`) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |
| Name | Type | Required | Default | Description |
|----------|----------------------------------------------------------------------------------------------------------------------------|----------|---------|---------------------------------------------------------------------------------------------------------------------------------------------------------------|
| listener | (`options`: [`IAVMWebClientListenerOptions`](types#iavmwebclientlisteneroptions)) => (`void` \| `Promise<void>`) \| `null` | yes | - | The callback is called when a response message is received, or null to remove the listener. If the result was successful, the `error` parameter will be null. |

#### Returns

Expand Down
Loading

0 comments on commit f65962f

Please sign in to comment.