File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66import typing
77
88
9+ class WalletHelper :
10+ # A helper class for wallet related operations.
11+
12+ @classmethod
13+ def requisition_send (
14+ cls ,
15+ prikey : typing .List [pxsol .core .PriKey ],
16+ rqlist : typing .List [pxsol .core .Requisition ],
17+ ) -> bytearray :
18+ # Sends a transaction built from the given requisitions and signed with the given private keys. This function
19+ # will wait until the transaction is confirmed. Returns the first signature of the transaction, also known as
20+ # the transaction id.
21+ tx = pxsol .core .Transaction .requisition_decode (prikey [0 ].pubkey (), rqlist )
22+ tx .message .recent_blockhash = pxsol .base58 .decode (pxsol .rpc .get_latest_blockhash ({})['blockhash' ])
23+ tx .sign (prikey )
24+ assert len (tx .serialize ()) <= 1232
25+ txid = pxsol .rpc .send_transaction (base64 .b64encode (tx .serialize ()).decode (), {})
26+ assert pxsol .base58 .decode (txid ) == tx .signatures [0 ]
27+ pxsol .rpc .wait ([txid ])
28+ return tx .signatures [0 ]
29+
30+
931class WalletLoaderV3 :
1032 # A built-in solana wallet that can be used to perform program loader v3 operations.
1133
You can’t perform that action at this time.
0 commit comments