Interface: StarknetPlugin<TProviderMethods, TAccountMethods>
Defined in: src/plugins/types.ts:67
A Starknet plugin that can extend Provider and Account with methods and lifecycle hooks.
Example
const myPlugin = (): StarknetPlugin<{ greet(): string }> => ({
name: 'my-plugin',
extend: () => ({ greet: () => 'hello' }),
});
Type Parameters
TProviderMethods
TProviderMethods extends Record<string, any> = Record<string, never>
Methods added to Provider instances
TAccountMethods
TAccountMethods extends Record<string, any> = TProviderMethods
Methods added to Account instances (defaults to TProviderMethods)
Properties
name
readonlyname:string
Defined in: src/plugins/types.ts:72
Unique plugin name, used for deduplication
hooks?
optionalhooks?:ProviderHooks
Defined in: src/plugins/types.ts:88
Provider-level lifecycle hooks
accountHooks?
optionalaccountHooks?:AccountHooks
Defined in: src/plugins/types.ts:91
Account-level lifecycle hooks
Methods
extend()?
optionalextend(provider):TProviderMethods
Defined in: src/plugins/types.ts:78
Called when the plugin is installed on a Provider. Returns an object of methods to add to the provider instance.
Parameters
provider
Returns
TProviderMethods
accountExtend()?
optionalaccountExtend(account):TAccountMethods
Defined in: src/plugins/types.ts:85
Called when the plugin is installed on an Account.
Returns methods specific to the account context.
If not provided, extend is used instead.
Parameters
account
Returns
TAccountMethods