seahorse.py 659 B

1234567891011121314151617181920212223242526
  1. # seahorse
  2. # Built with Seahorse v0.2.7
  3. from seahorse.prelude import *
  4. declare_id('2RjL4mpTANyGxz7fLWEbQtmdEDti7c4CqsLR96mgvcaV')
  5. class MockAccount(Account):
  6. mock_value: u8
  7. ## We don't care about this instruction, but we need an address to send our SOL to.
  8. @instruction
  9. def init_mock_account(signer: Signer, mock_account: Empty[MockAccount]):
  10. account = mock_account.init(
  11. payer = signer,
  12. seeds = ['mock_account'],
  13. )
  14. account.mock_value = u8(0)
  15. @instruction
  16. def transfer_sol_with_cpi(sender: Signer, recipient: MockAccount, amount: u64):
  17. sender.transfer_lamports(
  18. to = recipient,
  19. amount = amount,
  20. )