Class: RelayProvider
"providers/RelayProvider".RelayProvider
#
Hierarchy↳ RelayProvider
#
Implements#
Constructors#
constructor+ new RelayProvider(relayApiUrl
: string, relayWsApiUrl
: string): RelayProvider
Overrides Provider.constructor
Defined in src/providers/RelayProvider.ts:20
#
Parameters:Name | Type |
---|---|
relayApiUrl | string |
relayWsApiUrl | string |
Returns: RelayProvider
#
Properties#
ApiUrl• ApiUrl: string
Implementation of TLProvider.ApiUrl
Inherited from Provider.ApiUrl
Defined in src/providers/Provider.ts:8
#
WsApiUrl• WsApiUrl: string
Implementation of TLProvider.WsApiUrl
Inherited from Provider.WsApiUrl
Defined in src/providers/Provider.ts:9
#
Methods#
createWebsocketStreamâ–¸ createWebsocketStream(endpoint
: string, functionName
: string, args
: object, reconnectingOptions?
: ReconnectingWSOptions): Observable<any>
Implementation of TLProvider
Inherited from Provider.createWebsocketStream
Defined in src/providers/Provider.ts:45
Creates a websocket stream connection to the server.
#
Parameters:Name | Type | Description |
---|---|---|
endpoint | string | Websocket stream endpoint to connect to. |
functionName | string | Function to call on connection. |
args | object | Function arguments. |
reconnectingOptions? | ReconnectingWSOptions | - |
Returns: Observable<any>
#
fetchEndpointâ–¸ fetchEndpoint<T>(endpoint
: string, options?
: object): Promise<T>
Implementation of TLProvider
Inherited from Provider.fetchEndpoint
Defined in src/providers/Provider.ts:21
Returns a JSON response from the REST API of the server.
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type | Description |
---|---|---|
endpoint | string | Endpoint to fetch. |
options? | object | Optional fetch options. |
Returns: Promise<T>
#
getBalanceâ–¸ getBalance(address
: string): Promise<Amount>
Implementation of TLProvider
Defined in src/providers/RelayProvider.ts:115
Returns balance of given address.
#
Parameters:Name | Type | Description |
---|---|---|
address | string | Address to determine balance for. |
Returns: Promise<Amount>
#
getIdentityImplementationAddressâ–¸ getIdentityImplementationAddress(address
: string): Promise<string>
Implementation of TLProvider
Defined in src/providers/RelayProvider.ts:62
Returns implementation address of identity with given address
#
Parameters:Name | Type | Description |
---|---|---|
address | string | Address of identity |
Returns: Promise<string>
the implementation address currently in use by the given identity
#
getIdentityNonceâ–¸ getIdentityNonce(address
: string): Promise<number>
Implementation of TLProvider
Defined in src/providers/RelayProvider.ts:47
Returns next nonce for identity with given address
#
Parameters:Name | Type | Description |
---|---|---|
address | string | Address of identity |
Returns: Promise<number>
the next nonce that should be used for making a meta-transaction
#
getMetaTxFeesâ–¸ getMetaTxFees(metaTransaction
: MetaTransaction): Promise<MetaTransactionFees>
Implementation of TLProvider
Defined in src/providers/RelayProvider.ts:79
Returns the fees the provider would be willing to pay for the transaction
#
Parameters:Name | Type | Description |
---|---|---|
metaTransaction | MetaTransaction | Meta transaction to be relayed |
Returns: Promise<MetaTransactionFees>
The fees value and currency network of fees for given meta transaction
#
getMetaTxStatusâ–¸ getMetaTxStatus(identityAddress
: string, metaTransactionHash
: string): Promise<MetaTransactionStatus>
Implementation of TLProvider
Defined in src/providers/RelayProvider.ts:94
#
Parameters:Name | Type |
---|---|
identityAddress | string |
metaTransactionHash | string |
Returns: Promise<MetaTransactionStatus>
#
getTxInfosâ–¸ getTxInfos(address
: string): Promise<TxInfos>
Implementation of TLProvider
Defined in src/providers/RelayProvider.ts:31
Returns needed information for creating an ethereum transaction.
#
Parameters:Name | Type | Description |
---|---|---|
address | string | Address of user creating the transaction |
Returns: Promise<TxInfos>
Information for creating an ethereum transaction for the given user address.
See type TxInfos
for more details.
#
getTxStatusâ–¸ getTxStatus(transactionHash
: string): Promise<TransactionStatusObject>
Implementation of TLProvider
Defined in src/providers/RelayProvider.ts:103
#
Parameters:Name | Type |
---|---|
transactionHash | string |
Returns: Promise<TransactionStatusObject>
#
getVersionâ–¸ getVersion(): Promise<string>
Inherited from Provider.getVersion
Defined in src/providers/Provider.ts:64
Returns the version of the currently configured provider server.
Returns: Promise<string>
Version of relay in the format <name>/vX.X.X
.
#
postToEndpointâ–¸ postToEndpoint<T>(endpoint
: string, data
: any): Promise<T>
Implementation of TLProvider
Inherited from Provider.postToEndpoint
Defined in src/providers/Provider.ts:29
#
Type parameters:Name |
---|
T |
#
Parameters:Name | Type |
---|---|
endpoint | string |
data | any |
Returns: Promise<T>
#
sendSignedMetaTransactionâ–¸ sendSignedMetaTransaction(signedMetaTransaction
: MetaTransaction): Promise<string>
Implementation of TLProvider
Defined in src/providers/RelayProvider.ts:145
Send the given signed meta-transaction to a relay server to execute it on the
blockchain and returns a Promise
with the transaction hash.
#
Parameters:Name | Type | Description |
---|---|---|
signedMetaTransaction | MetaTransaction | Signed meta-transaction to be sent to the relay server |
Returns: Promise<string>
The hash of the transaction sent by the relay server, not to be confused with the hash of the meta-transaction
#
sendSignedTransactionâ–¸ sendSignedTransaction(signedTransaction
: string): Promise<string>
Implementation of TLProvider
Defined in src/providers/RelayProvider.ts:125
Send the given signedTransaction to a relay server to execute it on the
blockchain and returns a Promise
with the transaction hash.
#
Parameters:Name | Type | Description |
---|---|---|
signedTransaction | string |
Returns: Promise<string>