sui
sui copied to clipboard
Sui Code Bug or Feature Request
const tx = new Transaction();
tx.setGasBudget(10000000)
const p0 = tx.pure.u64(BigInt(0))
const money = parseInt(0.01 * 1e9)
// tx.transferObjects([coin], address);
const p1 = tx.sharedObjectRef({
objectId: "0x90e2dd6643d1eafe02d76a161a962e16bb573c55af934cfc86e911d64aa68b9b",
initialSharedVersion:19218095,
mutable: false,
})
const p2 = tx.sharedObjectRef({
objectId: "0x0000000000000000000000000000000000000000000000000000000000000006",
initialSharedVersion:1,
mutable: false,
})
const p3 = tx.sharedObjectRef({
objectId: "0x8447b6840ae21edaaf7baf9bbdf5749fff96ad4262123efd83e8d214c887f21a",
initialSharedVersion:11984592,
mutable: true,
})
const p4 = tx.sharedObjectRef({
objectId: "0x23c53c945744198ff070ea9c13f9263694f3441b52b13158ff6dc2da5416e6ab",
initialSharedVersion:19217233,
mutable: true,
})
const p5 = tx.sharedObjectRef({
objectId: "0x8313624f33dd48ab49b22de7032cc51f5539576fdaacb8321d408d9cb4e5cdf7",
initialSharedVersion:11984592,
mutable: true,
})
const p6 = tx.pure.string("asdkjl1231")
const p7 = tx.pure.string("guokaichen6166")
tx.moveCall({
target: target,
arguments: [
p0,
tx.object(p1),
tx.object(p2),
tx.object(p3),
tx.object(p4),
tx.object(p5),
p6,
p7
],
});
tx.splitCoins(tx.gas, [money]);
const res = await sendTx(address, tx)
console.log(res)
why does the p0 that I built look like this?
i need this
Thanks for the question @daihaojun554.
(package: 0x626a…9a74, module: 'hive_chronicles', function: kraft_hive_profile, arguments: [Input(1), Input(2), Input(3), Input(4), Input(5), Result(0), Input(6), Input(7)] and how can i build result0 this arg?
I'm not sure how valueType is determined in that explorer, but the bytes in the transaction for those pure types are exactly identical. A bcs encoded u64 0 value is [0,0,0,0,0,0,0,0]. Transactions do not contain type information when submitted (nothing in the transaction knows that those bytes are a u64 value). I think to display the value in an explorer as u64 0, it would need to look at how the value is used, and determine the type of the move call argument it was passed to.
thanks, and how can i build this Result0 arg,i can't find the way
Result args are returned from commands. Eg: const result0 = tx.moveCall({ ...} ) which can be used in a future command: const result1 = tx.moveCall({ ..., arguments: [result0, ...] })
ok thanks ,i have resolve this problem