Skip to main content
Version: Next

Class: PaymasterInterface

Implemented by

Constructors

constructor

new PaymasterInterface(): PaymasterInterface

Returns

PaymasterInterface

Properties

nodeUrl

Abstract nodeUrl: string

Defined in

src/paymaster/interface.ts:12


headers

Abstract headers: object

Defined in

src/paymaster/interface.ts:14


baseFetch

Readonly Abstract baseFetch: (input: RequestInfo | URL, init?: RequestInit) => Promise<Response>

Type declaration

▸ (input, init?): Promise<Response>

Parameters
NameType
inputRequestInfo | URL
init?RequestInit
Returns

Promise<Response>

Defined in

src/paymaster/interface.ts:16

Methods

isAvailable

isAvailable(): Promise<boolean>

Returns the status of the paymaster service

Returns

Promise<boolean>

If the paymaster service is correctly functioning, return true. Else, return false

Defined in

src/paymaster/interface.ts:23


buildTransaction

buildTransaction(transaction, parameters): Promise<PreparedTransaction>

Receives the transaction the user wants to execute. Returns the typed data along with the estimated gas cost and the maximum gas cost suggested to ensure execution

Parameters

NameTypeDescription
transactionUserTransactionTransaction to be executed by the paymaster
parametersExecutionParametersExecution parameters to be used when executing the transaction

Returns

Promise<PreparedTransaction>

The transaction data required for execution along with an estimation of the fee

Defined in

src/paymaster/interface.ts:33


executeTransaction

executeTransaction(transaction, parameters): Promise<ExecuteResponse>

Sends the signed typed data to the paymaster service for execution

Parameters

NameTypeDescription
transactionExecutableUserTransactionTyped data build by calling paymaster_buildTransaction signed by the user to be executed by the paymaster service
parametersExecutionParametersExecution parameters to be used when executing the transaction

Returns

Promise<ExecuteResponse>

The hash of the transaction broadcasted by the paymaster and the tracking ID corresponding to the user execute request

Defined in

src/paymaster/interface.ts:45


getSupportedTokens

getSupportedTokens(): Promise<TokenData[]>

Get a list of the tokens that the paymaster supports, together with their prices in STRK

Returns

Promise<TokenData[]>

An array of token data

Defined in

src/paymaster/interface.ts:55