Skip to content

Commit

Permalink
Crosschain enhanced: Arbitrum mainnet + util (getDepositStatus) (#825)
Browse files Browse the repository at this point in the history
  • Loading branch information
pdyraga authored Sep 5, 2024
2 parents 2ab5728 + 9e5ac4e commit 834bfa8
Show file tree
Hide file tree
Showing 16 changed files with 939 additions and 79 deletions.
1 change: 1 addition & 0 deletions typescript/api-reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
### Enumerations

- [BitcoinNetwork](enums/BitcoinNetwork-1.md)
- [DepositState](enums/DepositState.md)
- [WalletState](enums/WalletState-1.md)

### Classes
Expand Down
16 changes: 8 additions & 8 deletions typescript/api-reference/classes/ArbitrumL2BitcoinDepositor.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ EthersContractHandle\<L2BitcoinDepositorTypechain\>.constructor

#### Defined in

[lib/arbitrum/l2-bitcoin-depositor.ts:37](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L37)
[lib/arbitrum/l2-bitcoin-depositor.ts:36](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L36)

## Properties

Expand All @@ -73,7 +73,7 @@ EthersContractHandle\<L2BitcoinDepositorTypechain\>.constructor

#### Defined in

[lib/arbitrum/l2-bitcoin-depositor.ts:35](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L35)
[lib/arbitrum/l2-bitcoin-depositor.ts:34](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L34)

___

Expand All @@ -83,7 +83,7 @@ ___

#### Defined in

[lib/arbitrum/l2-bitcoin-depositor.ts:34](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L34)
[lib/arbitrum/l2-bitcoin-depositor.ts:33](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L33)

___

Expand Down Expand Up @@ -153,7 +153,7 @@ EthersContractHandle.\_totalRetryAttempts

#### Defined in

[lib/arbitrum/l2-bitcoin-depositor.ts:85](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L85)
[lib/arbitrum/l2-bitcoin-depositor.ts:83](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L83)

___

Expand Down Expand Up @@ -195,7 +195,7 @@ ___

#### Defined in

[lib/arbitrum/l2-bitcoin-depositor.ts:61](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L61)
[lib/arbitrum/l2-bitcoin-depositor.ts:59](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L59)

___

Expand All @@ -215,7 +215,7 @@ ___

#### Defined in

[lib/arbitrum/l2-bitcoin-depositor.ts:69](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L69)
[lib/arbitrum/l2-bitcoin-depositor.ts:67](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L67)

___

Expand Down Expand Up @@ -278,7 +278,7 @@ ___

#### Defined in

[lib/arbitrum/l2-bitcoin-depositor.ts:93](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L93)
[lib/arbitrum/l2-bitcoin-depositor.ts:91](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L91)

___

Expand All @@ -304,4 +304,4 @@ ___

#### Defined in

[lib/arbitrum/l2-bitcoin-depositor.ts:77](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L77)
[lib/arbitrum/l2-bitcoin-depositor.ts:75](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts#L75)
6 changes: 3 additions & 3 deletions typescript/api-reference/classes/ArbitrumL2TBTCToken.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ EthersContractHandle\<L2TBTCTypechain\>.constructor

#### Defined in

[lib/arbitrum/l2-tbtc-token.ts:23](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-tbtc-token.ts#L23)
[lib/arbitrum/l2-tbtc-token.ts:22](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-tbtc-token.ts#L22)

## Properties

Expand Down Expand Up @@ -134,7 +134,7 @@ EthersContractHandle.\_totalRetryAttempts

#### Defined in

[lib/arbitrum/l2-tbtc-token.ts:53](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-tbtc-token.ts#L53)
[lib/arbitrum/l2-tbtc-token.ts:51](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-tbtc-token.ts#L51)

___

Expand Down Expand Up @@ -176,7 +176,7 @@ ___

#### Defined in

[lib/arbitrum/l2-tbtc-token.ts:45](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-tbtc-token.ts#L45)
[lib/arbitrum/l2-tbtc-token.ts:43](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/arbitrum/l2-tbtc-token.ts#L43)

___

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ for reference.

#### Defined in

[lib/ethereum/l1-bitcoin-depositor.ts:163](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L163)
[lib/ethereum/l1-bitcoin-depositor.ts:172](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L172)

___

Expand All @@ -81,4 +81,4 @@ ___

#### Defined in

[lib/ethereum/l1-bitcoin-depositor.ts:149](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L149)
[lib/ethereum/l1-bitcoin-depositor.ts:158](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L158)
37 changes: 32 additions & 5 deletions typescript/api-reference/classes/EthereumL1BitcoinDepositor.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ for reference.
- [extraDataEncoder](EthereumL1BitcoinDepositor.md#extradataencoder)
- [getAddress](EthereumL1BitcoinDepositor.md#getaddress)
- [getChainIdentifier](EthereumL1BitcoinDepositor.md#getchainidentifier)
- [getDepositState](EthereumL1BitcoinDepositor.md#getDepositState)
- [getEvents](EthereumL1BitcoinDepositor.md#getevents)
- [initializeDeposit](EthereumL1BitcoinDepositor.md#initializedeposit)

Expand Down Expand Up @@ -62,7 +63,7 @@ EthersContractHandle\<L1BitcoinDepositorTypechain\>.constructor

#### Defined in

[lib/ethereum/l1-bitcoin-depositor.ts:64](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L64)
[lib/ethereum/l1-bitcoin-depositor.ts:65](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L65)

## Properties

Expand All @@ -72,7 +73,7 @@ EthersContractHandle\<L1BitcoinDepositorTypechain\>.constructor

#### Defined in

[lib/ethereum/l1-bitcoin-depositor.ts:62](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L62)
[lib/ethereum/l1-bitcoin-depositor.ts:63](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L63)

___

Expand Down Expand Up @@ -142,7 +143,7 @@ EthersContractHandle.\_totalRetryAttempts

#### Defined in

[lib/ethereum/l1-bitcoin-depositor.ts:99](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L99)
[lib/ethereum/l1-bitcoin-depositor.ts:108](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L108)

___

Expand Down Expand Up @@ -184,7 +185,33 @@ ___

#### Defined in

[lib/ethereum/l1-bitcoin-depositor.ts:91](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L91)
[lib/ethereum/l1-bitcoin-depositor.ts:100](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L100)

___

### getDepositState

**getDepositState**(`depositId`): `Promise`\<[`DepositState`](../enums/DepositState.md)\>

#### Parameters

| Name | Type |
| :------ | :------ |
| `depositId` | `string` |

#### Returns

`Promise`\<[`DepositState`](../enums/DepositState.md)\>

**`See`**

#### Implementation of

[L1BitcoinDepositor](../interfaces/L1BitcoinDepositor.md).[getDepositState](../interfaces/L1BitcoinDepositor.md#getDepositState)

#### Defined in

[lib/ethereum/l1-bitcoin-depositor.ts:92](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L92)

___

Expand Down Expand Up @@ -247,4 +274,4 @@ ___

#### Defined in

[lib/ethereum/l1-bitcoin-depositor.ts:107](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L107)
[lib/ethereum/l1-bitcoin-depositor.ts:116](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts#L116)
41 changes: 41 additions & 0 deletions typescript/api-reference/enums/DepositState.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Enumeration: DepositState

Represents the state of the deposit.

## Table of contents

### Enumeration Members

- [FINALIZED](DepositState.md#finalized)
- [INITIALIZED](DepositState.md#initialized)
- [UNKNOWN](DepositState.md#unknown)

## Enumeration Members

### FINALIZED

**FINALIZED** = ``2``

#### Defined in

[lib/contracts/cross-chain.ts:121](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L121)

___

### INITIALIZED

**INITIALIZED** = ``1``

#### Defined in

[lib/contracts/cross-chain.ts:119](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L119)

___

### UNKNOWN

**UNKNOWN** = ``0``

#### Defined in

[lib/contracts/cross-chain.ts:117](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L117)
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ Identifier of the deposit owner.

#### Defined in

[lib/contracts/cross-chain.ts:165](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L165)
[lib/contracts/cross-chain.ts:184](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L184)

___

Expand All @@ -60,4 +60,4 @@ Encoded extra data.

#### Defined in

[lib/contracts/cross-chain.ts:158](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L158)
[lib/contracts/cross-chain.ts:177](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L177)
31 changes: 28 additions & 3 deletions typescript/api-reference/interfaces/L1BitcoinDepositor.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ specific to the given L2 chain, deployed on the L1 chain.

- [extraDataEncoder](L1BitcoinDepositor.md#extradataencoder)
- [getChainIdentifier](L1BitcoinDepositor.md#getchainidentifier)
- [getDepositState](L1BitcoinDepositor.md#getDepositState)
- [initializeDeposit](L1BitcoinDepositor.md#initializedeposit)

## Methods
Expand All @@ -30,7 +31,7 @@ encode and decode the extra data included in the cross-chain deposit script.

#### Defined in

[lib/contracts/cross-chain.ts:126](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L126)
[lib/contracts/cross-chain.ts:145](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L145)

___

Expand All @@ -46,7 +47,31 @@ Gets the chain-specific identifier of this contract.

#### Defined in

[lib/contracts/cross-chain.ts:120](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L120)
[lib/contracts/cross-chain.ts:139](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L139)

___

### getDepositState

**getDepositState**(`depositId`): `Promise`\<[`DepositState`](../enums/DepositState.md)\>

Gets the deposit state for the given deposit identifier.

#### Parameters

| Name | Type | Description |
| :------ | :------ | :------ |
| `depositId` | `string` | Identifier of the deposit to get the state for. |

#### Returns

`Promise`\<[`DepositState`](../enums/DepositState.md)\>

The state of the deposit.

#### Defined in

[lib/contracts/cross-chain.ts:134](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L134)

___

Expand All @@ -73,4 +98,4 @@ Transaction hash of the reveal deposit transaction.

#### Defined in

[lib/contracts/cross-chain.ts:138](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L138)
[lib/contracts/cross-chain.ts:157](https://github.com/Unknown-Gravity/tbtc-v2-sdk/blob/main/typescript/src/lib/contracts/cross-chain.ts#L157)
2 changes: 1 addition & 1 deletion typescript/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@keep-network/tbtc-v2.ts",
"version": "2.5.0-dev",
"version": "2.5.1-dev",
"license": "MIT",
"main": "dist/src/index.js",
"types": "dist/src/index.d.ts",
Expand Down
Loading

0 comments on commit 834bfa8

Please sign in to comment.