# README

Go API client for api

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

Overview

This API client was generated by the OpenAPI Generator project. By using the OpenAPI-spec from a remote server, you can easily generate an API client.

  • API version: 3.0
  • Package version: 1.0.0-beta.1
  • Build package: org.openapitools.codegen.languages.GoClientCodegen

Installation

Install the following dependencies:

go get github.com/stretchr/testify/assert
go get golang.org/x/oauth2
go get golang.org/x/net/context

Put the package under your project folder and add the following in import:

import api "github.com/immutable/imx-core-sdk-golang/imx/api"

To use a proxy, set the environment variable HTTP_PROXY:

os.Setenv("HTTP_PROXY", "http://proxy_name:proxy_port")

Configuration of Server URL

Default configuration comes with Servers field that contains server objects as defined in the OpenAPI specification.

Select Server Configuration

For using other server than the one defined on index 0 set context value sw.ContextServerIndex of type int.

ctx := context.WithValue(context.Background(), api.ContextServerIndex, 1)

Templated Server URL

Templated server URL is formatted using default variables from configuration or from context value sw.ContextServerVariables of type map[string]string.

ctx := context.WithValue(context.Background(), api.ContextServerVariables, map[string]string{
	"basePath": "v2",
})

Note, enum values are always validated and all unused variables are silently ignored.

URLs Configuration per Operation

Each operation can use different server URL defined using OperationServers map in the Configuration. An operation is uniquely identified by "{classname}Service.{nickname}" string. Similar rules for overriding default operation server index and variables applies by using sw.ContextOperationServerIndices and sw.ContextOperationServerVariables context maps.

ctx := context.WithValue(context.Background(), api.ContextOperationServerIndices, map[string]int{
	"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), api.ContextOperationServerVariables, map[string]map[string]string{
	"{classname}Service.{nickname}": {
		"port": "8443",
	},
})

Documentation for API Endpoints

All URIs are relative to https://api.sandbox.x.immutable.com

ClassMethodHTTP requestDescription
AssetsApiGetAssetGet /v1/assets/{token_address}/{token_id}Get details of an asset
AssetsApiListAssetsGet /v1/assetsGet a list of assets
BalancesApiGetBalanceGet /v2/balances/{owner}/{address}Fetches the token balances of the user
BalancesApiListBalancesGet /v2/balances/{owner}Get a list of balances for given user
CollectionsApiCreateCollectionPost /v1/collectionsCreate collection
CollectionsApiGetCollectionGet /v1/collections/{address}Get details of a collection at the given address
CollectionsApiListCollectionFiltersGet /v1/collections/{address}/filtersGet a list of collection filters
CollectionsApiListCollectionsGet /v1/collectionsGet a list of collections
CollectionsApiUpdateCollectionPatch /v1/collections/{address}Update collection
DepositsApiGetDepositGet /v1/deposits/{id}Get details of a deposit with the given ID
DepositsApiGetSignableDepositPost /v1/signable-deposit-detailsGets details of a signable deposit
DepositsApiListDepositsGet /v1/depositsGet a list of deposits
EncodingApiEncodeAssetPost /v1/encode/{assetType}Retrieves the Starkex Encoded format for a given asset
ExchangesApiCreateExchangePost /v3/exchangesCreate an exchange with URL
ExchangesApiCreateExchangeTransferPost /v2/exchanges/{id}/transfersAccepts a transfer request and updates the transfer_status after processing transfer (offramp)
ExchangesApiGetExchangeGet /v3/exchanges/{id}Get an exchange by ID
ExchangesApiGetExchangeSignableTransferPost /v2/exchanges/{id}/signable-transfer-detailsSend a request for signable-transfer-details (offramp)
ExchangesApiGetExchangesGet /v3/exchangesReturns a list of exchanges based on the request
MetadataApiAddMetadataSchemaToCollectionPost /v1/collections/{address}/metadata-schemaAdd metadata schema to collection
MetadataApiGetMetadataSchemaGet /v1/collections/{address}/metadata-schemaGet collection metadata schema
MetadataApiUpdateMetadataSchemaByNamePatch /v1/collections/{address}/metadata-schema/{name}Update metadata schema by name
MetadataRefreshesApiGetAListOfMetadataRefreshesGet /v1/metadata-refreshes
MetadataRefreshesApiGetMetadataRefreshErrorsGet /v1/metadata-refreshes/{refresh_id}/errors
MetadataRefreshesApiGetMetadataRefreshResultsGet /v1/metadata-refreshes/{refresh_id}
MetadataRefreshesApiRequestAMetadataRefreshPost /v1/metadata-refreshes
MintsApiGetMintGet /v1/mints/{id}Get details of a mint with the given ID
MintsApiGetMintableTokenDetailsByClientTokenIdGet /v1/mintable-token/{token_address}/{token_id}Get details of a mintable token with the given token address and token ID
MintsApiListMintsGet /v1/mintsGet a list of mints
MintsApiMintTokensPost /v2/mintsMint Tokens V2
NftCheckoutPrimaryApiCreateNftPrimaryPost /v2/nft/primaryCreate NFT primary sale transaction
NftCheckoutPrimaryApiGetCurrenciesNFTCheckoutPrimaryGet /v2/nft/primary/currenciesGet currencies with limits
NftCheckoutPrimaryApiGetNftPrimaryTransactionGet /v2/nft/primary/{transaction_id}Get NFT primary sale transaction by id
NftCheckoutPrimaryApiGetNftPrimaryTransactionsGet /v2/nft/primaryGet a list of NFT primary sales transactions
NftCheckoutPrimaryApiRegisterNftPrimarySalesContractPost /v2/nft/primary/registerExecutes NFT primary sales contract registration
OrdersApiCancelOrderDelete /v1/orders/{id}Cancel an order
OrdersApiCreateOrderPost /v1/ordersCreate an order
OrdersApiGetOrderGet /v1/orders/{id}Get details of an order with the given ID
OrdersApiGetSignableCancelOrderPost /v1/signable-cancel-order-detailsGet details a signable cancel order
OrdersApiGetSignableOrderPost /v3/signable-order-detailsGet a signable order request (V3)
OrdersApiListOrdersGet /v1/ordersGet a list of orders
ProjectsApiCreateProjectPost /v1/projectsCreate a project
ProjectsApiGetProjectGet /v1/projects/{id}Get a project
ProjectsApiGetProjectsGet /v1/projectsGet projects
TokensApiGetTokenGet /v1/tokens/{address}Get details of a token
TokensApiListTokensGet /v1/tokensGet a list of tokens
TradesApiCreateTradePost /v1/tradesCreate a Trade between two parties
TradesApiGetSignableTradePost /v3/signable-trade-detailsGet details a signable trade V3
TradesApiGetTradeGet /v1/trades/{id}Get details of a trade with the given ID
TradesApiListTradesGet /v1/tradesGet a list of trades
TransfersApiCreateTransferPost /v2/transfersCreates a transfer of multiple tokens between two parties
TransfersApiCreateTransferV1Post /v1/transfersCreates a transfer of tokens between two parties
TransfersApiGetSignableTransferPost /v2/signable-transfer-detailsGets bulk details of a signable transfer
TransfersApiGetSignableTransferV1Post /v1/signable-transfer-detailsGets details of a signable transfer
TransfersApiGetTransferGet /v1/transfers/{id}Get details of a transfer with the given ID
TransfersApiListTransfersGet /v1/transfersGet a list of transfers
UsersApiGetSignableRegistrationPost /v1/signable-registrationGet operator signature to allow clients to register the user
UsersApiGetSignableRegistrationOffchainPost /v1/signable-registration-offchainGet encoded details to allow clients to register the user offchain
UsersApiGetUsersGet /v1/users/{user}Get stark keys for a registered user
UsersApiRegisterUserPost /v1/usersRegisters a user
WithdrawalsApiCreateWithdrawalPost /v1/withdrawalsCreates a withdrawal of a token
WithdrawalsApiGetSignableWithdrawalPost /v1/signable-withdrawal-detailsGets details of a signable withdrawal
WithdrawalsApiGetWithdrawalGet /v1/withdrawals/{id}Gets details of withdrawal with the given ID
WithdrawalsApiListWithdrawalsGet /v1/withdrawalsGet a list of withdrawals

Documentation For Models

Documentation For Authorization

Endpoints do not require authorization.

Documentation for Utility Methods

Due to the fact that model structure members are all pointers, this package contains a number of utility functions to easily obtain pointers to values of basic types. Each of these functions takes a value of the given basic type and returns a pointer to it:

  • PtrBool
  • PtrInt
  • PtrInt32
  • PtrInt64
  • PtrFloat
  • PtrFloat32
  • PtrFloat64
  • PtrString
  • PtrTime

Author

[email protected]