Skip to content

Latest commit

 

History

History
503 lines (280 loc) · 12.5 KB

EthereumTBTCVault.md

File metadata and controls

503 lines (280 loc) · 12.5 KB

Class: EthereumTBTCVault

Implementation of the Ethereum TBTCVault handle.

See

for reference.

Hierarchy

  • EthersContractHandle<TBTCVaultTypechain>

    EthereumTBTCVault

Implements

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new EthereumTBTCVault(config, chainId?): EthereumTBTCVault

Parameters

Name Type Default value
config EthereumContractConfig undefined
chainId Ethereum Chains.Ethereum.Local

Returns

EthereumTBTCVault

Overrides

EthersContractHandle&lt;TBTCVaultTypechain&gt;.constructor

Defined in

src/lib/ethereum/tbtc-vault.ts:41

Properties

_deployedAtBlockNumber

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.

Inherited from

EthersContractHandle._deployedAtBlockNumber

Defined in

src/lib/ethereum/adapter.ts:80


_instance

Protected Readonly _instance: TBTCVault

Ethers instance of the deployed contract.

Inherited from

EthersContractHandle._instance

Defined in

src/lib/ethereum/adapter.ts:74


_totalRetryAttempts

Protected Readonly _totalRetryAttempts: number

Number of retries for ethereum requests.

Inherited from

EthersContractHandle._totalRetryAttempts

Defined in

src/lib/ethereum/adapter.ts:84

Methods

cancelOptimisticMint

cancelOptimisticMint(depositTxHash, depositOutputIndex): Promise<Hex>

Parameters

Name Type
depositTxHash BitcoinTxHash
depositOutputIndex number

Returns

Promise<Hex>

See

Implementation of

TBTCVault.cancelOptimisticMint

Defined in

src/lib/ethereum/tbtc-vault.ts:150


finalizeOptimisticMint

finalizeOptimisticMint(depositTxHash, depositOutputIndex): Promise<Hex>

Parameters

Name Type
depositTxHash BitcoinTxHash
depositOutputIndex number

Returns

Promise<Hex>

See

Implementation of

TBTCVault.finalizeOptimisticMint

Defined in

src/lib/ethereum/tbtc-vault.ts:173


getAddress

getAddress(): EthereumAddress

Get address of the contract instance.

Returns

EthereumAddress

Address of this contract instance.

Inherited from

EthersContractHandle.getAddress

Defined in

src/lib/ethereum/adapter.ts:112


getChainIdentifier

getChainIdentifier(): ChainIdentifier

Returns

ChainIdentifier

See

Implementation of

TBTCVault.getChainIdentifier

Defined in

src/lib/ethereum/tbtc-vault.ts:68


getEvents

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.

Parameters

Name Type Description
eventName string Name of the event.
options? Options Options for events fetching.
...filterArgs unknown[] Arguments for events filtering.

Returns

Promise<Event[]>

Array of found events.

Inherited from

EthersContractHandle.getEvents

Defined in

src/lib/ethereum/adapter.ts:127


getMinters

getMinters(): Promise<EthereumAddress[]>

Returns

Promise<EthereumAddress[]>

See

Implementation of

TBTCVault.getMinters

Defined in

src/lib/ethereum/tbtc-vault.ts:90


getOptimisticMintingCancelledEvents

getOptimisticMintingCancelledEvents(options?, ...filterArgs): Promise<OptimisticMintingCancelledEvent[]>

Parameters

Name Type
options? Options
...filterArgs any[]

Returns

Promise<OptimisticMintingCancelledEvent[]>

See

Implementation of

TBTCVault.getOptimisticMintingCancelledEvents

Defined in

src/lib/ethereum/tbtc-vault.ts:268


getOptimisticMintingFinalizedEvents

getOptimisticMintingFinalizedEvents(options?, ...filterArgs): Promise<OptimisticMintingFinalizedEvent[]>

Parameters

Name Type
options? Options
...filterArgs any[]

Returns

Promise<OptimisticMintingFinalizedEvent[]>

See

Implementation of

TBTCVault.getOptimisticMintingFinalizedEvents

Defined in

src/lib/ethereum/tbtc-vault.ts:295


getOptimisticMintingRequestedEvents

getOptimisticMintingRequestedEvents(options?, ...filterArgs): Promise<OptimisticMintingRequestedEvent[]>

Parameters

Name Type
options? Options
...filterArgs any[]

Returns

Promise<OptimisticMintingRequestedEvent[]>

See

Implementation of

TBTCVault.getOptimisticMintingRequestedEvents

Defined in

src/lib/ethereum/tbtc-vault.ts:235


isGuardian

isGuardian(address): Promise<boolean>

Parameters

Name Type
address EthereumAddress

Returns

Promise<boolean>

See

Implementation of

TBTCVault.isGuardian

Defined in

src/lib/ethereum/tbtc-vault.ts:114


isMinter

isMinter(address): Promise<boolean>

Parameters

Name Type
address EthereumAddress

Returns

Promise<boolean>

See

Implementation of

TBTCVault.isMinter

Defined in

src/lib/ethereum/tbtc-vault.ts:104


optimisticMintingDelay

optimisticMintingDelay(): Promise<number>

Returns

Promise<number>

See

Implementation of

TBTCVault.optimisticMintingDelay

Defined in

src/lib/ethereum/tbtc-vault.ts:76


optimisticMintingRequests

optimisticMintingRequests(depositTxHash, depositOutputIndex): Promise<OptimisticMintingRequest>

Parameters

Name Type
depositTxHash BitcoinTxHash
depositOutputIndex number

Returns

Promise<OptimisticMintingRequest>

See

Implementation of

TBTCVault.optimisticMintingRequests

Defined in

src/lib/ethereum/tbtc-vault.ts:199


parseOptimisticMintingRequest

parseOptimisticMintingRequest(request): OptimisticMintingRequest

Parses a optimistic minting request using data fetched from the on-chain contract.

Parameters

Name Type Description
request ContractOptimisticMintingRequest Data of the optimistic minting request.

Returns

OptimisticMintingRequest

Parsed optimistic minting request.

Defined in

src/lib/ethereum/tbtc-vault.ts:222


requestOptimisticMint

requestOptimisticMint(depositTxHash, depositOutputIndex): Promise<Hex>

Parameters

Name Type
depositTxHash BitcoinTxHash
depositOutputIndex number

Returns

Promise<Hex>

See

Implementation of

TBTCVault.requestOptimisticMint

Defined in

src/lib/ethereum/tbtc-vault.ts:124