ProtocolBase
Defined in: protocols/base.ts:7
Shared plumbing for protocol base classes: holds the account and config, guards writes.
Extended by
Section titled “Extended by”SwapProtocolBridgeProtocolSwap2ProtocolLendingProtocolStakingProtocolApprovalsProtocolFiatProtocol
Type Parameters
Section titled “Type Parameters”TConfig
Section titled “TConfig”TConfig extends object = Record<string, never>
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ProtocolBase<
TConfig>(account,config):ProtocolBase<TConfig>
Defined in: protocols/base.ts:11
Parameters
Section titled “Parameters”account
Section titled “account”IWalletAccountReadOnly | IWalletAccount
config
Section titled “config”TConfig
Returns
Section titled “Returns”ProtocolBase<TConfig>
Properties
Section titled “Properties”_account
Section titled “_account”
protectedreadonly_account:IWalletAccountReadOnly|IWalletAccount
Defined in: protocols/base.ts:8
_config
Section titled “_config”
protectedreadonly_config:TConfig
Defined in: protocols/base.ts:9
Methods
Section titled “Methods”describeActivity()
Section titled “describeActivity()”describeActivity(
_tx,_ctx):ActivityItem|null
Defined in: protocols/base.ts:24
Recognize one of this protocol’s own transactions in an address’s history and
describe it for the wallet’s activity feed (“Supplied 100 USDC · Aave v3”).
Return null when the transaction is not this protocol’s: the kit then asks the
next module and finally falls back to send / receive / approve / contract call.
Must be pure and synchronous: no network, no account state. The conformance
suite feeds every module its recorded fixtures through this method.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”ActivityItem | null
requireSigningAccount()
Section titled “requireSigningAccount()”
protectedrequireSigningAccount(methodName):IWalletAccount
Defined in: protocols/base.ts:29
The account, narrowed to a signing one, or a ReadOnlyAccountError naming the caller.
Parameters
Section titled “Parameters”methodName
Section titled “methodName”string