Skip to content

Latest commit

 

History

History
1260 lines (820 loc) · 34 KB

ChainsApi.md

File metadata and controls

1260 lines (820 loc) · 34 KB

\ChainsApi

All URIs are relative to http://localhost

Method HTTP request Description
ActivateChain Post /v1/chains/{chainID}/activate Activate a chain
AddAccessNode Put /v1/chains/{chainID}/access-node/{peer} Configure a trusted node to be an access node.
CallView Post /v1/chains/{chainID}/callview Call a view function on a contract by Hname
DeactivateChain Post /v1/chains/{chainID}/deactivate Deactivate a chain
EstimateGasOffledger Post /v1/chains/{chainID}/estimategas-offledger Estimates gas for a given off-ledger ISC request
EstimateGasOnledger Post /v1/chains/{chainID}/estimategas-onledger Estimates gas for a given on-ledger ISC request
GetChainInfo Get /v1/chains/{chainID} Get information about a specific chain
GetChains Get /v1/chains Get a list of all chains
GetCommitteeInfo Get /v1/chains/{chainID}/committee Get information about the deployed committee
GetContracts Get /v1/chains/{chainID}/contracts Get all available chain contracts
GetMempoolContents Get /v1/chains/{chainID}/mempool Get the contents of the mempool.
GetReceipt Get /v1/chains/{chainID}/receipts/{requestID} Get a receipt from a request ID
GetStateValue Get /v1/chains/{chainID}/state/{stateKey} Fetch the raw value associated with the given key in the chain state
RemoveAccessNode Delete /v1/chains/{chainID}/access-node/{peer} Remove an access node.
SetChainRecord Post /v1/chains/{chainID}/chainrecord Sets the chain record.
V1ChainsChainIDEvmPost Post /v1/chains/{chainID}/evm Ethereum JSON-RPC
V1ChainsChainIDEvmWsGet Get /v1/chains/{chainID}/evm/ws Ethereum JSON-RPC (Websocket transport)
WaitForRequest Get /v1/chains/{chainID}/requests/{requestID}/wait Wait until the given request has been processed by the node

ActivateChain

ActivateChain(ctx, chainID).Execute()

Activate a chain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.ActivateChain(context.Background(), chainID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.ActivateChain``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiActivateChainRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

AddAccessNode

AddAccessNode(ctx, chainID, peer).Execute()

Configure a trusted node to be an access node.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    peer := "peer_example" // string | Name or PubKey (hex) of the trusted peer

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.AddAccessNode(context.Background(), chainID, peer).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.AddAccessNode``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)
peer string Name or PubKey (hex) of the trusted peer

Other Parameters

Other parameters are passed through a pointer to a apiAddAccessNodeRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

CallView

JSONDict CallView(ctx, chainID).ContractCallViewRequest(contractCallViewRequest).Execute()

Call a view function on a contract by Hname

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    contractCallViewRequest := *openapiclient.NewContractCallViewRequest(*openapiclient.NewJSONDict(), "ContractHName_example", "ContractName_example", "FunctionHName_example", "FunctionName_example") // ContractCallViewRequest | Parameters

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.CallView(context.Background(), chainID).ContractCallViewRequest(contractCallViewRequest).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.CallView``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `CallView`: JSONDict
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.CallView`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiCallViewRequest struct via the builder pattern

Name Type Description Notes

contractCallViewRequest | ContractCallViewRequest | Parameters |

Return type

JSONDict

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

DeactivateChain

DeactivateChain(ctx, chainID).Execute()

Deactivate a chain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.DeactivateChain(context.Background(), chainID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.DeactivateChain``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiDeactivateChainRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

EstimateGasOffledger

ReceiptResponse EstimateGasOffledger(ctx, chainID).Request(request).Execute()

Estimates gas for a given off-ledger ISC request

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    request := *openapiclient.NewEstimateGasRequestOffledger("RequestBytes_example") // EstimateGasRequestOffledger | Request

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.EstimateGasOffledger(context.Background(), chainID).Request(request).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.EstimateGasOffledger``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `EstimateGasOffledger`: ReceiptResponse
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.EstimateGasOffledger`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiEstimateGasOffledgerRequest struct via the builder pattern

Name Type Description Notes

request | EstimateGasRequestOffledger | Request |

Return type

ReceiptResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

EstimateGasOnledger

ReceiptResponse EstimateGasOnledger(ctx, chainID).Request(request).Execute()

Estimates gas for a given on-ledger ISC request

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    request := *openapiclient.NewEstimateGasRequestOnledger("OutputBytes_example") // EstimateGasRequestOnledger | Request

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.EstimateGasOnledger(context.Background(), chainID).Request(request).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.EstimateGasOnledger``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `EstimateGasOnledger`: ReceiptResponse
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.EstimateGasOnledger`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiEstimateGasOnledgerRequest struct via the builder pattern

Name Type Description Notes

request | EstimateGasRequestOnledger | Request |

Return type

ReceiptResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetChainInfo

ChainInfoResponse GetChainInfo(ctx, chainID).Block(block).Execute()

Get information about a specific chain

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    block := "block_example" // string | Block index or trie root (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.GetChainInfo(context.Background(), chainID).Block(block).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetChainInfo``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetChainInfo`: ChainInfoResponse
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetChainInfo`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiGetChainInfoRequest struct via the builder pattern

Name Type Description Notes

block | string | Block index or trie root |

Return type

ChainInfoResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetChains

[]ChainInfoResponse GetChains(ctx).Execute()

Get a list of all chains

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.GetChains(context.Background()).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetChains``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetChains`: []ChainInfoResponse
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetChains`: %v\n", resp)
}

Path Parameters

This endpoint does not need any parameter.

Other Parameters

Other parameters are passed through a pointer to a apiGetChainsRequest struct via the builder pattern

Return type

[]ChainInfoResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetCommitteeInfo

CommitteeInfoResponse GetCommitteeInfo(ctx, chainID).Block(block).Execute()

Get information about the deployed committee

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    block := "block_example" // string | Block index or trie root (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.GetCommitteeInfo(context.Background(), chainID).Block(block).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetCommitteeInfo``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetCommitteeInfo`: CommitteeInfoResponse
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetCommitteeInfo`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiGetCommitteeInfoRequest struct via the builder pattern

Name Type Description Notes

block | string | Block index or trie root |

Return type

CommitteeInfoResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetContracts

[]ContractInfoResponse GetContracts(ctx, chainID).Block(block).Execute()

Get all available chain contracts

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    block := "block_example" // string | Block index or trie root (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.GetContracts(context.Background(), chainID).Block(block).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetContracts``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetContracts`: []ContractInfoResponse
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetContracts`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiGetContractsRequest struct via the builder pattern

Name Type Description Notes

block | string | Block index or trie root |

Return type

[]ContractInfoResponse

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetMempoolContents

GetMempoolContents(ctx, chainID).Execute()

Get the contents of the mempool.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.GetMempoolContents(context.Background(), chainID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetMempoolContents``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiGetMempoolContentsRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetReceipt

ReceiptResponse GetReceipt(ctx, chainID, requestID).Execute()

Get a receipt from a request ID

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    requestID := "requestID_example" // string | RequestID (Hex)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.GetReceipt(context.Background(), chainID, requestID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetReceipt``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetReceipt`: ReceiptResponse
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetReceipt`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)
requestID string RequestID (Hex)

Other Parameters

Other parameters are passed through a pointer to a apiGetReceiptRequest struct via the builder pattern

Name Type Description Notes

Return type

ReceiptResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetStateValue

StateResponse GetStateValue(ctx, chainID, stateKey).Execute()

Fetch the raw value associated with the given key in the chain state

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    stateKey := "stateKey_example" // string | State Key (Hex)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.GetStateValue(context.Background(), chainID, stateKey).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.GetStateValue``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `GetStateValue`: StateResponse
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.GetStateValue`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)
stateKey string State Key (Hex)

Other Parameters

Other parameters are passed through a pointer to a apiGetStateValueRequest struct via the builder pattern

Name Type Description Notes

Return type

StateResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RemoveAccessNode

RemoveAccessNode(ctx, chainID, peer).Execute()

Remove an access node.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    peer := "peer_example" // string | Name or PubKey (hex) of the trusted peer

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.RemoveAccessNode(context.Background(), chainID, peer).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.RemoveAccessNode``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)
peer string Name or PubKey (hex) of the trusted peer

Other Parameters

Other parameters are passed through a pointer to a apiRemoveAccessNodeRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

SetChainRecord

SetChainRecord(ctx, chainID).ChainRecord(chainRecord).Execute()

Sets the chain record.

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    chainRecord := *openapiclient.NewChainRecord([]string{"AccessNodes_example"}, false) // ChainRecord | Chain Record

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.SetChainRecord(context.Background(), chainID).ChainRecord(chainRecord).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.SetChainRecord``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiSetChainRecordRequest struct via the builder pattern

Name Type Description Notes

chainRecord | ChainRecord | Chain Record |

Return type

(empty response body)

Authorization

Authorization

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

V1ChainsChainIDEvmPost

V1ChainsChainIDEvmPost(ctx, chainID).Execute()

Ethereum JSON-RPC

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.V1ChainsChainIDEvmPost(context.Background(), chainID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.V1ChainsChainIDEvmPost``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiV1ChainsChainIDEvmPostRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

V1ChainsChainIDEvmWsGet

V1ChainsChainIDEvmWsGet(ctx, chainID).Execute()

Ethereum JSON-RPC (Websocket transport)

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.V1ChainsChainIDEvmWsGet(context.Background(), chainID).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.V1ChainsChainIDEvmWsGet``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)

Other Parameters

Other parameters are passed through a pointer to a apiV1ChainsChainIDEvmWsGetRequest struct via the builder pattern

Name Type Description Notes

Return type

(empty response body)

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

[Back to top] [Back to API list] [Back to Model list] [Back to README]

WaitForRequest

ReceiptResponse WaitForRequest(ctx, chainID, requestID).TimeoutSeconds(timeoutSeconds).WaitForL1Confirmation(waitForL1Confirmation).Execute()

Wait until the given request has been processed by the node

Example

package main

import (
    "context"
    "fmt"
    "os"
    openapiclient "./openapi"
)

func main() {
    chainID := "chainID_example" // string | ChainID (Bech32)
    requestID := "requestID_example" // string | RequestID (Hex)
    timeoutSeconds := int32(56) // int32 | The timeout in seconds, maximum 60s (optional)
    waitForL1Confirmation := true // bool | Wait for the block to be confirmed on L1 (optional)

    configuration := openapiclient.NewConfiguration()
    apiClient := openapiclient.NewAPIClient(configuration)
    resp, r, err := apiClient.ChainsApi.WaitForRequest(context.Background(), chainID, requestID).TimeoutSeconds(timeoutSeconds).WaitForL1Confirmation(waitForL1Confirmation).Execute()
    if err != nil {
        fmt.Fprintf(os.Stderr, "Error when calling `ChainsApi.WaitForRequest``: %v\n", err)
        fmt.Fprintf(os.Stderr, "Full HTTP response: %v\n", r)
    }
    // response from `WaitForRequest`: ReceiptResponse
    fmt.Fprintf(os.Stdout, "Response from `ChainsApi.WaitForRequest`: %v\n", resp)
}

Path Parameters

Name Type Description Notes
ctx context.Context context for authentication, logging, cancellation, deadlines, tracing, etc.
chainID string ChainID (Bech32)
requestID string RequestID (Hex)

Other Parameters

Other parameters are passed through a pointer to a apiWaitForRequestRequest struct via the builder pattern

Name Type Description Notes

timeoutSeconds | int32 | The timeout in seconds, maximum 60s | waitForL1Confirmation | bool | Wait for the block to be confirmed on L1 |

Return type

ReceiptResponse

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]