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

SDK: Expose a way to fetch pending redemptions using wallet PKH #818

Merged
merged 2 commits into from
Jul 5, 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
10 changes: 5 additions & 5 deletions typescript/api-reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ Represents an event emitted on deposit reveal to the on-chain bridge.

#### Defined in

[src/lib/contracts/bridge.ts:293](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L293)
[src/lib/contracts/bridge.ts:307](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L307)

___

Expand Down Expand Up @@ -394,7 +394,7 @@ Represents an event emitted when new wallet is registered on the on-chain bridge

#### Defined in

[src/lib/contracts/bridge.ts:457](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L457)
[src/lib/contracts/bridge.ts:471](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L471)

___

Expand Down Expand Up @@ -465,7 +465,7 @@ Represents an event emitted on redemption request.

#### Defined in

[src/lib/contracts/bridge.ts:344](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L344)
[src/lib/contracts/bridge.ts:358](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L358)

___

Expand Down Expand Up @@ -1025,7 +1025,7 @@ Packed parameters.

#### Defined in

[src/lib/ethereum/bridge.ts:699](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L699)
[src/lib/ethereum/bridge.ts:714](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L714)

___

Expand Down Expand Up @@ -1213,4 +1213,4 @@ This function does not validate the depositor's identifier as its

#### Defined in

[src/lib/contracts/bridge.ts:233](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L233)
[src/lib/contracts/bridge.ts:247](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L247)
66 changes: 47 additions & 19 deletions typescript/api-reference/classes/EthereumBridge.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ for reference.
- [parseRedemptionRequest](EthereumBridge.md#parseredemptionrequest)
- [parseWalletDetails](EthereumBridge.md#parsewalletdetails)
- [pendingRedemptions](EthereumBridge.md#pendingredemptions)
- [pendingRedemptionsByWalletPKH](EthereumBridge.md#pendingredemptionsbywalletpkh)
- [requestRedemption](EthereumBridge.md#requestredemption)
- [revealDeposit](EthereumBridge.md#revealdeposit)
- [submitDepositSweepProof](EthereumBridge.md#submitdepositsweepproof)
Expand Down Expand Up @@ -148,7 +149,7 @@ EthersContractHandle.\_totalRetryAttempts

#### Defined in

[src/lib/ethereum/bridge.ts:494](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L494)
[src/lib/ethereum/bridge.ts:509](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L509)

___

Expand Down Expand Up @@ -177,7 +178,7 @@ Builds the UTXO hash based on the UTXO components. UTXO hash is computed as

#### Defined in

[src/lib/ethereum/bridge.ts:629](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L629)
[src/lib/ethereum/bridge.ts:644](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L644)

___

Expand All @@ -204,7 +205,7 @@ ___

#### Defined in

[src/lib/ethereum/bridge.ts:429](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L429)
[src/lib/ethereum/bridge.ts:444](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L444)

___

Expand Down Expand Up @@ -334,7 +335,7 @@ Bridge.getNewWalletRegisteredEvents

#### Defined in

[src/lib/ethereum/bridge.ts:541](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L541)
[src/lib/ethereum/bridge.ts:556](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L556)

___

Expand All @@ -361,7 +362,7 @@ Bridge.getRedemptionRequestedEvents

#### Defined in

[src/lib/ethereum/bridge.ts:646](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L646)
[src/lib/ethereum/bridge.ts:661](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L661)

___

Expand All @@ -381,7 +382,7 @@ ___

#### Defined in

[src/lib/ethereum/bridge.ts:515](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L515)
[src/lib/ethereum/bridge.ts:530](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L530)

___

Expand All @@ -405,7 +406,7 @@ Parsed deposit request.

#### Defined in

[src/lib/ethereum/bridge.ts:474](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L474)
[src/lib/ethereum/bridge.ts:489](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L489)

___

Expand All @@ -430,7 +431,7 @@ Parsed redemption request.

#### Defined in

[src/lib/ethereum/bridge.ts:213](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L213)
[src/lib/ethereum/bridge.ts:228](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L228)

___

Expand All @@ -454,7 +455,7 @@ Parsed wallet data.

#### Defined in

[src/lib/ethereum/bridge.ts:600](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L600)
[src/lib/ethereum/bridge.ts:615](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L615)

___

Expand Down Expand Up @@ -485,6 +486,33 @@ ___

___

### pendingRedemptionsByWalletPKH

▸ **pendingRedemptionsByWalletPKH**(`walletPublicKeyHash`, `redeemerOutputScript`): `Promise`\<[`RedemptionRequest`](../interfaces/RedemptionRequest.md)\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `walletPublicKeyHash` | [`Hex`](Hex.md) |
| `redeemerOutputScript` | [`Hex`](Hex.md) |

#### Returns

`Promise`\<[`RedemptionRequest`](../interfaces/RedemptionRequest.md)\>

**`See`**

#### Implementation of

[Bridge](../interfaces/Bridge.md).[pendingRedemptionsByWalletPKH](../interfaces/Bridge.md#pendingredemptionsbywalletpkh)

#### Defined in

[src/lib/ethereum/bridge.ts:147](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L147)

___

### requestRedemption

▸ **requestRedemption**(`walletPublicKey`, `mainUtxo`, `redeemerOutputScript`, `amount`): `Promise`\<[`Hex`](Hex.md)\>
Expand All @@ -510,7 +538,7 @@ ___

#### Defined in

[src/lib/ethereum/bridge.ts:334](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L334)
[src/lib/ethereum/bridge.ts:349](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L349)

___

Expand Down Expand Up @@ -539,7 +567,7 @@ ___

#### Defined in

[src/lib/ethereum/bridge.ts:231](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L231)
[src/lib/ethereum/bridge.ts:246](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L246)

___

Expand Down Expand Up @@ -568,7 +596,7 @@ ___

#### Defined in

[src/lib/ethereum/bridge.ts:268](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L268)
[src/lib/ethereum/bridge.ts:283](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L283)

___

Expand Down Expand Up @@ -597,7 +625,7 @@ ___

#### Defined in

[src/lib/ethereum/bridge.ts:378](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L378)
[src/lib/ethereum/bridge.ts:393](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L393)

___

Expand All @@ -624,7 +652,7 @@ ___

#### Defined in

[src/lib/ethereum/bridge.ts:155](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L155)
[src/lib/ethereum/bridge.ts:170](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L170)

___

Expand All @@ -644,7 +672,7 @@ ___

#### Defined in

[src/lib/ethereum/bridge.ts:320](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L320)
[src/lib/ethereum/bridge.ts:335](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L335)

___

Expand All @@ -664,7 +692,7 @@ ___

#### Defined in

[src/lib/ethereum/bridge.ts:566](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L566)
[src/lib/ethereum/bridge.ts:581](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L581)

___

Expand All @@ -690,7 +718,7 @@ ___

#### Defined in

[src/lib/ethereum/bridge.ts:583](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L583)
[src/lib/ethereum/bridge.ts:598](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L598)

___

Expand All @@ -715,7 +743,7 @@ Deposit key.

#### Defined in

[src/lib/ethereum/bridge.ts:455](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L455)
[src/lib/ethereum/bridge.ts:470](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L470)

___

Expand All @@ -740,4 +768,4 @@ The redemption key.

#### Defined in

[src/lib/ethereum/bridge.ts:183](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L183)
[src/lib/ethereum/bridge.ts:198](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/bridge.ts#L198)
12 changes: 6 additions & 6 deletions typescript/api-reference/enums/WalletState-1.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ any action in the Bridge.

#### Defined in

[src/lib/contracts/bridge.ts:381](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L381)
[src/lib/contracts/bridge.ts:395](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L395)

___

Expand All @@ -36,7 +36,7 @@ and must defend against them.

#### Defined in

[src/lib/contracts/bridge.ts:376](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L376)
[src/lib/contracts/bridge.ts:390](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L390)

___

Expand All @@ -48,7 +48,7 @@ The wallet can sweep deposits and accept redemption requests.

#### Defined in

[src/lib/contracts/bridge.ts:363](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L363)
[src/lib/contracts/bridge.ts:377](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L377)

___

Expand All @@ -63,7 +63,7 @@ accepted.

#### Defined in

[src/lib/contracts/bridge.ts:370](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L370)
[src/lib/contracts/bridge.ts:384](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L384)

___

Expand All @@ -78,7 +78,7 @@ any actions in the Bridge.

#### Defined in

[src/lib/contracts/bridge.ts:388](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L388)
[src/lib/contracts/bridge.ts:402](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L402)

___

Expand All @@ -90,4 +90,4 @@ The wallet is unknown to the Bridge.

#### Defined in

[src/lib/contracts/bridge.ts:359](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L359)
[src/lib/contracts/bridge.ts:373](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/contracts/bridge.ts#L373)
Loading
Loading