@mintbase-js/sdk
Advanced tools
Comparing version 0.0.4-use-owned-nfts-by-stores.1 to 0.0.4-v1-namespace.0
@@ -6,2 +6,7 @@ import { NearContractCall } from '../execute'; | ||
}; | ||
/** | ||
* Add minting access for one id to a contract you own. | ||
* @param addMinterArgs {@link AddMinterArgs} | ||
* @returns contract call to be passed to @mintbase-js/sdk execute method | ||
*/ | ||
export declare const addMinter: (args: AddMinterArgs) => NearContractCall; |
@@ -6,2 +6,7 @@ "use strict"; | ||
const constants_1 = require("../constants"); | ||
/** | ||
* Add minting access for one id to a contract you own. | ||
* @param addMinterArgs {@link AddMinterArgs} | ||
* @returns contract call to be passed to @mintbase-js/sdk execute method | ||
*/ | ||
const addMinter = (args) => { | ||
@@ -8,0 +13,0 @@ const { minterId, nftContractId } = args; |
@@ -7,2 +7,7 @@ import { NearContractCall } from '../execute'; | ||
}; | ||
/** | ||
* Add or remove minting access of various ids of a contract you own. | ||
* @param batchChangeMintersArgs {@link BatchChangeMintersArgs} | ||
* @returns contract call to be passed to @mintbase-js/sdk execute method | ||
*/ | ||
export declare const batchChangeMinters: (args: BatchChangeMintersArgs) => NearContractCall; |
@@ -5,2 +5,7 @@ "use strict"; | ||
const constants_1 = require("../constants"); | ||
/** | ||
* Add or remove minting access of various ids of a contract you own. | ||
* @param batchChangeMintersArgs {@link BatchChangeMintersArgs} | ||
* @returns contract call to be passed to @mintbase-js/sdk execute method | ||
*/ | ||
const batchChangeMinters = (args) => { | ||
@@ -7,0 +12,0 @@ const { addMinters = [], removeMinters = [], nftContractId } = args; |
@@ -6,2 +6,3 @@ export declare const GAS = "200000000000000"; | ||
export declare const CONTRACT_DEPOSIT = "6500000000000000000000000"; | ||
export declare const LISTING_DEPOSIT = "800000000000000000000"; | ||
export declare const TOKEN_METHOD_NAMES: { | ||
@@ -42,6 +43,8 @@ TRANSFER: string; | ||
export declare const ANON_USER_WARNING = "Warning: you are using the anonymous mintbase api key. You may want to specify yours."; | ||
export declare const HOST_BASED_NETWORK_DEFAULT: () => string; | ||
export declare const NEAR_NETWORK: string; | ||
export declare const MB_MAINNET_TOKEN_FACTORY_ADDRESS = "mintbase1.near"; | ||
export declare const MB_TESTNET_TOKEN_FACTORY_ADDRESS = "mintspace2.testnet"; | ||
export declare const MB_TESTNET_MARKET_CONTRACT_ADDRESS = "market-v2-beta.mintspace2.testnet"; | ||
export declare const MB_TOKEN_FACTORY_ADDRESS: string; | ||
export declare const DEFAULT_MB_LOGO = "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAEXUlEQVRYR8VXW4hVVRj+vrX3OYbFNBl2eSsoa8pkxMJmzpGGoIwMY0wwImuCXmKKkiikKayHQIpAwbdAswskBYqJSlANek7TUOPURGKCWdmFkJnsoZnhzNn/F2vcZ9gez2UfEVoP+2Gv///Xt771X4mUq6enpz2Kogck3S2pk+R1ki736iT/kfQzyW/N7PNsNrtvcHDwTBrTbCbU1dV1cxiGGyWtA3BJM/l4f1rSLjPbPDQ0dKyRTl0AS5YsubStre11AP0AwiYHi+SJmJGFCdmypG3T09MDIyMjk7Vs1ASQy+VuIrkbQEezG3vqJfXGTzHhnFtlZttIuoTuUQC9hULheLW98wDkcrnbARwkeWWzw+P9ewCsB/AYgBkz6yW5lmRfUl/SOMmVhUJhJPn/HAD+5gCKLRzubS0AMO59MTa828z2Oud2VF8gBtGdZGIOQPzmX6ehPWk4iqKOIAg+BnCr/y/pJUmnnHPv1WHw6NTU1B0Vn5gDkM/ntwB4NiXtc2KS9kdR1B+G4aMA/pD0kaQHGwDwILcUi8UNs37jPz7UgiD4PoW318Qn6QSA/STbJc2T9EkjAAB8dCwuFos/zgLI5/M7YydqlYBa8vvMbFcTAJ6FncVisY/5fP4KT10LSaYZyFQAAEyHYXitB+BD6N1mVlvYTwsAZraeuVxuR3XMNjpM0mFJW0n+VUfub0mnSS6S5JxznQBeBpDMkBXV7R7AKEkv1HRJGiLpvX0rgHYzGyB5S5yuZ/VJHioUCv25XO4Vn/0AHDCzD51z35DMViWnUf8EEwC8H6RZj5O8Py5M3pF+D4JghZn9lFDeB+AtAF9U/vmw9CBJ3lt1yIQHYIks1gzEapJPSlodJ53xcrncmclkTiUOOwRgM8n9iX8Pk/S+tqqKAWsZgJmddM6971kzs+f9W5P0VbOyZmZmZjyo5yStcc4djKJoE8kxkvNrAWjlCVZLugHAYefcpJmtIzkAIKii7ldJL5jZkTAMF0t6A8CNNeidaMkJAXjqNwLobvZWafYljbYahhcVAIDtrSaiiwpgNhGlSMVjAI5J8m3Xm3FILapD8UKSd9XwiVriZ1Ox36lXjCRtMLPPwjC8s1QqHRgeHv6tu7v7IefcNYkQG8tkMqPlcnmNrylm9q9z7lMAlzXyg7li5IXqlOOvADwN4EsAPoOdLpVKHdlsdm/SCUku8/UdwIo4NzxF8noALzYAcG45jlmobkjelnTc014xRPI+Sa8BWJ4w7lsyH8qVtUfSHpLv1ANwXkPiBWu0ZEeiKOoLgsAzMd+nXTNb7pz7geTsQBLfuIvkqwBWnu3I9ASAZSSfqQOgdkvmhaubUpKboij6IAiCpSSH/aAB4JEqw9+VSqXeTCZzm6Q/nXNXA/A94rxqAA2b0opwjbb8JADfzy8FcFWdW01K8kwtqFdZU7XlCRCpB5M0GQ9A+sGkYrDF0awejgsbzZLW/rfhtPpKTcbzM5J+uZDx/D8+0FUx/4DhyAAAAABJRU5ErkJggg=="; |
"use strict"; | ||
var _a, _b; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.DEFAULT_MB_LOGO = exports.MB_TOKEN_FACTORY_ADDRESS = exports.MB_TESTNET_TOKEN_FACTORY_ADDRESS = exports.MB_MAINNET_TOKEN_FACTORY_ADDRESS = exports.NEAR_NETWORK = exports.ANON_USER_WARNING = exports.MINTBASE_API_KEY = exports.MINTBASE_API_ANON_USER = exports.MINTBASE_API_KEY_HEADER = exports.Network = exports.DEPOSIT_CONSTANTS = exports.GAS_CONSTANTS = exports.MARKET_METHOD_NAMES = exports.TOKEN_METHOD_NAMES = exports.CONTRACT_DEPOSIT = exports.TOKEN_CONTRACT_SPEC = exports.ONE_YOCTO = exports.MAX_GAS = exports.GAS = void 0; | ||
exports.DEFAULT_MB_LOGO = exports.MB_TOKEN_FACTORY_ADDRESS = exports.MB_TESTNET_MARKET_CONTRACT_ADDRESS = exports.MB_TESTNET_TOKEN_FACTORY_ADDRESS = exports.MB_MAINNET_TOKEN_FACTORY_ADDRESS = exports.NEAR_NETWORK = exports.HOST_BASED_NETWORK_DEFAULT = exports.ANON_USER_WARNING = exports.MINTBASE_API_KEY = exports.MINTBASE_API_ANON_USER = exports.MINTBASE_API_KEY_HEADER = exports.Network = exports.DEPOSIT_CONSTANTS = exports.GAS_CONSTANTS = exports.MARKET_METHOD_NAMES = exports.TOKEN_METHOD_NAMES = exports.LISTING_DEPOSIT = exports.CONTRACT_DEPOSIT = exports.TOKEN_CONTRACT_SPEC = exports.ONE_YOCTO = exports.MAX_GAS = exports.GAS = void 0; | ||
exports.GAS = '200000000000000'; | ||
@@ -10,2 +10,3 @@ exports.MAX_GAS = '300000000000000'; | ||
exports.CONTRACT_DEPOSIT = '6500000000000000000000000'; | ||
exports.LISTING_DEPOSIT = '800000000000000000000'; | ||
exports.TOKEN_METHOD_NAMES = { | ||
@@ -48,7 +49,17 @@ TRANSFER: 'nft_transfer', | ||
exports.ANON_USER_WARNING = 'Warning: you are using the anonymous mintbase api key. You may want to specify yours.'; | ||
exports.NEAR_NETWORK = process.env.NEAR_NETWORK || ((_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.localStorage) === null || _b === void 0 ? void 0 : _b.getItem('NEAR_NETWORK')) || exports.Network.MAINNET; | ||
const HOST_BASED_NETWORK_DEFAULT = () => { | ||
var _a; | ||
return ((_a = globalThis === null || globalThis === void 0 ? void 0 : globalThis.window) === null || _a === void 0 ? void 0 : _a.location.host.includes('testnet')) | ||
? exports.Network.TESTNET | ||
: exports.Network.MAINNET; | ||
}; | ||
exports.HOST_BASED_NETWORK_DEFAULT = HOST_BASED_NETWORK_DEFAULT; | ||
exports.NEAR_NETWORK = process.env.NEAR_NETWORK || | ||
((_b = globalThis === null || globalThis === void 0 ? void 0 : globalThis.localStorage) === null || _b === void 0 ? void 0 : _b.getItem('NEAR_NETWORK')) || | ||
(0, exports.HOST_BASED_NETWORK_DEFAULT)(); | ||
exports.MB_MAINNET_TOKEN_FACTORY_ADDRESS = 'mintbase1.near'; | ||
exports.MB_TESTNET_TOKEN_FACTORY_ADDRESS = 'mintspace2.testnet'; | ||
exports.MB_TESTNET_MARKET_CONTRACT_ADDRESS = 'market-v2-beta.mintspace2.testnet'; | ||
exports.MB_TOKEN_FACTORY_ADDRESS = exports.NEAR_NETWORK === exports.Network.MAINNET ? exports.MB_MAINNET_TOKEN_FACTORY_ADDRESS : exports.MB_TESTNET_TOKEN_FACTORY_ADDRESS; | ||
exports.DEFAULT_MB_LOGO = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAEXUlEQVRYR8VXW4hVVRj+vrX3OYbFNBl2eSsoa8pkxMJmzpGGoIwMY0wwImuCXmKKkiikKayHQIpAwbdAswskBYqJSlANek7TUOPURGKCWdmFkJnsoZnhzNn/F2vcZ9gez2UfEVoP+2Gv///Xt771X4mUq6enpz2Kogck3S2pk+R1ki736iT/kfQzyW/N7PNsNrtvcHDwTBrTbCbU1dV1cxiGGyWtA3BJM/l4f1rSLjPbPDQ0dKyRTl0AS5YsubStre11AP0AwiYHi+SJmJGFCdmypG3T09MDIyMjk7Vs1ASQy+VuIrkbQEezG3vqJfXGTzHhnFtlZttIuoTuUQC9hULheLW98wDkcrnbARwkeWWzw+P9ewCsB/AYgBkz6yW5lmRfUl/SOMmVhUJhJPn/HAD+5gCKLRzubS0AMO59MTa828z2Oud2VF8gBtGdZGIOQPzmX6ehPWk4iqKOIAg+BnCr/y/pJUmnnHPv1WHw6NTU1B0Vn5gDkM/ntwB4NiXtc2KS9kdR1B+G4aMA/pD0kaQHGwDwILcUi8UNs37jPz7UgiD4PoW318Qn6QSA/STbJc2T9EkjAAB8dCwuFos/zgLI5/M7YydqlYBa8vvMbFcTAJ6FncVisY/5fP4KT10LSaYZyFQAAEyHYXitB+BD6N1mVlvYTwsAZraeuVxuR3XMNjpM0mFJW0n+VUfub0mnSS6S5JxznQBeBpDMkBXV7R7AKEkv1HRJGiLpvX0rgHYzGyB5S5yuZ/VJHioUCv25XO4Vn/0AHDCzD51z35DMViWnUf8EEwC8H6RZj5O8Py5M3pF+D4JghZn9lFDeB+AtAF9U/vmw9CBJ3lt1yIQHYIks1gzEapJPSlodJ53xcrncmclkTiUOOwRgM8n9iX8Pk/S+tqqKAWsZgJmddM6971kzs+f9W5P0VbOyZmZmZjyo5yStcc4djKJoE8kxkvNrAWjlCVZLugHAYefcpJmtIzkAIKii7ldJL5jZkTAMF0t6A8CNNeidaMkJAXjqNwLobvZWafYljbYahhcVAIDtrSaiiwpgNhGlSMVjAI5J8m3Xm3FILapD8UKSd9XwiVriZ1Ox36lXjCRtMLPPwjC8s1QqHRgeHv6tu7v7IefcNYkQG8tkMqPlcnmNrylm9q9z7lMAlzXyg7li5IXqlOOvADwN4EsAPoOdLpVKHdlsdm/SCUku8/UdwIo4NzxF8noALzYAcG45jlmobkjelnTc014xRPI+Sa8BWJ4w7lsyH8qVtUfSHpLv1ANwXkPiBWu0ZEeiKOoLgsAzMd+nXTNb7pz7geTsQBLfuIvkqwBWnu3I9ASAZSSfqQOgdkvmhaubUpKboij6IAiCpSSH/aAB4JEqw9+VSqXeTCZzm6Q/nXNXA/A94rxqAA2b0opwjbb8JADfzy8FcFWdW01K8kwtqFdZU7XlCRCpB5M0GQ9A+sGkYrDF0awejgsbzZLW/rfhtPpKTcbzM5J+uZDx/D8+0FUx/4DhyAAAAABJRU5ErkJggg=='; | ||
//# sourceMappingURL=constants.js.map |
@@ -8,8 +8,8 @@ export * from './execute'; | ||
export * from './batchChangeMinters/batchChangeMinters'; | ||
export * from './v1/token'; | ||
export * from './v1/token.types'; | ||
export * from './v1/market'; | ||
export * from './v1/market.types'; | ||
export { Account, providers, connect as connectToNear, KeyPair } from 'near-api-js'; | ||
export { InMemoryKeyStore, KeyStore } from 'near-api-js/lib/key_stores'; | ||
export { FinalExecutionOutcome } from '@near-wallet-selector/core'; | ||
export * from './deployContract/deployContract'; | ||
export * from './transferContractOwnership/transferContractOwnership'; | ||
export * from './list/list'; | ||
export * from './buy/buy'; | ||
export * from './depositStorage/depositStorage'; | ||
export * from './mint/mint'; | ||
export * from './revoke/revoke'; |
@@ -17,3 +17,2 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.KeyStore = exports.InMemoryKeyStore = exports.KeyPair = exports.connectToNear = exports.providers = exports.Account = void 0; | ||
__exportStar(require("./execute"), exports); | ||
@@ -26,17 +25,9 @@ __exportStar(require("./constants"), exports); | ||
__exportStar(require("./batchChangeMinters/batchChangeMinters"), exports); | ||
__exportStar(require("./v1/token"), exports); | ||
__exportStar(require("./v1/token.types"), exports); | ||
__exportStar(require("./v1/market"), exports); | ||
__exportStar(require("./v1/market.types"), exports); | ||
// this is done to avoid importing near-api-js more than once | ||
// which leads to a strange, but known issue | ||
// https://docs.near.org/tools/near-api-js/faq#class-x-is-missing-in-schema-publickey | ||
var near_api_js_1 = require("near-api-js"); | ||
Object.defineProperty(exports, "Account", { enumerable: true, get: function () { return near_api_js_1.Account; } }); | ||
Object.defineProperty(exports, "providers", { enumerable: true, get: function () { return near_api_js_1.providers; } }); | ||
Object.defineProperty(exports, "connectToNear", { enumerable: true, get: function () { return near_api_js_1.connect; } }); | ||
Object.defineProperty(exports, "KeyPair", { enumerable: true, get: function () { return near_api_js_1.KeyPair; } }); | ||
var key_stores_1 = require("near-api-js/lib/key_stores"); | ||
Object.defineProperty(exports, "InMemoryKeyStore", { enumerable: true, get: function () { return key_stores_1.InMemoryKeyStore; } }); | ||
Object.defineProperty(exports, "KeyStore", { enumerable: true, get: function () { return key_stores_1.KeyStore; } }); | ||
__exportStar(require("./deployContract/deployContract"), exports); | ||
__exportStar(require("./transferContractOwnership/transferContractOwnership"), exports); | ||
__exportStar(require("./list/list"), exports); | ||
__exportStar(require("./buy/buy"), exports); | ||
__exportStar(require("./depositStorage/depositStorage"), exports); | ||
__exportStar(require("./mint/mint"), exports); | ||
__exportStar(require("./revoke/revoke"), exports); | ||
//# sourceMappingURL=index.js.map |
@@ -6,2 +6,7 @@ import { NearContractCall } from '../execute'; | ||
}; | ||
/** | ||
* Remove minting access of a provided id for a contract you own. | ||
* @param removeMinterArgs {@link RemoveMinterArgs} | ||
* @returns contract call to be passed to @mintbase-js/sdk execute method | ||
*/ | ||
export declare const removeMinter: (args: RemoveMinterArgs) => NearContractCall; |
@@ -6,2 +6,7 @@ "use strict"; | ||
const constants_1 = require("../constants"); | ||
/** | ||
* Remove minting access of a provided id for a contract you own. | ||
* @param removeMinterArgs {@link RemoveMinterArgs} | ||
* @returns contract call to be passed to @mintbase-js/sdk execute method | ||
*/ | ||
const removeMinter = (args) => { | ||
@@ -8,0 +13,0 @@ const { minterId, nftContractId } = args; |
@@ -6,3 +6,3 @@ "use strict"; | ||
const near_api_js_1 = require("near-api-js"); | ||
const constants_1 = require("../constants"); | ||
const constants_1 = require("./constants"); | ||
const buy = (args) => { | ||
@@ -9,0 +9,0 @@ const { nftContractId, tokenId, referrerId, marketAddress, price } = args; |
import { TransactionArgs, TransactionAttachments } from '../execute'; | ||
import { MintArgs, RevokeAccountArgs } from './token.types'; | ||
import { BurnArgs, DeployTokenContractArgs, TransferTokenContractOwnership, MintArgs, AddRemoveMinterArgs, BatchChangeMinters, RevokeAccountArgs } from './token.types'; | ||
export declare const burn: (args: BurnArgs) => TransactionArgs & TransactionAttachments; | ||
export declare const deployContract: (args: DeployTokenContractArgs) => TransactionArgs & TransactionAttachments; | ||
export declare const transferContractOwnership: (args: TransferTokenContractOwnership) => TransactionArgs & TransactionAttachments; | ||
export declare const mint: (args: MintArgs) => TransactionArgs & TransactionAttachments; | ||
export declare const mintMore: () => void; | ||
export declare const addMinter: (args: AddRemoveMinterArgs) => TransactionArgs & TransactionAttachments; | ||
export declare const removeMinter: (args: AddRemoveMinterArgs) => TransactionArgs & TransactionAttachments; | ||
export declare const batchChangeMinters: (args: BatchChangeMinters) => TransactionArgs & TransactionAttachments; | ||
export declare const revoke: (args: RevokeAccountArgs) => TransactionArgs & TransactionAttachments; |
"use strict"; | ||
// Mintbase token contract JS implementation | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.revoke = exports.mintMore = exports.mint = void 0; | ||
exports.revoke = exports.batchChangeMinters = exports.removeMinter = exports.addMinter = exports.mintMore = exports.mint = exports.transferContractOwnership = exports.deployContract = exports.burn = void 0; | ||
const constants_1 = require("../constants"); | ||
// TODO: figure out a way to generate gas and deposit for each | ||
const burn = (args) => { | ||
const { nftContractId, tokenIds } = args; | ||
return { | ||
contractAddress: nftContractId, | ||
methodName: constants_1.TOKEN_METHOD_NAMES.BATCH_BURN, | ||
args: { | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
token_ids: tokenIds, | ||
}, | ||
gas: constants_1.GAS_CONSTANTS.DEFAULT_GAS, | ||
deposit: constants_1.DEPOSIT_CONSTANTS.ONE_YOCTO, | ||
}; | ||
}; | ||
exports.burn = burn; | ||
const deployContract = (args) => { | ||
const { name, factoryContractId, network = constants_1.Network.TESTNET, ownerId, metadata, } = args; | ||
const { symbol, icon, baseUri, reference, referenceHash } = metadata; | ||
const data = { | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
owner_id: ownerId, | ||
metadata: { | ||
spec: 'nft-1.0.0', | ||
name: name.replace(/[^a-z0-9]+/gim, '').toLowerCase(), | ||
symbol: symbol.replace(/[^a-z0-9]+/gim, '').toLowerCase(), | ||
icon: icon !== null && icon !== void 0 ? icon : constants_1.DEFAULT_MB_LOGO, | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
base_uri: baseUri !== null && baseUri !== void 0 ? baseUri : null, | ||
reference: reference !== null && reference !== void 0 ? reference : null, | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
reference_hash: referenceHash !== null && referenceHash !== void 0 ? referenceHash : null, | ||
}, | ||
}; | ||
return { | ||
contractAddress: factoryContractId || constants_1.MB_TOKEN_FACTORY_ADDRESS, | ||
methodName: constants_1.TOKEN_METHOD_NAMES.DEPLOY_TOKEN_CONTRACT, | ||
args: data, | ||
gas: constants_1.GAS_CONSTANTS.DEFAULT_GAS, | ||
deposit: '6500000000000000000000000', | ||
}; | ||
}; | ||
exports.deployContract = deployContract; | ||
const transferContractOwnership = (args) => { | ||
const { nftContractId, nextOwner, options } = args; | ||
const { keepMinters = true } = options; | ||
return { | ||
contractAddress: nftContractId, | ||
args: { | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
new_owner: nextOwner, | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
keep_old_minters: keepMinters, | ||
}, | ||
methodName: constants_1.TOKEN_METHOD_NAMES.TRANSFER_TOKEN_CONTRACT_OWNERSHIP, | ||
gas: constants_1.GAS_CONSTANTS.DEFAULT_GAS, | ||
deposit: constants_1.DEPOSIT_CONSTANTS.ONE_YOCTO, | ||
}; | ||
}; | ||
exports.transferContractOwnership = transferContractOwnership; | ||
const mint = (args) => { | ||
const { nftContractId } = args; | ||
const { nftContractId, options } = args; | ||
return { | ||
@@ -22,2 +81,44 @@ contractAddress: nftContractId, | ||
exports.mintMore = mintMore; | ||
const addMinter = (args) => { | ||
const { minterId, nftContractId } = args; | ||
return { | ||
contractAddress: nftContractId, | ||
args: { | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
account_id: minterId, | ||
}, | ||
methodName: constants_1.TOKEN_METHOD_NAMES.ADD_MINTER, | ||
gas: constants_1.GAS_CONSTANTS.DEFAULT_GAS, | ||
deposit: constants_1.DEPOSIT_CONSTANTS.ONE_YOCTO, | ||
}; | ||
}; | ||
exports.addMinter = addMinter; | ||
const removeMinter = (args) => { | ||
const { minterId, nftContractId } = args; | ||
return { | ||
contractAddress: nftContractId, | ||
args: { | ||
// eslint-disable-next-line @typescript-eslint/camelcase | ||
account_id: minterId, | ||
}, | ||
methodName: constants_1.TOKEN_METHOD_NAMES.REMOVE_MINTER, | ||
gas: constants_1.GAS_CONSTANTS.DEFAULT_GAS, | ||
deposit: constants_1.DEPOSIT_CONSTANTS.ONE_YOCTO, | ||
}; | ||
}; | ||
exports.removeMinter = removeMinter; | ||
const batchChangeMinters = (args) => { | ||
const { addMinters, removeMinters, nftContractId } = args; | ||
return { | ||
contractAddress: nftContractId, | ||
args: { | ||
grant: addMinters.length > 0 ? addMinters : undefined, | ||
revoke: removeMinters.length > 0 ? removeMinters : undefined, | ||
}, | ||
methodName: constants_1.TOKEN_METHOD_NAMES.BATCH_CHANGE_MINTERS, | ||
gas: constants_1.GAS_CONSTANTS.DEFAULT_GAS, | ||
deposit: constants_1.DEPOSIT_CONSTANTS.ONE_YOCTO, | ||
}; | ||
}; | ||
exports.batchChangeMinters = batchChangeMinters; | ||
const revoke = (args) => { | ||
@@ -24,0 +125,0 @@ const { nftContractId, tokenId, accountToRevokeId } = args; |
@@ -6,2 +6,25 @@ export declare type AccountId = string; | ||
}; | ||
export declare type BurnArgs = { | ||
nftContractId: AccountId; | ||
tokenIds: TokenId[]; | ||
}; | ||
export declare type DeployTokenContractArgs = TokenArgs & { | ||
name: string; | ||
factoryContractId?: AccountId; | ||
ownerId: AccountId; | ||
metadata: { | ||
symbol: string; | ||
icon?: string; | ||
baseUri?: string; | ||
reference?: string; | ||
referenceHash?: string; | ||
}; | ||
}; | ||
export declare type TransferTokenContractOwnership = TokenArgs & { | ||
nftContractId: AccountId; | ||
nextOwner: AccountId; | ||
options?: { | ||
keepMinters: boolean; | ||
}; | ||
}; | ||
export declare type Splits = Record<AccountId, number>; | ||
@@ -23,2 +46,11 @@ export declare type MintArgs = TokenArgs & { | ||
}; | ||
export declare type AddRemoveMinterArgs = TokenArgs & { | ||
minterId: AccountId; | ||
nftContractId: AccountId; | ||
}; | ||
export declare type BatchChangeMinters = TokenArgs & { | ||
addMinters: AccountId[]; | ||
removeMinters: AccountId[]; | ||
nftContractId: AccountId; | ||
}; | ||
export declare type RevokeAccountArgs = TokenArgs & { | ||
@@ -25,0 +57,0 @@ nftContractId: AccountId; |
{ | ||
"name": "@mintbase-js/sdk", | ||
"version": "0.0.4-use-owned-nfts-by-stores.1", | ||
"version": "0.0.4-v1-namespace.0", | ||
"description": "Core functions for Mintbase JS SDK", | ||
@@ -25,3 +25,3 @@ "main": "lib/index.js", | ||
}, | ||
"gitHead": "8a66534bb8ca5da6a11c6e159fd5c3111a62c528" | ||
"gitHead": "438306c7348b0c9d3aa643510bc4d86202468b64" | ||
} |
@@ -110,4 +110,4 @@ [//]: # `{ "title": "@mintbase-js/sdk", "order": 0 }` | ||
Should you encounter this [known issue](ttps://docs.near.org/tools/near-api-js/faq#class-x-is-missing-in-schema-publickey) make sure you are not importing modules directly from `near-api-js`, import them from `@mintbase-js/sdk` instead to avoid the duplicate import. | ||
Should you encounter this [known issue](https://docs.near.org/tools/near-api-js/faq#class-x-is-missing-in-schema-publickey) `Class PublicKey is missing in schema: publicKey` make sure you are not importing modules directly from `near-api-js`, import them from `@mintbase-js/sdk` instead to avoid the duplicate import. | ||
{% endhint %} |
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
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
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
82300
69
1249