@opensea/cli 1.0.0 → 1.1.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 +4 -3
- package/dist/cli.js +58 -12
- package/dist/cli.js.map +1 -1
- package/dist/index.d.ts +5 -3
- package/dist/index.js +16 -7
- package/dist/index.js.map +1 -1
- package/package.json +7 -6
package/dist/index.d.ts
CHANGED
|
@@ -55,6 +55,7 @@ type DropPaginatedResponse = Schemas["DropPaginatedResponse"];
|
|
|
55
55
|
type DropMintRequest = Schemas["DropMintRequest"];
|
|
56
56
|
type DropMintResponse = Schemas["DropMintResponse"];
|
|
57
57
|
type AccountResolveResponse = Schemas["AccountResolveResponse"];
|
|
58
|
+
type AssetMetadataResponse = Schemas["AssetMetadataResponse"];
|
|
58
59
|
type SafelistStatus = "not_requested" | "requested" | "approved" | "verified" | "disabled_top_trending";
|
|
59
60
|
type CollectionOrderBy = "created_date" | "one_day_change" | "seven_day_volume" | "seven_day_change" | "num_owners" | "market_cap";
|
|
60
61
|
type EventType = "sale" | "transfer" | "mint" | "listing" | "offer" | "trait_offer" | "collection_offer";
|
|
@@ -585,8 +586,7 @@ declare const WALLET_PROVIDERS: WalletProvider[];
|
|
|
585
586
|
* Create a WalletAdapter from the current environment.
|
|
586
587
|
*
|
|
587
588
|
* When no provider is specified, auto-detects based on which
|
|
588
|
-
* environment variables are set. Priority:
|
|
589
|
-
* If no provider-specific vars are found, defaults to Privy.
|
|
589
|
+
* environment variables are set. Priority: Privy > Fireblocks > Turnkey > PrivateKey.
|
|
590
590
|
*/
|
|
591
591
|
declare function createWalletFromEnv(provider?: WalletProvider): WalletAdapter;
|
|
592
592
|
|
|
@@ -690,6 +690,8 @@ declare class NFTsAPI {
|
|
|
690
690
|
validateMetadata(chain: Chain, address: string, identifier: string, options?: {
|
|
691
691
|
ignoreCachedItemUrls?: boolean;
|
|
692
692
|
}): Promise<ValidateMetadataResponse>;
|
|
693
|
+
getCollection(chain: Chain, address: string, identifier: string): Promise<CollectionDetailedResponse>;
|
|
694
|
+
getMetadata(chain: Chain, address: string, tokenId: string): Promise<AssetMetadataResponse>;
|
|
693
695
|
}
|
|
694
696
|
declare class ListingsAPI {
|
|
695
697
|
private client;
|
|
@@ -873,4 +875,4 @@ declare class HealthAPI {
|
|
|
873
875
|
|
|
874
876
|
declare function formatToon(data: unknown): string;
|
|
875
877
|
|
|
876
|
-
export { type AccountResponse as Account, type AccountResolveResponse, type AccountResponse, type AssetEvent, type AssetEventsResponse, CHAIN_IDS, type Chain, type ChainInfo, type ChainListResponse, type CollectionDetailedResponse as Collection, type CollectionDetailedResponse, type CollectionOrderBy, type CollectionPaginatedResponse, type CollectionRarity, type CollectionResponse, type CollectionStatsResponse as CollectionStats, type CollectionStatsResponse, type CommandOptions, type Contract, type ContractResponse, type DropDetailedResponse, type DropMintRequest, type DropMintResponse, type DropPaginatedResponse, type DropResponse, type DropStageResponse, type Event, type EventAsset, type Payment as EventPayment, type EventType, type Fee, FireblocksAdapter, type FulfillListingResponse, type GetOrderResponse, type GetTraitsResponse, type HealthResult, type IntervalStat, type Listing, type ListingPrice, type ListingsResponse, type NftDetailed as NFT, type Nft, type NftDetailed, type NftListResponse, type NftResponse, type Offer, type OffersResponse, OpenSeaAPIError, OpenSeaCLI, OpenSeaClient, type OpenSeaClientConfig, type Order, type OrderEvent, type OrderSide, type OrdersResponse, type OutputFormat, type Owner, type Payment, type PaymentToken, type Price, type PricingCurrencies, PrivateKeyAdapter, PrivyAdapter, type ProtocolData, type Rarity, type SafelistStatus, type SaleEvent, type SearchAssetType, type SearchResponse, type SearchResult, type SearchResultAccount, type SearchResultCollection, type SearchResultNFT, type SearchResultToken, type SimpleAccount, type SocialMediaAccount, type SwapQuote, type SwapQuoteResponse, type SwapTransaction, SwapsAPI, type Token, type TokenBalance, type TokenBalancePaginatedResponse, type TokenBalanceSortBy, type TokenDetails, type TokenSocials, type TokenStats, type Total, type Trait, type TraitCategories, type TraitCounts, type TransactionRequest, type TransactionResult, type TransferEvent, TurnkeyAdapter, type ValidateMetadataResponse, WALLET_PROVIDERS, type WalletAdapter, type WalletProvider, checkHealth, createWalletFromEnv, formatOutput, formatToon, resolveChainId };
|
|
878
|
+
export { type AccountResponse as Account, type AccountResolveResponse, type AccountResponse, type AssetEvent, type AssetEventsResponse, type AssetMetadataResponse, CHAIN_IDS, type Chain, type ChainInfo, type ChainListResponse, type CollectionDetailedResponse as Collection, type CollectionDetailedResponse, type CollectionOrderBy, type CollectionPaginatedResponse, type CollectionRarity, type CollectionResponse, type CollectionStatsResponse as CollectionStats, type CollectionStatsResponse, type CommandOptions, type Contract, type ContractResponse, type DropDetailedResponse, type DropMintRequest, type DropMintResponse, type DropPaginatedResponse, type DropResponse, type DropStageResponse, type Event, type EventAsset, type Payment as EventPayment, type EventType, type Fee, FireblocksAdapter, type FulfillListingResponse, type GetOrderResponse, type GetTraitsResponse, type HealthResult, type IntervalStat, type Listing, type ListingPrice, type ListingsResponse, type NftDetailed as NFT, type Nft, type NftDetailed, type NftListResponse, type NftResponse, type Offer, type OffersResponse, OpenSeaAPIError, OpenSeaCLI, OpenSeaClient, type OpenSeaClientConfig, type Order, type OrderEvent, type OrderSide, type OrdersResponse, type OutputFormat, type Owner, type Payment, type PaymentToken, type Price, type PricingCurrencies, PrivateKeyAdapter, PrivyAdapter, type ProtocolData, type Rarity, type SafelistStatus, type SaleEvent, type SearchAssetType, type SearchResponse, type SearchResult, type SearchResultAccount, type SearchResultCollection, type SearchResultNFT, type SearchResultToken, type SimpleAccount, type SocialMediaAccount, type SwapQuote, type SwapQuoteResponse, type SwapTransaction, SwapsAPI, type Token, type TokenBalance, type TokenBalancePaginatedResponse, type TokenBalanceSortBy, type TokenDetails, type TokenSocials, type TokenStats, type Total, type Trait, type TraitCategories, type TraitCounts, type TransactionRequest, type TransactionResult, type TransferEvent, TurnkeyAdapter, type ValidateMetadataResponse, WALLET_PROVIDERS, type WalletAdapter, type WalletProvider, checkHealth, createWalletFromEnv, formatOutput, formatToon, resolveChainId };
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/client.ts
|
|
2
2
|
var DEFAULT_BASE_URL = "https://api.opensea.io";
|
|
3
3
|
var DEFAULT_TIMEOUT_MS = 3e4;
|
|
4
|
-
var USER_AGENT = `opensea-cli/${"1.
|
|
4
|
+
var USER_AGENT = `opensea-cli/${"1.1.0"}`;
|
|
5
5
|
var DEFAULT_MAX_RETRIES = 0;
|
|
6
6
|
var DEFAULT_RETRY_BASE_DELAY_MS = 1e3;
|
|
7
7
|
function isRetryableStatus(status, method) {
|
|
@@ -1458,23 +1458,24 @@ function createWalletFromEnv(provider) {
|
|
|
1458
1458
|
if (provider) {
|
|
1459
1459
|
return createAdapter(provider);
|
|
1460
1460
|
}
|
|
1461
|
-
const
|
|
1461
|
+
const hasPrivy = !!process.env.PRIVY_APP_ID && !!process.env.PRIVY_APP_SECRET;
|
|
1462
1462
|
const hasFireblocks = !!process.env.FIREBLOCKS_API_KEY && !!process.env.FIREBLOCKS_VAULT_ID;
|
|
1463
|
+
const hasTurnkey = !!process.env.TURNKEY_API_PUBLIC_KEY && !!process.env.TURNKEY_ORGANIZATION_ID;
|
|
1463
1464
|
const hasPrivateKey = !!process.env.PRIVATE_KEY && !!process.env.RPC_URL;
|
|
1464
|
-
const hasPrivy = !!process.env.PRIVY_APP_ID && !!process.env.PRIVY_APP_SECRET;
|
|
1465
1465
|
const detected = [
|
|
1466
|
-
|
|
1466
|
+
hasPrivy && "privy",
|
|
1467
1467
|
hasFireblocks && "fireblocks",
|
|
1468
|
-
|
|
1469
|
-
|
|
1468
|
+
hasTurnkey && "turnkey",
|
|
1469
|
+
hasPrivateKey && "private-key"
|
|
1470
1470
|
].filter(Boolean);
|
|
1471
1471
|
if (detected.length > 1) {
|
|
1472
1472
|
console.warn(
|
|
1473
1473
|
`WARNING: Multiple wallet providers detected: ${detected.join(", ")}. Using ${detected[0]}. Set --wallet-provider explicitly to avoid ambiguity.`
|
|
1474
1474
|
);
|
|
1475
1475
|
}
|
|
1476
|
-
if (
|
|
1476
|
+
if (hasPrivy) return PrivyAdapter.fromEnv();
|
|
1477
1477
|
if (hasFireblocks) return FireblocksAdapter.fromEnv();
|
|
1478
|
+
if (hasTurnkey) return TurnkeyAdapter.fromEnv();
|
|
1478
1479
|
if (hasPrivateKey) return PrivateKeyAdapter.fromEnv();
|
|
1479
1480
|
return PrivyAdapter.fromEnv();
|
|
1480
1481
|
}
|
|
@@ -1648,6 +1649,14 @@ var NFTsAPI = class {
|
|
|
1648
1649
|
params
|
|
1649
1650
|
);
|
|
1650
1651
|
}
|
|
1652
|
+
async getCollection(chain, address, identifier) {
|
|
1653
|
+
return this.client.get(
|
|
1654
|
+
`/api/v2/chain/${chain}/contract/${address}/nfts/${identifier}/collection`
|
|
1655
|
+
);
|
|
1656
|
+
}
|
|
1657
|
+
async getMetadata(chain, address, tokenId) {
|
|
1658
|
+
return this.client.get(`/api/v2/metadata/${chain}/${address}/${tokenId}`);
|
|
1659
|
+
}
|
|
1651
1660
|
};
|
|
1652
1661
|
var ListingsAPI = class {
|
|
1653
1662
|
constructor(client) {
|