solana_web3_sys/transaction.rs
1//!
2//! [`Transaction`](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html) class bindings.
3//!
4
5use crate::imports::*;
6use crate::instruction::TransactionInstruction;
7
8#[wasm_bindgen]
9extern "C" {
10 #[wasm_bindgen(js_namespace=solanaWeb3, js_name = Transaction)]
11 #[derive(Debug, Clone)]
12 /// Transaction
13 ///
14 /// ⧉ [Solana Documentation](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html)
15 ///
16 pub type Transaction;
17
18 #[wasm_bindgen(constructor, js_namespace=["solanaWeb3"])]
19 /// Construct an empty Transaction
20 ///
21 /// ⧉ [Solana Documentation](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html)
22 ///
23 pub fn new() -> Transaction;
24
25 #[wasm_bindgen(setter, method, js_namespace=["solanaWeb3"], js_name="feePayer")]
26 /// Set the transaction fee payer
27 ///
28 /// ⧉ [Solana Documentation](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html#feePayer)
29 ///
30 pub fn set_fee_payer(this: &Transaction, fee_payer_pubkey: JsValue);
31
32 #[wasm_bindgen(setter, method, js_namespace=["solanaWeb3"], js_name="recentBlockhash")]
33 /// A recent transaction id. Must be populated by the caller
34 ///
35 /// ⧉ [Solana Documentation](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html#recentBlockhash)
36 ///
37 pub fn set_recent_block_hash(this: &Transaction, recent_blockhash: JsValue);
38
39 #[wasm_bindgen(method, js_namespace=["solanaWeb3"], js_name="add")]
40 /// Add one instruction to this Transaction
41 ///
42 /// ⧉ [Solana Documentation](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html#add)
43 ///
44 pub fn add(this: &Transaction, instruction: TransactionInstruction);
45
46 #[wasm_bindgen(method, js_namespace=["solanaWeb3"], js_name="serialize")]
47 /// Serialize the Transaction in the wire format.
48 ///
49 /// ⧉ [Solana Documentation](https://solana-labs.github.io/solana-web3.js/classes/Transaction.html#serialize)
50 ///
51 pub fn serialize(this: &Transaction, config: SerializeConfig) -> JsValue;
52
53 #[wasm_bindgen(extends = Object)]
54 #[derive(Debug, Clone, PartialEq, Eq)]
55 /// Configuration object for Transaction.serialize()
56 ///
57 /// ⧉ [Solana Documentation](https://solana-labs.github.io/solana-web3.js/types/SerializeConfig.html)
58 ///
59 pub type SerializeConfig;
60
61 #[wasm_bindgen(setter, method, js_name = "requireAllSignatures")]
62 /// Setter: requireAllSignatures Require all transaction signatures be present (default: true)
63 ///
64 /// ⧉ [Solana Documentation](https://solana-labs.github.io/solana-web3.js/types/SerializeConfig.html)
65 ///
66 pub fn set_require_all_signatures(this: &SerializeConfig, require_all_signatures: bool);
67
68 #[wasm_bindgen(setter, method, js_name = "verifySignatures")]
69 /// Setter: Verify provided signatures (default: true)
70 ///
71 /// ⧉ [Solana Documentation](https://solana-labs.github.io/solana-web3.js/types/SerializeConfig.html)
72 ///
73 pub fn set_verify_signatures(this: &SerializeConfig, verify_signatures: bool);
74}
75
76impl Transaction {}
77
78impl OptionsTrait for SerializeConfig {}