Kda跨链转账问题
测试代码
test('cross chain sign transaction test', async () => {
const privateKey = '私钥3d6705eedd35cc8b97cee9b'
const params = {
txObj: {
from: 'k:259e184f5c7cecf261063dd298e250b2303cf896a3d6705eedd35cc8b97cee9b',
to: 'k:78b5b5ac81dd80a4089d54ea1481900d6cdccf7d1073ea0b7caeb4da92b92086',
toPub: '78b5b5ac81dd80a4089d54ea1481900d6cdccf7d1073ea0b7caeb4da92b92086',
amount: "0.001",
chainId: 2,
targetChainId: 1,
gasPrice: "0.000001",
gasLimit: 2350,
decimal: 12,
spv: "",
pactId: "",
},
network: 'main_net',
privs: [{ key: privateKey }]
}
const tx_sign_msg = await signTransaction(params)
console.log("tx_sign_msg===", tx_sign_msg);
});
测试发现只要签发一次就能成功,不需要获取获取spv和pacId后再做一次签名再发一次
浏览器如图
如果再签发一次交易失败
新版的跨链不需要再使用 spv 和 pactId 签名交易了,这个过程会自动完成。
跨链流程如下