Hi everybody.

I am using blueprint to build my tact written contracts. I am trying to create a transaction via TonConnect ui-react sdk on front-end. How can I create that base64 payload to pass to the SendTransactionRequest object?

I am using the code below:

let data = new TonWeb.boc.Cell();
data.bits.writeUint(1804651575, 32);
let task = new TonWeb.boc.Cell();
task.bits.writeString("My new task!");
data.refs.push(task);

// Create Payload
TonWeb.utils.bytesToBase64(await data.toBoc())

But there is something wrong with my message that the contract cannot handle it.

Using ton-core was easier with the built wrappers of blueprint but I do not know how to create that boc base64 payload from the snippet below:

beginCell().store(storeMessage({$$type: "Message", "test": "HI"})).endCell()

Nov 10, 2023, 12:24 PM
Could you show message TL-B scheme from contract build artifacts?
Nov 10, 2023, 12:26 PM
;;
;; Type: NewTodo
;; Header: 0x6b90cc37
;; TLB: new_todo#6b90cc37 task:^string = NewTodo
;;

(slice, ((slice))) $NewTodo$_load(slice sc_0) inline {
throw_unless(129, sc_0~load_uint(32) == 1804651575);
var v'task = sc_0~load_ref().begin_parse();
return (sc_0, (v'task));
}
Nov 10, 2023, 12:28 PM
The contract can't handle it, or it doesn't get sent either?
So far the only change I would make is
```ts
TonWeb.utils.bytesToBase64(await data.toBoc(false))
```
Nov 10, 2023, 12:29 PM
What is hasIdx?
Nov 10, 2023, 12:31 PM
Big bags-of-cells have index to help to search a specific hash.
Nov 10, 2023, 12:31 PM

© 2024 Draquery.com All rights reserved.