Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

alchemy-sdk

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

alchemy-sdk - npm Package Compare versions

Comparing version 2.0.2 to 2.0.3

dist/cjs/alchemy-provider-262cb091.js

13

CHANGELOG.md

@@ -5,2 +5,13 @@ # Changelog for Alchemy SDK for JavaScript

## 2.0.3
### Minor Changes
- Added support for the `pageSize` parameter in `GetNftsForOwnerOptions` to specify the number of NFTs fetched when using `alchemy.nft.getNftsForOwner()`.
- Added support for a Wallet object. This object is identical to the Ethers `Wallet` class.
- Added support for Arbitrum Goerli network via the `Network.ARB_GOERLI` enum.
- Added support for the AStar Mainnet network via the `Network.ASTAR_MAINNET` enum.
- Added typed request/response overloads for `CoreNamespace.getAssetTransfers()` for when the `withMetadata` param is true.
- Added support the `tokenUriTimeoutInMs` parameter on `getNftsForOwner()`, `getNftMetadata()`, and `getNftsForContract()`.
## 2.0.2

@@ -16,3 +27,3 @@

- Added support for Optimism Goerli network via the `Network.OPT_GOERLI` enum.
- Added the `pageSize` parameter in `GetNftsForContractOption` to specify the number of NFTs fetched when using `alchemy.nft.getNftsForContract`.
- Added the `pageSize` parameter in `GetNftsForContractOptions` to specify the number of NFTs fetched when using `alchemy.nft.getNftsForContract`.
- Added correct `withMetadata` typing to `AssetTransfersResponse`.

@@ -19,0 +30,0 @@

4

dist/cjs/index.js

@@ -5,5 +5,6 @@ 'use strict';

var index = require('./index-61a87bcd.js');
var index = require('./index-74edb4b0.js');
require('@ethersproject/bignumber');
require('axios');
require('@ethersproject/wallet');

@@ -37,2 +38,3 @@

});
exports.Wallet = index.Wallet;
exports.fromHex = index.fromHex;

@@ -39,0 +41,0 @@ exports.isHex = index.isHex;

@@ -1,2 +0,1 @@

import { AlchemyConfig } from './alchemy-config';
import type { Block, BlockTag, BlockWithTransactions, FeeData, Filter, FilterByBlockHash, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from '@ethersproject/abstract-provider';

@@ -6,6 +5,16 @@ import type { BigNumber, BigNumberish } from '@ethersproject/bignumber';

import type { Deferrable } from '@ethersproject/properties';
import { AssetTransfersParams, AssetTransfersResponse, DeployResult, TokenBalancesResponse, TokenMetadataResponse, TransactionReceiptsParams, TransactionReceiptsResponse } from '../types/types';
import { AssetTransfersParams, AssetTransfersResponse, AssetTransfersWithMetadataParams, AssetTransfersWithMetadataResponse, DeployResult, TokenBalancesResponse, TokenMetadataResponse, TransactionReceiptsParams, TransactionReceiptsResponse } from '../types/types';
/**
* The core namespace contains all commonly-used [Ethers.js
* Provider](https://docs.ethers.io/v5/api/providers/api-providers/#AlchemyProvider)
* methods. If you are already using Ethers.js, you should be simply able to
* replace the Ethers.js Provider object with `alchemy.core` when accessing
* provider methods and it should just work.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.core`.
*/
export declare class CoreNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -233,2 +242,15 @@ * Returns the balance of a given address as of the provided block.

*
* This overload requires {@link AssetTransfersWithMetadataParams.withMetadata}
* to be set to `true`, which results in additional metadata returned in the
* response object.
*
* @param params An object containing fields for the asset transfer query
* @public
*/
getAssetTransfers(params: AssetTransfersWithMetadataParams): Promise<AssetTransfersWithMetadataResponse>;
/**
* Get transactions for specific addresses. See the web documentation for the
* full details:
* https://docs.alchemy.com/alchemy/enhanced-apis/transfers-api#alchemy_getassettransfers
*
* @param params An object containing fields for the asset transfer query.

@@ -235,0 +257,0 @@ * @public

import type { BigNumberish } from '@ethersproject/bignumber';
import { GetBaseNftsForContractOptions, GetBaseNftsForOwnerOptions, GetFloorPriceResponse, GetNftsForContractOptions, GetNftsForOwnerOptions, GetOwnersForContractResponse, GetOwnersForNftResponse, NftContractBaseNftsResponse, NftContractNftsResponse, NftTokenType, OwnedBaseNft, OwnedBaseNftsResponse, OwnedNft, OwnedNftsResponse, RefreshContractResult } from '../types/types';
import { BaseNft, Nft, NftContract } from './nft';
import { AlchemyConfig } from './alchemy-config';
/**
* The NFT namespace contains all the functionality related to NFTs.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.nft`.
*/
export declare class NftNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -14,5 +19,9 @@ * Get the NFT metadata associated with the provided parameters.

* @param tokenType - Optionally specify the type of token to speed up the query.
* @param tokenUriTimeoutInMs - No set timeout by default - When metadata is
* requested, this parameter is the timeout (in milliseconds) for the
* website hosting the metadata to respond. If you want to only access the
* cache and not live fetch any metadata for cache misses then set this value to 0.
* @public
*/
getNftMetadata(contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType): Promise<Nft>;
getNftMetadata(contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, tokenUriTimeoutInMs?: number): Promise<Nft>;
/**

@@ -19,0 +28,0 @@ * Get the NFT collection metadata associated with the provided parameters.

@@ -1,7 +0,13 @@

import { AlchemyConfig } from './alchemy-config';
import { SendPrivateTransactionOptions } from '../types/types';
import { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider';
/**
* The Transact namespace contains methods used for sending transactions and
* checking on the state of submitted transactions.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.transact`.
*/
export declare class TransactNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -8,0 +14,0 @@ * Used to send a single transaction to Flashbots. Flashbots will attempt to

import { AlchemyEventType } from '../types/types';
import type { Listener } from '@ethersproject/abstract-provider';
import { AlchemyConfig } from './alchemy-config';
/**
* The Websocket namespace contains all subscription related functions that
* allow you to subscribe to events and receive updates as they occur. The
* underlying WebSocket provider has additional logic to handle reconnections
* and automatically backfills missed events.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.ws`.
*/
export declare class WebSocketNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -8,0 +16,0 @@ * Adds a listener to be triggered for each {@link eventName} event. Also

/** This is the main entry point for the library and exports user-facing API. */
export * from './types/types';
export { Alchemy } from './api/alchemy';
export { Wallet } from './api/alchemy-wallet';
export type { AlchemyConfig } from './api/alchemy-config';

@@ -5,0 +6,0 @@ export type { AlchemyProvider } from './api/alchemy-provider';

@@ -5,3 +5,3 @@ import { BigNumberish } from '@ethersproject/bignumber';

import { AlchemyConfig } from '../api/alchemy-config';
export declare function getNftMetadata(config: AlchemyConfig, contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, srcMethod?: string): Promise<Nft>;
export declare function getNftMetadata(config: AlchemyConfig, contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, tokenUriTimeoutInMs?: number, srcMethod?: string): Promise<Nft>;
export declare function getContractMetadata(config: AlchemyConfig, contractAddress: string, srcMethod?: string): Promise<NftContract>;

@@ -8,0 +8,0 @@ export declare function getNftsForOwnerIterator(config: AlchemyConfig, owner: string, options?: GetNftsForOwnerOptions | GetBaseNftsForOwnerOptions, srcMethod?: string): AsyncIterable<OwnedBaseNft | OwnedNft>;

@@ -46,4 +46,6 @@ import { EventType, TransactionReceipt } from '@ethersproject/abstract-provider';

ARB_RINKEBY = "arb-rinkeby",
ARB_GOERLI = "arb-goerli",
MATIC_MAINNET = "polygon-mainnet",
MATIC_MUMBAI = "polygon-mumbai"
MATIC_MUMBAI = "polygon-mumbai",
ASTAR_MAINNET = "astar-mainnet"
}

@@ -69,38 +71,125 @@ /** @public */

}
/** @public */
/**
* Response object for the {@link CoreNamespace.getTokenMetadata} method.
*
* @public
*/
export interface TokenMetadataResponse {
/**
* The token's name. Is `null` if the name is not defined in the contract and
* not available from other sources.
*/
name: string | null;
/**
* The token's symbol. Is `null` if the symbol is not defined in the contract
* and not available from other sources.
*/
symbol: string | null;
/**
* The number of decimals of the token. Returns `null` if not defined in the
* contract and not available from other sources.
*/
decimals: number | null;
/** URL link to the token's logo. Is `null` if the logo is not available. */
logo: string | null;
name: string | null;
symbol: string | null;
}
/** @public */
/**
* Parameters for the {@link CoreNamespace.getAssetTransfers} method.
*
* @public
*/
export interface AssetTransfersParams {
/**
* The starting block to check for transfers. This value is inclusive and
* defaults to `0x0` if omitted.
*/
fromBlock?: string;
/**
* The ending block to check for transfers. This value is inclusive and
* defaults to the latest block if omitted.
*/
toBlock?: string;
/**
* Whether to return results in ascending or descending order by block number.
* Defaults to ascending if omitted.
*/
order?: AssetTransfersOrder;
/**
* The from address to filter transfers by. This value defaults to a wildcard
* for all addresses if omitted.
*/
fromAddress?: string;
/**
* The to address to filter transfers by. This value defaults to a wildcard
* for all address if omitted.
*/
toAddress?: string;
/**
* List of contract addresses to filter for - only applies to "erc20",
* "erc721", "erc1155" transfers. Defaults to all address if omitted.
*/
contractAddresses?: string[];
/**
* Whether to exclude transfers with zero value. Note that zero value is
* different than null value. Defaults to `false` if omitted.
*/
excludeZeroValue?: boolean;
/** REQUIRED field. An array of categories to get transfers for. */
category: AssetTransfersCategory[];
/** The maximum number of results to return per page. Defaults to 1000 if omitted. */
maxCount?: number;
category: AssetTransfersCategory[];
/**
* Optional page key from an existing {@link OwnedBaseNftsResponse}
* {@link AssetTransfersResult}to use for pagination.
*/
pageKey?: string;
/**
* Whether to include additional metadata about each transfer event. Defaults
* to `false` if omitted.
*/
withMetadata?: boolean;
}
/** @public */
/**
* Parameters for the {@link CoreNamespace.getAssetTransfers} method that
* includes metadata.
*
* @public
*/
export interface AssetTransfersWithMetadataParams extends AssetTransfersParams {
withMetadata: true;
}
/**
* Categories of transfers to use with the {@link AssetTransfersParams} request
* object when using {@link CoreNamespace.getAssetTransfers}.
*
* @public
*/
export declare enum AssetTransfersCategory {
/**
* Top level ETH transactions that occur where the `fromAddress` is an
* external user-created address. External addresses have private keys and are
* accessed by users.
*/
EXTERNAL = "external",
/**
* Top level ETH transactions that occur where the `fromAddress` is an
* internal, smart contract address. For example, a smart contract calling
* another smart contract or sending
*/
INTERNAL = "internal",
/** ERC20 transfers. */
ERC20 = "erc20",
/** ERC721 transfers. */
ERC721 = "erc721",
/** ERC1155 transfers. */
ERC1155 = "erc1155",
/**
* Special contracts that don't follow ERC 721/1155, (ex: CryptoKitties).
*
* @beta
*/
/** Special contracts that don't follow ERC 721/1155, (ex: CryptoKitties). */
SPECIALNFT = "specialnft"
}
/** @public */
/**
* Enum for the order of the {@link AssetTransfersParams} request object when
* using {@link CoreNamespace.getAssetTransfers}.
*
* @public
*/
export declare enum AssetTransfersOrder {

@@ -110,3 +199,7 @@ ASCENDING = "asc",

}
/** @public */
/**
* An enum for specifying the token type on NFTs.
*
* @public
*/
export declare enum NftTokenType {

@@ -117,24 +210,81 @@ ERC721 = "ERC721",

}
/** @public */
/**
* Response object for the {@link CoreNamespace.getAssetTransfers} method.
*
* @public
*/
export interface AssetTransfersResponse {
transfers: AssetTransfersResult[];
/** Page key for the next page of results, if one exists. */
pageKey?: string;
}
/** @public */
/**
* Response object for the {@link CoreNamespace.getAssetTransfers} method when
* the {@link AssetTransfersWithMetadataParams} are used.
*
* @public
*/
export interface AssetTransfersWithMetadataResponse {
transfers: AssetTransfersWithMetadataResult[];
pageKey?: string;
}
/**
* Represents a transfer event that is returned in a {@link AssetTransfersResponse}.
*
* @public
*/
export interface AssetTransfersResult {
/** The category of the transfer. */
category: AssetTransfersCategory;
/** The block number where the transfer occurred. */
blockNum: string;
/** The from address of the transfer. */
from: string;
/** The to address of the transfer. */
to: string | null;
/**
* Converted asset transfer value as a number (raw value divided by contract
* decimal). `null` if ERC721 transfer or contract decimal not available.
*/
value: number | null;
/**
* The raw ERC721 token id of the transfer as a hex string. `null` if not an
* ERC721 transfer.
*/
erc721TokenId: string | null;
/**
* A list of ERC1155 metadata objects if the asset transferred is an ERC1155
* token. `null` if not an ERC1155 transfer.
*/
erc1155Metadata: ERC1155Metadata[] | null;
/** The token id of the token transferred. */
tokenId: string | null;
/**
* Returns the token's symbol or ETH for other transfers. `null` if the
* information was not available.
*/
asset: string | null;
/** The transaction hash of the transfer transaction. */
hash: string;
/** Information about the raw contract of the asset transferred. */
rawContract: RawContract;
metadata?: AssetTransfersMetadata;
}
/** @public */
/**
* Represents a transfer event that is returned in a
* {@link AssetTransfersResponse} when {@link AssetTransfersWithMetadataParams} are used.
*
* @public
*/
export interface AssetTransfersWithMetadataResult extends AssetTransfersResult {
/** Additional metadata about the transfer event. */
metadata: AssetTransfersMetadata;
}
/**
* The metadata object for a {@link AssetTransfersResult} when the
* {@link AssetTransfersParams.withMetadata} field is set to true.
*
* @public
*/
export interface AssetTransfersMetadata {
/** Timestamp of the block from which the transaction event originated. */
blockTimestamp: string;

@@ -222,4 +372,16 @@ }

excludeFilters?: NftExcludeFilters[];
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/** Optional boolean flag to omit NFT metadata. Defaults to `false`. */
omitMetadata?: boolean;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -248,4 +410,16 @@ /**

excludeFilters?: NftExcludeFilters[];
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/** Optional boolean flag to include NFT metadata. Defaults to `false`. */
omitMetadata: true;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -402,17 +576,41 @@ /**

}
/** @public */
/**
* The parameter field of {@link TransactionReceiptsParams}.
*
* @public
*/
export interface TransactionReceiptsBlockNumber {
/** The block number to get transaction receipts for. */
blockNumber: string;
}
/** @public */
/**
* The parameter field of {@link TransactionReceiptsParams}.
*
* @public
*/
export interface TransactionReceiptsBlockHash {
/** The block hash to get transaction receipts for. */
blockHash: string;
}
/** @public */
/**
* The parameters to use with the {@link CoreNamespace.getTransactionReceipts} method.
*
* @public
*/
export declare type TransactionReceiptsParams = TransactionReceiptsBlockNumber | TransactionReceiptsBlockHash;
/** @public */
/**
* Response object for a {@link CoreNamespace.getTransactionReceipts} call.
*
* @public
*/
export interface TransactionReceiptsResponse {
/** A list of transaction receipts for the queried block. */
receipts: TransactionReceipt[] | null;
}
/** @public */
/**
* Metadata object returned in a {@link AssetTransfersResult} object if the asset
* transferred is an ERC1155.
*
* @public
*/
export interface ERC1155Metadata {

@@ -422,6 +620,20 @@ tokenId: string;

}
/** @public */
/**
* Information about the underlying contract for the asset that was transferred
* in a {@link AssetTransfersResult} object.
*
* @public
*/
export interface RawContract {
/**
* The raw transfer value as a hex string. `null` if the transfer was for an
* ERC721 or ERC1155 token.
*/
value: string | null;
/** The contract address. `null` if it was an internal or external transfer. */
address: string | null;
/**
* The number of decimals in the contract as a hex string. `null` if the value
* is not in the contract and not available from other sources.
*/
decimal: string | null;

@@ -446,4 +658,14 @@ }

omitMetadata?: boolean;
/** Sets the total number of NFTs to return in the response. Defaults to 100. */
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -467,3 +689,6 @@ /**

omitMetadata: false;
/** Sets the total number of NFTs to return in the response. Defaults to 100. */
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;

@@ -470,0 +695,0 @@ }

import { Network } from '../types/types';
import { Network as NetworkFromEthers } from '@ethersproject/networks';
export declare const DEFAULT_CONTRACT_ADDRESSES = "DEFAULT_TOKENS";

@@ -27,6 +28,16 @@ export declare const DEFAULT_ALCHEMY_API_KEY = "demo";

"arb-rinkeby": string;
"arb-goerli": string;
"polygon-mainnet": string;
"polygon-mumbai": string;
"astar-mainnet": string;
};
/**
* Mapping of network names to their corresponding Ethers Network objects. These
* networks are not yet supported by Ethers and are listed here to be overriden
* in the provider.
*/
export declare const CustomNetworks: {
[key: string]: NetworkFromEthers;
};
export declare function noop(): void;
export declare const ETH_NULL_VALUE = "0x";

@@ -1,1 +0,1 @@

export declare const VERSION = "2.0.1";
export declare const VERSION = "2.0.3";

@@ -1,4 +0,5 @@

export { A as Alchemy, c as AssetTransfersCategory, d as AssetTransfersOrder, N as Network, h as NftExcludeFilters, e as NftTokenType, R as RefreshState, f as fromHex, i as isHex, s as setLogLevel, t as toHex } from './index-8998d743.js';
export { A as Alchemy, c as AssetTransfersCategory, d as AssetTransfersOrder, N as Network, h as NftExcludeFilters, e as NftTokenType, R as RefreshState, W as Wallet, f as fromHex, i as isHex, s as setLogLevel, t as toHex } from './index-dddbb41a.js';
import '@ethersproject/bignumber';
import 'axios';
import '@ethersproject/wallet';
//# sourceMappingURL=index.js.map

@@ -1,2 +0,1 @@

import { AlchemyConfig } from './alchemy-config';
import type { Block, BlockTag, BlockWithTransactions, FeeData, Filter, FilterByBlockHash, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from '@ethersproject/abstract-provider';

@@ -6,6 +5,16 @@ import type { BigNumber, BigNumberish } from '@ethersproject/bignumber';

import type { Deferrable } from '@ethersproject/properties';
import { AssetTransfersParams, AssetTransfersResponse, DeployResult, TokenBalancesResponse, TokenMetadataResponse, TransactionReceiptsParams, TransactionReceiptsResponse } from '../types/types';
import { AssetTransfersParams, AssetTransfersResponse, AssetTransfersWithMetadataParams, AssetTransfersWithMetadataResponse, DeployResult, TokenBalancesResponse, TokenMetadataResponse, TransactionReceiptsParams, TransactionReceiptsResponse } from '../types/types';
/**
* The core namespace contains all commonly-used [Ethers.js
* Provider](https://docs.ethers.io/v5/api/providers/api-providers/#AlchemyProvider)
* methods. If you are already using Ethers.js, you should be simply able to
* replace the Ethers.js Provider object with `alchemy.core` when accessing
* provider methods and it should just work.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.core`.
*/
export declare class CoreNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -233,2 +242,15 @@ * Returns the balance of a given address as of the provided block.

*
* This overload requires {@link AssetTransfersWithMetadataParams.withMetadata}
* to be set to `true`, which results in additional metadata returned in the
* response object.
*
* @param params An object containing fields for the asset transfer query
* @public
*/
getAssetTransfers(params: AssetTransfersWithMetadataParams): Promise<AssetTransfersWithMetadataResponse>;
/**
* Get transactions for specific addresses. See the web documentation for the
* full details:
* https://docs.alchemy.com/alchemy/enhanced-apis/transfers-api#alchemy_getassettransfers
*
* @param params An object containing fields for the asset transfer query.

@@ -235,0 +257,0 @@ * @public

import type { BigNumberish } from '@ethersproject/bignumber';
import { GetBaseNftsForContractOptions, GetBaseNftsForOwnerOptions, GetFloorPriceResponse, GetNftsForContractOptions, GetNftsForOwnerOptions, GetOwnersForContractResponse, GetOwnersForNftResponse, NftContractBaseNftsResponse, NftContractNftsResponse, NftTokenType, OwnedBaseNft, OwnedBaseNftsResponse, OwnedNft, OwnedNftsResponse, RefreshContractResult } from '../types/types';
import { BaseNft, Nft, NftContract } from './nft';
import { AlchemyConfig } from './alchemy-config';
/**
* The NFT namespace contains all the functionality related to NFTs.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.nft`.
*/
export declare class NftNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -14,5 +19,9 @@ * Get the NFT metadata associated with the provided parameters.

* @param tokenType - Optionally specify the type of token to speed up the query.
* @param tokenUriTimeoutInMs - No set timeout by default - When metadata is
* requested, this parameter is the timeout (in milliseconds) for the
* website hosting the metadata to respond. If you want to only access the
* cache and not live fetch any metadata for cache misses then set this value to 0.
* @public
*/
getNftMetadata(contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType): Promise<Nft>;
getNftMetadata(contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, tokenUriTimeoutInMs?: number): Promise<Nft>;
/**

@@ -19,0 +28,0 @@ * Get the NFT collection metadata associated with the provided parameters.

@@ -1,7 +0,13 @@

import { AlchemyConfig } from './alchemy-config';
import { SendPrivateTransactionOptions } from '../types/types';
import { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider';
/**
* The Transact namespace contains methods used for sending transactions and
* checking on the state of submitted transactions.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.transact`.
*/
export declare class TransactNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -8,0 +14,0 @@ * Used to send a single transaction to Flashbots. Flashbots will attempt to

import { AlchemyEventType } from '../types/types';
import type { Listener } from '@ethersproject/abstract-provider';
import { AlchemyConfig } from './alchemy-config';
/**
* The Websocket namespace contains all subscription related functions that
* allow you to subscribe to events and receive updates as they occur. The
* underlying WebSocket provider has additional logic to handle reconnections
* and automatically backfills missed events.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.ws`.
*/
export declare class WebSocketNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -8,0 +16,0 @@ * Adds a listener to be triggered for each {@link eventName} event. Also

/** This is the main entry point for the library and exports user-facing API. */
export * from './types/types';
export { Alchemy } from './api/alchemy';
export { Wallet } from './api/alchemy-wallet';
export type { AlchemyConfig } from './api/alchemy-config';

@@ -5,0 +6,0 @@ export type { AlchemyProvider } from './api/alchemy-provider';

@@ -5,3 +5,3 @@ import { BigNumberish } from '@ethersproject/bignumber';

import { AlchemyConfig } from '../api/alchemy-config';
export declare function getNftMetadata(config: AlchemyConfig, contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, srcMethod?: string): Promise<Nft>;
export declare function getNftMetadata(config: AlchemyConfig, contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, tokenUriTimeoutInMs?: number, srcMethod?: string): Promise<Nft>;
export declare function getContractMetadata(config: AlchemyConfig, contractAddress: string, srcMethod?: string): Promise<NftContract>;

@@ -8,0 +8,0 @@ export declare function getNftsForOwnerIterator(config: AlchemyConfig, owner: string, options?: GetNftsForOwnerOptions | GetBaseNftsForOwnerOptions, srcMethod?: string): AsyncIterable<OwnedBaseNft | OwnedNft>;

@@ -46,4 +46,6 @@ import { EventType, TransactionReceipt } from '@ethersproject/abstract-provider';

ARB_RINKEBY = "arb-rinkeby",
ARB_GOERLI = "arb-goerli",
MATIC_MAINNET = "polygon-mainnet",
MATIC_MUMBAI = "polygon-mumbai"
MATIC_MUMBAI = "polygon-mumbai",
ASTAR_MAINNET = "astar-mainnet"
}

@@ -69,38 +71,125 @@ /** @public */

}
/** @public */
/**
* Response object for the {@link CoreNamespace.getTokenMetadata} method.
*
* @public
*/
export interface TokenMetadataResponse {
/**
* The token's name. Is `null` if the name is not defined in the contract and
* not available from other sources.
*/
name: string | null;
/**
* The token's symbol. Is `null` if the symbol is not defined in the contract
* and not available from other sources.
*/
symbol: string | null;
/**
* The number of decimals of the token. Returns `null` if not defined in the
* contract and not available from other sources.
*/
decimals: number | null;
/** URL link to the token's logo. Is `null` if the logo is not available. */
logo: string | null;
name: string | null;
symbol: string | null;
}
/** @public */
/**
* Parameters for the {@link CoreNamespace.getAssetTransfers} method.
*
* @public
*/
export interface AssetTransfersParams {
/**
* The starting block to check for transfers. This value is inclusive and
* defaults to `0x0` if omitted.
*/
fromBlock?: string;
/**
* The ending block to check for transfers. This value is inclusive and
* defaults to the latest block if omitted.
*/
toBlock?: string;
/**
* Whether to return results in ascending or descending order by block number.
* Defaults to ascending if omitted.
*/
order?: AssetTransfersOrder;
/**
* The from address to filter transfers by. This value defaults to a wildcard
* for all addresses if omitted.
*/
fromAddress?: string;
/**
* The to address to filter transfers by. This value defaults to a wildcard
* for all address if omitted.
*/
toAddress?: string;
/**
* List of contract addresses to filter for - only applies to "erc20",
* "erc721", "erc1155" transfers. Defaults to all address if omitted.
*/
contractAddresses?: string[];
/**
* Whether to exclude transfers with zero value. Note that zero value is
* different than null value. Defaults to `false` if omitted.
*/
excludeZeroValue?: boolean;
/** REQUIRED field. An array of categories to get transfers for. */
category: AssetTransfersCategory[];
/** The maximum number of results to return per page. Defaults to 1000 if omitted. */
maxCount?: number;
category: AssetTransfersCategory[];
/**
* Optional page key from an existing {@link OwnedBaseNftsResponse}
* {@link AssetTransfersResult}to use for pagination.
*/
pageKey?: string;
/**
* Whether to include additional metadata about each transfer event. Defaults
* to `false` if omitted.
*/
withMetadata?: boolean;
}
/** @public */
/**
* Parameters for the {@link CoreNamespace.getAssetTransfers} method that
* includes metadata.
*
* @public
*/
export interface AssetTransfersWithMetadataParams extends AssetTransfersParams {
withMetadata: true;
}
/**
* Categories of transfers to use with the {@link AssetTransfersParams} request
* object when using {@link CoreNamespace.getAssetTransfers}.
*
* @public
*/
export declare enum AssetTransfersCategory {
/**
* Top level ETH transactions that occur where the `fromAddress` is an
* external user-created address. External addresses have private keys and are
* accessed by users.
*/
EXTERNAL = "external",
/**
* Top level ETH transactions that occur where the `fromAddress` is an
* internal, smart contract address. For example, a smart contract calling
* another smart contract or sending
*/
INTERNAL = "internal",
/** ERC20 transfers. */
ERC20 = "erc20",
/** ERC721 transfers. */
ERC721 = "erc721",
/** ERC1155 transfers. */
ERC1155 = "erc1155",
/**
* Special contracts that don't follow ERC 721/1155, (ex: CryptoKitties).
*
* @beta
*/
/** Special contracts that don't follow ERC 721/1155, (ex: CryptoKitties). */
SPECIALNFT = "specialnft"
}
/** @public */
/**
* Enum for the order of the {@link AssetTransfersParams} request object when
* using {@link CoreNamespace.getAssetTransfers}.
*
* @public
*/
export declare enum AssetTransfersOrder {

@@ -110,3 +199,7 @@ ASCENDING = "asc",

}
/** @public */
/**
* An enum for specifying the token type on NFTs.
*
* @public
*/
export declare enum NftTokenType {

@@ -117,24 +210,81 @@ ERC721 = "ERC721",

}
/** @public */
/**
* Response object for the {@link CoreNamespace.getAssetTransfers} method.
*
* @public
*/
export interface AssetTransfersResponse {
transfers: AssetTransfersResult[];
/** Page key for the next page of results, if one exists. */
pageKey?: string;
}
/** @public */
/**
* Response object for the {@link CoreNamespace.getAssetTransfers} method when
* the {@link AssetTransfersWithMetadataParams} are used.
*
* @public
*/
export interface AssetTransfersWithMetadataResponse {
transfers: AssetTransfersWithMetadataResult[];
pageKey?: string;
}
/**
* Represents a transfer event that is returned in a {@link AssetTransfersResponse}.
*
* @public
*/
export interface AssetTransfersResult {
/** The category of the transfer. */
category: AssetTransfersCategory;
/** The block number where the transfer occurred. */
blockNum: string;
/** The from address of the transfer. */
from: string;
/** The to address of the transfer. */
to: string | null;
/**
* Converted asset transfer value as a number (raw value divided by contract
* decimal). `null` if ERC721 transfer or contract decimal not available.
*/
value: number | null;
/**
* The raw ERC721 token id of the transfer as a hex string. `null` if not an
* ERC721 transfer.
*/
erc721TokenId: string | null;
/**
* A list of ERC1155 metadata objects if the asset transferred is an ERC1155
* token. `null` if not an ERC1155 transfer.
*/
erc1155Metadata: ERC1155Metadata[] | null;
/** The token id of the token transferred. */
tokenId: string | null;
/**
* Returns the token's symbol or ETH for other transfers. `null` if the
* information was not available.
*/
asset: string | null;
/** The transaction hash of the transfer transaction. */
hash: string;
/** Information about the raw contract of the asset transferred. */
rawContract: RawContract;
metadata?: AssetTransfersMetadata;
}
/** @public */
/**
* Represents a transfer event that is returned in a
* {@link AssetTransfersResponse} when {@link AssetTransfersWithMetadataParams} are used.
*
* @public
*/
export interface AssetTransfersWithMetadataResult extends AssetTransfersResult {
/** Additional metadata about the transfer event. */
metadata: AssetTransfersMetadata;
}
/**
* The metadata object for a {@link AssetTransfersResult} when the
* {@link AssetTransfersParams.withMetadata} field is set to true.
*
* @public
*/
export interface AssetTransfersMetadata {
/** Timestamp of the block from which the transaction event originated. */
blockTimestamp: string;

@@ -222,4 +372,16 @@ }

excludeFilters?: NftExcludeFilters[];
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/** Optional boolean flag to omit NFT metadata. Defaults to `false`. */
omitMetadata?: boolean;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -248,4 +410,16 @@ /**

excludeFilters?: NftExcludeFilters[];
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/** Optional boolean flag to include NFT metadata. Defaults to `false`. */
omitMetadata: true;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -402,17 +576,41 @@ /**

}
/** @public */
/**
* The parameter field of {@link TransactionReceiptsParams}.
*
* @public
*/
export interface TransactionReceiptsBlockNumber {
/** The block number to get transaction receipts for. */
blockNumber: string;
}
/** @public */
/**
* The parameter field of {@link TransactionReceiptsParams}.
*
* @public
*/
export interface TransactionReceiptsBlockHash {
/** The block hash to get transaction receipts for. */
blockHash: string;
}
/** @public */
/**
* The parameters to use with the {@link CoreNamespace.getTransactionReceipts} method.
*
* @public
*/
export declare type TransactionReceiptsParams = TransactionReceiptsBlockNumber | TransactionReceiptsBlockHash;
/** @public */
/**
* Response object for a {@link CoreNamespace.getTransactionReceipts} call.
*
* @public
*/
export interface TransactionReceiptsResponse {
/** A list of transaction receipts for the queried block. */
receipts: TransactionReceipt[] | null;
}
/** @public */
/**
* Metadata object returned in a {@link AssetTransfersResult} object if the asset
* transferred is an ERC1155.
*
* @public
*/
export interface ERC1155Metadata {

@@ -422,6 +620,20 @@ tokenId: string;

}
/** @public */
/**
* Information about the underlying contract for the asset that was transferred
* in a {@link AssetTransfersResult} object.
*
* @public
*/
export interface RawContract {
/**
* The raw transfer value as a hex string. `null` if the transfer was for an
* ERC721 or ERC1155 token.
*/
value: string | null;
/** The contract address. `null` if it was an internal or external transfer. */
address: string | null;
/**
* The number of decimals in the contract as a hex string. `null` if the value
* is not in the contract and not available from other sources.
*/
decimal: string | null;

@@ -446,4 +658,14 @@ }

omitMetadata?: boolean;
/** Sets the total number of NFTs to return in the response. Defaults to 100. */
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -467,3 +689,6 @@ /**

omitMetadata: false;
/** Sets the total number of NFTs to return in the response. Defaults to 100. */
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;

@@ -470,0 +695,0 @@ }

import { Network } from '../types/types';
import { Network as NetworkFromEthers } from '@ethersproject/networks';
export declare const DEFAULT_CONTRACT_ADDRESSES = "DEFAULT_TOKENS";

@@ -27,6 +28,16 @@ export declare const DEFAULT_ALCHEMY_API_KEY = "demo";

"arb-rinkeby": string;
"arb-goerli": string;
"polygon-mainnet": string;
"polygon-mumbai": string;
"astar-mainnet": string;
};
/**
* Mapping of network names to their corresponding Ethers Network objects. These
* networks are not yet supported by Ethers and are listed here to be overriden
* in the provider.
*/
export declare const CustomNetworks: {
[key: string]: NetworkFromEthers;
};
export declare function noop(): void;
export declare const ETH_NULL_VALUE = "0x";

@@ -1,1 +0,1 @@

export declare const VERSION = "2.0.1";
export declare const VERSION = "2.0.3";

@@ -1,4 +0,5 @@

export { A as Alchemy, c as AssetTransfersCategory, d as AssetTransfersOrder, N as Network, h as NftExcludeFilters, e as NftTokenType, R as RefreshState, f as fromHex, i as isHex, s as setLogLevel, t as toHex } from './index-8998d743.js';
export { A as Alchemy, c as AssetTransfersCategory, d as AssetTransfersOrder, N as Network, h as NftExcludeFilters, e as NftTokenType, R as RefreshState, W as Wallet, f as fromHex, i as isHex, s as setLogLevel, t as toHex } from './index-dddbb41a.js';
import '@ethersproject/bignumber';
import 'axios';
import '@ethersproject/wallet';
//# sourceMappingURL=index.js.map

@@ -1,2 +0,1 @@

import { AlchemyConfig } from './alchemy-config';
import type { Block, BlockTag, BlockWithTransactions, FeeData, Filter, FilterByBlockHash, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from '@ethersproject/abstract-provider';

@@ -6,6 +5,16 @@ import type { BigNumber, BigNumberish } from '@ethersproject/bignumber';

import type { Deferrable } from '@ethersproject/properties';
import { AssetTransfersParams, AssetTransfersResponse, DeployResult, TokenBalancesResponse, TokenMetadataResponse, TransactionReceiptsParams, TransactionReceiptsResponse } from '../types/types';
import { AssetTransfersParams, AssetTransfersResponse, AssetTransfersWithMetadataParams, AssetTransfersWithMetadataResponse, DeployResult, TokenBalancesResponse, TokenMetadataResponse, TransactionReceiptsParams, TransactionReceiptsResponse } from '../types/types';
/**
* The core namespace contains all commonly-used [Ethers.js
* Provider](https://docs.ethers.io/v5/api/providers/api-providers/#AlchemyProvider)
* methods. If you are already using Ethers.js, you should be simply able to
* replace the Ethers.js Provider object with `alchemy.core` when accessing
* provider methods and it should just work.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.core`.
*/
export declare class CoreNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -233,2 +242,15 @@ * Returns the balance of a given address as of the provided block.

*
* This overload requires {@link AssetTransfersWithMetadataParams.withMetadata}
* to be set to `true`, which results in additional metadata returned in the
* response object.
*
* @param params An object containing fields for the asset transfer query
* @public
*/
getAssetTransfers(params: AssetTransfersWithMetadataParams): Promise<AssetTransfersWithMetadataResponse>;
/**
* Get transactions for specific addresses. See the web documentation for the
* full details:
* https://docs.alchemy.com/alchemy/enhanced-apis/transfers-api#alchemy_getassettransfers
*
* @param params An object containing fields for the asset transfer query.

@@ -235,0 +257,0 @@ * @public

import type { BigNumberish } from '@ethersproject/bignumber';
import { GetBaseNftsForContractOptions, GetBaseNftsForOwnerOptions, GetFloorPriceResponse, GetNftsForContractOptions, GetNftsForOwnerOptions, GetOwnersForContractResponse, GetOwnersForNftResponse, NftContractBaseNftsResponse, NftContractNftsResponse, NftTokenType, OwnedBaseNft, OwnedBaseNftsResponse, OwnedNft, OwnedNftsResponse, RefreshContractResult } from '../types/types';
import { BaseNft, Nft, NftContract } from './nft';
import { AlchemyConfig } from './alchemy-config';
/**
* The NFT namespace contains all the functionality related to NFTs.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.nft`.
*/
export declare class NftNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -14,5 +19,9 @@ * Get the NFT metadata associated with the provided parameters.

* @param tokenType - Optionally specify the type of token to speed up the query.
* @param tokenUriTimeoutInMs - No set timeout by default - When metadata is
* requested, this parameter is the timeout (in milliseconds) for the
* website hosting the metadata to respond. If you want to only access the
* cache and not live fetch any metadata for cache misses then set this value to 0.
* @public
*/
getNftMetadata(contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType): Promise<Nft>;
getNftMetadata(contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, tokenUriTimeoutInMs?: number): Promise<Nft>;
/**

@@ -19,0 +28,0 @@ * Get the NFT collection metadata associated with the provided parameters.

@@ -1,7 +0,13 @@

import { AlchemyConfig } from './alchemy-config';
import { SendPrivateTransactionOptions } from '../types/types';
import { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider';
/**
* The Transact namespace contains methods used for sending transactions and
* checking on the state of submitted transactions.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.transact`.
*/
export declare class TransactNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -8,0 +14,0 @@ * Used to send a single transaction to Flashbots. Flashbots will attempt to

import { AlchemyEventType } from '../types/types';
import type { Listener } from '@ethersproject/abstract-provider';
import { AlchemyConfig } from './alchemy-config';
/**
* The Websocket namespace contains all subscription related functions that
* allow you to subscribe to events and receive updates as they occur. The
* underlying WebSocket provider has additional logic to handle reconnections
* and automatically backfills missed events.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.ws`.
*/
export declare class WebSocketNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -8,0 +16,0 @@ * Adds a listener to be triggered for each {@link eventName} event. Also

/** This is the main entry point for the library and exports user-facing API. */
export * from './types/types';
export { Alchemy } from './api/alchemy';
export { Wallet } from './api/alchemy-wallet';
export type { AlchemyConfig } from './api/alchemy-config';

@@ -5,0 +6,0 @@ export type { AlchemyProvider } from './api/alchemy-provider';

@@ -5,3 +5,3 @@ import { BigNumberish } from '@ethersproject/bignumber';

import { AlchemyConfig } from '../api/alchemy-config';
export declare function getNftMetadata(config: AlchemyConfig, contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, srcMethod?: string): Promise<Nft>;
export declare function getNftMetadata(config: AlchemyConfig, contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, tokenUriTimeoutInMs?: number, srcMethod?: string): Promise<Nft>;
export declare function getContractMetadata(config: AlchemyConfig, contractAddress: string, srcMethod?: string): Promise<NftContract>;

@@ -8,0 +8,0 @@ export declare function getNftsForOwnerIterator(config: AlchemyConfig, owner: string, options?: GetNftsForOwnerOptions | GetBaseNftsForOwnerOptions, srcMethod?: string): AsyncIterable<OwnedBaseNft | OwnedNft>;

@@ -46,4 +46,6 @@ import { EventType, TransactionReceipt } from '@ethersproject/abstract-provider';

ARB_RINKEBY = "arb-rinkeby",
ARB_GOERLI = "arb-goerli",
MATIC_MAINNET = "polygon-mainnet",
MATIC_MUMBAI = "polygon-mumbai"
MATIC_MUMBAI = "polygon-mumbai",
ASTAR_MAINNET = "astar-mainnet"
}

@@ -69,38 +71,125 @@ /** @public */

}
/** @public */
/**
* Response object for the {@link CoreNamespace.getTokenMetadata} method.
*
* @public
*/
export interface TokenMetadataResponse {
/**
* The token's name. Is `null` if the name is not defined in the contract and
* not available from other sources.
*/
name: string | null;
/**
* The token's symbol. Is `null` if the symbol is not defined in the contract
* and not available from other sources.
*/
symbol: string | null;
/**
* The number of decimals of the token. Returns `null` if not defined in the
* contract and not available from other sources.
*/
decimals: number | null;
/** URL link to the token's logo. Is `null` if the logo is not available. */
logo: string | null;
name: string | null;
symbol: string | null;
}
/** @public */
/**
* Parameters for the {@link CoreNamespace.getAssetTransfers} method.
*
* @public
*/
export interface AssetTransfersParams {
/**
* The starting block to check for transfers. This value is inclusive and
* defaults to `0x0` if omitted.
*/
fromBlock?: string;
/**
* The ending block to check for transfers. This value is inclusive and
* defaults to the latest block if omitted.
*/
toBlock?: string;
/**
* Whether to return results in ascending or descending order by block number.
* Defaults to ascending if omitted.
*/
order?: AssetTransfersOrder;
/**
* The from address to filter transfers by. This value defaults to a wildcard
* for all addresses if omitted.
*/
fromAddress?: string;
/**
* The to address to filter transfers by. This value defaults to a wildcard
* for all address if omitted.
*/
toAddress?: string;
/**
* List of contract addresses to filter for - only applies to "erc20",
* "erc721", "erc1155" transfers. Defaults to all address if omitted.
*/
contractAddresses?: string[];
/**
* Whether to exclude transfers with zero value. Note that zero value is
* different than null value. Defaults to `false` if omitted.
*/
excludeZeroValue?: boolean;
/** REQUIRED field. An array of categories to get transfers for. */
category: AssetTransfersCategory[];
/** The maximum number of results to return per page. Defaults to 1000 if omitted. */
maxCount?: number;
category: AssetTransfersCategory[];
/**
* Optional page key from an existing {@link OwnedBaseNftsResponse}
* {@link AssetTransfersResult}to use for pagination.
*/
pageKey?: string;
/**
* Whether to include additional metadata about each transfer event. Defaults
* to `false` if omitted.
*/
withMetadata?: boolean;
}
/** @public */
/**
* Parameters for the {@link CoreNamespace.getAssetTransfers} method that
* includes metadata.
*
* @public
*/
export interface AssetTransfersWithMetadataParams extends AssetTransfersParams {
withMetadata: true;
}
/**
* Categories of transfers to use with the {@link AssetTransfersParams} request
* object when using {@link CoreNamespace.getAssetTransfers}.
*
* @public
*/
export declare enum AssetTransfersCategory {
/**
* Top level ETH transactions that occur where the `fromAddress` is an
* external user-created address. External addresses have private keys and are
* accessed by users.
*/
EXTERNAL = "external",
/**
* Top level ETH transactions that occur where the `fromAddress` is an
* internal, smart contract address. For example, a smart contract calling
* another smart contract or sending
*/
INTERNAL = "internal",
/** ERC20 transfers. */
ERC20 = "erc20",
/** ERC721 transfers. */
ERC721 = "erc721",
/** ERC1155 transfers. */
ERC1155 = "erc1155",
/**
* Special contracts that don't follow ERC 721/1155, (ex: CryptoKitties).
*
* @beta
*/
/** Special contracts that don't follow ERC 721/1155, (ex: CryptoKitties). */
SPECIALNFT = "specialnft"
}
/** @public */
/**
* Enum for the order of the {@link AssetTransfersParams} request object when
* using {@link CoreNamespace.getAssetTransfers}.
*
* @public
*/
export declare enum AssetTransfersOrder {

@@ -110,3 +199,7 @@ ASCENDING = "asc",

}
/** @public */
/**
* An enum for specifying the token type on NFTs.
*
* @public
*/
export declare enum NftTokenType {

@@ -117,24 +210,81 @@ ERC721 = "ERC721",

}
/** @public */
/**
* Response object for the {@link CoreNamespace.getAssetTransfers} method.
*
* @public
*/
export interface AssetTransfersResponse {
transfers: AssetTransfersResult[];
/** Page key for the next page of results, if one exists. */
pageKey?: string;
}
/** @public */
/**
* Response object for the {@link CoreNamespace.getAssetTransfers} method when
* the {@link AssetTransfersWithMetadataParams} are used.
*
* @public
*/
export interface AssetTransfersWithMetadataResponse {
transfers: AssetTransfersWithMetadataResult[];
pageKey?: string;
}
/**
* Represents a transfer event that is returned in a {@link AssetTransfersResponse}.
*
* @public
*/
export interface AssetTransfersResult {
/** The category of the transfer. */
category: AssetTransfersCategory;
/** The block number where the transfer occurred. */
blockNum: string;
/** The from address of the transfer. */
from: string;
/** The to address of the transfer. */
to: string | null;
/**
* Converted asset transfer value as a number (raw value divided by contract
* decimal). `null` if ERC721 transfer or contract decimal not available.
*/
value: number | null;
/**
* The raw ERC721 token id of the transfer as a hex string. `null` if not an
* ERC721 transfer.
*/
erc721TokenId: string | null;
/**
* A list of ERC1155 metadata objects if the asset transferred is an ERC1155
* token. `null` if not an ERC1155 transfer.
*/
erc1155Metadata: ERC1155Metadata[] | null;
/** The token id of the token transferred. */
tokenId: string | null;
/**
* Returns the token's symbol or ETH for other transfers. `null` if the
* information was not available.
*/
asset: string | null;
/** The transaction hash of the transfer transaction. */
hash: string;
/** Information about the raw contract of the asset transferred. */
rawContract: RawContract;
metadata?: AssetTransfersMetadata;
}
/** @public */
/**
* Represents a transfer event that is returned in a
* {@link AssetTransfersResponse} when {@link AssetTransfersWithMetadataParams} are used.
*
* @public
*/
export interface AssetTransfersWithMetadataResult extends AssetTransfersResult {
/** Additional metadata about the transfer event. */
metadata: AssetTransfersMetadata;
}
/**
* The metadata object for a {@link AssetTransfersResult} when the
* {@link AssetTransfersParams.withMetadata} field is set to true.
*
* @public
*/
export interface AssetTransfersMetadata {
/** Timestamp of the block from which the transaction event originated. */
blockTimestamp: string;

@@ -222,4 +372,16 @@ }

excludeFilters?: NftExcludeFilters[];
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/** Optional boolean flag to omit NFT metadata. Defaults to `false`. */
omitMetadata?: boolean;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -248,4 +410,16 @@ /**

excludeFilters?: NftExcludeFilters[];
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/** Optional boolean flag to include NFT metadata. Defaults to `false`. */
omitMetadata: true;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -402,17 +576,41 @@ /**

}
/** @public */
/**
* The parameter field of {@link TransactionReceiptsParams}.
*
* @public
*/
export interface TransactionReceiptsBlockNumber {
/** The block number to get transaction receipts for. */
blockNumber: string;
}
/** @public */
/**
* The parameter field of {@link TransactionReceiptsParams}.
*
* @public
*/
export interface TransactionReceiptsBlockHash {
/** The block hash to get transaction receipts for. */
blockHash: string;
}
/** @public */
/**
* The parameters to use with the {@link CoreNamespace.getTransactionReceipts} method.
*
* @public
*/
export declare type TransactionReceiptsParams = TransactionReceiptsBlockNumber | TransactionReceiptsBlockHash;
/** @public */
/**
* Response object for a {@link CoreNamespace.getTransactionReceipts} call.
*
* @public
*/
export interface TransactionReceiptsResponse {
/** A list of transaction receipts for the queried block. */
receipts: TransactionReceipt[] | null;
}
/** @public */
/**
* Metadata object returned in a {@link AssetTransfersResult} object if the asset
* transferred is an ERC1155.
*
* @public
*/
export interface ERC1155Metadata {

@@ -422,6 +620,20 @@ tokenId: string;

}
/** @public */
/**
* Information about the underlying contract for the asset that was transferred
* in a {@link AssetTransfersResult} object.
*
* @public
*/
export interface RawContract {
/**
* The raw transfer value as a hex string. `null` if the transfer was for an
* ERC721 or ERC1155 token.
*/
value: string | null;
/** The contract address. `null` if it was an internal or external transfer. */
address: string | null;
/**
* The number of decimals in the contract as a hex string. `null` if the value
* is not in the contract and not available from other sources.
*/
decimal: string | null;

@@ -446,4 +658,14 @@ }

omitMetadata?: boolean;
/** Sets the total number of NFTs to return in the response. Defaults to 100. */
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -467,3 +689,6 @@ /**

omitMetadata: false;
/** Sets the total number of NFTs to return in the response. Defaults to 100. */
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;

@@ -470,0 +695,0 @@ }

import { Network } from '../types/types';
import { Network as NetworkFromEthers } from '@ethersproject/networks';
export declare const DEFAULT_CONTRACT_ADDRESSES = "DEFAULT_TOKENS";

@@ -27,6 +28,16 @@ export declare const DEFAULT_ALCHEMY_API_KEY = "demo";

"arb-rinkeby": string;
"arb-goerli": string;
"polygon-mainnet": string;
"polygon-mumbai": string;
"astar-mainnet": string;
};
/**
* Mapping of network names to their corresponding Ethers Network objects. These
* networks are not yet supported by Ethers and are listed here to be overriden
* in the provider.
*/
export declare const CustomNetworks: {
[key: string]: NetworkFromEthers;
};
export declare function noop(): void;
export declare const ETH_NULL_VALUE = "0x";

@@ -1,1 +0,1 @@

export declare const VERSION = "2.0.1";
export declare const VERSION = "2.0.3";

@@ -1,2 +0,1 @@

import { AlchemyConfig } from './alchemy-config';
import type { Block, BlockTag, BlockWithTransactions, FeeData, Filter, FilterByBlockHash, Log, TransactionReceipt, TransactionRequest, TransactionResponse } from '@ethersproject/abstract-provider';

@@ -6,6 +5,16 @@ import type { BigNumber, BigNumberish } from '@ethersproject/bignumber';

import type { Deferrable } from '@ethersproject/properties';
import { AssetTransfersParams, AssetTransfersResponse, DeployResult, TokenBalancesResponse, TokenMetadataResponse, TransactionReceiptsParams, TransactionReceiptsResponse } from '../types/types';
import { AssetTransfersParams, AssetTransfersResponse, AssetTransfersWithMetadataParams, AssetTransfersWithMetadataResponse, DeployResult, TokenBalancesResponse, TokenMetadataResponse, TransactionReceiptsParams, TransactionReceiptsResponse } from '../types/types';
/**
* The core namespace contains all commonly-used [Ethers.js
* Provider](https://docs.ethers.io/v5/api/providers/api-providers/#AlchemyProvider)
* methods. If you are already using Ethers.js, you should be simply able to
* replace the Ethers.js Provider object with `alchemy.core` when accessing
* provider methods and it should just work.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.core`.
*/
export declare class CoreNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -233,2 +242,15 @@ * Returns the balance of a given address as of the provided block.

*
* This overload requires {@link AssetTransfersWithMetadataParams.withMetadata}
* to be set to `true`, which results in additional metadata returned in the
* response object.
*
* @param params An object containing fields for the asset transfer query
* @public
*/
getAssetTransfers(params: AssetTransfersWithMetadataParams): Promise<AssetTransfersWithMetadataResponse>;
/**
* Get transactions for specific addresses. See the web documentation for the
* full details:
* https://docs.alchemy.com/alchemy/enhanced-apis/transfers-api#alchemy_getassettransfers
*
* @param params An object containing fields for the asset transfer query.

@@ -235,0 +257,0 @@ * @public

import type { BigNumberish } from '@ethersproject/bignumber';
import { GetBaseNftsForContractOptions, GetBaseNftsForOwnerOptions, GetFloorPriceResponse, GetNftsForContractOptions, GetNftsForOwnerOptions, GetOwnersForContractResponse, GetOwnersForNftResponse, NftContractBaseNftsResponse, NftContractNftsResponse, NftTokenType, OwnedBaseNft, OwnedBaseNftsResponse, OwnedNft, OwnedNftsResponse, RefreshContractResult } from '../types/types';
import { BaseNft, Nft, NftContract } from './nft';
import { AlchemyConfig } from './alchemy-config';
/**
* The NFT namespace contains all the functionality related to NFTs.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.nft`.
*/
export declare class NftNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -14,5 +19,9 @@ * Get the NFT metadata associated with the provided parameters.

* @param tokenType - Optionally specify the type of token to speed up the query.
* @param tokenUriTimeoutInMs - No set timeout by default - When metadata is
* requested, this parameter is the timeout (in milliseconds) for the
* website hosting the metadata to respond. If you want to only access the
* cache and not live fetch any metadata for cache misses then set this value to 0.
* @public
*/
getNftMetadata(contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType): Promise<Nft>;
getNftMetadata(contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, tokenUriTimeoutInMs?: number): Promise<Nft>;
/**

@@ -19,0 +28,0 @@ * Get the NFT collection metadata associated with the provided parameters.

@@ -1,7 +0,13 @@

import { AlchemyConfig } from './alchemy-config';
import { SendPrivateTransactionOptions } from '../types/types';
import { TransactionReceipt, TransactionResponse } from '@ethersproject/abstract-provider';
/**
* The Transact namespace contains methods used for sending transactions and
* checking on the state of submitted transactions.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.transact`.
*/
export declare class TransactNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -8,0 +14,0 @@ * Used to send a single transaction to Flashbots. Flashbots will attempt to

import { AlchemyEventType } from '../types/types';
import type { Listener } from '@ethersproject/abstract-provider';
import { AlchemyConfig } from './alchemy-config';
/**
* The Websocket namespace contains all subscription related functions that
* allow you to subscribe to events and receive updates as they occur. The
* underlying WebSocket provider has additional logic to handle reconnections
* and automatically backfills missed events.
*
* Do not call this constructor directly. Instead, instantiate an Alchemy object
* with `const alchemy = new Alchemy(config)` and then access the core namespace
* via `alchemy.ws`.
*/
export declare class WebSocketNamespace {
private readonly config;
constructor(config: AlchemyConfig);
/**

@@ -8,0 +16,0 @@ * Adds a listener to be triggered for each {@link eventName} event. Also

/** This is the main entry point for the library and exports user-facing API. */
export * from './types/types';
export { Alchemy } from './api/alchemy';
export { Wallet } from './api/alchemy-wallet';
export type { AlchemyConfig } from './api/alchemy-config';

@@ -5,0 +6,0 @@ export type { AlchemyProvider } from './api/alchemy-provider';

@@ -5,3 +5,3 @@ import { BigNumberish } from '@ethersproject/bignumber';

import { AlchemyConfig } from '../api/alchemy-config';
export declare function getNftMetadata(config: AlchemyConfig, contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, srcMethod?: string): Promise<Nft>;
export declare function getNftMetadata(config: AlchemyConfig, contractAddress: string, tokenId: BigNumberish, tokenType?: NftTokenType, tokenUriTimeoutInMs?: number, srcMethod?: string): Promise<Nft>;
export declare function getContractMetadata(config: AlchemyConfig, contractAddress: string, srcMethod?: string): Promise<NftContract>;

@@ -8,0 +8,0 @@ export declare function getNftsForOwnerIterator(config: AlchemyConfig, owner: string, options?: GetNftsForOwnerOptions | GetBaseNftsForOwnerOptions, srcMethod?: string): AsyncIterable<OwnedBaseNft | OwnedNft>;

@@ -46,4 +46,6 @@ import { EventType, TransactionReceipt } from '@ethersproject/abstract-provider';

ARB_RINKEBY = "arb-rinkeby",
ARB_GOERLI = "arb-goerli",
MATIC_MAINNET = "polygon-mainnet",
MATIC_MUMBAI = "polygon-mumbai"
MATIC_MUMBAI = "polygon-mumbai",
ASTAR_MAINNET = "astar-mainnet"
}

@@ -69,38 +71,125 @@ /** @public */

}
/** @public */
/**
* Response object for the {@link CoreNamespace.getTokenMetadata} method.
*
* @public
*/
export interface TokenMetadataResponse {
/**
* The token's name. Is `null` if the name is not defined in the contract and
* not available from other sources.
*/
name: string | null;
/**
* The token's symbol. Is `null` if the symbol is not defined in the contract
* and not available from other sources.
*/
symbol: string | null;
/**
* The number of decimals of the token. Returns `null` if not defined in the
* contract and not available from other sources.
*/
decimals: number | null;
/** URL link to the token's logo. Is `null` if the logo is not available. */
logo: string | null;
name: string | null;
symbol: string | null;
}
/** @public */
/**
* Parameters for the {@link CoreNamespace.getAssetTransfers} method.
*
* @public
*/
export interface AssetTransfersParams {
/**
* The starting block to check for transfers. This value is inclusive and
* defaults to `0x0` if omitted.
*/
fromBlock?: string;
/**
* The ending block to check for transfers. This value is inclusive and
* defaults to the latest block if omitted.
*/
toBlock?: string;
/**
* Whether to return results in ascending or descending order by block number.
* Defaults to ascending if omitted.
*/
order?: AssetTransfersOrder;
/**
* The from address to filter transfers by. This value defaults to a wildcard
* for all addresses if omitted.
*/
fromAddress?: string;
/**
* The to address to filter transfers by. This value defaults to a wildcard
* for all address if omitted.
*/
toAddress?: string;
/**
* List of contract addresses to filter for - only applies to "erc20",
* "erc721", "erc1155" transfers. Defaults to all address if omitted.
*/
contractAddresses?: string[];
/**
* Whether to exclude transfers with zero value. Note that zero value is
* different than null value. Defaults to `false` if omitted.
*/
excludeZeroValue?: boolean;
/** REQUIRED field. An array of categories to get transfers for. */
category: AssetTransfersCategory[];
/** The maximum number of results to return per page. Defaults to 1000 if omitted. */
maxCount?: number;
category: AssetTransfersCategory[];
/**
* Optional page key from an existing {@link OwnedBaseNftsResponse}
* {@link AssetTransfersResult}to use for pagination.
*/
pageKey?: string;
/**
* Whether to include additional metadata about each transfer event. Defaults
* to `false` if omitted.
*/
withMetadata?: boolean;
}
/** @public */
/**
* Parameters for the {@link CoreNamespace.getAssetTransfers} method that
* includes metadata.
*
* @public
*/
export interface AssetTransfersWithMetadataParams extends AssetTransfersParams {
withMetadata: true;
}
/**
* Categories of transfers to use with the {@link AssetTransfersParams} request
* object when using {@link CoreNamespace.getAssetTransfers}.
*
* @public
*/
export declare enum AssetTransfersCategory {
/**
* Top level ETH transactions that occur where the `fromAddress` is an
* external user-created address. External addresses have private keys and are
* accessed by users.
*/
EXTERNAL = "external",
/**
* Top level ETH transactions that occur where the `fromAddress` is an
* internal, smart contract address. For example, a smart contract calling
* another smart contract or sending
*/
INTERNAL = "internal",
/** ERC20 transfers. */
ERC20 = "erc20",
/** ERC721 transfers. */
ERC721 = "erc721",
/** ERC1155 transfers. */
ERC1155 = "erc1155",
/**
* Special contracts that don't follow ERC 721/1155, (ex: CryptoKitties).
*
* @beta
*/
/** Special contracts that don't follow ERC 721/1155, (ex: CryptoKitties). */
SPECIALNFT = "specialnft"
}
/** @public */
/**
* Enum for the order of the {@link AssetTransfersParams} request object when
* using {@link CoreNamespace.getAssetTransfers}.
*
* @public
*/
export declare enum AssetTransfersOrder {

@@ -110,3 +199,7 @@ ASCENDING = "asc",

}
/** @public */
/**
* An enum for specifying the token type on NFTs.
*
* @public
*/
export declare enum NftTokenType {

@@ -117,24 +210,81 @@ ERC721 = "ERC721",

}
/** @public */
/**
* Response object for the {@link CoreNamespace.getAssetTransfers} method.
*
* @public
*/
export interface AssetTransfersResponse {
transfers: AssetTransfersResult[];
/** Page key for the next page of results, if one exists. */
pageKey?: string;
}
/** @public */
/**
* Response object for the {@link CoreNamespace.getAssetTransfers} method when
* the {@link AssetTransfersWithMetadataParams} are used.
*
* @public
*/
export interface AssetTransfersWithMetadataResponse {
transfers: AssetTransfersWithMetadataResult[];
pageKey?: string;
}
/**
* Represents a transfer event that is returned in a {@link AssetTransfersResponse}.
*
* @public
*/
export interface AssetTransfersResult {
/** The category of the transfer. */
category: AssetTransfersCategory;
/** The block number where the transfer occurred. */
blockNum: string;
/** The from address of the transfer. */
from: string;
/** The to address of the transfer. */
to: string | null;
/**
* Converted asset transfer value as a number (raw value divided by contract
* decimal). `null` if ERC721 transfer or contract decimal not available.
*/
value: number | null;
/**
* The raw ERC721 token id of the transfer as a hex string. `null` if not an
* ERC721 transfer.
*/
erc721TokenId: string | null;
/**
* A list of ERC1155 metadata objects if the asset transferred is an ERC1155
* token. `null` if not an ERC1155 transfer.
*/
erc1155Metadata: ERC1155Metadata[] | null;
/** The token id of the token transferred. */
tokenId: string | null;
/**
* Returns the token's symbol or ETH for other transfers. `null` if the
* information was not available.
*/
asset: string | null;
/** The transaction hash of the transfer transaction. */
hash: string;
/** Information about the raw contract of the asset transferred. */
rawContract: RawContract;
metadata?: AssetTransfersMetadata;
}
/** @public */
/**
* Represents a transfer event that is returned in a
* {@link AssetTransfersResponse} when {@link AssetTransfersWithMetadataParams} are used.
*
* @public
*/
export interface AssetTransfersWithMetadataResult extends AssetTransfersResult {
/** Additional metadata about the transfer event. */
metadata: AssetTransfersMetadata;
}
/**
* The metadata object for a {@link AssetTransfersResult} when the
* {@link AssetTransfersParams.withMetadata} field is set to true.
*
* @public
*/
export interface AssetTransfersMetadata {
/** Timestamp of the block from which the transaction event originated. */
blockTimestamp: string;

@@ -222,4 +372,16 @@ }

excludeFilters?: NftExcludeFilters[];
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/** Optional boolean flag to omit NFT metadata. Defaults to `false`. */
omitMetadata?: boolean;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -248,4 +410,16 @@ /**

excludeFilters?: NftExcludeFilters[];
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/** Optional boolean flag to include NFT metadata. Defaults to `false`. */
omitMetadata: true;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -402,17 +576,41 @@ /**

}
/** @public */
/**
* The parameter field of {@link TransactionReceiptsParams}.
*
* @public
*/
export interface TransactionReceiptsBlockNumber {
/** The block number to get transaction receipts for. */
blockNumber: string;
}
/** @public */
/**
* The parameter field of {@link TransactionReceiptsParams}.
*
* @public
*/
export interface TransactionReceiptsBlockHash {
/** The block hash to get transaction receipts for. */
blockHash: string;
}
/** @public */
/**
* The parameters to use with the {@link CoreNamespace.getTransactionReceipts} method.
*
* @public
*/
export declare type TransactionReceiptsParams = TransactionReceiptsBlockNumber | TransactionReceiptsBlockHash;
/** @public */
/**
* Response object for a {@link CoreNamespace.getTransactionReceipts} call.
*
* @public
*/
export interface TransactionReceiptsResponse {
/** A list of transaction receipts for the queried block. */
receipts: TransactionReceipt[] | null;
}
/** @public */
/**
* Metadata object returned in a {@link AssetTransfersResult} object if the asset
* transferred is an ERC1155.
*
* @public
*/
export interface ERC1155Metadata {

@@ -422,6 +620,20 @@ tokenId: string;

}
/** @public */
/**
* Information about the underlying contract for the asset that was transferred
* in a {@link AssetTransfersResult} object.
*
* @public
*/
export interface RawContract {
/**
* The raw transfer value as a hex string. `null` if the transfer was for an
* ERC721 or ERC1155 token.
*/
value: string | null;
/** The contract address. `null` if it was an internal or external transfer. */
address: string | null;
/**
* The number of decimals in the contract as a hex string. `null` if the value
* is not in the contract and not available from other sources.
*/
decimal: string | null;

@@ -446,4 +658,14 @@ }

omitMetadata?: boolean;
/** Sets the total number of NFTs to return in the response. Defaults to 100. */
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;
/**
* No set timeout by default - When metadata is requested, this parameter is
* the timeout (in milliseconds) for the website hosting the metadata to
* respond. If you want to only access the cache and not live fetch any
* metadata for cache misses then set this value to 0.
*/
tokenUriTimeoutInMs?: number;
}

@@ -467,3 +689,6 @@ /**

omitMetadata: false;
/** Sets the total number of NFTs to return in the response. Defaults to 100. */
/**
* Sets the total number of NFTs to return in the response. Defaults to 100.
* Maximum page size is 100.
*/
pageSize?: number;

@@ -470,0 +695,0 @@ }

import { Network } from '../types/types';
import { Network as NetworkFromEthers } from '@ethersproject/networks';
export declare const DEFAULT_CONTRACT_ADDRESSES = "DEFAULT_TOKENS";

@@ -27,6 +28,16 @@ export declare const DEFAULT_ALCHEMY_API_KEY = "demo";

"arb-rinkeby": string;
"arb-goerli": string;
"polygon-mainnet": string;
"polygon-mumbai": string;
"astar-mainnet": string;
};
/**
* Mapping of network names to their corresponding Ethers Network objects. These
* networks are not yet supported by Ethers and are listed here to be overriden
* in the provider.
*/
export declare const CustomNetworks: {
[key: string]: NetworkFromEthers;
};
export declare function noop(): void;
export declare const ETH_NULL_VALUE = "0x";

@@ -1,1 +0,1 @@

export declare const VERSION = "2.0.1";
export declare const VERSION = "2.0.3";
{
"name": "alchemy-sdk",
"version": "2.0.2",
"version": "2.0.3",
"description": "Extended Ethers.js SDK for Alchemy APIs",

@@ -61,2 +61,3 @@ "author": "Alchemy",

"@ethersproject/providers": "^5.6.8",
"@ethersproject/wallet": "^5.6.2",
"@ethersproject/web": "^5.6.1",

@@ -68,2 +69,3 @@ "axios": "^0.26.1",

"devDependencies": {
"@ethersproject/units": "^5.6.1",
"@microsoft/api-documenter": "^7.16.0",

@@ -70,0 +72,0 @@ "@microsoft/api-extractor": "^7.19.5",

@@ -9,9 +9,2 @@ # Alchemy SDK for Javascript

> :warning: **WARNING:** The `@alch/alchemy-sdk` package is now deprecated as of the v2.0.0 release. Please use the `alchemy-sdk` package instead. Note that upgrading from v1 to v2 will be a breaking change. To upgrade to v2.0.0 from v1.X.X, simply run the following in your project root:
```
npm uninstall @alch/alchemy-sdk
npm install alchemy-sdk@latest
```
> 🙋‍♀️ **FEATURE REQUESTS:** We'd love your thoughts on what would improve your web3 dev process the most! If you have 5 minutes, tell us what you want at our [Feature Request feedback form](https://alchemyapi.typeform.com/sdk-feedback), and we'd love to build it for you:

@@ -80,3 +73,3 @@

The core package contains all commonly-used [Ethers.js Provider](https://docs.ethers.io/v5/api/providers/api-providers/#AlchemyProvider) methods. If you are already using Ethers.js, you should be simply able to replace the Ethers.js Provider object with `alchemy.core` and it should just work.
The core namespace contains all commonly-used [Ethers.js Provider](https://docs.ethers.io/v5/api/providers/api-providers/#AlchemyProvider) methods. If you are already using Ethers.js, you should be simply able to replace the Ethers.js Provider object with `alchemy.core` when accessing provider methods and it should just work.

@@ -83,0 +76,0 @@ It also includes the majority of Alchemy Enhanced APIs, including:

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc