@opensea/sdk 11.4.9 → 11.5.1
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 +32 -38
- package/lib/api/api.d.ts +6 -1
- package/lib/api/api.js +7 -0
- package/lib/api/api.js.map +1 -1
- package/lib/api/apiPaths.d.ts +1 -0
- package/lib/api/apiPaths.js +5 -1
- package/lib/api/apiPaths.js.map +1 -1
- package/lib/api/tokens.d.ts +6 -1
- package/lib/api/tokens.js +7 -0
- package/lib/api/tokens.js.map +1 -1
- package/lib/api/types.d.ts +94 -107
- package/lib/api/types.js.map +1 -1
- package/lib/api/walletAuth.d.ts +89 -2
- package/lib/api/walletAuth.js +47 -2
- package/lib/api/walletAuth.js.map +1 -1
- package/package.json +2 -2
- package/src/api/api.ts +13 -0
- package/src/api/apiPaths.ts +4 -0
- package/src/api/tokens.ts +17 -0
- package/src/api/types.ts +129 -109
- package/src/api/walletAuth.ts +107 -3
package/lib/api/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { BuildOfferResponse as ApiBuildOfferResponse, CancelResponse as ApiCancelResponse, Listing as ApiListing, Nft as ApiNft, Offer as ApiOffer, Order as ApiOrder, OrderAsset as ApiOrderAsset, Payment as ApiPayment, Price as ApiPrice, SwapExecuteRequest as ApiSwapExecuteRequest, SwapExecuteResponse as ApiSwapExecuteResponse, SwapQuoteResponse as ApiSwapQuoteResponse, SweepCollectionRequest as ApiSweepCollectionRequest, SweepCollectionResponse as ApiSweepCollectionResponse, Trait as ApiTrait, TransactionReceiptRequest as ApiTransactionReceiptRequest, TransactionReceiptResponse as ApiTransactionReceiptResponse, AssetMetadataResponse, ChainResponse, DropDetailedResponse, DropResponse, DropStageResponse, InstantApiKeyResponse, ListingsResponse, NftDetailed, NftListResponse, NftResponse, OffersResponse, TokenBalanceResponse, TokenGroupPaginatedResponse, TokenGroupResponse } from "@opensea/api-types";
|
|
1
|
+
import type { AccountSearchResponse as ApiAccountSearchResponse, BuildOfferResponse as ApiBuildOfferResponse, CancelResponse as ApiCancelResponse, CollectionSearchResponse as ApiCollectionSearchResponse, Listing as ApiListing, Nft as ApiNft, NftSearchResponse as ApiNftSearchResponse, Offer as ApiOffer, Order as ApiOrder, OrderAsset as ApiOrderAsset, Payment as ApiPayment, Price as ApiPrice, SearchResponse as ApiSearchResponse, SearchResultResponse as ApiSearchResultResponse, SwapExecuteRequest as ApiSwapExecuteRequest, SwapExecuteResponse as ApiSwapExecuteResponse, SwapQuoteResponse as ApiSwapQuoteResponse, SweepCollectionRequest as ApiSweepCollectionRequest, SweepCollectionResponse as ApiSweepCollectionResponse, TokenDetailedResponse as ApiTokenDetailedResponse, TokenResponse as ApiTokenResponse, TokenSearchResponse as ApiTokenSearchResponse, Trait as ApiTrait, TransactionReceiptRequest as ApiTransactionReceiptRequest, TransactionReceiptResponse as ApiTransactionReceiptResponse, AssetMetadataResponse, ChainResponse, ContractResponse, DropDetailedResponse, DropResponse, DropStageResponse, InstantApiKeyResponse, ListingsResponse, NftDetailed, NftListResponse, NftResponse, OffersResponse, TokenAccountActivityPaginatedResponse, TokenBalancePaginatedResponse, TokenBalanceResponse, TokenGroupPaginatedResponse, TokenGroupResponse, TokenPaginatedResponse } from "@opensea/api-types";
|
|
2
2
|
import type { OrderType, ProtocolData } from "../orders/types";
|
|
3
3
|
import type { OpenSeaCollection } from "../types";
|
|
4
4
|
import type { Camelize } from "../utils/case";
|
|
@@ -539,25 +539,15 @@ export type GetEventsResponse = QueryCursorsV2 & {
|
|
|
539
539
|
assetEvents: AssetEvent[];
|
|
540
540
|
};
|
|
541
541
|
/**
|
|
542
|
-
* Contract information returned by OpenSea API.
|
|
542
|
+
* Contract information returned by OpenSea API. Sourced from
|
|
543
|
+
* `@opensea/api-types` (`ContractResponse`) with `collection` widened to
|
|
544
|
+
* `string | null` because the live API returns `null` for contracts without an
|
|
545
|
+
* associated collection even though the spec models it as required non-null.
|
|
543
546
|
* @category API Models
|
|
544
547
|
*/
|
|
545
|
-
export type Contract = {
|
|
546
|
-
/**
|
|
547
|
-
address: string;
|
|
548
|
-
/** Chain the contract is deployed on */
|
|
549
|
-
chain: string;
|
|
550
|
-
/**
|
|
551
|
-
* Associated collection slug. `null` for contracts without an associated
|
|
552
|
-
* collection on OpenSea. TODO(api-types): the OpenAPI spec marks this as
|
|
553
|
-
* required non-null, but the live API returns null for standalone contracts —
|
|
554
|
-
* swap to `Camelize<ContractResponse>` once the spec is updated.
|
|
555
|
-
*/
|
|
548
|
+
export type Contract = Camelize<Omit<ContractResponse, "collection">> & {
|
|
549
|
+
/** Associated collection slug (null when the contract has no collection) */
|
|
556
550
|
collection: string | null;
|
|
557
|
-
/** Contract name */
|
|
558
|
-
name: string;
|
|
559
|
-
/** Contract standard (e.g., erc721, erc1155) */
|
|
560
|
-
contractStandard: string;
|
|
561
551
|
};
|
|
562
552
|
/**
|
|
563
553
|
* Response from OpenSea API for fetching a contract.
|
|
@@ -591,43 +581,35 @@ export type GetTraitsResponse = {
|
|
|
591
581
|
};
|
|
592
582
|
};
|
|
593
583
|
/**
|
|
594
|
-
* Token model returned by OpenSea API.
|
|
584
|
+
* Token model returned by OpenSea API token list endpoints.
|
|
595
585
|
*
|
|
596
|
-
*
|
|
597
|
-
*
|
|
598
|
-
*
|
|
586
|
+
* Camelized from `@opensea/api-types` `TokenResponse`. `imageUrl` is widened
|
|
587
|
+
* to `string | null` because the live API returns `null` for tokens without
|
|
588
|
+
* an image even though the spec models it as optional non-null.
|
|
599
589
|
*
|
|
600
590
|
* @category API Models
|
|
601
591
|
*/
|
|
602
|
-
export type Token = {
|
|
603
|
-
/** Token contract address */
|
|
604
|
-
address: string;
|
|
605
|
-
/** Chain the token is on */
|
|
606
|
-
chain: string;
|
|
607
|
-
/** Token name */
|
|
608
|
-
name: string;
|
|
609
|
-
/** Token symbol */
|
|
610
|
-
symbol: string;
|
|
611
|
-
/** Number of decimals */
|
|
612
|
-
decimals: number;
|
|
592
|
+
export type Token = Camelize<Omit<ApiTokenResponse, "image_url">> & {
|
|
613
593
|
/** URL of the token image (null when the token has no image) */
|
|
614
|
-
imageUrl
|
|
615
|
-
/** URL on OpenSea */
|
|
616
|
-
openseaUrl: string;
|
|
594
|
+
imageUrl?: string | null;
|
|
617
595
|
};
|
|
618
596
|
/**
|
|
619
|
-
* Response from OpenSea API for fetching trending tokens.
|
|
597
|
+
* Response from OpenSea API for fetching trending tokens. Sourced from
|
|
598
|
+
* `@opensea/api-types` (`TokenPaginatedResponse`) with `tokens` overridden to
|
|
599
|
+
* use the SDK's nullable-image `Token` type.
|
|
620
600
|
* @category API Response Types
|
|
621
601
|
*/
|
|
622
|
-
export type GetTrendingTokensResponse =
|
|
602
|
+
export type GetTrendingTokensResponse = Camelize<Omit<TokenPaginatedResponse, "tokens">> & {
|
|
623
603
|
/** List of {@link Token} */
|
|
624
604
|
tokens: Token[];
|
|
625
605
|
};
|
|
626
606
|
/**
|
|
627
|
-
* Response from OpenSea API for fetching top tokens.
|
|
607
|
+
* Response from OpenSea API for fetching top tokens. Sourced from
|
|
608
|
+
* `@opensea/api-types` (`TokenPaginatedResponse`) with `tokens` overridden to
|
|
609
|
+
* use the SDK's nullable-image `Token` type.
|
|
628
610
|
* @category API Response Types
|
|
629
611
|
*/
|
|
630
|
-
export type GetTopTokensResponse =
|
|
612
|
+
export type GetTopTokensResponse = Camelize<Omit<TokenPaginatedResponse, "tokens">> & {
|
|
631
613
|
/** List of {@link Token} */
|
|
632
614
|
tokens: Token[];
|
|
633
615
|
};
|
|
@@ -673,7 +655,10 @@ export type GetSwapQuoteResponse = Camelize<ApiSwapQuoteResponse>;
|
|
|
673
655
|
* Response from OpenSea API for fetching token details.
|
|
674
656
|
* @category API Response Types
|
|
675
657
|
*/
|
|
676
|
-
export type GetTokenResponse =
|
|
658
|
+
export type GetTokenResponse = Camelize<Omit<ApiTokenDetailedResponse, "image_url">> & {
|
|
659
|
+
/** URL of the token image (null when the token has no image) */
|
|
660
|
+
imageUrl?: string | null;
|
|
661
|
+
};
|
|
677
662
|
/**
|
|
678
663
|
* Response from OpenSea API for fetching a token group by slug.
|
|
679
664
|
* @category API Response Types
|
|
@@ -714,84 +699,56 @@ export interface SearchArgs {
|
|
|
714
699
|
limit?: number;
|
|
715
700
|
}
|
|
716
701
|
/**
|
|
717
|
-
* Collection search result.
|
|
702
|
+
* Collection search result. Sourced from `@opensea/api-types`
|
|
703
|
+
* (`CollectionSearchResponse`). `imageUrl` is widened to `string | null` to
|
|
704
|
+
* match the live API response for collections without an image.
|
|
718
705
|
* @category API Models
|
|
719
706
|
*/
|
|
720
|
-
export type CollectionSearchResult = {
|
|
721
|
-
/**
|
|
722
|
-
|
|
723
|
-
/** The collection name */
|
|
724
|
-
name: string;
|
|
725
|
-
/** URL of the collection image */
|
|
726
|
-
imageUrl: string | null;
|
|
727
|
-
/** Whether trading is disabled for this collection */
|
|
728
|
-
isDisabled: boolean;
|
|
729
|
-
/** Whether this collection is marked as NSFW */
|
|
730
|
-
isNsfw: boolean;
|
|
731
|
-
/** URL to the collection on OpenSea */
|
|
732
|
-
openseaUrl: string;
|
|
707
|
+
export type CollectionSearchResult = Camelize<Omit<ApiCollectionSearchResponse, "image_url">> & {
|
|
708
|
+
/** URL of the collection image (null when no image) */
|
|
709
|
+
imageUrl?: string | null;
|
|
733
710
|
};
|
|
734
711
|
/**
|
|
735
|
-
* Token (currency) search result.
|
|
712
|
+
* Token (currency) search result. Sourced from `@opensea/api-types`
|
|
713
|
+
* (`TokenSearchResponse`). `imageUrl` is widened to `string | null` to match
|
|
714
|
+
* the live API response for tokens without an image.
|
|
736
715
|
* @category API Models
|
|
737
716
|
*/
|
|
738
|
-
export type TokenSearchResult = {
|
|
739
|
-
/**
|
|
740
|
-
|
|
741
|
-
/** Blockchain the token is on */
|
|
742
|
-
chain: string;
|
|
743
|
-
/** Token name */
|
|
744
|
-
name: string;
|
|
745
|
-
/** Token symbol */
|
|
746
|
-
symbol: string;
|
|
747
|
-
/** URL of the token image */
|
|
748
|
-
imageUrl: string | null;
|
|
749
|
-
/** Current USD price of the token */
|
|
750
|
-
usdPrice: string;
|
|
751
|
-
/** Number of decimal places for the token */
|
|
752
|
-
decimals: number;
|
|
753
|
-
/** URL to the token on OpenSea */
|
|
754
|
-
openseaUrl: string;
|
|
717
|
+
export type TokenSearchResult = Camelize<Omit<ApiTokenSearchResponse, "image_url">> & {
|
|
718
|
+
/** URL of the token image (null when no image) */
|
|
719
|
+
imageUrl?: string | null;
|
|
755
720
|
};
|
|
756
721
|
/**
|
|
757
|
-
* NFT search result.
|
|
722
|
+
* NFT search result. Sourced from `@opensea/api-types`
|
|
723
|
+
* (`NftSearchResponse`). `name` and `imageUrl` are widened to `string | null`
|
|
724
|
+
* to match the live API response.
|
|
758
725
|
* @category API Models
|
|
759
726
|
*/
|
|
760
|
-
export type NftSearchResult = {
|
|
761
|
-
/**
|
|
762
|
-
|
|
763
|
-
/**
|
|
764
|
-
|
|
765
|
-
/** Contract address of the NFT */
|
|
766
|
-
contract: string;
|
|
767
|
-
/** Name of the NFT */
|
|
768
|
-
name: string | null;
|
|
769
|
-
/** URL of the NFT image */
|
|
770
|
-
imageUrl: string | null;
|
|
771
|
-
/** URL to the NFT on OpenSea */
|
|
772
|
-
openseaUrl: string;
|
|
727
|
+
export type NftSearchResult = Camelize<Omit<ApiNftSearchResponse, "image_url" | "name">> & {
|
|
728
|
+
/** Name of the NFT (null when not named) */
|
|
729
|
+
name?: string | null;
|
|
730
|
+
/** URL of the NFT image (null when no image) */
|
|
731
|
+
imageUrl?: string | null;
|
|
773
732
|
};
|
|
774
733
|
/**
|
|
775
|
-
* Account search result.
|
|
734
|
+
* Account search result. Sourced from `@opensea/api-types`
|
|
735
|
+
* (`AccountSearchResponse`). `username` and `profileImageUrl` are widened to
|
|
736
|
+
* `string | null` to match the live API response.
|
|
776
737
|
* @category API Models
|
|
777
738
|
*/
|
|
778
|
-
export type AccountSearchResult = {
|
|
779
|
-
/**
|
|
780
|
-
|
|
781
|
-
/**
|
|
782
|
-
|
|
783
|
-
/** URL of the account's profile image */
|
|
784
|
-
profileImageUrl: string | null;
|
|
785
|
-
/** URL to the account on OpenSea */
|
|
786
|
-
openseaUrl: string;
|
|
739
|
+
export type AccountSearchResult = Camelize<Omit<ApiAccountSearchResponse, "username" | "profile_image_url">> & {
|
|
740
|
+
/** Username of the account (null when not set) */
|
|
741
|
+
username?: string | null;
|
|
742
|
+
/** URL of the account's profile image (null when not set) */
|
|
743
|
+
profileImageUrl?: string | null;
|
|
787
744
|
};
|
|
788
745
|
/**
|
|
789
|
-
* A single search result with a type discriminator and the corresponding typed
|
|
746
|
+
* A single search result with a type discriminator and the corresponding typed
|
|
747
|
+
* object. Built from `@opensea/api-types` (`SearchResultResponse`) with nested
|
|
748
|
+
* search-result types using the SDK's nullable-image overrides.
|
|
790
749
|
* @category API Models
|
|
791
750
|
*/
|
|
792
|
-
export type SearchResult = {
|
|
793
|
-
/** The type of search result */
|
|
794
|
-
type: string;
|
|
751
|
+
export type SearchResult = Camelize<Omit<ApiSearchResultResponse, "collection" | "token" | "nft" | "account">> & {
|
|
795
752
|
/** Collection details, present when type is 'collection' */
|
|
796
753
|
collection?: CollectionSearchResult;
|
|
797
754
|
/** Token details, present when type is 'token' */
|
|
@@ -802,10 +759,11 @@ export type SearchResult = {
|
|
|
802
759
|
account?: AccountSearchResult;
|
|
803
760
|
};
|
|
804
761
|
/**
|
|
805
|
-
* Response from OpenSea API for search.
|
|
762
|
+
* Response from OpenSea API for search. Built from `@opensea/api-types`
|
|
763
|
+
* (`SearchResponse`) with the SDK's `SearchResult` type.
|
|
806
764
|
* @category API Response Types
|
|
807
765
|
*/
|
|
808
|
-
export type SearchResponse = {
|
|
766
|
+
export type SearchResponse = Camelize<Omit<ApiSearchResponse, "results">> & {
|
|
809
767
|
/** List of search results ranked by relevance */
|
|
810
768
|
results: SearchResult[];
|
|
811
769
|
};
|
|
@@ -825,11 +783,17 @@ export type GetChainsResponse = {
|
|
|
825
783
|
};
|
|
826
784
|
/**
|
|
827
785
|
* Token balance for a wallet address. Sourced from `@opensea/api-types`
|
|
828
|
-
* (`TokenBalanceResponse`). Gains optional `status`, `
|
|
829
|
-
* and `
|
|
786
|
+
* (`TokenBalanceResponse`). Gains optional `status`, `baseTokenLiquidityUsd`,
|
|
787
|
+
* and `quoteTokenLiquidityUsd` fields the hand-rolled version didn't expose.
|
|
788
|
+
* `imageUrl` is widened to `string | null` because the live API returns `null`
|
|
789
|
+
* for tokens without an image even though the spec models it as optional
|
|
790
|
+
* non-null.
|
|
830
791
|
* @category API Models
|
|
831
792
|
*/
|
|
832
|
-
export type TokenBalance = Camelize<TokenBalanceResponse
|
|
793
|
+
export type TokenBalance = Camelize<Omit<TokenBalanceResponse, "image_url">> & {
|
|
794
|
+
/** URL of the token image (null when the token has no image) */
|
|
795
|
+
imageUrl?: string | null;
|
|
796
|
+
};
|
|
833
797
|
/**
|
|
834
798
|
* Query args for Get Account Tokens endpoint.
|
|
835
799
|
* @category API Query Args
|
|
@@ -849,10 +813,12 @@ export interface GetAccountTokensArgs {
|
|
|
849
813
|
cursor?: string;
|
|
850
814
|
}
|
|
851
815
|
/**
|
|
852
|
-
* Response from OpenSea API for fetching account token balances.
|
|
816
|
+
* Response from OpenSea API for fetching account token balances. Sourced from
|
|
817
|
+
* `@opensea/api-types` (`TokenBalancePaginatedResponse`) with `token_balances`
|
|
818
|
+
* overridden to use the SDK's nullable-image `TokenBalance` type.
|
|
853
819
|
* @category API Response Types
|
|
854
820
|
*/
|
|
855
|
-
export type GetAccountTokensResponse =
|
|
821
|
+
export type GetAccountTokensResponse = Camelize<Omit<TokenBalancePaginatedResponse, "token_balances">> & {
|
|
856
822
|
/** List of token balances */
|
|
857
823
|
tokenBalances: TokenBalance[];
|
|
858
824
|
};
|
|
@@ -1103,6 +1069,27 @@ export interface TokenActivityArgs {
|
|
|
1103
1069
|
limit?: number;
|
|
1104
1070
|
cursor?: string;
|
|
1105
1071
|
}
|
|
1072
|
+
/**
|
|
1073
|
+
* Query args for the account token activity endpoint.
|
|
1074
|
+
* @category API Query Args
|
|
1075
|
+
*/
|
|
1076
|
+
export interface GetAccountTokenActivityArgs {
|
|
1077
|
+
/** Chain(s) to filter by. Repeat for multiple chains. */
|
|
1078
|
+
chains?: string[];
|
|
1079
|
+
/** Token contract address(es) to filter by. */
|
|
1080
|
+
tokens?: string[];
|
|
1081
|
+
/** Activity types to include (send, receive, swap, wrap, unwrap). */
|
|
1082
|
+
type?: string[];
|
|
1083
|
+
/** Number of items to return per page. */
|
|
1084
|
+
limit?: number;
|
|
1085
|
+
/** Pagination cursor for the next page. */
|
|
1086
|
+
next?: string;
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
1089
|
+
* Response from OpenSea API for fetching account token activity.
|
|
1090
|
+
* @category API Response Types
|
|
1091
|
+
*/
|
|
1092
|
+
export type GetAccountTokenActivityResponse = Camelize<TokenAccountActivityPaginatedResponse>;
|
|
1106
1093
|
/**
|
|
1107
1094
|
* Query args for the token holders endpoint (paginated with `cursor`,
|
|
1108
1095
|
* sortable by `QUANTITY`).
|
package/lib/api/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":";;;AAgFA,8CAIC;AAVD;;;;;GAKG;AACH,SAAgB,iBAAiB,CAC/B,MAAiC;IAEjC,OAAO,MAAM,IAAI,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AACzE,CAAC;AA0ED,IAAY,uBAOX;AAPD,WAAY,uBAAuB;IACjC,wDAA6B,CAAA;IAC7B,4DAAiC,CAAA;IACjC,gEAAqC,CAAA;IACrC,gEAAqC,CAAA;IACrC,oDAAyB,CAAA;IACzB,oDAAyB,CAAA;AAC3B,CAAC,EAPW,uBAAuB,uCAAvB,uBAAuB,QAOlC;AAED;;;GAGG;AACH,IAAY,WAMX;AAND,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,oCAAqB,CAAA;IACrB,sCAAuB,CAAA;IACvB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;AACzB,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB;AA4KD;;;;GAIG;AACH,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,yDAAqC,CAAA;IACrC,iDAA6B,CAAA;IAC7B,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,uCAAuC;IACvC,iCAAa,CAAA;AACf,CAAC,EARW,gBAAgB,gCAAhB,gBAAgB,QAQ3B;AAED;;;GAGG;AACH,IAAY,cASX;AATD,WAAY,cAAc;IACxB,+BAAa,CAAA;IACb,uCAAqB,CAAA;IACrB,+BAAa,CAAA;IACb,qCAAmB,CAAA;IACnB,iCAAe,CAAA;IACf,iCAAe,CAAA;IACf,6CAA2B,CAAA;IAC3B,uDAAqC,CAAA;AACvC,CAAC,EATW,cAAc,8BAAd,cAAc,QASzB;AAED;;;GAGG;AACH,IAAY,cAKX;AALD,WAAY,cAAc;IACxB,qCAAmB,CAAA;IACnB,2CAAyB,CAAA;IACzB,uDAAqC,CAAA;IACrC,6CAA2B,CAAA;AAC7B,CAAC,EALW,cAAc,8BAAd,cAAc,QAKzB"}
|
package/lib/api/walletAuth.d.ts
CHANGED
|
@@ -100,7 +100,83 @@ export declare class WalletAuthAPI {
|
|
|
100
100
|
removeWatchlistEntry(body: WalletAuthRequest<"remove_watchlist_entry">): Promise<{
|
|
101
101
|
success: boolean;
|
|
102
102
|
}>;
|
|
103
|
-
|
|
103
|
+
getAccountRelationship(addressOrUsername: string): Promise<{
|
|
104
|
+
isFollowing: boolean;
|
|
105
|
+
isWatching: boolean;
|
|
106
|
+
}>;
|
|
107
|
+
getAccountFollowing(addressOrUsername: string, query?: WalletAuthQuery<"get_account_following">): Promise<{
|
|
108
|
+
profiles: {
|
|
109
|
+
address: string;
|
|
110
|
+
username?: string | undefined;
|
|
111
|
+
displayName?: string | undefined;
|
|
112
|
+
profileImageUrl?: string | undefined;
|
|
113
|
+
isVerified: boolean;
|
|
114
|
+
followerCount: number;
|
|
115
|
+
nftPfp?: {
|
|
116
|
+
contractAddress: string;
|
|
117
|
+
tokenId: string;
|
|
118
|
+
chain: string;
|
|
119
|
+
collectionSlug?: string | undefined;
|
|
120
|
+
imageUrl: string;
|
|
121
|
+
isVerified: boolean;
|
|
122
|
+
} | undefined;
|
|
123
|
+
isFollowing: boolean;
|
|
124
|
+
isWatching: boolean;
|
|
125
|
+
}[];
|
|
126
|
+
next?: string | undefined;
|
|
127
|
+
}>;
|
|
128
|
+
getAccountFollowers(addressOrUsername: string, query?: WalletAuthQuery<"get_account_followers">): Promise<{
|
|
129
|
+
profiles: {
|
|
130
|
+
address: string;
|
|
131
|
+
username?: string | undefined;
|
|
132
|
+
displayName?: string | undefined;
|
|
133
|
+
profileImageUrl?: string | undefined;
|
|
134
|
+
isVerified: boolean;
|
|
135
|
+
followerCount: number;
|
|
136
|
+
nftPfp?: {
|
|
137
|
+
contractAddress: string;
|
|
138
|
+
tokenId: string;
|
|
139
|
+
chain: string;
|
|
140
|
+
collectionSlug?: string | undefined;
|
|
141
|
+
imageUrl: string;
|
|
142
|
+
isVerified: boolean;
|
|
143
|
+
} | undefined;
|
|
144
|
+
isFollowing: boolean;
|
|
145
|
+
isWatching: boolean;
|
|
146
|
+
}[];
|
|
147
|
+
next?: string | undefined;
|
|
148
|
+
}>;
|
|
149
|
+
followAccount(addressOrUsername: string): Promise<{
|
|
150
|
+
status: string;
|
|
151
|
+
}>;
|
|
152
|
+
unfollowAccount(addressOrUsername: string): Promise<{
|
|
153
|
+
status: string;
|
|
154
|
+
}>;
|
|
155
|
+
watchAccount(addressOrUsername: string): Promise<{
|
|
156
|
+
status: string;
|
|
157
|
+
}>;
|
|
158
|
+
unwatchAccount(addressOrUsername: string): Promise<{
|
|
159
|
+
status: string;
|
|
160
|
+
}>;
|
|
161
|
+
listSavedTools(query?: WalletAuthQuery<"list_saved_tools">): Promise<{
|
|
162
|
+
tools: {
|
|
163
|
+
id: string;
|
|
164
|
+
toolId: string;
|
|
165
|
+
registryChain: string;
|
|
166
|
+
registryAddr: string;
|
|
167
|
+
}[];
|
|
168
|
+
next?: string | undefined;
|
|
169
|
+
}>;
|
|
170
|
+
saveTool(body: WalletAuthRequest<"save_tool">): Promise<{
|
|
171
|
+
id: string;
|
|
172
|
+
toolId: string;
|
|
173
|
+
registryChain: string;
|
|
174
|
+
registryAddr: string;
|
|
175
|
+
}>;
|
|
176
|
+
removeSavedTool(query: WalletAuthQuery<"unsave_tool">): Promise<{
|
|
177
|
+
removed: boolean;
|
|
178
|
+
}>;
|
|
179
|
+
cancelOrder(chain: string, protocolAddress: string, orderHash: string, body?: WalletAuthRequest<"cancel_order">): Promise<{
|
|
104
180
|
lastSignatureIssuedValidUntil: string;
|
|
105
181
|
}>;
|
|
106
182
|
saveDropEdits(slug: string, body: WalletAuthRequest<"save_drop_edits">): Promise<{
|
|
@@ -171,7 +247,7 @@ export declare class WalletAuthAPI {
|
|
|
171
247
|
setCollectionVisibility(slug: string, body: WalletAuthRequest<"set_collection_visibility">): Promise<{
|
|
172
248
|
success: boolean;
|
|
173
249
|
}>;
|
|
174
|
-
createCollectionImageUpload(slug: string, imageType: string): Promise<{
|
|
250
|
+
createCollectionImageUpload(slug: string, imageType: string, contentType: WalletAuthQuery<"upload_collection_image">["contentType"]): Promise<{
|
|
175
251
|
url: string;
|
|
176
252
|
method: "POST" | "PUT";
|
|
177
253
|
fields: {
|
|
@@ -195,6 +271,17 @@ export declare class WalletAuthAPI {
|
|
|
195
271
|
};
|
|
196
272
|
token: string;
|
|
197
273
|
}>;
|
|
274
|
+
setProfileNftPfp(body: WalletAuthRequest<"set_profile_nft_pfp">): Promise<{
|
|
275
|
+
contractAddress: string;
|
|
276
|
+
tokenId: string;
|
|
277
|
+
chain: string;
|
|
278
|
+
collectionSlug?: string | undefined;
|
|
279
|
+
imageUrl: string;
|
|
280
|
+
isVerified: boolean;
|
|
281
|
+
}>;
|
|
282
|
+
clearProfileNftPfp(): Promise<{
|
|
283
|
+
success: boolean;
|
|
284
|
+
}>;
|
|
198
285
|
createProfileShelf(body: WalletAuthRequest<"create_profile_shelf">): Promise<{
|
|
199
286
|
id: string;
|
|
200
287
|
accountAddress?: string | undefined;
|
package/lib/api/walletAuth.js
CHANGED
|
@@ -26,6 +26,44 @@ class WalletAuthAPI {
|
|
|
26
26
|
removeWatchlistEntry(body) {
|
|
27
27
|
return this.fetcher.request("DELETE", "/api/v2/watchlist", body);
|
|
28
28
|
}
|
|
29
|
+
getAccountRelationship(addressOrUsername) {
|
|
30
|
+
return this.fetcher.get(`/api/v2/accounts/${segment(addressOrUsername)}/relationship`);
|
|
31
|
+
}
|
|
32
|
+
getAccountFollowing(addressOrUsername, query) {
|
|
33
|
+
return this.fetcher.get(`/api/v2/accounts/${segment(addressOrUsername)}/following`, query);
|
|
34
|
+
}
|
|
35
|
+
getAccountFollowers(addressOrUsername, query) {
|
|
36
|
+
return this.fetcher.get(`/api/v2/accounts/${segment(addressOrUsername)}/followers`, query);
|
|
37
|
+
}
|
|
38
|
+
followAccount(addressOrUsername) {
|
|
39
|
+
return this.fetcher.request("POST", `/api/v2/accounts/${segment(addressOrUsername)}/follow`);
|
|
40
|
+
}
|
|
41
|
+
unfollowAccount(addressOrUsername) {
|
|
42
|
+
return this.fetcher.request("DELETE", `/api/v2/accounts/${segment(addressOrUsername)}/follow`);
|
|
43
|
+
}
|
|
44
|
+
watchAccount(addressOrUsername) {
|
|
45
|
+
return this.fetcher.request("POST", `/api/v2/accounts/${segment(addressOrUsername)}/watch`);
|
|
46
|
+
}
|
|
47
|
+
unwatchAccount(addressOrUsername) {
|
|
48
|
+
return this.fetcher.request("DELETE", `/api/v2/accounts/${segment(addressOrUsername)}/watch`);
|
|
49
|
+
}
|
|
50
|
+
listSavedTools(query) {
|
|
51
|
+
return this.fetcher.get("/api/v2/saved-tools", query);
|
|
52
|
+
}
|
|
53
|
+
saveTool(body) {
|
|
54
|
+
return this.fetcher.request("POST", "/api/v2/saved-tools", body);
|
|
55
|
+
}
|
|
56
|
+
removeSavedTool(query) {
|
|
57
|
+
const params = new URLSearchParams({
|
|
58
|
+
tool_id: query.toolId,
|
|
59
|
+
registry_chain: query.registryChain,
|
|
60
|
+
registry_addr: query.registryAddr,
|
|
61
|
+
});
|
|
62
|
+
if (query.toolkitName != null) {
|
|
63
|
+
params.set("toolkit_name", query.toolkitName);
|
|
64
|
+
}
|
|
65
|
+
return this.fetcher.request("DELETE", `/api/v2/saved-tools?${params}`);
|
|
66
|
+
}
|
|
29
67
|
cancelOrder(chain, protocolAddress, orderHash, body) {
|
|
30
68
|
return this.fetcher.request("POST", `/api/v2/orders/chain/${segment(chain)}/protocol/${segment(protocolAddress)}/${segment(orderHash)}/cancel`, body);
|
|
31
69
|
}
|
|
@@ -65,8 +103,9 @@ class WalletAuthAPI {
|
|
|
65
103
|
setCollectionVisibility(slug, body) {
|
|
66
104
|
return this.fetcher.request("PATCH", `/api/v2/collections/${segment(slug)}/visibility`, body);
|
|
67
105
|
}
|
|
68
|
-
createCollectionImageUpload(slug, imageType) {
|
|
69
|
-
|
|
106
|
+
createCollectionImageUpload(slug, imageType, contentType) {
|
|
107
|
+
const query = new URLSearchParams({ content_type: contentType });
|
|
108
|
+
return this.fetcher.request("POST", `/api/v2/collections/${segment(slug)}/images/${segment(imageType)}?${query}`);
|
|
70
109
|
}
|
|
71
110
|
updateProfileSettings(body) {
|
|
72
111
|
return this.fetcher.request("PATCH", "/api/v2/profile", body);
|
|
@@ -77,6 +116,12 @@ class WalletAuthAPI {
|
|
|
77
116
|
createProfileImageUpload(body) {
|
|
78
117
|
return this.fetcher.request("POST", "/api/v2/profile/images", body);
|
|
79
118
|
}
|
|
119
|
+
setProfileNftPfp(body) {
|
|
120
|
+
return this.fetcher.request("POST", "/api/v2/profile/nft-pfp", body);
|
|
121
|
+
}
|
|
122
|
+
clearProfileNftPfp() {
|
|
123
|
+
return this.fetcher.request("DELETE", "/api/v2/profile/nft-pfp");
|
|
124
|
+
}
|
|
80
125
|
createProfileShelf(body) {
|
|
81
126
|
return this.fetcher.request("POST", "/api/v2/profile/shelves", body);
|
|
82
127
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"walletAuth.js","sourceRoot":"","sources":["../../src/api/walletAuth.ts"],"names":[],"mappings":";;;AAoBA,MAAM,OAAO,GAAG,CAAC,KAAsB,EAAE,EAAE,CAAC,kBAAkB,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAA;AAE7E,8DAA8D;AAC9D,MAAa,aAAa;IACJ;IAApB,YAAoB,OAA0B;QAA1B,YAAO,GAAP,OAAO,CAAmB;IAAG,CAAC;IAElD,kBAAkB,CAAC,IAAY;QAC7B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,iBAAiB,OAAO,CAAC,IAAI,CAAC,cAAc,CAC7C,CAAA;IACH,CAAC;IAED,YAAY,CACV,OAAe,EACf,KAAgD;QAEhD,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,mBAAmB,OAAO,CAAC,OAAO,CAAC,YAAY,EAC/C,KAAK,CACN,CAAA;IACH,CAAC;IAED,iBAAiB,CAAC,OAAe;QAC/B,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CACrB,mBAAmB,OAAO,CAAC,OAAO,CAAC,kBAAkB,CACtD,CAAA;IACH,CAAC;IAED,qBAAqB,CAAC,OAAe;QACnC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAErB,mBAAmB,OAAO,CAAC,OAAO,CAAC,sBAAsB,CAAC,CAAA;IAC9D,CAAC;IAED,iBAAiB,CAAC,IAA8C;QAC9D,OAAO,IAAI,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
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.5.1",
|
|
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",
|
|
@@ -45,7 +45,7 @@
|
|
|
45
45
|
"types": "lib/index.d.ts",
|
|
46
46
|
"dependencies": {
|
|
47
47
|
"@noble/hashes": "^2.0.1",
|
|
48
|
-
"@opensea/api-types": "^0.8.
|
|
48
|
+
"@opensea/api-types": "^0.8.3",
|
|
49
49
|
"@opensea/seaport-js": "^4.1.1",
|
|
50
50
|
"ethers": "^6.16.0"
|
|
51
51
|
},
|
package/src/api/api.ts
CHANGED
|
@@ -56,6 +56,8 @@ import {
|
|
|
56
56
|
type DropMintRequest,
|
|
57
57
|
type DropMintResponse,
|
|
58
58
|
type FloorPriceHistoryResponse,
|
|
59
|
+
type GetAccountTokenActivityArgs,
|
|
60
|
+
type GetAccountTokenActivityResponse,
|
|
59
61
|
type GetAccountTokensArgs,
|
|
60
62
|
type GetAccountTokensResponse,
|
|
61
63
|
type GetBestListingResponse,
|
|
@@ -1094,6 +1096,17 @@ export class OpenSeaAPI {
|
|
|
1094
1096
|
return this.tokensAPI.getTokenActivity(chain, address, args)
|
|
1095
1097
|
}
|
|
1096
1098
|
|
|
1099
|
+
/**
|
|
1100
|
+
* Fetch paginated fungible token activity (transfers, swaps, wraps, and
|
|
1101
|
+
* unwraps) for an account across all chains.
|
|
1102
|
+
*/
|
|
1103
|
+
public async getAccountTokenActivity(
|
|
1104
|
+
address: string,
|
|
1105
|
+
args?: GetAccountTokenActivityArgs,
|
|
1106
|
+
): Promise<GetAccountTokenActivityResponse> {
|
|
1107
|
+
return this.tokensAPI.getAccountTokenActivity(address, args)
|
|
1108
|
+
}
|
|
1109
|
+
|
|
1097
1110
|
/**
|
|
1098
1111
|
* Fetch paginated holders for a token, including quantity held, USD value,
|
|
1099
1112
|
* and aggregate distribution health (STRONG | HEALTHY | CONCERNING | BAD).
|
package/src/api/apiPaths.ts
CHANGED
|
@@ -321,6 +321,10 @@ export const getTokenActivityPath = (chain: Chain, address: string) => {
|
|
|
321
321
|
return `${API_V2_PREFIX}/chain/${chain}/token/${address}/activity`
|
|
322
322
|
}
|
|
323
323
|
|
|
324
|
+
export const getAccountTokenActivityPath = (address: string) => {
|
|
325
|
+
return `${API_V2_PREFIX}/account/${address}/token-activity`
|
|
326
|
+
}
|
|
327
|
+
|
|
324
328
|
export const getTokenHoldersPath = (chain: Chain, address: string) => {
|
|
325
329
|
return `${API_V2_PREFIX}/chain/${chain}/token/${address}/holders`
|
|
326
330
|
}
|
package/src/api/tokens.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { Chain } from "../types"
|
|
2
2
|
import {
|
|
3
|
+
getAccountTokenActivityPath,
|
|
3
4
|
getBatchTokensPath,
|
|
4
5
|
getSwapExecutePath,
|
|
5
6
|
getSwapQuotePath,
|
|
@@ -17,6 +18,8 @@ import {
|
|
|
17
18
|
import type { Fetcher } from "./fetcher"
|
|
18
19
|
import type {
|
|
19
20
|
BatchTokensRequest,
|
|
21
|
+
GetAccountTokenActivityArgs,
|
|
22
|
+
GetAccountTokenActivityResponse,
|
|
20
23
|
GetSwapQuoteArgs,
|
|
21
24
|
GetSwapQuoteResponse,
|
|
22
25
|
GetTokenGroupResponse,
|
|
@@ -168,6 +171,20 @@ export class TokensAPI {
|
|
|
168
171
|
)
|
|
169
172
|
}
|
|
170
173
|
|
|
174
|
+
/**
|
|
175
|
+
* Fetch paginated fungible token activity (transfers, swaps, wraps, and
|
|
176
|
+
* unwraps) for an account across all chains.
|
|
177
|
+
*/
|
|
178
|
+
async getAccountTokenActivity(
|
|
179
|
+
address: string,
|
|
180
|
+
args?: GetAccountTokenActivityArgs,
|
|
181
|
+
): Promise<GetAccountTokenActivityResponse> {
|
|
182
|
+
return this.fetcher.get<GetAccountTokenActivityResponse>(
|
|
183
|
+
getAccountTokenActivityPath(address),
|
|
184
|
+
args,
|
|
185
|
+
)
|
|
186
|
+
}
|
|
187
|
+
|
|
171
188
|
/**
|
|
172
189
|
* Fetch paginated holders for a token, including quantity held, USD value,
|
|
173
190
|
* and an aggregate distribution health label (STRONG | HEALTHY |
|