diff --git a/typescript/api-reference/classes/BaseL2TBTCToken.md b/typescript/api-reference/classes/BaseL2TBTCToken.md index 069905dc4..14a748b55 100644 --- a/typescript/api-reference/classes/BaseL2TBTCToken.md +++ b/typescript/api-reference/classes/BaseL2TBTCToken.md @@ -58,7 +58,7 @@ EthersContractHandle\<L2TBTCTypechain\>.constructor #### Defined in -[src/lib/base/l2-tbtc-token.ts:21](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/base/l2-tbtc-token.ts#L21) +[src/lib/base/l2-tbtc-token.ts:23](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/base/l2-tbtc-token.ts#L23) ## Properties @@ -134,7 +134,7 @@ EthersContractHandle.\_totalRetryAttempts #### Defined in -[src/lib/base/l2-tbtc-token.ts:50](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/base/l2-tbtc-token.ts#L50) +[src/lib/base/l2-tbtc-token.ts:53](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/base/l2-tbtc-token.ts#L53) ___ @@ -176,7 +176,7 @@ ___ #### Defined in -[src/lib/base/l2-tbtc-token.ts:42](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/base/l2-tbtc-token.ts#L42) +[src/lib/base/l2-tbtc-token.ts:45](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/lib/base/l2-tbtc-token.ts#L45) ___ diff --git a/typescript/api-reference/classes/DepositsService.md b/typescript/api-reference/classes/DepositsService.md index 5b3a91e08..420ed82a8 100644 --- a/typescript/api-reference/classes/DepositsService.md +++ b/typescript/api-reference/classes/DepositsService.md @@ -145,7 +145,7 @@ Handle to tBTC contracts. #### Defined in -[src/services/deposits/deposits-service.ts:177](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/deposits/deposits-service.ts#L177) +[src/services/deposits/deposits-service.ts:183](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/deposits/deposits-service.ts#L183) ___ @@ -159,6 +159,11 @@ system is deployed on. Such a deposit is initiated using a transaction on the L2 chain. To make it happen, the given L2 cross-chain contracts must be initialized along with a L2 signer first. + THIS IS EXPERIMENTAL CODE THAT CAN BE CHANGED OR REMOVED + IN FUTURE RELEASES. IT SHOULD BE USED ONLY FOR INTERNAL + PURPOSES AND EXTERNAL APPLICATIONS SHOULD NOT DEPEND ON IT. + CROSS-CHAIN SUPPORT IS NOT FULLY OPERATIONAL YET. + #### Parameters | Name | Type | Description | @@ -194,7 +199,7 @@ This is actually a call to initiateDepositWithProxy with a built-in #### Defined in -[src/services/deposits/deposits-service.ts:157](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/deposits/deposits-service.ts#L157) +[src/services/deposits/deposits-service.ts:163](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/deposits/deposits-service.ts#L163) ___ @@ -299,4 +304,4 @@ Typically, there is no need to use this method when DepositsService #### Defined in -[src/services/deposits/deposits-service.ts:255](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/deposits/deposits-service.ts#L255) +[src/services/deposits/deposits-service.ts:261](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/deposits/deposits-service.ts#L261) diff --git a/typescript/api-reference/classes/TBTC.md b/typescript/api-reference/classes/TBTC.md index 68f119868..4fa1966aa 100644 --- a/typescript/api-reference/classes/TBTC.md +++ b/typescript/api-reference/classes/TBTC.md @@ -146,6 +146,11 @@ Gets cross-chain contracts for the given supported L2 chain. The given L2 chain contracts must be first initialized using the `initializeCrossChain` method. + THIS IS EXPERIMENTAL CODE THAT CAN BE CHANGED OR REMOVED + IN FUTURE RELEASES. IT SHOULD BE USED ONLY FOR INTERNAL + PURPOSES AND EXTERNAL APPLICATIONS SHOULD NOT DEPEND ON IT. + CROSS-CHAIN SUPPORT IS NOT FULLY OPERATIONAL YET. + #### Parameters | Name | Type | Description | @@ -161,7 +166,7 @@ Cross-chain contracts for the given L2 chain or #### Defined in -[src/services/tbtc.ts:233](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/tbtc.ts#L233) +[src/services/tbtc.ts:252](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/tbtc.ts#L252) ___ @@ -172,6 +177,11 @@ ___ Initializes cross-chain contracts for the given L2 chain, using the given signer. Updates the signer on subsequent calls. + THIS IS EXPERIMENTAL CODE THAT CAN BE CHANGED OR REMOVED + IN FUTURE RELEASES. IT SHOULD BE USED ONLY FOR INTERNAL + PURPOSES AND EXTERNAL APPLICATIONS SHOULD NOT DEPEND ON IT. + CROSS-CHAIN SUPPORT IS NOT FULLY OPERATIONAL YET. + #### Parameters | Name | Type | Description | @@ -200,7 +210,7 @@ In case this function needs to support non-EVM L2 chains that can't #### Defined in -[src/services/tbtc.ts:185](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/tbtc.ts#L185) +[src/services/tbtc.ts:198](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/tbtc.ts#L198) ___ @@ -232,13 +242,13 @@ This function is especially useful for local development as it gives #### Defined in -[src/services/tbtc.ts:163](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/tbtc.ts#L163) +[src/services/tbtc.ts:170](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/tbtc.ts#L170) ___ ### initializeEthereum -▸ **initializeEthereum**(`signer`, `ethereumChainId`, `bitcoinNetwork`): `Promise`\<[`TBTC`](TBTC.md)\> +▸ **initializeEthereum**(`signer`, `ethereumChainId`, `bitcoinNetwork`, `crossChainSupport?`): `Promise`\<[`TBTC`](TBTC.md)\> Initializes the tBTC v2 SDK entrypoint for the given Ethereum network and Bitcoin network. The initialized instance uses default Electrum servers to interact @@ -246,11 +256,12 @@ with Bitcoin network. #### Parameters -| Name | Type | Description | -| :------ | :------ | :------ | -| `signer` | [`EthereumSigner`](../README.md#ethereumsigner) | Ethereum signer. | -| `ethereumChainId` | [`Ethereum`](../enums/Chains.Ethereum.md) | Ethereum chain ID. | -| `bitcoinNetwork` | [`BitcoinNetwork`](../enums/BitcoinNetwork-1.md) | Bitcoin network. | +| Name | Type | Default value | Description | +| :------ | :------ | :------ | :------ | +| `signer` | [`EthereumSigner`](../README.md#ethereumsigner) | `undefined` | Ethereum signer. | +| `ethereumChainId` | [`Ethereum`](../enums/Chains.Ethereum.md) | `undefined` | Ethereum chain ID. | +| `bitcoinNetwork` | [`BitcoinNetwork`](../enums/BitcoinNetwork-1.md) | `undefined` | Bitcoin network. | +| `crossChainSupport` | `boolean` | `false` | Whether to enable cross-chain support. False by default. | #### Returns @@ -265,7 +276,7 @@ Throws an error if the underlying signer's Ethereum network is #### Defined in -[src/services/tbtc.ts:122](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/tbtc.ts#L122) +[src/services/tbtc.ts:123](https://github.com/keep-network/tbtc-v2/blob/main/typescript/src/services/tbtc.ts#L123) ___ diff --git a/typescript/src/lib/base/artifacts/base/BaseTBTC.json b/typescript/src/lib/base/artifacts/base/BaseTBTC.json deleted file mode 100644 index 8e834c472..000000000 --- a/typescript/src/lib/base/artifacts/base/BaseTBTC.json +++ /dev/null @@ -1,863 +0,0 @@ -{ - "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "guardian", - "type": "address" - } - ], - "name": "GuardianAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "guardian", - "type": "address" - } - ], - "name": "GuardianRemoved", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint8", - "name": "version", - "type": "uint8" - } - ], - "name": "Initialized", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "MinterAdded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "MinterRemoved", - "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": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Paused", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "Unpaused", - "type": "event" - }, - { - "inputs": [], - "name": "DOMAIN_SEPARATOR", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "guardian", - "type": "address" - } - ], - "name": "addGuardian", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "addMinter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burnFrom", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "getGuardians", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getMinters", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "guardians", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "_name", - "type": "string" - }, - { - "internalType": "string", - "name": "_symbol", - "type": "string" - } - ], - "name": "initialize", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isGuardian", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "name": "isMinter", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "name": "minters", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - } - ], - "name": "nonces", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "pause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "paused", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "deadline", - "type": "uint256" - }, - { - "internalType": "uint8", - "name": "v", - "type": "uint8" - }, - { - "internalType": "bytes32", - "name": "r", - "type": "bytes32" - }, - { - "internalType": "bytes32", - "name": "s", - "type": "bytes32" - } - ], - "name": "permit", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC20Upgradeable", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "recoverERC20", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "contract IERC721Upgradeable", - "name": "token", - "type": "address" - }, - { - "internalType": "address", - "name": "recipient", - "type": "address" - }, - { - "internalType": "uint256", - "name": "tokenId", - "type": "uint256" - }, - { - "internalType": "bytes", - "name": "data", - "type": "bytes" - } - ], - "name": "recoverERC721", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "guardian", - "type": "address" - } - ], - "name": "removeGuardian", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "minter", - "type": "address" - } - ], - "name": "removeMinter", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "unpause", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "transactionHash": "0x85f05786bb1d38013714332804139352f16aa2751d05b4517ed2f7e67d683a6a", - "receipt": { - "to": null, - "from": "0x123694886DBf5Ac94DDA07135349534536D14cAf", - "contractAddress": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", - "transactionIndex": 1, - "gasUsed": "754031", - "logsBloom": "0x00000000000000000000400000000000400000000002000000800000000000000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000002800001000000000000000080000000000000000000020000000000000000000800000000800000000000000000400000400000000000000000000000000000000000000000000080000000000000800000000000000000000000000000000400000000000000000000000000000000000000000020000000040000000000440000000000000400000000000000000020000000000000000000000000000000000000000000000000000000000000000000", - "blockHash": "0x676b27fe07778a4d23b12ebcda86efb3396f4727c4f22fecfc534f22ad0382f2", - "transactionHash": "0x85f05786bb1d38013714332804139352f16aa2751d05b4517ed2f7e67d683a6a", - "logs": [ - { - "transactionIndex": 1, - "blockNumber": 2126367, - "transactionHash": "0x85f05786bb1d38013714332804139352f16aa2751d05b4517ed2f7e67d683a6a", - "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", - "topics": [ - "0xbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b", - "0x00000000000000000000000041c9b5639e3f2f6c61e9b78b2c6ff3746e79d91a" - ], - "data": "0x", - "logIndex": 0, - "blockHash": "0x676b27fe07778a4d23b12ebcda86efb3396f4727c4f22fecfc534f22ad0382f2" - }, - { - "transactionIndex": 1, - "blockNumber": 2126367, - "transactionHash": "0x85f05786bb1d38013714332804139352f16aa2751d05b4517ed2f7e67d683a6a", - "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", - "topics": [ - "0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0", - "0x0000000000000000000000000000000000000000000000000000000000000000", - "0x000000000000000000000000123694886dbf5ac94dda07135349534536d14caf" - ], - "data": "0x", - "logIndex": 1, - "blockHash": "0x676b27fe07778a4d23b12ebcda86efb3396f4727c4f22fecfc534f22ad0382f2" - }, - { - "transactionIndex": 1, - "blockNumber": 2126367, - "transactionHash": "0x85f05786bb1d38013714332804139352f16aa2751d05b4517ed2f7e67d683a6a", - "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", - "topics": [ - "0x7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498" - ], - "data": "0x0000000000000000000000000000000000000000000000000000000000000001", - "logIndex": 2, - "blockHash": "0x676b27fe07778a4d23b12ebcda86efb3396f4727c4f22fecfc534f22ad0382f2" - }, - { - "transactionIndex": 1, - "blockNumber": 2126367, - "transactionHash": "0x85f05786bb1d38013714332804139352f16aa2751d05b4517ed2f7e67d683a6a", - "address": "0x236aa50979D5f3De3Bd1Eeb40E81137F22ab794b", - "topics": [ - "0x7e644d79422f17c01e4894b5f4f588d331ebfa28653d42ae832dc59e38c9798f" - ], - "data": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000001293a54e160d1cd7075487898d65266081a15458", - "logIndex": 3, - "blockHash": "0x676b27fe07778a4d23b12ebcda86efb3396f4727c4f22fecfc534f22ad0382f2" - } - ], - "blockNumber": 2126367, - "cumulativeGasUsed": "818044", - "status": 1, - "byzantium": true - }, - "numDeployments": 1, - "implementation": "0x41C9b5639E3F2F6C61e9B78b2c6FF3746E79d91A", - "devdoc": "Contract deployed as upgradable proxy" -} diff --git a/typescript/src/lib/base/l2-bitcoin-depositor.ts b/typescript/src/lib/base/l2-bitcoin-depositor.ts index 2419ce0bc..5601b0be0 100644 --- a/typescript/src/lib/base/l2-bitcoin-depositor.ts +++ b/typescript/src/lib/base/l2-bitcoin-depositor.ts @@ -16,12 +16,12 @@ import { EthereumCrossChainExtraDataEncoder, packRevealDepositParameters, } from "../ethereum" +import { Hex } from "../utils" +import { BitcoinRawTxVectors } from "../bitcoin" -// TODO: Uncomment once BaseL2BitcoinDepositor is available on Base mainnet. +// TODO: Uncomment once Base native minting is available on Base mainnet. // import BaseL2BitcoinDepositorDeployment from "./artifacts/base/BaseL2BitcoinDepositor.json" import BaseSepoliaL2BitcoinDepositorDeployment from "./artifacts/baseSepolia/BaseL2BitcoinDepositor.json" -import { BitcoinRawTxVectors } from "../bitcoin" -import { Hex } from "../utils" /** * Implementation of the Base L2BitcoinDepositor handle. @@ -41,10 +41,10 @@ export class BaseL2BitcoinDepositor case Chains.Base.BaseSepolia: deployment = BaseSepoliaL2BitcoinDepositorDeployment break - case Chains.Base.Base: - // TODO: Uncomment once BaseL2BitcoinDepositor is available on Base mainnet. - // deployment = BaseL2BitcoinDepositorDeployment - // break + // TODO: Uncomment once Base native minting is available on Base mainnet. + // case Chains.Base.Base: + // deployment = BaseL2BitcoinDepositorDeployment + // break default: throw new Error("Unsupported deployment type") } diff --git a/typescript/src/lib/base/l2-tbtc-token.ts b/typescript/src/lib/base/l2-tbtc-token.ts index 018f4a42e..0b7d5797e 100644 --- a/typescript/src/lib/base/l2-tbtc-token.ts +++ b/typescript/src/lib/base/l2-tbtc-token.ts @@ -6,10 +6,12 @@ import { import { L2TBTC as L2TBTCTypechain } from "../../../typechain/L2TBTC" import { ChainIdentifier, Chains, L2TBTCToken } from "../contracts" import { BigNumber } from "ethers" -import BaseL2TBTCTokenDeployment from "./artifacts/base/BaseTBTC.json" -import BaseSepoliaL2TBTCTokenDeployment from "./artifacts/baseSepolia/BaseTBTC.json" import { EthereumAddress } from "../ethereum" +// TODO: Uncomment once Base native minting is available on Base mainnet. +// import BaseL2TBTCTokenDeployment from "./artifacts/base/BaseTBTC.json" +import BaseSepoliaL2TBTCTokenDeployment from "./artifacts/baseSepolia/BaseTBTC.json" + /** * Implementation of the Base L2TBTCToken handle. * @see {L2TBTCToken} for reference. @@ -25,9 +27,10 @@ export class BaseL2TBTCToken case Chains.Base.BaseSepolia: deployment = BaseSepoliaL2TBTCTokenDeployment break - case Chains.Base.Base: - deployment = BaseL2TBTCTokenDeployment - break + // TODO: Uncomment once Base native minting is available on Base mainnet. + // case Chains.Base.Base: + // deployment = BaseL2TBTCTokenDeployment + // break default: throw new Error("Unsupported deployment type") } diff --git a/typescript/src/services/deposits/deposits-service.ts b/typescript/src/services/deposits/deposits-service.ts index 097caffff..b10ed0327 100644 --- a/typescript/src/services/deposits/deposits-service.ts +++ b/typescript/src/services/deposits/deposits-service.ts @@ -137,6 +137,12 @@ export class DepositsService { * system is deployed on. Such a deposit is initiated using a transaction * on the L2 chain. To make it happen, the given L2 cross-chain contracts * must be initialized along with a L2 signer first. + * + * @experimental THIS IS EXPERIMENTAL CODE THAT CAN BE CHANGED OR REMOVED + * IN FUTURE RELEASES. IT SHOULD BE USED ONLY FOR INTERNAL + * PURPOSES AND EXTERNAL APPLICATIONS SHOULD NOT DEPEND ON IT. + * CROSS-CHAIN SUPPORT IS NOT FULLY OPERATIONAL YET. + * * @param bitcoinRecoveryAddress P2PKH or P2WPKH Bitcoin address that can * be used for emergency recovery of the * deposited funds. diff --git a/typescript/src/services/tbtc.ts b/typescript/src/services/tbtc.ts index 9e82eaf09..84c759ef4 100644 --- a/typescript/src/services/tbtc.ts +++ b/typescript/src/services/tbtc.ts @@ -115,6 +115,7 @@ export class TBTC { * @param signer Ethereum signer. * @param ethereumChainId Ethereum chain ID. * @param bitcoinNetwork Bitcoin network. + * @param crossChainSupport Whether to enable cross-chain support. False by default. * @returns Initialized tBTC v2 SDK entrypoint. * @throws Throws an error if the underlying signer's Ethereum network is * other than the given Ethereum network. @@ -122,17 +123,23 @@ export class TBTC { private static async initializeEthereum( signer: EthereumSigner, ethereumChainId: Chains.Ethereum, - bitcoinNetwork: BitcoinNetwork + bitcoinNetwork: BitcoinNetwork, + crossChainSupport = false ): Promise { const signerAddress = await ethereumAddressFromSigner(signer) const tbtcContracts = await loadEthereumCoreContracts( signer, ethereumChainId ) - const crossChainContractsLoader = await ethereumCrossChainContractsLoader( - signer, - ethereumChainId - ) + + let crossChainContractsLoader: CrossChainContractsLoader | undefined = + undefined + if (crossChainSupport) { + crossChainContractsLoader = await ethereumCrossChainContractsLoader( + signer, + ethereumChainId + ) + } const bitcoinClient = ElectrumClient.fromDefaultConfig(bitcoinNetwork) @@ -170,6 +177,12 @@ export class TBTC { /** * Initializes cross-chain contracts for the given L2 chain, using the * given signer. Updates the signer on subsequent calls. + * + * @experimental THIS IS EXPERIMENTAL CODE THAT CAN BE CHANGED OR REMOVED + * IN FUTURE RELEASES. IT SHOULD BE USED ONLY FOR INTERNAL + * PURPOSES AND EXTERNAL APPLICATIONS SHOULD NOT DEPEND ON IT. + * CROSS-CHAIN SUPPORT IS NOT FULLY OPERATIONAL YET. + * * @param l2ChainName Name of the L2 chain for which to initialize * cross-chain contracts. * @param l2Signer Signer to use with the L2 chain contracts. @@ -226,6 +239,12 @@ export class TBTC { * Gets cross-chain contracts for the given supported L2 chain. * The given L2 chain contracts must be first initialized using the * `initializeCrossChain` method. + * + * @experimental THIS IS EXPERIMENTAL CODE THAT CAN BE CHANGED OR REMOVED + * IN FUTURE RELEASES. IT SHOULD BE USED ONLY FOR INTERNAL + * PURPOSES AND EXTERNAL APPLICATIONS SHOULD NOT DEPEND ON IT. + * CROSS-CHAIN SUPPORT IS NOT FULLY OPERATIONAL YET. + * * @param l2ChainName Name of the L2 chain for which to get cross-chain contracts. * @returns Cross-chain contracts for the given L2 chain or * undefined if not initialized.