Module orca_whirlpool.internal.anchor.instructions.set_default_protocol_fee_rate
Expand source code
from __future__ import annotations
import typing
from solders.pubkey import Pubkey
from solders.instruction import Instruction, AccountMeta
import borsh_construct as borsh
from ..program_id import PROGRAM_ID
class SetDefaultProtocolFeeRateArgs(typing.TypedDict):
default_protocol_fee_rate: int
layout = borsh.CStruct("default_protocol_fee_rate" / borsh.U16)
class SetDefaultProtocolFeeRateAccounts(typing.TypedDict):
whirlpools_config: Pubkey
fee_authority: Pubkey
def set_default_protocol_fee_rate(
args: SetDefaultProtocolFeeRateArgs,
accounts: SetDefaultProtocolFeeRateAccounts,
program_id: Pubkey = PROGRAM_ID,
remaining_accounts: typing.Optional[typing.List[AccountMeta]] = None,
) -> Instruction:
keys: list[AccountMeta] = [
AccountMeta(
pubkey=accounts["whirlpools_config"], is_signer=False, is_writable=True
),
AccountMeta(
pubkey=accounts["fee_authority"], is_signer=True, is_writable=False
),
]
if remaining_accounts is not None:
keys += remaining_accounts
identifier = b"k\xcd\xf9\xe2\x97#V\x00"
encoded_args = layout.build(
{
"default_protocol_fee_rate": args["default_protocol_fee_rate"],
}
)
data = identifier + encoded_args
return Instruction(program_id, data, keys)
Functions
def set_default_protocol_fee_rate(args: SetDefaultProtocolFeeRateArgs, accounts: SetDefaultProtocolFeeRateAccounts, program_id: Pubkey = Pubkey( whirLbMiicVdio4qvUfM5KAg6Ct8VwpYzGff3uctyCc, ), remaining_accounts: typing.Optional[typing.List[AccountMeta]] = None) ‑> solders.instruction.Instruction
-
Expand source code
def set_default_protocol_fee_rate( args: SetDefaultProtocolFeeRateArgs, accounts: SetDefaultProtocolFeeRateAccounts, program_id: Pubkey = PROGRAM_ID, remaining_accounts: typing.Optional[typing.List[AccountMeta]] = None, ) -> Instruction: keys: list[AccountMeta] = [ AccountMeta( pubkey=accounts["whirlpools_config"], is_signer=False, is_writable=True ), AccountMeta( pubkey=accounts["fee_authority"], is_signer=True, is_writable=False ), ] if remaining_accounts is not None: keys += remaining_accounts identifier = b"k\xcd\xf9\xe2\x97#V\x00" encoded_args = layout.build( { "default_protocol_fee_rate": args["default_protocol_fee_rate"], } ) data = identifier + encoded_args return Instruction(program_id, data, keys)
Classes
class SetDefaultProtocolFeeRateAccounts (*args, **kwargs)
-
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
Expand source code
class SetDefaultProtocolFeeRateAccounts(typing.TypedDict): whirlpools_config: Pubkey fee_authority: Pubkey
Ancestors
- builtins.dict
Class variables
var whirlpools_config : solders.pubkey.Pubkey
class SetDefaultProtocolFeeRateArgs (*args, **kwargs)
-
dict() -> new empty dictionary dict(mapping) -> new dictionary initialized from a mapping object's (key, value) pairs dict(iterable) -> new dictionary initialized as if via: d = {} for k, v in iterable: d[k] = v dict(**kwargs) -> new dictionary initialized with the name=value pairs in the keyword argument list. For example: dict(one=1, two=2)
Expand source code
class SetDefaultProtocolFeeRateArgs(typing.TypedDict): default_protocol_fee_rate: int
Ancestors
- builtins.dict
Class variables
var default_protocol_fee_rate : int