运行浏览器示例
在其他项目安装 SDK 压缩包后执行:Simulate confirmation。示例包含能力检查、显式历史权限、具名结果、状态查询、等待取消、事件清理和账户变化处理。
使用真实插件时,在连接前关闭模拟选项并填写实际收款地址。真实模式会请求钱包授权并移动资金,要求插件声明支持 getTransaction。返回 txid 只代表提交;failed、cancelled、recoverable 使用不同提示,不自动重试付款。
Documentation Index
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
运行 SDK 自带浏览器示例,使用模拟钱包测试接入,并在不主动申请钱包权限的默认模式下检查 Provider 接口兼容性。
node node_modules/@arksat/wallet-sdk/examples/serve.mjs
Simulate confirmation。示例包含能力检查、显式历史权限、具名结果、状态查询、等待取消、事件清理和账户变化处理。
使用真实插件时,在连接前关闭模拟选项并填写实际收款地址。真实模式会请求钱包授权并移动资金,要求插件声明支持 getTransaction。返回 txid 只代表提交;failed、cancelled、recoverable 使用不同提示,不自动重试付款。
import { createArksatClient, waitForTransaction } from '@arksat/wallet-sdk'
import { createMockProvider } from '@arksat/wallet-sdk/mock'
const provider = createMockProvider({ balance: 10000 })
const client = createArksatClient(provider)
await client.connect({ read: ['transactions'] })
const { txid } = await client.sendToAddress({ address: 'mock:recipient', amount: 1000 })
const waiting = waitForTransaction(provider, txid)
provider.mock.setTransactionStatus(txid, 'confirmed')
console.log((await waiting).status)
import { runConformance } from '@arksat/wallet-sdk/conformance'
const report = await runConformance(provider)
console.table(report.checks)
const report = await runConformance(provider, {
readAuthorized: true,
transactionId: txid,
timeoutMs: 5000,
})
const capabilities = await client.getCapabilities()
if (!capabilities.methods.includes('getTransaction')) throw new Error('请更新插件')
await client.connect({ read: ['transactions'] })
const tx = await client.getTransaction({ txid })