@somnia-chain/markets-sdk


@somnia-chain/markets-sdk / index / PerpWalletLinkEvent

Type Alias: PerpWalletLinkEvent

PerpWalletLinkEvent = object

Defined in: packages/sdk/src/perp/linkedWallet.ts:344

One state change in the linked-wallet consent graph (mirror of the indexer PerpWalletLinkEvent entity).

Four kinds, and one of them is the only record that exists:

  • Proposed — a main offered a link. The registry has no getter for a pending proposal, so this row is the ONLY way a child learns one was made. Without it a pending offer is invisible to everything off-chain.
  • ProposalCancelled — the main withdrew the offer before it was accepted. A client showing an inbox must apply this, or it keeps offering a link that no longer stands.
  • Linked — the child accepted; the group exists from here.
  • Unlinked — either side tore the link down. Consent for the funding rail IS the link plus the allowance, with no separate opt-out flag, so this is the revocation event.

Gotcha. This is the CONSENT graph, not the money layer. A Linked row grants no authority over funds by itself — the rail is dormant until the bank's getLinkedWalletRegistry() is non-zero and the main has given an allowance. Ask client.quotePerpFundingPayer whether an order would actually spend a main's wallet; do not infer it from a link.

Properties

id

id: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:346

Row id (${txHash}_${logIndex}).


kind

kind: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:348

Proposed | ProposalCancelled | Linked | Unlinked.


main

main: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:350

The main side of the pair (lowercased) — present on every kind.


child

child: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:352

The child side of the pair (lowercased) — present on every kind.


timestamp

timestamp: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:354

Timestamp (unix seconds) of the change.


blockNumber

blockNumber: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:356

Block the change landed in.


logIndex

logIndex: number

Defined in: packages/sdk/src/perp/linkedWallet.ts:358

Position within the block — needed to order two changes to the same pair in one block.


txHash

txHash: string

Defined in: packages/sdk/src/perp/linkedWallet.ts:360

Tx hash the change landed in.