Documentation
¶
Overview ¶
Package sdk provides a Go SDK with which to interact with the 0xkey API service.
Index ¶
- Variables
- func NewHTTPClient(formats strfmt.Registry) *client.ZeroXKeyAPI
- func SetClientVersion(inner http.RoundTripper, clientVersion string) http.RoundTripper
- type Authenticator
- type Client
- type Logger
- type OptionFunc
- func WithAPIKey(apiKey *apikey.Key) OptionFunc
- func WithAPIKeyName(keyname string) OptionFunc
- func WithClientVersion(clientVersion string) OptionFunc
- func WithLogger(logger Logger) OptionFunc
- func WithRegistry(registry strfmt.Registry) OptionFunc
- func WithTransportConfig(transportConfig client.TransportConfig) OptionFunc
Constants ¶
This section is empty.
Variables ¶
var DefaultClientVersion = "0xkey-go/" + strings.TrimSpace(embeddedVersion)
DefaultClientVersion is sent as the X-Client-Version header on API requests.
Functions ¶
func NewHTTPClient ¶
func NewHTTPClient(formats strfmt.Registry) *client.ZeroXKeyAPI
NewHTTPClient returns a new base HTTP API client. Deprecated: Use New(WithRegistry(formats)) instead.
func SetClientVersion ¶
func SetClientVersion(inner http.RoundTripper, clientVersion string) http.RoundTripper
SetClientVersion wraps inner with a RoundTripper that sets X-Client-Version.
Types ¶
type Authenticator ¶
Authenticator provides a runtime.ClientAuthInfoWriter for use with the swagger API client.
func (*Authenticator) AuthenticateRequest ¶
func (auth *Authenticator) AuthenticateRequest(req runtime.ClientRequest, _ strfmt.Registry) error
AuthenticateRequest implements runtime.ClientAuthInfoWriter.
type Client ¶
type Client struct {
Client *client.ZeroXKeyAPI
Authenticator *Authenticator
APIKey *apikey.Key
}
Client provides a handle by which to interact with the 0xkey API.
func New ¶
func New(options ...OptionFunc) (*Client, error)
New returns a new API Client with the given options.
func (*Client) DefaultOrganization ¶
DefaultOrganization returns the first organization found in the APIKey's set of organizations.
func (*Client) V0 ¶
func (c *Client) V0() *client.ZeroXKeyAPI
V0 returns the raw initial 0xkey API client.
type Logger ¶
type Logger interface {
Printf(format string, v ...interface{})
}
Logger defines a minimal logging interface. Compatible with stdlib log.Logger, zap.SugaredLogger, etc.
type OptionFunc ¶
type OptionFunc func(c *config) error
OptionFunc defines a function which sets configuration options for a Client.
func WithAPIKey ¶
func WithAPIKey(apiKey *apikey.Key) OptionFunc
WithAPIKey sets the API key used for this API client.
func WithAPIKeyName ¶
func WithAPIKeyName(keyname string) OptionFunc
WithAPIKeyName sets the API key loaded from the local keystore with the provided name.
func WithClientVersion ¶
func WithClientVersion(clientVersion string) OptionFunc
WithClientVersion overrides the client version used for this API client.
func WithLogger ¶
func WithLogger(logger Logger) OptionFunc
WithLogger sets a custom logger for the SDK.
func WithRegistry ¶
func WithRegistry(registry strfmt.Registry) OptionFunc
WithRegistry sets the registry formats used for this API client.
func WithTransportConfig ¶
func WithTransportConfig(transportConfig client.TransportConfig) OptionFunc
WithTransportConfig sets the TransportConfig used for this API client.
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
changeset
command
|
|
|
changeset-changelog
command
|
|
|
changeset-version
command
|
|
|
examples
|
|
|
apikey
command
|
|
|
delegated_access
command
Package main demonstrates the delegated access setup For details check our docs https://docs.0xkey.com/concepts/policies/delegated-access
|
Package main demonstrates the delegated access setup For details check our docs https://docs.0xkey.com/concepts/policies/delegated-access |
|
email_otp
command
Package main demonstrates the OTP enclave authentication flow.
|
Package main demonstrates the OTP enclave authentication flow. |
|
private_keys/import_private_key
command
Package main demonstrates a Secp256k1 or Ed25519 private key import
|
Package main demonstrates a Secp256k1 or Ed25519 private key import |
|
signing/sign_raw_payload
command
Package main demonstrates an API client which signs a raw payload with a wallet account
|
Package main demonstrates an API client which signs a raw payload with a wallet account |
|
signing/sign_transaction
command
Package main demonstrates an API client which signs a transaction with a private key ID or wallet account.
|
Package main demonstrates an API client which signs a transaction with a private key ID or wallet account. |
|
transaction_management/ethereum
command
|
|
|
transaction_management/solana
command
|
|
|
wallets/create_wallet
command
Package main demonstrates an API client which creates a new wallet with a wallet account.
|
Package main demonstrates an API client which creates a new wallet with a wallet account. |
|
wallets/create_wallet_accounts
command
Package main demonstrates an API client which creates new wallet accounts.
|
Package main demonstrates an API client which creates new wallet accounts. |
|
wallets/export_wallet
command
|
|
|
wallets/export_wallet_account
command
|
|
|
wallets/import_wallet
command
Package main demonstrates a wallet import from menmonic
|
Package main demonstrates a wallet import from menmonic |
|
whoami
command
Package main demonstrates an API client which returns the UserID of its API key.
|
Package main demonstrates an API client which returns the UserID of its API key. |
|
internal
|
|
|
base58check
Package base58check implements checksum validation used by auth bundles.
|
Package base58check implements checksum validation used by auth bundles. |
|
p256util
Package p256util provides shared P-256 ECDSA helpers.
|
Package p256util provides shared P-256 ECDSA helpers. |
|
pkg
|
|
|
apikey
Package apikey manages 0xkey API keys for organizations
|
Package apikey manages 0xkey API keys for organizations |
|
common
Package common contains key and key metadata interfaces
|
Package common contains key and key metadata interfaces |
|
encryptionkey
Package encryptionkey manages encryption keys for users
|
Package encryptionkey manages encryption keys for users |
|
proofs
Package proofs provides verification for 0xkey app proofs and boot proofs.
|
Package proofs provides verification for 0xkey app proofs and boot proofs. |
|
store
Package store defines a key storage interface.
|
Package store defines a key storage interface. |
|
store/local
Package local provides a keystore based on a local directory.
|
Package local provides a keystore based on a local directory. |
|
store/ram
Package ram defines a RAM-based apikey store.
|
Package ram defines a RAM-based apikey store. |
|
util
Package util provides convenience utilities for interacting with the API.
|
Package util provides convenience utilities for interacting with the API. |