export declare interface SendTransactionRequest { /** * Sending transaction deadline in unix epoch seconds. */ validUntil: number; /** * The network (mainnet or testnet) where DApp intends to send the transaction. If not set, the transaction is sent to the network currently set in the wallet, but this is not safe and DApp should always strive to set the network. If the network parameter is set, but the wallet has a different network set, the wallet should show an alert and DO NOT ALLOW TO SEND this transaction. */ network?: CHAIN; /** * The sender address in '<wc>:<hex>' format from which DApp intends to send the transaction. Current account.address by default. */ from?: string; /** * Messages to send: min is 1, max is 4. */ messages: { /** * Receiver's address. */ address: string; /** * Amount to send in nanoTon. */ amount: string; /** * Contract specific data to add to the transaction. */ stateInit?: string; /** * Contract specific data to add to the transaction. */ payload?: string; }[]; }
所以當我今天想要做一筆簡單的傳送交易時,我只需要構建下列的交易參數即可
1 2 3 4 5 6 7 8 9 10 11
const transaction = { // The transaction is valid for 10 minutes from now, in unix epoch seconds. validUntil: Math.floor(Date.now() / 1000) + 600, messages: [ { address: "0:412410771DA82CBA306A55FA9E0D43C9D245E38133CB58F1457DFB8D5CD8892F", // destination address amount: "20000000", //Toncoin in nanotons }, ], };
const body = beginCell() .storeUint(0, 32) // write 32 zero bits to indicate that a text comment will follow .storeStringTail("Hello, TON!") // write our text comment .endCell();
const transaction = { // The transaction is valid for 10 minutes from now, in unix epoch seconds. validUntil: Math.floor(Date.now() / 1000) + 600, messages: [ { address: "0:412410771DA82CBA306A55FA9E0D43C9D245E38133CB58F1457DFB8D5CD8892F", // destination address amount: "20000000", //Toncoin in nanotons, payload: body.toBoc().toString("base64"), // payload with comment in body }, ], };
在 TON 上面的錢包帳戶,跟傳統以太坊的 EOA 帳戶非常不一樣,在 TON 上面,每個錢包都是一個智能合約,這代表著 TON 的錢包帳戶一開始就支持了帳戶抽象化,同一套註記詞可以根據不同合約類型建立不同的帳戶,根據合約類型不同,可以支持不同的版本,當前最新的版本為 Wallet V5 (Beta),由 TonKeeper 推出,下列是幾個不同版本的錢包合約比對
Flutter 可以選擇兩種 VSCode,以及 Android Studio 這兩種 IDE 來開發,我之前偏好 VSCode,因為他更輕量,但是在 Android Studio 升級到最新版本之後,整個 UI 變得更加的好用,所以我目前是使用 Android Studio 來開發 Flutter。這邊看個人喜好就好了
finalvoidnotifyDataSetChanged() Notify any registered observers that the data set has changed.
finalvoidnotifyItemChanged(int position, Object payload) Notify any registered observers that the item at position has changed with an optional payload object.
finalvoidnotifyItemChanged(int position) Notify any registered observers that the item at position has changed.
finalvoidnotifyItemInserted(int position) Notify any registered observers that the item reflected at position has been newly inserted.
finalvoidnotifyItemMoved(int fromPosition, int toPosition) Notify any registered observers that the item reflected at fromPosition has been moved to toPosition.
finalvoidnotifyItemRangeChanged(int positionStart, int itemCount, Object payload) Notify any registered observers that the itemCount items starting at position positionStart have changed.
finalvoidnotifyItemRangeChanged(int positionStart, int itemCount) Notify any registered observers that the itemCount items starting at position positionStart have changed.
finalvoidnotifyItemRangeInserted(int positionStart, int itemCount) Notify any registered observers that the currently reflected itemCount items starting at positionStart have been newly inserted.
finalvoidnotifyItemRangeRemoved(int positionStart, int itemCount) Notify any registered observers that the itemCount items previously located at positionStart have been removed from the data set.
finalvoidnotifyItemRemoved(int position) Notify any registered observers that the item previously located at position has been removed from the data set.