# Packages
# README
Go API client for superlink
API for Superlink
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: v0.5.0
- Package version: v0.5.0
- Generator version: 7.5.0-SNAPSHOT
- Build package: org.openapitools.codegen.languages.GoClientCodegen For more information, please visit https://superlink.me/about#contact-us
Installation
Install the following dependencies:
go get github.com/stretchr/testify/assert
go get golang.org/x/net/context
Put the package under your project folder and add the following in import:
import superlink "github.com/superlink-me/superlink-api-go-client"
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 superlink.ContextServerIndex
of type int
.
ctx := context.WithValue(context.Background(), superlink.ContextServerIndex, 1)
Templated Server URL
Templated server URL is formatted using default variables from configuration or from context value superlink.ContextServerVariables
of type map[string]string
.
ctx := context.WithValue(context.Background(), superlink.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 superlink.ContextOperationServerIndices
and superlink.ContextOperationServerVariables
context maps.
ctx := context.WithValue(context.Background(), superlink.ContextOperationServerIndices, map[string]int{
"{classname}Service.{nickname}": 2,
})
ctx = context.WithValue(context.Background(), superlink.ContextOperationServerVariables, map[string]map[string]string{
"{classname}Service.{nickname}": {
"port": "8443",
},
})
Documentation for API Endpoints
All URIs are relative to https://api.superlink.me
Class | Method | HTTP request | Description |
---|---|---|---|
AdminAPI | AdminCreateAccessToken | Post /v1/admin/access-token | Creates an admin token |
AdminAPI | AdminDeleteAccessToken | Delete /v1/admin/access-token | Deletes an access token |
AdminAPI | AdminListAccessTokens | Get /v1/admin/access-token | Lists access tokens |
AdminAPI | AdminListPartners | Get /v1/admin/partner | Lists partners |
AdminAPI | AdminPartnerCreate | Post /v1/admin/partner | Creates a partner |
AdminAPI | HnsTldRegister | Post /v1/admin/hns/tld/register | HNSTLDRegister registers a Handshake TLD |
AdminAPI | RemoveReverseResolutionAddress | Delete /v1/admin/reverse | Removes a reverse resolution address from a domain |
AdminAPI | SetReverseResolutionAddress | Post /v1/admin/reverse | Assigns an address to a domain for reverse resolution |
DefaultAPI | HealthCheck | Get /v1/health | Checks the health of the API |
DomainInfoAPI | GetAllDomains | Get /v1/domain | Returns all the domains owned by a given ownerAddress |
HnsAPI | HnsDomainAvailable | Get /v1/hns/tld/{tld}/sld/{sld}/available | checks if a handshake domain is available to mint |
HnsAPI | HnsDomainCreate | Post /v1/hns/tld/{tld}/sld/mint | HNSCreateDomain creates a handshake domain |
HnsAPI | HnsDomainCreateSig | Post /v1/hns/tld/{tld}/sld/mint-with-sig | creates a handshake domain authenticated by a signed message |
HnsAPI | HnsDomainDelete | Delete /v1/hns/tld/{tld}/sld/{sld} | deletes a handshake domain |
HnsAPI | HnsTldCheckClaimed | Get /v1/hns/tld/{tld}/check-if-claimed/{address} | tests if the wallet has already claimed a domain for this TLD. |
HnsAPI | HnsTldValidate | Get /v1/hns/tld/{tld}/validate | HNSTLDValidation tests if the TLD blockchain DNS records are valid. |
LoginAPI | LoginWithLink | Get /v1/login/link/{loginToken} | Login via a magic link |
LoginAPI | LoginWithWallet | Post /v1/login/wallet/{ownerAddress} | Login with a valid wallet |
LoginAPI | SendLoginEmail | Post /v1/login/email/{emailAddress} | Sends the e-mail that contains the magic link to login a specfic user |
MarketAPI | MarketCryptoEstimate | Get /v1/market/crypto/estimate | CryptoEstimate returns the estimated conversion rates for supported crypto payment options |
MarketAPI | MarketCryptoPurchase | Post /v1/market/crypto/purchase | CryptoPurchase returns the payment details required for crypto payment |
MarketAPI | MarketOrder | Get /v1/market/order/{orderID} | Returns order information |
MarketAPI | MarketPurchase | Post /v1/market/purchase | Purchase returns the payment details required by Stripe |
MarketAPI | MarketSearch | Post /v1/market/search | Returns market listings |
MarketAPI | MarketSuggestion | Post /v1/market/suggest | Returns market listings for suggestions |
NftAPI | GetTokenImageByDomain | Get /v1/card-image/{domain}.svg | Returns a SVG image for a Superlink NFT |
NftAPI | GetTokenMetadataByDomain | Get /v1/metadata/{domain} | Returns metadata usually associated with NFTs uri |
PartnerAPI | CreateAccessToken | Post /v1/partner/access-token | Creates an admin token for a partner |
PartnerAPI | DeleteAccessToken | Delete /v1/partner/access-token | Deletes an access token |
PartnerAPI | ListAccessTokens | Get /v1/partner/access-token | Lists access tokens for a partner |
PartnerAPI | PartnerPurchases | Get /v1/partner/purchases | Returns a list of all purchases |
ProveAPI | GetEthWalletMessage | Get /v1/prove/wallet/eth/{ownerAddress} | Get message which should be signed by an eth wallet as proof of ownership |
ResolutionAPI | ResolveDataByAddress | Get /v1/reverse/{address} | Resolves wallets and DNS records for an address |
ResolutionAPI | ResolveDataByDomain | Get /v1/resolve/{domain} | Resolves wallets and DNS records for a domain |
SubdomainAPI | ParentdomainPurchase | Post /v1/parentdomains/{parentDomain}/buy | Purchases and sets up a parent domain for use with ens subdomains |
SubdomainAPI | ParentdomainSearch | Get /v1/parentdomains/{parentDomain}/search | Returns a list of available parent-domains provided the preferred parent ddomain |
SubdomainAPI | ParentdomainValidation | Get /v1/parentdomains/{parentDomain} | Validates if parent domain is correctly configured for use with ens subdomains |
SubdomainAPI | SubdomainAvailable | Get /v1/parentdomains/{parentDomain}/subdomains/{subDomainName} | Returns subdomain availability |
SubdomainAPI | SubdomainClaimed | Get /v1/parentdomains/{parentDomain}/claimed/{ethAddress} | Returns subdomain availability |
SubdomainAPI | SubdomainInvalidateClaimRateLimit | Delete /v1/parentdomains/{parentDomain}/invalidate-claim-rate-limit | Invalidates the claim rate limit for the current IP |
SubdomainAPI | SubdomainList | Get /v1/parentdomains/{parentDomain}/list | Paginates over all subdomains in descending order of the creation date |
SubdomainAPI | SubdomainMint | Post /v1/parentdomains/{parentDomain}/subdomains/{subDomainName} | Creates a subdomain for provided parentdomain |
SubdomainAPI | SubdomainMintSig | Post /v1/parentdomains/{parentDomain}/subdomains/{subDomainName}/mint-with-sig | Creates a subdomain for provided parentdomain with signature |
SubdomainAPI | SubdomainPerDay | Get /v1/parentdomains/{parentDomain}/per-day | Paginates over per-day aggregated counts for subdomains created given a parentdomain |
SubdomainAPI | SubdomainResolve | Get /v1/parentdomains/{parentDomain}/subdomains/{subDomainName}/resolve | Returns resolution of a provided subdomain |
SubdomainAPI | SubdomainReverseResolve | Get /v1/parentdomains/{parentDomain}/addresses/{ethAddress}/reverse-resolve | Returns reverse-resolution of a provided eth address limited to provided parentdomain |
SubdomainAPI | SubdomainRevoke | Delete /v1/parentdomains/{parentDomain}/subdomains/{subDomainName} | Deletes a subdomain for provided parentdomain (Omnipotent) |
SubdomainAPI | SubdomainTotal | Get /v1/parentdomains/{parentDomain}/total | Returns the total number of subdomains registered to parentdomain |
Documentation For Models
- ApiAccessTokenCreateRequest
- ApiAccessTokenDeleteRequest
- ApiAccessTokenResponse
- ApiAddressRecord
- ApiAdminAccessTokenCreateRequest
- ApiAdminPartnerCreateRequest
- ApiBadRequestResponse
- ApiCoin
- ApiCryptoPurchaseRequest
- ApiDNSRecord
- ApiDomainBasicInformation
- ApiDomainMetadataAttribute
- ApiDomainMetadataResponse
- ApiErrorResponse
- ApiGetAllDomainsResponse
- ApiHNSBlockchainRecords
- ApiHNSCreateDomainRequest
- ApiHNSCreateDomainWithWalletRequest
- ApiHNSDomainAvailableResponse
- ApiHNSRegisterTLDRequest
- ApiHNSRegisterTLDResponse
- ApiInternalServerErrorResponse
- ApiMarketCryptoEstimation
- ApiMarketCryptoEstimationResponse
- ApiMarketCryptoPurchaseResponse
- ApiMarketListing
- ApiMarketPurchaseResponse
- ApiMarketSearchRequest
- ApiMarketSearchResponse
- ApiMarketSuggestRequest
- ApiMarketplaceOrderResponse
- ApiNameService
- ApiParentDomainPurchaseRequest
- ApiParentDomainPurchaseRequestDomainContactDetails
- ApiParentDomainSearchResponse
- ApiParentDomainValidationResponse
- ApiPartnerResponse
- ApiPurchaseListResponse
- ApiPurchaseRequest
- ApiPurchaseResponse
- ApiResolveDomainResponse
- ApiReverseResolutionDeleteRequest
- ApiSetReverseAddressRequest
- ApiSubDomainAvailableResponse
- ApiSubDomainItem
- ApiSubDomainListResponse
- ApiSubDomainMintRequest
- ApiSubDomainMintWithSigRequest
- ApiSubDomainNameData
- ApiSubDomainPerDayCount
- ApiSubDomainPerDayResponse
- ApiSubDomainResolveResponse
- ApiSubDomainReverseResolveResponse
- ApiSubDomainTotalResponse
- ApiSubdomainStatus
- ApiTXTRecord
- ApiWalletData
- ApiWalletLoginRequest
- ApiWalletMessageResponse
- DataAccessTokenType
Documentation For Authorization
Authentication schemes defined for the API:
BearerAuth
- Type: API key
- API key parameter name: Authorization
- Location: HTTP header
Note, each API key must be added to a map of map[string]APIKey
where the key is: Authorization and passed in as the auth context for each request.
Example
auth := context.WithValue(
context.Background(),
superlink.ContextAPIKeys,
map[string]superlink.APIKey{
"Authorization": {Key: "API_KEY_STRING"},
},
)
r, err := client.Service.Operation(auth, args)
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