Skip to content

Commit 3a6cd7b

Browse files
authored
docs(cookbook): upgrade pay-fees-with-any-token kit example to plugin client (#1465)
* docs(cookbook): upgrade pay-fees-with-any-token kit example to plugin client Rewrite using `createClient().use(...)` plugin composition with the `@solana-program/token` kit plugin so the example reads as `client.token.instructions.{createMint,mintToATA,transferToATA}` + `client.sendTransaction([...])`. Drops manual pipe, blockhash, signing, and ATA wiring boilerplate (238 → 134 lines). * chore: fix CI * chore: shorter snippet * chore: use solanaRpc plugin
1 parent db492c4 commit 3a6cd7b

4 files changed

Lines changed: 157 additions & 274 deletions

File tree

apps/docs/content/docs/en/references/terminology.mdx

Lines changed: 34 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -118,9 +118,9 @@ the account data to avoid recalculating it.
118118

119119
## central limit order book (CLOB)
120120

121-
An exchange model that maintains a sorted list of resting bids and asks; a
122-
trade occurs when an incoming order crosses an order on the opposite side.
123-
Contrast with [automated market maker](#automated-market-maker-amm).
121+
An exchange model that maintains a sorted list of resting bids and asks; a trade
122+
occurs when an incoming order crosses an order on the opposite side. Contrast
123+
with [automated market maker](#automated-market-maker-amm).
124124

125125
## client
126126

@@ -232,9 +232,9 @@ The time, i.e. number of [slots](#slot), for which a
232232
## escrow
233233

234234
A pattern in which an [onchain program](#onchain-program) holds tokens in a
235-
[vault](#vault) on behalf of two or more parties until conditions defined by
236-
the program are met, then releases them. Used to remove the need for the
237-
parties to trust each other directly.
235+
[vault](#vault) on behalf of two or more parties until conditions defined by the
236+
program are met, then releases them. Used to remove the need for the parties to
237+
trust each other directly.
238238

239239
## fee account
240240

@@ -346,12 +346,11 @@ A type of [client](#client) that can verify it's pointing to a valid
346346

347347
## liquidity
348348

349-
The depth of orders or pooled reserves available to trade against at or near
350-
the current price. Deeper liquidity reduces [slippage](#slippage). On a
349+
The depth of orders or pooled reserves available to trade against at or near the
350+
current price. Deeper liquidity reduces [slippage](#slippage). On a
351351
[CLOB](#central-limit-order-book-clob) liquidity is supplied by
352-
[maker orders](#maker); on an
353-
[AMM](#automated-market-maker-amm) it is supplied by liquidity providers who
354-
deposit token pairs into the pool.
352+
[maker orders](#maker); on an [AMM](#automated-market-maker-amm) it is supplied
353+
by liquidity providers who deposit token pairs into the pool.
355354

356355
## loader
357356

@@ -367,16 +366,15 @@ The duration of time for which a [validator](#validator) is unable to
367366

368367
A trader whose order adds [liquidity](#liquidity) to a
369368
[CLOB](#central-limit-order-book-clob) by resting on the book rather than
370-
immediately crossing the opposite side. Such an order is called a maker
371-
order. Makers typically pay no fee or receive a rebate from the venue.
369+
immediately crossing the opposite side. Such an order is called a maker order.
370+
Makers typically pay no fee or receive a rebate from the venue.
372371

373372
## market maker
374373

375374
An entity that supplies [liquidity](#liquidity) by continuously posting both
376375
bids and asks. On Solana, market makers are either programs (such as
377-
[AMMs](#automated-market-maker-amm)) or offchain firms running bots that
378-
post [maker orders](#maker) on
379-
[CLOBs](#central-limit-order-book-clob).
376+
[AMMs](#automated-market-maker-amm)) or offchain firms running bots that post
377+
[maker orders](#maker) on [CLOBs](#central-limit-order-book-clob).
380378

381379
## message
382380

@@ -414,9 +412,9 @@ The number of [validators](#validator) participating in a [cluster](#cluster).
414412
## offchain
415413

416414
Describes data, processes, or services that exist or run outside the Solana
417-
blockchain, such as RPC clients, indexers, frontends, and offchain order
418-
book makers. Complement of [onchain](#onchain). "Offchain" (no hyphen) is
419-
the preferred spelling.
415+
blockchain, such as RPC clients, indexers, frontends, and offchain order book
416+
makers. Complement of [onchain](#onchain). "Offchain" (no hyphen) is the
417+
preferred spelling.
420418

421419
## onchain
422420

@@ -582,8 +580,8 @@ An [account](#account) that has authorized an [instruction](#instruction) or
582580
cryptographic [signature](#signature) over the transaction. For a
583581
[program derived address](#program-derived-address-pda), authorization is
584582
asserted by the [owning program](#owning-program) when it makes a
585-
[cross-program invocation](#cross-program-invocation-cpi), since a PDA has
586-
no private key.
583+
[cross-program invocation](#cross-program-invocation-cpi), since a PDA has no
584+
private key.
587585

588586
## skip rate
589587

@@ -606,11 +604,11 @@ than the latest [rooted](#root) (thus not-skipped) slot.
606604

607605
## slippage
608606

609-
The difference between the price a trader expected and the price at which
610-
their trade actually executed. On [AMMs](#automated-market-maker-amm) it
611-
arises from the pricing curve moving as reserves change; on
612-
[CLOBs](#central-limit-order-book-clob) it arises from a single order
613-
consuming several resting orders at successively worse prices.
607+
The difference between the price a trader expected and the price at which their
608+
trade actually executed. On [AMMs](#automated-market-maker-amm) it arises from
609+
the pricing curve moving as reserves change; on
610+
[CLOBs](#central-limit-order-book-clob) it arises from a single order consuming
611+
several resting orders at successively worse prices.
614612

615613
## slot
616614

@@ -665,9 +663,9 @@ provide cluster state information such as current tick height, rewards
665663
## taker
666664

667665
A trader whose order removes [liquidity](#liquidity) from a
668-
[CLOB](#central-limit-order-book-clob) by crossing the opposite side of the
669-
book and matching against one or more resting orders. Such an order is
670-
called a taker order, and the taker typically pays the venue's trading fee.
666+
[CLOB](#central-limit-order-book-clob) by crossing the opposite side of the book
667+
and matching against one or more resting orders. Such an order is called a taker
668+
order, and the taker typically pays the venue's trading fee.
671669

672670
## thin client
673671

@@ -755,13 +753,13 @@ A full participant in a Solana network [cluster](#cluster) that produces new
755753
## vault
756754

757755
A [token account](#token-account) owned by an
758-
[onchain program](#onchain-program) that holds pooled assets on behalf of
759-
users — for example the base and quote reserves of an
760-
[AMM](#automated-market-maker-amm), the locked tokens in an
761-
[escrow](#escrow), or the resting balances and accumulated fees of a
762-
[CLOB](#central-limit-order-book-clob). Only the owning program can move
763-
tokens out of the vault, typically into a user's own
764-
[token account](#token-account) once a trade or release condition is met.
756+
[onchain program](#onchain-program) that holds pooled assets on behalf of users
757+
— for example the base and quote reserves of an
758+
[AMM](#automated-market-maker-amm), the locked tokens in an [escrow](#escrow),
759+
or the resting balances and accumulated fees of a
760+
[CLOB](#central-limit-order-book-clob). Only the owning program can move tokens
761+
out of the vault, typically into a user's own [token account](#token-account)
762+
once a trade or release condition is met.
765763

766764
## VDF
767765

0 commit comments

Comments
 (0)