@mintbase-js/data
Advanced tools
Comparing version 0.0.4-rpc-get-txn-status.3 to 0.0.4-sdk-documentation-improvement.0
@@ -5,1 +5,3 @@ export * from './tokenListingCounts/tokenListingCountsByMetaId'; | ||
export * from './tokensByStatus/tokensByStatus'; | ||
export * from './ownedNftsByStore/ownedNftsByStore'; | ||
export * from './attributes/attributesByMetaId'; |
@@ -21,2 +21,4 @@ "use strict"; | ||
__exportStar(require("./tokensByStatus/tokensByStatus"), exports); | ||
__exportStar(require("./ownedNftsByStore/ownedNftsByStore"), exports); | ||
__exportStar(require("./attributes/attributesByMetaId"), 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-rpc-get-txn-status.3", | ||
"version": "0.0.4-sdk-documentation-improvement.0", | ||
"description": "Query wrappers for Mintbase JS SDK", | ||
@@ -30,3 +30,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "5cfe1ec170ff3bd46f6d55b2fc0e070075ea55a0" | ||
"gitHead": "4030a43b3e18e61486ed3a030c6c1debde4ff9e6" | ||
} |
[//]: # `{ "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
359993
87
7741
29