KAI Integration for Exchanges
Initialize
Javascript:
import KardiaClient from 'kardia-js-sdk';
const endpoint = "https://rpc.kardiachain.io";
const kardiaClient = new KardiaClient({ endpoint }); Golang:
func SetupKAIClient(rpcURL string) (*Node, context.Context, error) {
ctx, _ := context.WithCancel(context.Background())
cfg := zapdriver.NewProductionConfig()
logger, err := cfg.Build()
if err != nil {
return nil, nil, fmt.Errorf("Failed to create logger: %v", err)
}
node, err := NewNode(rpcURL, lgr)
if err != nil {
logger.Warn("cannot connect to RPC url", rpcURL)
return nil, nil, fmt.Errorf("Failed to dial to RPC URL: %v", err)
}
return node, ctx, nil
}
node, _, err := SetupKAIClient("https://rpc.kardiachain.io")Blocks
Block Info API:
REQUEST PARAMS
Javascript SDK
Go KaiClient
Sending transactions
Sending Transaction
Response
Javascript SDK
Go KaiClient
Transactions and Receipts
Transaction and Receipt API:
RESPONSE
RESPONSE
Javascript SDK
Go KaiClient
Account Balances
Account Balances
RESPONSE
Javascript SDK
Go KaiClient
Last updated