# Go SDK Signing Guide

The official Go SDK focuses on constructing request payloads and generating SoDEX-compatible signatures.

GitHub: [sodex-go-sdk-public](https://github.com/sodex-tech/sodex-go-sdk-public)

## What the SDK Covers

* EIP-712 domain construction
* `payloadHash` generation
* signature-type prefixes
* spot and perps signer helpers

## What the SDK Does Not Cover

* HTTP clients
* WebSocket clients
* retries and reconnects
* rate-limit scheduling
* key storage

## Core Entry Points

* `common/signer/evm_signer.go`
* `spot/signer/signer.go`
* `perps/signer/signer.go`

Use the spot signer for the `spot` domain and the perps signer for the `futures` domain.

## Example

```go
package main

import (
	"crypto/ecdsa"

	"github.com/sodex-tech/sodex-go-sdk-public/common/enums"
	commonTypes "github.com/sodex-tech/sodex-go-sdk-public/common/types"
	spotSigner "github.com/sodex-tech/sodex-go-sdk-public/spot/signer"
	spotTypes "github.com/sodex-tech/sodex-go-sdk-public/spot/types"
)

func signSpotOrder(privateKey *ecdsa.PrivateKey) ([]byte, error) {
	signer := spotSigner.NewSigner(286623, privateKey)

	req := &spotTypes.NewOrderRequest{
		AccountID:   1001,
		SymbolID:    1,
		ClOrdID:     "example-order-1",
		Side:        enums.OrderSideBuy,
		Type:        enums.OrderTypeLimit,
		TimeInForce: enums.TimeInForceGTC,
		Price:       "100000",
		Quantity:    "0.01",
	}

	nonce := uint64(1760373925000)
	return signer.SignNewOrderRequest(req, nonce)
}

```

## Notes

* The returned signature already includes the SoDEX signature-type prefix.
* All nonces must still satisfy the gateway nonce rules.
* The SDK marshals the request payload before hashing, so your custom clients should avoid mutating field order or names when reimplementing signing outside the SDK.

## Related Pages

{% content-ref url="<https://github.com/sosovalue-tech/sodex-docs/blob/main/api/authentication-and-signing.md>" %}
<https://github.com/sosovalue-tech/sodex-docs/blob/main/api/authentication-and-signing.md>
{% endcontent-ref %}

{% content-ref url="/pages/JhkOXmaIr0osLMjp2DfF" %}
[REST API v1](/documentation/trading-api/rest-v1.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sodex.com/documentation/trading-api/go-sdk-signing-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
