Skip to main content

-Types-

MicroSui Object-style This section describes all the Type Structs of the SDK.

Inspired by the Mysten Labs TypeScript SDK, adapted for embedded C.


Types with Methods and Functions

MicroSuiEd25519

struct MicroSuiEd25519 {
uint8_t secret_key[32]; // Placeholder for the Secret Key

// OO-style methods
SuiSignature (*signTransaction)(MicroSuiEd25519 *self, const char *msg)
const char* (*toSuiAddress)(MicroSuiEd25519 *self);
const uint8_t* (*getPublicKey)(MicroSuiEd25519 *self);
const char* (*getSecretKey)(MicroSuiEd25519 *self);
};

MicroSuiClient

struct MicroSuiClient {
char rpc_url[128]; // Placeholder for the URL

// OO-style methods
SuiTransactionBlockResponse (*signAndExecuteTransaction)(MicroSuiClient *self, MicroSuiEd25519 kp, MicroSuiTransaction tx);
SuiTransactionBlockResponse (*executeTransactionBlock)(MicroSuiClient *self, TransactionBytes txBytes, SuiSignature signature);
};

MicroSuiTransaction

struct MicroSuiTransaction {
TransactionBytes tx_bytes; // Transaction bytes

// OO-style methods
TransactionBytes (*build)(MicroSuiTransaction *self);
void (*clear)(MicroSuiTransaction *self);
};

MicroSuiWiFi

struct MicroSuiWiFi {
char ssid[64]; // Placeholder for the WiFi SSID
char password[64]; // Placeholder for the WiFi Password

// OO-style methods
void (*disconnect)(MicroSuiWiFi *self);
};

Types Struct native

SuiSignature

struct SuiSignature {
uint8_t bytes[97]; // Placeholder for the signature in bytes format
char signature[133]; // Placeholder for the signature in base64 format (132 + null terminator)
};

TransactionBytes

struct TransactionBytes {
uint8_t* data; // Placeholder for transaction bytes data
size_t length; // Length of the transaction bytes
};

SuiTransactionBlockResponse

struct SuiTransactionBlockResponse {
BalanceChange balanceChanges[MAX_BALANCE_CHANGES];
int balanceChanges_len; // actual count

char* checkpoint; // may be NULL if not present
char* confirmedLocalExecution; // "true"/"false" or NULL
char* digest; // may be NULL if not present
};

BalanceChange

struct BalanceChange {
char* amount; // e.g., "100000000"
char* coinType; // e.g., "0x2::sui::SUI"
char* owner; // e.g., "0xabc..." (flattened AddressOwner if present)
};