@quicknode/sdk 1.1.5 → 2.0.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 +3 -8
- package/cjs/index.js +15 -1093
- package/esm/{src/client → client}/client.js +0 -2
- package/esm/{src/index.js → index.js} +0 -2
- package/esm/lib/validation/ValidateInput.js +16 -0
- package/esm/lib/validation/validators.js +15 -0
- package/index.d.ts +6 -2767
- package/package.json +11 -29
- package/esm/package.json.js +0 -3
- package/esm/src/api/api.js +0 -94
- package/esm/src/api/controllers/contracts.js +0 -34
- package/esm/src/api/controllers/events.js +0 -113
- package/esm/src/api/controllers/nfts.js +0 -227
- package/esm/src/api/controllers/tokens.js +0 -93
- package/esm/src/api/controllers/transactions.js +0 -120
- package/esm/src/api/controllers/utils.js +0 -53
- package/esm/src/api/graphql/customUrqlClient.js +0 -23
- package/esm/src/api/graphql/generatedTypes.js +0 -22
- package/esm/src/api/graphql/modifyQueryForChain.js +0 -28
- package/esm/src/api/index.d.ts +0 -2690
- package/esm/src/api/index.js +0 -2
- package/esm/src/api/types/chains.js +0 -7
- package/esm/src/api/types/contracts/getContractDetails.js +0 -12
- package/esm/src/api/types/events/getAll.js +0 -7
- package/esm/src/api/types/events/getByContract.js +0 -12
- package/esm/src/api/types/nfts/getByContractAddress.js +0 -10
- package/esm/src/api/types/nfts/getByWalletAddress.js +0 -18
- package/esm/src/api/types/nfts/getCollectionDetails.js +0 -11
- package/esm/src/api/types/nfts/getCollectionEvents.js +0 -12
- package/esm/src/api/types/nfts/getNFTDetails.js +0 -9
- package/esm/src/api/types/nfts/getNFTEvents.js +0 -13
- package/esm/src/api/types/nfts/getTrendingCollections.js +0 -7
- package/esm/src/api/types/nfts/verifyOwnershipByAddress.js +0 -12
- package/esm/src/api/types/tokens/getBalancesByWalletAddress.js +0 -12
- package/esm/src/api/types/transactions/getByHash.js +0 -11
- package/esm/src/api/types/transactions/getBySearch.js +0 -7
- package/esm/src/api/types/utils/gasPrices.js +0 -12
- package/esm/src/api/utils/constants.js +0 -3
- package/esm/src/api/utils/helpers.js +0 -11
- package/esm/src/api/utils/isValidENSAddress.js +0 -21
- package/esm/src/api/utils/postQueryFormatter.js +0 -24
- package/esm/src/api/utils/removeNodesAndEdges.js +0 -51
- package/esm/src/lib/validation/ValidateInput.js +0 -35
- package/esm/src/lib/validation/codegenDerivedValidators.js +0 -28
- package/esm/src/lib/validation/validators.js +0 -105
- package/esm/{src/client → client}/index.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/actions.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_fetchNFTCollectionDetails.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_fetchNFTs.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_fetchNFTsByCollection.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getTokenMetadataByContractAddress.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getTokenMetadataBySymbol.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getTransactionsByAddress.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getTransfersByNFT.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getWalletTokenBalance.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_getWalletTokenTransactions.js +0 -0
- package/esm/{src/core → core}/addOns/nftTokenV2/types/qn_verifyNFTsOwner.js +0 -0
- package/esm/{src/core → core}/addOns/shared/helpers.js +0 -0
- package/esm/{src/core → core}/chains.js +0 -0
- package/esm/{src/core → core}/core.js +0 -0
- package/esm/{src/core → core}/index.d.ts +4 -4
- /package/esm/{src/core → core}/index.js +0 -0
- /package/esm/{src/lib → lib}/errors/QNChainNotSupported.js +0 -0
- /package/esm/{src/lib → lib}/errors/QNInputValidationError.js +0 -0
- /package/esm/{src/lib → lib}/errors/QNInvalidEnpointUrl.js +0 -0
- /package/esm/{src/lib → lib}/helpers/globalFetch.js +0 -0
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import QuickNode from './client/client.js';
|
|
2
2
|
export { default } from './client/client.js';
|
|
3
|
-
export { API } from './api/api.js';
|
|
4
3
|
export { Core } from './core/core.js';
|
|
5
4
|
import * as viem from 'viem';
|
|
6
5
|
export { viem };
|
|
7
6
|
export { QNInputValidationError } from './lib/errors/QNInputValidationError.js';
|
|
8
7
|
export { QNInvalidEndpointUrl } from './lib/errors/QNInvalidEnpointUrl.js';
|
|
9
8
|
export { QNChainNotSupported } from './lib/errors/QNChainNotSupported.js';
|
|
10
|
-
export { gql } from '@urql/core';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { QNInputValidationError } from '../errors/QNInputValidationError.js';
|
|
2
|
+
|
|
3
|
+
function formatErrors(baseError) {
|
|
4
|
+
const errorMessages = [];
|
|
5
|
+
baseError.errors.forEach((error) => {
|
|
6
|
+
errorMessages.push(`${error.path.length > 0 ? error.path + ': ' : ''}${error.message}`);
|
|
7
|
+
});
|
|
8
|
+
return errorMessages.length > 0
|
|
9
|
+
? new QNInputValidationError({
|
|
10
|
+
messages: errorMessages,
|
|
11
|
+
zodError: baseError,
|
|
12
|
+
})
|
|
13
|
+
: null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { formatErrors };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
|
|
3
|
+
const isEvmAddress = z
|
|
4
|
+
.string()
|
|
5
|
+
.length(42) // Using built-in function for better error messages
|
|
6
|
+
.startsWith('0x') // Using built-in function for better error messages
|
|
7
|
+
.regex(/^0x[a-fA-F0-9]{40}$/, 'Not a valid address');
|
|
8
|
+
const rpcPaginationParams = z
|
|
9
|
+
.object({
|
|
10
|
+
perPage: z.number().positive().nullish(),
|
|
11
|
+
page: z.number().positive().nullish(),
|
|
12
|
+
})
|
|
13
|
+
.strict();
|
|
14
|
+
|
|
15
|
+
export { isEvmAddress, rpcPaginationParams };
|