@opensea/sdk 14.3.0 → 14.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -114,6 +114,21 @@ Volume history is oldest first. Each bucket has a numeric Unix-seconds `time`, d
114
114
 
115
115
  `api.nfts.getNFTsByCollection` keeps its first five positional arguments and accepts listing, price, rarity, numeric-trait and ordering filters as a sixth argument. See [the collection NFT parameters](developerDocs/api-reference.md#get-nfts-by-collection). Keep filters and ordering unchanged across cursor pages.
116
116
 
117
+ ## Swap quotes for agents
118
+
119
+ `api.tokens.getSwapQuote` accepts `singleTransactionOnly` and `transactionFormat`.
120
+ `api.tokens.executeSwap` accepts both options and prepares transaction data for external signing
121
+ and submission.
122
+
123
+ The SDK returns camelCase response fields. `quote.routes` exposes `fromQuantity`, `toQuantity`,
124
+ and nullable `minToQuantity` as raw token-unit strings. The provider reports the minimum when available.
125
+ Verify the onchain floor independently. Solana transaction details can include unsigned
126
+ `serializedTransaction`, `blockhash`, `lastValidBlockHeight`, `requiresJitoBundle`, and nullable
127
+ `marketplaceFeeTransfer`. That field describes the reported OpenSea marketplace fee transfer.
128
+
129
+ Use an external Solana signer for serialized output, preserve the message bytes, and request a
130
+ new quote after its block-height expiry.
131
+
117
132
  ## Response casing
118
133
 
119
134
  The API uses snake_case. The SDK converts response keys to camelCase, and converts camelCase
@@ -702,24 +702,7 @@ export type TokenRankingSortBy = NonNullable<NonNullable<paths["/api/v2/tokens/t
702
702
  * Query args for Get Swap Quote endpoint.
703
703
  * @category API Query Args
704
704
  */
705
- export interface GetSwapQuoteArgs {
706
- /** Chain of the token to swap from */
707
- fromChain: string;
708
- /** Contract address of the token to swap from */
709
- fromAddress: string;
710
- /** Chain of the token to swap to */
711
- toChain: string;
712
- /** Contract address of the token to swap to */
713
- toAddress: string;
714
- /** Amount to swap in the smallest unit of the token (e.g. wei for ETH) */
715
- quantity: string;
716
- /** Wallet address executing the swap */
717
- address: string;
718
- /** Slippage tolerance, 0.0 to 0.5 (default 0.01) */
719
- slippage?: number;
720
- /** Recipient address (defaults to the sender address) */
721
- recipient?: string;
722
- }
705
+ export type GetSwapQuoteArgs = Camelize<OperationQueryParams<"get_swap_quote">>;
723
706
  /**
724
707
  * Response from OpenSea API for fetching a swap quote.
725
708
  * Camelized from api-types `SwapQuoteResponse`.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@opensea/sdk",
3
- "version": "14.3.0",
3
+ "version": "14.4.0",
4
4
  "description": "TypeScript SDK for the OpenSea marketplace helps developers build new experiences using NFTs, tokens, and our marketplace data",
5
5
  "license": "MIT",
6
6
  "author": "OpenSea Developers",
package/src/api/types.ts CHANGED
@@ -879,24 +879,7 @@ export type TokenRankingSortBy = NonNullable<
879
879
  * Query args for Get Swap Quote endpoint.
880
880
  * @category API Query Args
881
881
  */
882
- export interface GetSwapQuoteArgs {
883
- /** Chain of the token to swap from */
884
- fromChain: string
885
- /** Contract address of the token to swap from */
886
- fromAddress: string
887
- /** Chain of the token to swap to */
888
- toChain: string
889
- /** Contract address of the token to swap to */
890
- toAddress: string
891
- /** Amount to swap in the smallest unit of the token (e.g. wei for ETH) */
892
- quantity: string
893
- /** Wallet address executing the swap */
894
- address: string
895
- /** Slippage tolerance, 0.0 to 0.5 (default 0.01) */
896
- slippage?: number
897
- /** Recipient address (defaults to the sender address) */
898
- recipient?: string
899
- }
882
+ export type GetSwapQuoteArgs = Camelize<OperationQueryParams<"get_swap_quote">>
900
883
 
901
884
  /**
902
885
  * Response from OpenSea API for fetching a swap quote.