diff --git a/typescript/api-reference/README.md b/typescript/api-reference/README.md index fef7f0180..c3b8b1be9 100644 --- a/typescript/api-reference/README.md +++ b/typescript/api-reference/README.md @@ -12,6 +12,7 @@ ### Enumerations - [BitcoinNetwork](enums/BitcoinNetwork-1.md) +- [DepositState](enums/DepositState.md) - [WalletState](enums/WalletState-1.md) ### Classes diff --git a/typescript/api-reference/classes/ArbitrumL2BitcoinDepositor.md b/typescript/api-reference/classes/ArbitrumL2BitcoinDepositor.md index 003ec3484..33c384f3b 100644 --- a/typescript/api-reference/classes/ArbitrumL2BitcoinDepositor.md +++ b/typescript/api-reference/classes/ArbitrumL2BitcoinDepositor.md @@ -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 @@ -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) ___ @@ -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) ___ @@ -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) ___ @@ -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) ___ @@ -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) ___ @@ -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) ___ @@ -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) diff --git a/typescript/api-reference/classes/ArbitrumL2TBTCToken.md b/typescript/api-reference/classes/ArbitrumL2TBTCToken.md index f22b91438..a1d86057b 100644 --- a/typescript/api-reference/classes/ArbitrumL2TBTCToken.md +++ b/typescript/api-reference/classes/ArbitrumL2TBTCToken.md @@ -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 @@ -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) ___ @@ -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) ___ diff --git a/typescript/api-reference/classes/EthereumCrossChainExtraDataEncoder.md b/typescript/api-reference/classes/EthereumCrossChainExtraDataEncoder.md index c84df3178..bd7b90709 100644 --- a/typescript/api-reference/classes/EthereumCrossChainExtraDataEncoder.md +++ b/typescript/api-reference/classes/EthereumCrossChainExtraDataEncoder.md @@ -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) ___ @@ -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) diff --git a/typescript/api-reference/classes/EthereumL1BitcoinDepositor.md b/typescript/api-reference/classes/EthereumL1BitcoinDepositor.md index e1abd7316..6761bb637 100644 --- a/typescript/api-reference/classes/EthereumL1BitcoinDepositor.md +++ b/typescript/api-reference/classes/EthereumL1BitcoinDepositor.md @@ -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) @@ -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 @@ -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) ___ @@ -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) ___ @@ -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) ___ @@ -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) diff --git a/typescript/api-reference/enums/DepositState.md b/typescript/api-reference/enums/DepositState.md new file mode 100644 index 000000000..e26aeba53 --- /dev/null +++ b/typescript/api-reference/enums/DepositState.md @@ -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) diff --git a/typescript/api-reference/interfaces/CrossChainExtraDataEncoder.md b/typescript/api-reference/interfaces/CrossChainExtraDataEncoder.md index 8a236ecd1..3b95f51df 100644 --- a/typescript/api-reference/interfaces/CrossChainExtraDataEncoder.md +++ b/typescript/api-reference/interfaces/CrossChainExtraDataEncoder.md @@ -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) ___ @@ -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) diff --git a/typescript/api-reference/interfaces/L1BitcoinDepositor.md b/typescript/api-reference/interfaces/L1BitcoinDepositor.md index 29224d2ac..b20cad79f 100644 --- a/typescript/api-reference/interfaces/L1BitcoinDepositor.md +++ b/typescript/api-reference/interfaces/L1BitcoinDepositor.md @@ -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 @@ -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) ___ @@ -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) ___ @@ -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) diff --git a/typescript/package.json b/typescript/package.json index 53233d1e1..be450bfdf 100644 --- a/typescript/package.json +++ b/typescript/package.json @@ -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", diff --git a/typescript/src/lib/arbitrum/artifacts/arbitrumOne/ArbitrumL2BitcoinDepositor.json b/typescript/src/lib/arbitrum/artifacts/arbitrumOne/ArbitrumL2BitcoinDepositor.json index 0af34abd3..160166757 100644 --- a/typescript/src/lib/arbitrum/artifacts/arbitrumOne/ArbitrumL2BitcoinDepositor.json +++ b/typescript/src/lib/arbitrum/artifacts/arbitrumOne/ArbitrumL2BitcoinDepositor.json @@ -1,5 +1,5 @@ { - "address": "0xf90292a39014033DE50c81f651365cB6A1040Bb6", + "address": "0x1C8d7b744b474c080faADd5BF9AD965Be4258F9e", "abi": [ { "inputs": [], @@ -355,75 +355,75 @@ "type": "function" } ], - "transactionHash": "0xaeb9ee6679e0f96108788abffa9ed78c943c09565686dfdb826378e9bd1487df", + "transactionHash": "0xb7407ca090240d1d1c4bd13c12c66826cf72e5a54ab44535165d3207a34579ea", "receipt": { "to": null, - "from": "0x68ad60CC5e8f3B7cC53beaB321cf0e6036962dBc", - "contractAddress": "0x04BE8F183572ec802aD26756F3E9398098700E76", - "transactionIndex": 2, - "gasUsed": "704802", - "logsBloom": "0x00000000000000000000000000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000202000001000000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400002000200000000000000000000000000000000000080000000000000800080000000000000000000000000000400000000000100000000000000000000000000000020000000000000000020040000000008000400000000000000000020000000000000000000080000000000000000000000000000000000000000400000", - "blockHash": "0xcb1f5aa73f2f63d359224b51e7abf66a431e3420daa6940b72a3a58dd5a00c85", - "transactionHash": "0xaeb9ee6679e0f96108788abffa9ed78c943c09565686dfdb826378e9bd1487df", + "from": "0xBC9C7345d240764BAF2D2016a86165BDf06131c2", + "contractAddress": "0x1C8d7b744b474c080faADd5BF9AD965Be4258F9e", + "transactionIndex": 1, + "gasUsed": "766562", + "logsBloom": "0x00000000001000000000000000000000400000000000000000800000000000000000000000000000000000000000000000000000000000000100000000040000000000000000000000000000000002000001000000000000000000000000000000000000020000000000000000000800000000810000000000000004000000400000000000000000000000000000000000000200400080000000000002800000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000400100000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xc52717448d3c1ddb16d61eb4e8b39cba69ea4073b6185d05a4c820578c0a8d33", + "transactionHash": "0xb7407ca090240d1d1c4bd13c12c66826cf72e5a54ab44535165d3207a34579ea", "logs": [ { - "transactionIndex": 2, - "blockNumber": 7063584, - "transactionHash": "0xaeb9ee6679e0f96108788abffa9ed78c943c09565686dfdb826378e9bd1487df", - "address": "0x04BE8F183572ec802aD26756F3E9398098700E76", + "transactionIndex": 1, + "blockNumber": 247865814, + "transactionHash": "0xb7407ca090240d1d1c4bd13c12c66826cf72e5a54ab44535165d3207a34579ea", + "address": "0x1C8d7b744b474c080faADd5BF9AD965Be4258F9e", "topics": [ "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x0000000000000000000000001ecd87c8d510a7390a561ae0ac54fbe7e5125bcf" + "0x000000000000000000000000ff79fca71751a5a0c4487a1ace268d6cd2a64db1" ], "data": "0x", - "logIndex": 1, - "blockHash": "0xcb1f5aa73f2f63d359224b51e7abf66a431e3420daa6940b72a3a58dd5a00c85" + "logIndex": 0, + "blockHash": "0xc52717448d3c1ddb16d61eb4e8b39cba69ea4073b6185d05a4c820578c0a8d33" }, { - "transactionIndex": 2, - "blockNumber": 7063584, - "transactionHash": "0xaeb9ee6679e0f96108788abffa9ed78c943c09565686dfdb826378e9bd1487df", - "address": "0x04BE8F183572ec802aD26756F3E9398098700E76", + "transactionIndex": 1, + "blockNumber": 247865814, + "transactionHash": "0xb7407ca090240d1d1c4bd13c12c66826cf72e5a54ab44535165d3207a34579ea", + "address": "0x1C8d7b744b474c080faADd5BF9AD965Be4258F9e", "topics": [ "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x00000000000000000000000068ad60cc5e8f3b7cc53beab321cf0e6036962dbc" + "0x000000000000000000000000bc9c7345d240764baf2d2016a86165bdf06131c2" ], "data": "0x", - "logIndex": 2, - "blockHash": "0xcb1f5aa73f2f63d359224b51e7abf66a431e3420daa6940b72a3a58dd5a00c85" + "logIndex": 1, + "blockHash": "0xc52717448d3c1ddb16d61eb4e8b39cba69ea4073b6185d05a4c820578c0a8d33" }, { - "transactionIndex": 2, - "blockNumber": 7063584, - "transactionHash": "0xaeb9ee6679e0f96108788abffa9ed78c943c09565686dfdb826378e9bd1487df", - "address": "0x04BE8F183572ec802aD26756F3E9398098700E76", + "transactionIndex": 1, + "blockNumber": 247865814, + "transactionHash": "0xb7407ca090240d1d1c4bd13c12c66826cf72e5a54ab44535165d3207a34579ea", + "address": "0x1C8d7b744b474c080faADd5BF9AD965Be4258F9e", "topics": [ "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" ], "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 3, - "blockHash": "0xcb1f5aa73f2f63d359224b51e7abf66a431e3420daa6940b72a3a58dd5a00c85" + "logIndex": 2, + "blockHash": "0xc52717448d3c1ddb16d61eb4e8b39cba69ea4073b6185d05a4c820578c0a8d33" }, { - "transactionIndex": 2, - "blockNumber": 7063584, - "transactionHash": "0xaeb9ee6679e0f96108788abffa9ed78c943c09565686dfdb826378e9bd1487df", - "address": "0x04BE8F183572ec802aD26756F3E9398098700E76", + "transactionIndex": 1, + "blockNumber": 247865814, + "transactionHash": "0xb7407ca090240d1d1c4bd13c12c66826cf72e5a54ab44535165d3207a34579ea", + "address": "0x1C8d7b744b474c080faADd5BF9AD965Be4258F9e", "topics": [ "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000b2f6c5b73239c39360ee0ea95047565dab13e3c7", - "logIndex": 4, - "blockHash": "0xcb1f5aa73f2f63d359224b51e7abf66a431e3420daa6940b72a3a58dd5a00c85" + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000037169570d846cc05d5848aaa30194d308b355638", + "logIndex": 3, + "blockHash": "0xc52717448d3c1ddb16d61eb4e8b39cba69ea4073b6185d05a4c820578c0a8d33" } ], - "blockNumber": 7063584, - "cumulativeGasUsed": "804788", + "blockNumber": 247865814, + "cumulativeGasUsed": "766562", "status": 1, "byzantium": true }, "numDeployments": 1, - "implementation": "0x1Ecd87C8D510A7390a561AE0Ac54FBe7e5125BcF", + "implementation": "0xFf79fca71751A5A0C4487a1aCE268d6cd2A64Db1", "devdoc": "Contract deployed as upgradable proxy" } diff --git a/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts b/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts index a43c5834e..0cef228bb 100644 --- a/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts +++ b/typescript/src/lib/arbitrum/l2-bitcoin-depositor.ts @@ -19,8 +19,7 @@ import { import { Hex } from "../utils" import { BitcoinRawTxVectors } from "../bitcoin" -// TODO: Uncomment once Arbitrum native minting is available on Arbitrum mainnet. -// import ArbitrumL2BitcoinDepositorDeployment from "./artifacts/arbitrumOne/ArbitrumL2BitcoinDepositor.json" +import ArbitrumL2BitcoinDepositorDeployment from "./artifacts/arbitrumOne/ArbitrumL2BitcoinDepositor.json" import ArbitrumSepoliaL2BitcoinDepositorDeployment from "./artifacts/arbitrumSepolia/ArbitrumL2BitcoinDepositor.json" /** @@ -41,10 +40,9 @@ export class ArbitrumL2BitcoinDepositor case Chains.Arbitrum.ArbitrumSepolia: deployment = ArbitrumSepoliaL2BitcoinDepositorDeployment break - // TODO: Uncomment once Arbitrum native minting is available on Arbitrum mainnet. - // case Chains.Arbitrum.Arbitrum: - // deployment = ArbitrumL2BitcoinDepositorDeployment - // break + case Chains.Arbitrum.Arbitrum: + deployment = ArbitrumL2BitcoinDepositorDeployment + break default: throw new Error("Unsupported deployment type") } diff --git a/typescript/src/lib/arbitrum/l2-tbtc-token.ts b/typescript/src/lib/arbitrum/l2-tbtc-token.ts index f54f0c0eb..70f62c5bc 100644 --- a/typescript/src/lib/arbitrum/l2-tbtc-token.ts +++ b/typescript/src/lib/arbitrum/l2-tbtc-token.ts @@ -8,8 +8,7 @@ import { ChainIdentifier, Chains, L2TBTCToken } from "../contracts" import { BigNumber } from "ethers" import { EthereumAddress } from "../ethereum" -// TODO: Uncomment once Arbitrum native minting is available on Arbitrum mainnet. -// import ArbitrumL2TBTCTokenDeployment from "./artifacts/arbitrumOne/ArbitrumTBTC.json" +import ArbitrumL2TBTCTokenDeployment from "./artifacts/arbitrumOne/ArbitrumTBTC.json" import ArbitrumSepoliaL2TBTCTokenDeployment from "./artifacts/arbitrumSepolia/ArbitrumTBTC.json" /** @@ -27,10 +26,9 @@ export class ArbitrumL2TBTCToken case Chains.Arbitrum.ArbitrumSepolia: deployment = ArbitrumSepoliaL2TBTCTokenDeployment break - // TODO: Uncomment once Arbitrum native minting is available on Arbitrum mainnet. - // case Chains.Arbitrum.Arbitrum: - // deployment = ArbitrumL2TBTCTokenDeployment - // break + case Chains.Arbitrum.Arbitrum: + deployment = ArbitrumL2TBTCTokenDeployment + break default: throw new Error("Unsupported deployment type") } diff --git a/typescript/src/lib/contracts/cross-chain.ts b/typescript/src/lib/contracts/cross-chain.ts index 869e9201b..68a397fa9 100644 --- a/typescript/src/lib/contracts/cross-chain.ts +++ b/typescript/src/lib/contracts/cross-chain.ts @@ -109,11 +109,30 @@ export interface L2BitcoinDepositor { ): Promise } +/** + * Represents the state of the deposit. + */ +export enum DepositState { + // eslint-disable-next-line no-unused-vars + UNKNOWN, + // eslint-disable-next-line no-unused-vars + INITIALIZED, + // eslint-disable-next-line no-unused-vars + FINALIZED, +} + /** * Interface for communication with the L1BitcoinDepositor on-chain contract * specific to the given L2 chain, deployed on the L1 chain. */ export interface L1BitcoinDepositor { + /** + * Gets the deposit state for the given deposit identifier. + * @param depositId Identifier of the deposit to get the state for. + * @returns The state of the deposit. + */ + getDepositState(depositId: string): Promise + /** * Gets the chain-specific identifier of this contract. */ diff --git a/typescript/src/lib/ethereum/artifacts/mainnet/ArbitrumOneL1BitcoinDepositor.json b/typescript/src/lib/ethereum/artifacts/mainnet/ArbitrumOneL1BitcoinDepositor.json new file mode 100644 index 000000000..979987aff --- /dev/null +++ b/typescript/src/lib/ethereum/artifacts/mainnet/ArbitrumOneL1BitcoinDepositor.json @@ -0,0 +1,737 @@ +{ + "address": "0x75A6e4A7C8fAa162192FAD6C1F7A6d48992c619A", + "abi": [ + { + "inputs": [], + "stateMutability": "nonpayable", + "type": "constructor" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "depositKey", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2DepositOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Sender", + "type": "address" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "initialAmount", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "tbtcAmount", + "type": "uint256" + } + ], + "name": "DepositFinalized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "uint256", + "name": "depositKey", + "type": "uint256" + }, + { + "indexed": true, + "internalType": "address", + "name": "l2DepositOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "l1Sender", + "type": "address" + } + ], + "name": "DepositInitialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "initializeDepositGasOffset", + "type": "uint256" + }, + { + "indexed": false, + "internalType": "uint256", + "name": "finalizeDepositGasOffset", + "type": "uint256" + } + ], + "name": "GasOffsetParametersUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint8", + "name": "version", + "type": "uint8" + } + ], + "name": "Initialized", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "uint256", + "name": "l2FinalizeDepositGasLimit", + "type": "uint256" + } + ], + "name": "L2FinalizeDepositGasLimitUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, + { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "OwnershipTransferred", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": true, + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "indexed": false, + "internalType": "bool", + "name": "authorization", + "type": "bool" + } + ], + "name": "ReimbursementAuthorizationUpdated", + "type": "event" + }, + { + "anonymous": false, + "inputs": [ + { + "indexed": false, + "internalType": "address", + "name": "newReimbursementPool", + "type": "address" + } + ], + "name": "ReimbursementPoolUpdated", + "type": "event" + }, + { + "inputs": [], + "name": "SATOSHI_MULTIPLIER", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_l2BitcoinDepositor", + "type": "address" + } + ], + "name": "attachL2BitcoinDepositor", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "bridge", + "outputs": [ + { + "internalType": "contract IBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "deposits", + "outputs": [ + { + "internalType": "enum L1BitcoinDepositor.DepositState", + "name": "", + "type": "uint8" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "depositKey", + "type": "uint256" + } + ], + "name": "finalizeDeposit", + "outputs": [], + "stateMutability": "payable", + "type": "function" + }, + { + "inputs": [], + "name": "finalizeDepositGasOffset", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "name": "gasReimbursements", + "outputs": [ + { + "internalType": "address", + "name": "receiver", + "type": "address" + }, + { + "internalType": "uint96", + "name": "gasSpent", + "type": "uint96" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_tbtcBridge", + "type": "address" + }, + { + "internalType": "address", + "name": "_tbtcVault", + "type": "address" + }, + { + "internalType": "address", + "name": "_wormhole", + "type": "address" + }, + { + "internalType": "address", + "name": "_wormholeRelayer", + "type": "address" + }, + { + "internalType": "address", + "name": "_wormholeTokenBridge", + "type": "address" + }, + { + "internalType": "address", + "name": "_l2WormholeGateway", + "type": "address" + }, + { + "internalType": "uint16", + "name": "_l2ChainId", + "type": "uint16" + } + ], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "components": [ + { + "internalType": "bytes4", + "name": "version", + "type": "bytes4" + }, + { + "internalType": "bytes", + "name": "inputVector", + "type": "bytes" + }, + { + "internalType": "bytes", + "name": "outputVector", + "type": "bytes" + }, + { + "internalType": "bytes4", + "name": "locktime", + "type": "bytes4" + } + ], + "internalType": "struct IBridgeTypes.BitcoinTxInfo", + "name": "fundingTx", + "type": "tuple" + }, + { + "components": [ + { + "internalType": "uint32", + "name": "fundingOutputIndex", + "type": "uint32" + }, + { + "internalType": "bytes8", + "name": "blindingFactor", + "type": "bytes8" + }, + { + "internalType": "bytes20", + "name": "walletPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes20", + "name": "refundPubKeyHash", + "type": "bytes20" + }, + { + "internalType": "bytes4", + "name": "refundLocktime", + "type": "bytes4" + }, + { + "internalType": "address", + "name": "vault", + "type": "address" + } + ], + "internalType": "struct IBridgeTypes.DepositRevealInfo", + "name": "reveal", + "type": "tuple" + }, + { + "internalType": "address", + "name": "l2DepositOwner", + "type": "address" + } + ], + "name": "initializeDeposit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "initializeDepositGasOffset", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2BitcoinDepositor", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2ChainId", + "outputs": [ + { + "internalType": "uint16", + "name": "", + "type": "uint16" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2FinalizeDepositGasLimit", + "outputs": [ + { + "internalType": "uint256", + "name": "", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "l2WormholeGateway", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "owner", + "outputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "quoteFinalizeDeposit", + "outputs": [ + { + "internalType": "uint256", + "name": "cost", + "type": "uint256" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "", + "type": "address" + } + ], + "name": "reimbursementAuthorizations", + "outputs": [ + { + "internalType": "bool", + "name": "", + "type": "bool" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "reimbursementPool", + "outputs": [ + { + "internalType": "contract ReimbursementPool", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "tbtcToken", + "outputs": [ + { + "internalType": "contract IERC20Upgradeable", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "tbtcVault", + "outputs": [ + { + "internalType": "contract ITBTCVault", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "newOwner", + "type": "address" + } + ], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_initializeDepositGasOffset", + "type": "uint256" + }, + { + "internalType": "uint256", + "name": "_finalizeDepositGasOffset", + "type": "uint256" + } + ], + "name": "updateGasOffsetParameters", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "uint256", + "name": "_l2FinalizeDepositGasLimit", + "type": "uint256" + } + ], + "name": "updateL2FinalizeDepositGasLimit", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address", + "name": "_address", + "type": "address" + }, + { + "internalType": "bool", + "name": "authorization", + "type": "bool" + } + ], + "name": "updateReimbursementAuthorization", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "contract ReimbursementPool", + "name": "_reimbursementPool", + "type": "address" + } + ], + "name": "updateReimbursementPool", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [], + "name": "wormhole", + "outputs": [ + { + "internalType": "contract IWormhole", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "wormholeRelayer", + "outputs": [ + { + "internalType": "contract IWormholeRelayer", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + }, + { + "inputs": [], + "name": "wormholeTokenBridge", + "outputs": [ + { + "internalType": "contract IWormholeTokenBridge", + "name": "", + "type": "address" + } + ], + "stateMutability": "view", + "type": "function" + } + ], + "transactionHash": "0x51e2686f22fd29a987096d0c27b9d1c7256e64cd37fd0a31a0bc316bbfc2b92b", + "receipt": { + "to": null, + "from": "0x949f0ADFDA95351829E49aEec0f99371A227572d", + "contractAddress": "0x75A6e4A7C8fAa162192FAD6C1F7A6d48992c619A", + "transactionIndex": 75, + "gasUsed": "866087", + "logsBloom": "0x00000000000000000000000080001000400000000000000000800000000000000000000000000000000000000000000000000000000000000000000000040000000000000000000000000000000002000001400000000000000000000000000000000000020000000000000000000800000000800000000000000000000000400000000000000000000000000000000000000200000080000080040004800000000000000000000000000000000400000000000000000000000000000000000000000020000000000000000000040000000000000400100000000000000020000000000000000000000000000000000000000000000000000000000000000000", + "blockHash": "0xca28b9305b8bd5685b90d6dc17819fb68d14198e4812b0675e93aab068836f3f", + "transactionHash": "0x51e2686f22fd29a987096d0c27b9d1c7256e64cd37fd0a31a0bc316bbfc2b92b", + "logs": [ + { + "transactionIndex": 75, + "blockNumber": 20632547, + "transactionHash": "0x51e2686f22fd29a987096d0c27b9d1c7256e64cd37fd0a31a0bc316bbfc2b92b", + "address": "0x75A6e4A7C8fAa162192FAD6C1F7A6d48992c619A", + "topics": [ + "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", + "0x000000000000000000000000ff79fca71751a5a0c4487a1ace268d6cd2a64db1" + ], + "data": "0x", + "logIndex": 148, + "blockHash": "0xca28b9305b8bd5685b90d6dc17819fb68d14198e4812b0675e93aab068836f3f" + }, + { + "transactionIndex": 75, + "blockNumber": 20632547, + "transactionHash": "0x51e2686f22fd29a987096d0c27b9d1c7256e64cd37fd0a31a0bc316bbfc2b92b", + "address": "0x75A6e4A7C8fAa162192FAD6C1F7A6d48992c619A", + "topics": [ + "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", + "0x0000000000000000000000000000000000000000000000000000000000000000", + "0x000000000000000000000000949f0adfda95351829e49aeec0f99371a227572d" + ], + "data": "0x", + "logIndex": 149, + "blockHash": "0xca28b9305b8bd5685b90d6dc17819fb68d14198e4812b0675e93aab068836f3f" + }, + { + "transactionIndex": 75, + "blockNumber": 20632547, + "transactionHash": "0x51e2686f22fd29a987096d0c27b9d1c7256e64cd37fd0a31a0bc316bbfc2b92b", + "address": "0x75A6e4A7C8fAa162192FAD6C1F7A6d48992c619A", + "topics": [ + "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" + ], + "data": "0x0000000000000000000000000000000000000000000000000000000000000001", + "logIndex": 150, + "blockHash": "0xca28b9305b8bd5685b90d6dc17819fb68d14198e4812b0675e93aab068836f3f" + }, + { + "transactionIndex": 75, + "blockNumber": 20632547, + "transactionHash": "0x51e2686f22fd29a987096d0c27b9d1c7256e64cd37fd0a31a0bc316bbfc2b92b", + "address": "0x75A6e4A7C8fAa162192FAD6C1F7A6d48992c619A", + "topics": [ + "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" + ], + "data": "0x000000000000000000000000000000000000000000000000000000000000000000000000000000000000000037169570d846cc05d5848aaa30194d308b355638", + "logIndex": 151, + "blockHash": "0xca28b9305b8bd5685b90d6dc17819fb68d14198e4812b0675e93aab068836f3f" + } + ], + "blockNumber": 20632547, + "cumulativeGasUsed": "6345110", + "status": 1, + "byzantium": true + }, + "numDeployments": 1, + "implementation": "0xFf79fca71751A5A0C4487a1aCE268d6cd2A64Db1", + "devdoc": "Contract deployed as upgradable proxy" +} diff --git a/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts b/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts index 4d625b99f..9a437481d 100644 --- a/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts +++ b/typescript/src/lib/ethereum/l1-bitcoin-depositor.ts @@ -9,6 +9,7 @@ import { Chains, CrossChainExtraDataEncoder, DepositReceipt, + DepositState, L1BitcoinDepositor, L2Chain, } from "../contracts" @@ -18,7 +19,7 @@ import { Hex } from "../utils" // TODO: Uncomment once BaseL1BitcoinDepositor is available on Ethereum mainnet. // import MainnetBaseL1BitcoinDepositorDeployment from "./artifacts/mainnet/BaseL1BitcoinDepositor.json" -// import MainnetArbitrumL1BitcoinDepositorDeployment from "./artifacts/mainnet/ArbitrumL1BitcoinDepositor.json" +import MainnetArbitrumL1BitcoinDepositorDeployment from "./artifacts/mainnet/ArbitrumOneL1BitcoinDepositor.json" import SepoliaBaseL1BitcoinDepositorDeployment from "./artifacts/sepolia/BaseL1BitcoinDepositor.json" import SepoliaArbitrumL1BitcoinDepositorDeployment from "./artifacts/sepolia/ArbitrumL1BitcoinDepositor.json" @@ -30,9 +31,9 @@ const artifactLoader = { // case "Base": // return MainnetBaseL1BitcoinDepositorDeployment - // TODO: Uncomment once ArbitrumL1BitcoinDepositor is available on Ethereum mainnet. - // case "Arbitrum": - // return MainnetArbitrumL1BitcoinDepositorDeployment + case "Arbitrum": + return MainnetArbitrumL1BitcoinDepositorDeployment + default: throw new Error("Unsupported L2 chain") } @@ -84,6 +85,14 @@ export class EthereumL1BitcoinDepositor this.#extraDataEncoder = new EthereumCrossChainExtraDataEncoder() } + // eslint-disable-next-line valid-jsdoc + /** + * @see {L1BitcoinDepositor#getDepositState} + */ + getDepositState(depositId: string): Promise { + return this._instance.deposits(depositId) + } + // eslint-disable-next-line valid-jsdoc /** * @see {L1BitcoinDepositor#getChainIdentifier} diff --git a/typescript/test/utils/mock-cross-chain.ts b/typescript/test/utils/mock-cross-chain.ts index e9ed8e3f6..2142881b3 100644 --- a/typescript/test/utils/mock-cross-chain.ts +++ b/typescript/test/utils/mock-cross-chain.ts @@ -7,6 +7,7 @@ import { BitcoinRawTxVectors, DepositReceipt, Hex, + DepositState, } from "../../src" import { BigNumber } from "ethers" @@ -80,6 +81,10 @@ export class MockL1BitcoinDepositor implements L1BitcoinDepositor { this.#encoder = encoder } + getDepositState(depositId: string): Promise { + throw new Error("Not supported") + } + extraDataEncoder(): CrossChainExtraDataEncoder { return this.#encoder }