Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
432c4ec
feat(sdk): add gasless deposit type exports and comprehensive test co…
lrsaturnino Nov 5, 2025
4b64c87
feat(sdk): auto-resolve NativeBTCDepositor from Bitcoin network and a…
piotr-roslaniec Nov 5, 2025
e7bf109
test(sdk): cover NativeBTCDepositor auto-resolve, setter override, an…
piotr-roslaniec Nov 5, 2025
b20f4ae
test(sdk): fix mainnet auto-resolve test to use mainnet P2PKH address
piotr-roslaniec Nov 5, 2025
c85656d
docs(sdk): regenerate API reference for DepositsService changes (auto…
piotr-roslaniec Nov 5, 2025
5db6f22
feat(typescript): enhance gasless deposits with chain validation and …
lrsaturnino Nov 6, 2025
6157cfb
docs(sdk): update destinationChainDepositOwner documentation for all …
lrsaturnino Nov 6, 2025
965336f
refactor(sdk): add type safety for gasless deposit destination chains
lrsaturnino Nov 7, 2025
067ddd6
docs(sdk): add missing JSDoc tags for gasless deposit methods
lrsaturnino Nov 7, 2025
e86d0fe
chore(typescript): upgrade Node.js to v20 for Solana compatibility
lrsaturnino Nov 7, 2025
7c321a9
fix(deposits): add depositOwner parameter to gasless deposits
lrsaturnino Nov 8, 2025
dbc35f5
Update typescript/src/services/deposits/deposits-service.ts
lrsaturnino Nov 8, 2025
989d8d8
refactor(deposits): remove duplicate Bitcoin address validation
lrsaturnino Nov 8, 2025
182add9
Merge branch 'feat/gasless-deposits' of https://github.com/threshold-…
lrsaturnino Nov 8, 2025
c8ec759
fix(typescript): resolve type errors in gasless deposit tests
lrsaturnino Nov 8, 2025
ac56381
fix(deposits): add chain-specific address handling for L2 deposits
lrsaturnino Nov 22, 2025
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
6 changes: 3 additions & 3 deletions .github/workflows/typescript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "18.x"
node-version: "20.x"
cache: "yarn"
cache-dependency-path: typescript/yarn.lock

Expand Down Expand Up @@ -88,7 +88,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "18.x"
node-version: "20.x"
cache: "yarn"
cache-dependency-path: typescript/yarn.lock

Expand Down Expand Up @@ -120,7 +120,7 @@ jobs:

- uses: actions/setup-node@v3
with:
node-version: "18.x"
node-version: "20.x"
cache: "yarn"
cache-dependency-path: typescript/yarn.lock

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
"prettier": "^2.3.2",
"prettier-plugin-sh": "^0.7.1",
"prettier-plugin-solidity": "^1.0.0-beta.14"
}
},
"packageManager": "yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
}
72 changes: 67 additions & 5 deletions typescript/api-reference/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@
- [ElectrumCredentials](interfaces/ElectrumCredentials.md)
- [EthereumContractConfig](interfaces/EthereumContractConfig.md)
- [ExtraDataEncoder](interfaces/ExtraDataEncoder.md)
- [GaslessDepositResult](interfaces/GaslessDepositResult.md)
- [GaslessRevealPayload](interfaces/GaslessRevealPayload.md)
- [L1BitcoinRedeemer](interfaces/L1BitcoinRedeemer.md)
- [L2BitcoinRedeemer](interfaces/L2BitcoinRedeemer.md)
- [RedeemerProxy](interfaces/RedeemerProxy.md)
Expand Down Expand Up @@ -110,6 +112,7 @@
- [ErrorMatcherFn](README.md#errormatcherfn)
- [EthereumSigner](README.md#ethereumsigner)
- [ExecutionLoggerFn](README.md#executionloggerfn)
- [GaslessDestination](README.md#gaslessdestination)
- [L1BitcoinDepositor](README.md#l1bitcoindepositor)
- [L1CrossChainContracts](README.md#l1crosschaincontracts)
- [L2BitcoinDepositor](README.md#l2bitcoindepositor)
Expand Down Expand Up @@ -145,6 +148,7 @@
- [BitcoinTargetConverter](README.md#bitcointargetconverter)
- [ChainMappings](README.md#chainmappings)
- [EthereumCrossChainExtraDataEncoder](README.md#ethereumcrosschainextradataencoder)
- [NATIVE\_BTC\_DEPOSITOR\_ADDRESSES](README.md#native_btc_depositor_addresses)
- [SolanaCrossChainExtraDataEncoder](README.md#solanacrosschainextradataencoder)
- [StarkNetCrossChainExtraDataEncoder](README.md#starknetcrosschainextradataencoder)
- [StarkNetDepositor](README.md#starknetdepositor)
Expand Down Expand Up @@ -413,7 +417,7 @@ or a Provider that works only in the read-only mode.

#### Defined in

[lib/ethereum/index.ts:35](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/index.ts#L35)
[lib/ethereum/index.ts:36](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/index.ts#L36)

___

Expand Down Expand Up @@ -443,6 +447,19 @@ A function that is called with execution status messages.

___

### GaslessDestination

Ƭ **GaslessDestination**: ``"L1"`` \| [`DestinationChainName`](README.md#destinationchainname)

Supported destination chains for gasless deposits.
Includes "L1" for direct Ethereum L1 deposits and all supported L2 chains.

#### Defined in

[services/deposits/deposits-service.ts:29](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/services/deposits/deposits-service.ts#L29)

___

### L1BitcoinDepositor

Ƭ **L1BitcoinDepositor**: [`BitcoinDepositor`](interfaces/BitcoinDepositor.md) & \{ `extraDataEncoder`: () => [`ExtraDataEncoder`](interfaces/ExtraDataEncoder.md) ; `getChainIdentifier`: () => [`ChainIdentifier`](interfaces/ChainIdentifier.md) ; `getDepositState`: (`depositId`: `string`) => `Promise`\<[`DepositState`](enums/DepositState.md)\> ; `initializeDeposit`: (`depositTx`: [`BitcoinRawTxVectors`](interfaces/BitcoinRawTxVectors.md), `depositOutputIndex`: `number`, `deposit`: [`DepositReceipt`](interfaces/DepositReceipt.md), `vault?`: [`ChainIdentifier`](interfaces/ChainIdentifier.md)) => `Promise`\<`any`\> }
Expand Down Expand Up @@ -968,6 +985,51 @@ Use EthereumExtraDataEncoder instead

___

### NATIVE\_BTC\_DEPOSITOR\_ADDRESSES

• `Const` **NATIVE\_BTC\_DEPOSITOR\_ADDRESSES**: `Record`\<[`Mainnet`](enums/BitcoinNetwork-1.md#mainnet) \| [`Testnet`](enums/BitcoinNetwork-1.md#testnet), `string`\>

NativeBTCDepositor contract addresses for gasless L1 tBTC deposits.

These contracts enable users to make Bitcoin deposits to L1 Ethereum
without paying gas fees. The relayer backend handles all transaction costs.
The depositor contract acts as an intermediary that accepts Bitcoin deposits
and automatically initiates the tBTC minting process on the user's behalf.

**`Remarks`**

This constant maps Bitcoin network types to their corresponding
NativeBTCDepositor smart contract addresses deployed on Ethereum.
It is used by the DepositsService to select the appropriate contract
address based on the Bitcoin network environment (mainnet vs testnet).

The gasless deposit flow works as follows:
1. User makes a Bitcoin deposit to the depositor contract address
2. Relayer backend detects the deposit and covers gas costs
3. Depositor contract initiates tBTC minting on Ethereum L1
4. User receives tBTC without paying any Ethereum transaction fees

**`Example`**

```typescript
import { NATIVE_BTC_DEPOSITOR_ADDRESSES } from "@keep-network/tbtc-v2.ts"
import { BitcoinNetwork } from "@keep-network/tbtc-v2.ts"

const bitcoinNetwork = BitcoinNetwork.Mainnet
const depositorAddress = NATIVE_BTC_DEPOSITOR_ADDRESSES[bitcoinNetwork]
console.log(depositorAddress) // "0xad7c6d46F4a4bc2D3A227067d03218d6D7c9aaa5"
```

**`See`**

[https://github.com/keep-network/tbtc-v2/blob/main/solidity/contracts/depositor/NativeBTCDepositor.sol](https://github.com/keep-network/tbtc-v2/blob/main/solidity/contracts/depositor/NativeBTCDepositor.sol) for contract implementation

#### Defined in

[lib/ethereum/constants.ts:35](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/constants.ts#L35)

___

### SolanaCrossChainExtraDataEncoder

• `Const` **SolanaCrossChainExtraDataEncoder**: typeof [`SolanaExtraDataEncoder`](classes/SolanaExtraDataEncoder.md) = `SolanaExtraDataEncoder`
Expand Down Expand Up @@ -1144,7 +1206,7 @@ Chain ID as a string.

#### Defined in

[lib/ethereum/index.ts:42](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/index.ts#L42)
[lib/ethereum/index.ts:43](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/index.ts#L43)

___

Expand Down Expand Up @@ -1199,7 +1261,7 @@ Throws an error if the address of the signer is not a proper

#### Defined in

[lib/ethereum/index.ts:64](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/index.ts#L64)
[lib/ethereum/index.ts:65](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/index.ts#L65)

___

Expand Down Expand Up @@ -1232,7 +1294,7 @@ Throws an error if the signer's Ethereum chain ID is other than

#### Defined in

[lib/ethereum/index.ts:119](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/index.ts#L119)
[lib/ethereum/index.ts:120](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/index.ts#L120)

___

Expand Down Expand Up @@ -1400,7 +1462,7 @@ Throws an error if the signer's Ethereum chain ID is other than

#### Defined in

[lib/ethereum/index.ts:83](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/index.ts#L83)
[lib/ethereum/index.ts:84](https://github.com/threshold-network/tbtc-v2/blob/main/typescript/src/lib/ethereum/index.ts#L84)

___

Expand Down
Loading