Creates an NFT AMM API bound to an AftermathApi provider.
Provider containing the network client and NFT AMM addresses.
Appends an NFT AMM withdrawal Move call to an existing transaction.
This local builder accepts an LP coin object ID or transaction argument and
NFT object IDs. withTransfer: true targets interface::withdraw;
otherwise it targets actions::withdraw. The expected asset output is a
raw balance in the asset coin's smallest unit.
Transaction, market object ID, LP coin argument, NFT IDs, expected asset output, type tuple, slippage, and transfer mode.
The TransactionArgument returned by tx.moveCall.
Appends an NFT AMM buy Move call to an existing transaction.
This local builder does not create a transaction, set its sender, select
coins, or sign. withTransfer: true targets interface::buy; otherwise it
targets actions::buy, allowing the caller to compose the returned Move
values. The slippage value is encoded as the fixed-point complement
1 - inputs.slippage.
Transaction, market object ID, asset coin argument, NFT IDs, expected asset input, type tuple, slippage, and transfer mode.
The TransactionArgument returned by tx.moveCall.
Appends an NFT AMM deposit Move call to an existing transaction.
The expectedLpRatio argument is an 18-decimal fixed-point bigint. The
builder accepts asset and NFT inputs as object IDs or transaction arguments,
and selects interface::deposit when withTransfer is true, otherwise
actions::deposit.
Transaction, market object ID, asset coin argument, NFT arguments, fixed LP ratio, type tuple, slippage, and transfer mode.
The TransactionArgument returned by tx.moveCall.
Builds an unsigned NFT AMM buy transaction.
This method creates a new Transaction, sets walletAddress as its
sender, calculates the required asset-coin amount from the NFT count, and
selects that coin from the wallet through Coin.fetchCoinWithAmountTx.
It then appends the interface::buy call with withTransfer: true.
slippage is a decimal fraction such as 0.01 for 1%; the Move call
receives the fixed-point complement 1 - slippage.
Market facade, sender address, NFT IDs to buy, slippage, and optional referrer.
An unsigned transaction with the sender set to walletAddress.
Builds an unsigned NFT AMM deposit transaction.
The method creates a transaction with walletAddress as sender, calculates
the pool LP ratio, converts that ratio to an 18-decimal fixed-point bigint,
selects the requested asset-coin amount from the wallet, and appends the
interface::deposit call with withTransfer: true.
Market facade, sender address, asset amount, NFT IDs, slippage, and optional referrer.
An unsigned transaction with the sender set to walletAddress.
Builds an unsigned NFT AMM sell transaction.
This method creates a new Transaction, sets walletAddress as its sender,
estimates the asset-coin output from the number of NFT IDs, and appends the
interface::sell call with withTransfer: true. It does not fetch the NFT
objects first. The sender must own the supplied NFT IDs when the transaction
executes.
Market facade, sender address, NFT IDs to sell, slippage, and optional referrer.
An unsigned transaction with the sender set to walletAddress.
Builds an unsigned NFT AMM withdrawal transaction.
The method creates a transaction with walletAddress as sender, estimates
the fractionalized-coin output, converts the non-zero output to the minimum
asset-coin amount used by the Move call, selects the LP coin amount from the
wallet, and appends the interface::withdraw call with withTransfer: true.
Market facade, sender address, LP amount, NFT IDs, slippage, and optional referrer.
An unsigned transaction with the sender set to walletAddress.
Fetches and casts one NFT AMM market object by ID.
The response is converted by NftAmmApiCasting.marketObjectFromSuiObject.
The current caster expects the nested pool and supply data to contain type
information that is not available in every response, so casting errors are
propagated instead of being replaced with guessed type arguments.
The market's on-chain object ID.
The cast market object, including pool and coin type data.
Fetches and casts a batch of NFT AMM market objects by ID.
The market object IDs to fetch.
The cast market objects returned by the object client.
Fetches one page of NFTs from an NFT AMM market's dynamic-field table.
The method lists fields under marketTableObjectId, uses the optional
object-ID cursor and numeric page limit, and resolves the field object IDs
through the NFT API. A null nextCursor means that no later page exists.
The table parent object ID, optional previous-page cursor, and page size.
The resolved NFTs and the next dynamic-field cursor.
Appends an NFT AMM sell Move call to an existing transaction.
This local builder accepts either object IDs or existing transaction object
arguments in nfts. withTransfer: true targets interface::sell;
otherwise it targets actions::sell. The caller must provide NFT objects
owned or otherwise usable by the transaction sender.
Transaction, market object ID, NFT arguments, expected asset output, type tuple, slippage, and transfer mode.
The TransactionArgument returned by tx.moveCall.
Low-level NFT AMM API and transaction-builder methods.
Object methods use the configured
AftermathApifor on-chain reads. Builder methods either create a new unsigned transaction or append one Move call to a caller-owned transaction. No method signs or executes a transaction.