Skip to content

Latest commit

 

History

History
322 lines (192 loc) · 7.32 KB

internal_.PromiEvent.md

File metadata and controls

322 lines (192 loc) · 7.32 KB

@paraswap/sdk / Exports / <internal> / PromiEvent

Interface: PromiEvent<T>

.PromiEvent

Type parameters

Name
T

Hierarchy

  • Promise<T>

    PromiEvent

Table of contents

Properties

Methods

Properties

[toStringTag]

Readonly [toStringTag]: string

Inherited from

Promise.__@toStringTag@167

Defined in

node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts:174

Methods

catch

catch<TResult>(onrejected?): Promise<T | TResult>

Attaches a callback for only the rejection of the Promise.

Type parameters

Name Type
TResult never

Parameters

Name Type Description
onrejected? null | (reason: any) => TResult | PromiseLike<TResult> The callback to execute when the Promise is rejected.

Returns

Promise<T | TResult>

A Promise for the completion of the callback.

Inherited from

Promise.catch


finally

finally(onfinally?): Promise<T>

Attaches a callback that is invoked when the Promise is settled (fulfilled or rejected). The resolved value cannot be modified from the callback.

Parameters

Name Type Description
onfinally? null | () => void The callback to execute when the Promise is settled (fulfilled or rejected).

Returns

Promise<T>

A Promise for the completion of the callback.

Inherited from

Promise.finally


on

on(type, handler): PromiEvent<T>

Parameters

Name Type
type "sending"
handler (payload: object) => void

Returns

PromiEvent<T>

on(type, handler): PromiEvent<T>

Parameters

Name Type
type "sent"
handler (payload: object) => void

Returns

PromiEvent<T>

on(type, handler): PromiEvent<T>

Parameters

Name Type
type "transactionHash"
handler (receipt: string) => void

Returns

PromiEvent<T>

on(type, handler): PromiEvent<T>

Parameters

Name Type
type "receipt"
handler (receipt: TransactionReceipt) => void

Returns

PromiEvent<T>

on(type, handler): PromiEvent<T>

Parameters

Name Type
type "confirmation"
handler (confNumber: number, receipt: TransactionReceipt, latestBlockHash?: string) => void

Returns

PromiEvent<T>

on(type, handler): PromiEvent<T>

Parameters

Name Type
type "error"
handler (error: Error) => void

Returns

PromiEvent<T>

on(type, handler): PromiEvent<T>

Parameters

Name Type
type "sending" | "sent" | "transactionHash" | "receipt" | "confirmation" | "error"
handler (error: string | object | Error | TransactionReceipt) => void

Returns

PromiEvent<T>


once

once(type, handler): PromiEvent<T>

Parameters

Name Type
type "sending"
handler (payload: object) => void

Returns

PromiEvent<T>

once(type, handler): PromiEvent<T>

Parameters

Name Type
type "sent"
handler (payload: object) => void

Returns

PromiEvent<T>

once(type, handler): PromiEvent<T>

Parameters

Name Type
type "transactionHash"
handler (transactionHash: string) => void

Returns

PromiEvent<T>

once(type, handler): PromiEvent<T>

Parameters

Name Type
type "receipt"
handler (receipt: TransactionReceipt) => void

Returns

PromiEvent<T>

once(type, handler): PromiEvent<T>

Parameters

Name Type
type "confirmation"
handler (confirmationNumber: number, receipt: TransactionReceipt, latestBlockHash?: string) => void

Returns

PromiEvent<T>

once(type, handler): PromiEvent<T>

Parameters

Name Type
type "error"
handler (error: Error) => void

Returns

PromiEvent<T>

once(type, handler): PromiEvent<T>

Parameters

Name Type
type "sending" | "sent" | "transactionHash" | "receipt" | "confirmation" | "error"
handler (error: string | object | Error | TransactionReceipt) => void

Returns

PromiEvent<T>


then

then<TResult1, TResult2>(onfulfilled?, onrejected?): Promise<TResult1 | TResult2>

Attaches callbacks for the resolution and/or rejection of the Promise.

Type parameters

Name Type
TResult1 T
TResult2 never

Parameters

Name Type Description
onfulfilled? null | (value: T) => TResult1 | PromiseLike<TResult1> The callback to execute when the Promise is resolved.
onrejected? null | (reason: any) => TResult2 | PromiseLike<TResult2> The callback to execute when the Promise is rejected.

Returns

Promise<TResult1 | TResult2>

A Promise for the completion of which ever callback is executed.

Inherited from

Promise.then