import { BlockrushSDK, Region } from "@blockrush/sdk";
// 使用您的 API 密钥和首选区域初始化 SDK
const sdk = new BlockrushSDK({
region: Region.JP,
api_key: "YOUR_API_KEY", // 在生产环境中使用环境变量
});
// 示例:发送单笔交易
const res = await sdk.send_transaction(
"完全签名交易的 Base64 字符串"
);
console.log(res);
// 示例:提交批量交易
const res2 = await sdk.submit_batch([
"完全签名交易 1 的 Base64 字符串",
"完全签名交易 2 的 Base64 字符串",
]);
console.log(res2);
// 完成后清理资源
sdk.destroy();