Memo Program
spl.memo.instructions
Memo program instructions.
create_memo(params)
Creates a transaction instruction that creates a memo.
Message need to be encoded in bytes.
Example
from solders.pubkey import Pubkey from spl.memo.models import MemoParams leading_zeros = [0] * 31 signer, memo_program = Pubkey(leading_zeros + [1]), Pubkey(leading_zeros + [2]) message = bytes("test", encoding="utf8") params = MemoParams( ... program_id=memo_program, ... message=message, ... signer=signer ... ) type(create_memo(params))
Returns:
| Type | Description |
|---|---|
Instruction
|
The instruction to create a memo. |
Source code in src/spl/memo/instructions.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |
decode_create_memo(instruction)
Decode a create_memo_instruction and retrieve the instruction params.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
instruction
|
Instruction
|
The instruction to decode. |
required |
Returns:
| Type | Description |
|---|---|
MemoParams
|
The decoded instruction. |
Source code in src/spl/memo/instructions.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 | |