@mintbase-js/data
Advanced tools
Comparing version 0.0.4-deployContract.0 to 0.0.4-market-method-restructure.0
@@ -5,1 +5,2 @@ export * from './tokenListingCounts/tokenListingCountsByMetaId'; | ||
export * from './tokensByStatus/tokensByStatus'; | ||
export * from './ownedNftsByStore/ownedNftsByStore'; |
@@ -21,2 +21,3 @@ "use strict"; | ||
__exportStar(require("./tokensByStatus/tokensByStatus"), exports); | ||
__exportStar(require("./ownedNftsByStore/ownedNftsByStore"), exports); | ||
//# sourceMappingURL=index.js.map |
export declare type NearDataEnv = 'mainnet' | 'testnet' | 'sandbox'; | ||
export declare const DataNetwork: { | ||
MAINNET: string; | ||
TESTNET: string; | ||
SANDBOX: string; | ||
}; | ||
export declare const NEAR_DATA_ENV: string; | ||
export declare const GRAPHQL_ENDPOINT: string; | ||
export declare const QUERY_OPS_PREFIX = "mintbase_js_data_"; |
"use strict"; | ||
var _a, _b; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.QUERY_OPS_PREFIX = exports.GRAPHQL_ENDPOINT = exports.NEAR_DATA_ENV = void 0; | ||
exports.QUERY_OPS_PREFIX = exports.GRAPHQL_ENDPOINT = exports.NEAR_DATA_ENV = exports.DataNetwork = void 0; | ||
exports.DataNetwork = { | ||
MAINNET: 'mainnet', | ||
TESTNET: 'testnet', | ||
SANDBOX: 'sandbox', | ||
}; | ||
let hostBasedNetworkDefault = exports.DataNetwork.MAINNET; | ||
if ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.window) === null || _a === void 0 ? void 0 : _a.location.host.includes(exports.DataNetwork.TESTNET)) { | ||
hostBasedNetworkDefault = exports.DataNetwork.TESTNET; | ||
} | ||
if ((_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.window) === null || _b === void 0 ? void 0 : _b.location.host.includes(exports.DataNetwork.SANDBOX)) { | ||
hostBasedNetworkDefault = exports.DataNetwork.SANDBOX; | ||
} | ||
exports.NEAR_DATA_ENV = process.env.NEAR_DATA_ENV || | ||
process.env.NEXT_PUBLIC_NEAR_DATA_ENV || | ||
'mainnet'; | ||
hostBasedNetworkDefault; | ||
exports.GRAPHQL_ENDPOINT = `https://interop-${exports.NEAR_DATA_ENV}.hasura.app/v1/graphql`; | ||
exports.QUERY_OPS_PREFIX = 'mintbase_js_data_'; | ||
//# sourceMappingURL=constants.js.map |
{ | ||
"name": "@mintbase-js/data", | ||
"version": "0.0.4-deployContract.0", | ||
"version": "0.0.4-market-method-restructure.0", | ||
"description": "Query wrappers for Mintbase JS SDK", | ||
@@ -30,3 +30,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "6ca8cba75b1399129e4d9df5c31df47f62f7e7c0" | ||
"gitHead": "0a4cda60363fc088641c9ef8c4f103c75faee2c2" | ||
} |
[//]: # `{ "title": "@mintbase-js/data", "order": 1 }` | ||
# Fetching Data From the Indexer | ||
# @mintbase-js/data | ||
Built-in methods to help fetch data from our indexer | ||
# methods | ||
| method name | params | description | | ||
|--|--|--| | ||
| [ownedNftsByStore](https://github.com/Mintbase/mintbase-js/tree/alpha/packages/data/src/api/ownedNftsByStore/README.md) | `ownerId: string,contractAddress: string, pagination: {limit: number, offset:number}` |get all nfts from a single store| | ||
| [ownedTokens](https://github.com/Mintbase/mintbase-js/tree/alpha/packages/data/src/api/ownedTokens/README.md) | `ownerId: string,{limit: number, offset:number}` |get all tokens/nfts from a owner| | ||
| [tokenById](https://github.com/Mintbase/mintbase-js/tree/alpha/packages/data/src/api/tokenById/README.md) | `tokenId: string, contractAddress: string` |get token data by id of certain contract| | ||
| [tokenListingCountsByMetaId](https://github.com/Mintbase/mintbase-js/tree/alpha/packages/data/src/api/tokenListingCountsByMetaId/README.md) | `metadataId: string` | get token listings from metadata id | | ||
| [tokensByStatus](https://github.com/Mintbase/mintbase-js/tree/alpha/packages/data/src/api/tokensByStatus/README.md) | `metadataId: string, ownedBy: string` |get token by status on metadataId, and owner| | ||
## For now, use our GraphQL schemas | ||
For as long as we have had an indexer, we have relied on GraphQL to provide Mintbase Builders with a flexible and efficient way to query data any way they like. | ||
While we will continue to provide public and our new mb_views schema objects, we will also begin to introduce helper methods here that can be used to query data **without having to write any graphql**. | ||
For now, reference our [existing graphql docs](https://docs.mintbase.io/dev/read-data/mintbase-graph) and be sure to check back here soon for updates concerning our [data layer API](src/api/). |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
356552
81
7685
29