Implementation of the Ethereum TBTCVault handle.
See
for reference.
-
EthersContractHandle
<TBTCVaultTypechain
>↳
EthereumTBTCVault
- cancelOptimisticMint
- finalizeOptimisticMint
- getAddress
- getChainIdentifier
- getEvents
- getMinters
- getOptimisticMintingCancelledEvents
- getOptimisticMintingFinalizedEvents
- getOptimisticMintingRequestedEvents
- isGuardian
- isMinter
- optimisticMintingDelay
- optimisticMintingRequests
- parseOptimisticMintingRequest
- requestOptimisticMint
• new EthereumTBTCVault(config
, chainId?
): EthereumTBTCVault
Name | Type | Default value |
---|---|---|
config |
EthereumContractConfig |
undefined |
chainId |
Ethereum |
Chains.Ethereum.Local |
EthersContractHandle<TBTCVaultTypechain>.constructor
src/lib/ethereum/tbtc-vault.ts:41
• Protected
Readonly
_deployedAtBlockNumber: number
Number of a block within which the contract was deployed. Value is read from the contract deployment artifact. It can be overwritten by setting a EthersContractConfig.deployedAtBlockNumber property.
EthersContractHandle._deployedAtBlockNumber
src/lib/ethereum/adapter.ts:80
• Protected
Readonly
_instance: TBTCVault
Ethers instance of the deployed contract.
EthersContractHandle._instance
src/lib/ethereum/adapter.ts:74
• Protected
Readonly
_totalRetryAttempts: number
Number of retries for ethereum requests.
EthersContractHandle._totalRetryAttempts
src/lib/ethereum/adapter.ts:84
▸ cancelOptimisticMint(depositTxHash
, depositOutputIndex
): Promise
<Hex
>
Name | Type |
---|---|
depositTxHash |
BitcoinTxHash |
depositOutputIndex |
number |
Promise
<Hex
>
See
TBTCVault.cancelOptimisticMint
src/lib/ethereum/tbtc-vault.ts:150
▸ finalizeOptimisticMint(depositTxHash
, depositOutputIndex
): Promise
<Hex
>
Name | Type |
---|---|
depositTxHash |
BitcoinTxHash |
depositOutputIndex |
number |
Promise
<Hex
>
See
TBTCVault.finalizeOptimisticMint
src/lib/ethereum/tbtc-vault.ts:173
▸ getAddress(): EthereumAddress
Get address of the contract instance.
Address of this contract instance.
EthersContractHandle.getAddress
src/lib/ethereum/adapter.ts:112
▸ getChainIdentifier(): ChainIdentifier
See
src/lib/ethereum/tbtc-vault.ts:68
▸ getEvents(eventName
, options?
, ...filterArgs
): Promise
<Event
[]>
Get events emitted by the Ethereum contract.
It starts searching from provided block number. If the GetEvents.Options#fromBlock
option is missing it looks for a contract's defined property
_deployedAtBlockNumber. If the property is missing starts searching
from block 0
.
Name | Type | Description |
---|---|---|
eventName |
string |
Name of the event. |
options? |
Options |
Options for events fetching. |
...filterArgs |
unknown [] |
Arguments for events filtering. |
Promise
<Event
[]>
Array of found events.
EthersContractHandle.getEvents
src/lib/ethereum/adapter.ts:127
▸ getMinters(): Promise
<EthereumAddress
[]>
Promise
<EthereumAddress
[]>
See
src/lib/ethereum/tbtc-vault.ts:90
▸ getOptimisticMintingCancelledEvents(options?
, ...filterArgs
): Promise
<OptimisticMintingCancelledEvent
[]>
Name | Type |
---|---|
options? |
Options |
...filterArgs |
any [] |
Promise
<OptimisticMintingCancelledEvent
[]>
See
TBTCVault.getOptimisticMintingCancelledEvents
src/lib/ethereum/tbtc-vault.ts:268
▸ getOptimisticMintingFinalizedEvents(options?
, ...filterArgs
): Promise
<OptimisticMintingFinalizedEvent
[]>
Name | Type |
---|---|
options? |
Options |
...filterArgs |
any [] |
Promise
<OptimisticMintingFinalizedEvent
[]>
See
TBTCVault.getOptimisticMintingFinalizedEvents
src/lib/ethereum/tbtc-vault.ts:295
▸ getOptimisticMintingRequestedEvents(options?
, ...filterArgs
): Promise
<OptimisticMintingRequestedEvent
[]>
Name | Type |
---|---|
options? |
Options |
...filterArgs |
any [] |
Promise
<OptimisticMintingRequestedEvent
[]>
See
TBTCVault.getOptimisticMintingRequestedEvents
src/lib/ethereum/tbtc-vault.ts:235
▸ isGuardian(address
): Promise
<boolean
>
Name | Type |
---|---|
address |
EthereumAddress |
Promise
<boolean
>
See
src/lib/ethereum/tbtc-vault.ts:114
▸ isMinter(address
): Promise
<boolean
>
Name | Type |
---|---|
address |
EthereumAddress |
Promise
<boolean
>
See
src/lib/ethereum/tbtc-vault.ts:104
▸ optimisticMintingDelay(): Promise
<number
>
Promise
<number
>
See
TBTCVault.optimisticMintingDelay
src/lib/ethereum/tbtc-vault.ts:76
▸ optimisticMintingRequests(depositTxHash
, depositOutputIndex
): Promise
<OptimisticMintingRequest
>
Name | Type |
---|---|
depositTxHash |
BitcoinTxHash |
depositOutputIndex |
number |
Promise
<OptimisticMintingRequest
>
See
TBTCVault.optimisticMintingRequests
src/lib/ethereum/tbtc-vault.ts:199
▸ parseOptimisticMintingRequest(request
): OptimisticMintingRequest
Parses a optimistic minting request using data fetched from the on-chain contract.
Name | Type | Description |
---|---|---|
request |
ContractOptimisticMintingRequest |
Data of the optimistic minting request. |
Parsed optimistic minting request.
src/lib/ethereum/tbtc-vault.ts:222
▸ requestOptimisticMint(depositTxHash
, depositOutputIndex
): Promise
<Hex
>
Name | Type |
---|---|
depositTxHash |
BitcoinTxHash |
depositOutputIndex |
number |
Promise
<Hex
>
See