{"_id":"@ashkuc/solidity-interfaces","name":"@ashkuc/solidity-interfaces","dist-tags":{"beta":"0.64.0","latest":"0.64.0"},"versions":{"0.64.0":{"name":"@ashkuc/solidity-interfaces","version":"0.64.0","license":"MIT","description":"Solidity smart contracts and ethers.js/web3 wrappings for Unique network technologies","publishConfig":{"access":"public"},"repository":{"type":"git","url":"git+https://github.com/UniqueNetwork/solidity-interfaces.git"},"bugs":{"url":"https://github.com/UniqueNetwork/solidity-interfaces/issues"},"homepage":"https://github.com/UniqueNetwork/solidity-interfaces#readme","scripts":{"clean":"rimraf dist && mkdirp dist","build:compile":"yarn tsx downloadSolidityInterfaces.ts","build:tsup":"yarn tsup --config configs/tsup.config.ts","copy_files":"cpy ./package.json ./README.md ./dist","build":"yarn clean && yarn build:compile && yarn build:tsup && yarn copy_files","release":"npm run copy_files && cd dist && npm publish","release:beta_as_is":"npm run copy_files && cd dist && npm publish --tag beta","release:beta":"tsx bumper.mts --beta && npm run copy_files && cd dist && npm publish --tag beta","release:patch":"tsx bumper.mts --patch && npm run copy_files && cd dist && npm publish"},"devDependencies":{"@typechain/ethers-v5":"^10.2.0","@typechain/ethers-v6":"^0.5.1","@typechain/web3-v1":"^6.0.2","@types/node":"^18.11.17","@types/semver":"^7.3.13","commander":"^9.4.1","cpy-cli":"^4.2.0","dotenv":"^16.0.3","dotenv-cli":"^6.0.0","mkdirp":"^1.0.4","pkg-versions":"^3.0.0","release-it":"^15.5.1","rimraf":"^3.0.2","semver":"^7.5.2","solc":"^0.8.17","tsup":"^6.5.0","tsx":"^3.12.1","typechain":"^8.1.1","typescript":"^4.9.4","web3":"^1.10.4"},"keywords":["Unique Network","NFT","RFT","blockchain","Solidity","ABI","Smart contracts","ERC721","ERC1633","ERC20","Polkadot","Kusama"],"dependencies":{"@unique-nft/utils":"^0.3.2","ethers":"^6.9.0"},"exports":{".":{"import":"./index.mjs","require":"./index.js","types":"./index.d.ts"},"./ethers":{"import":"./ethers/index.mjs","require":"./ethers/index.js","types":"./ethers/index.d.ts"},"./web3":{"import":"./web3/index.mjs","require":"./web3/index.js","types":"./web3/index.d.ts"},"./contracts/*":"./contracts/*","./abi/*":"./abi/*"},"packageManager":"yarn@1.22.22+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e","_id":"@ashkuc/solidity-interfaces@0.64.0","gitHead":"e4caf9faedd79f0de5c01163f8159df9c3883a98","types":"./index.d.ts","_nodeVersion":"22.0.0","_npmVersion":"10.5.1","dist":{"integrity":"sha512-a3inoaYH8h9kIpB2r+AAZAWQGIJy3FTj590LGNV1mZwr8mK9WPXkK6kUahLEJylLSFUyoGkQ48yTgp+NE1ZK5A==","shasum":"11d9e608a51802a28b3db4938257a2cb0a1eff69","tarball":"https://registry.npmjs.org/@ashkuc/solidity-interfaces/-/solidity-interfaces-0.64.0.tgz","fileCount":73,"unpackedSize":2583218,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDoUlOQa3fjWQm6u/mHq/l6MsospNDoD7URs4GUgh3/8AIhAPeDbgc3HI8vnTxwaKcaVBD20MPNGIjguUZIkMVIVTpd"}]},"_npmUser":{"name":"ashkuc","email":"ashkucc@gmail.com"},"directories":{},"maintainers":[{"name":"ashkuc","email":"ashkucc@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/solidity-interfaces_0.64.0_1721911903980_0.5446416880187885"},"_hasShrinkwrap":false}},"time":{"created":"2024-07-25T12:51:43.855Z","0.64.0":"2024-07-25T12:51:44.129Z","modified":"2024-07-25T12:51:44.415Z"},"maintainers":[{"name":"ashkuc","email":"ashkucc@gmail.com"}],"description":"Solidity smart contracts and ethers.js/web3 wrappings for Unique network technologies","homepage":"https://github.com/UniqueNetwork/solidity-interfaces#readme","keywords":["Unique Network","NFT","RFT","blockchain","Solidity","ABI","Smart contracts","ERC721","ERC1633","ERC20","Polkadot","Kusama"],"repository":{"type":"git","url":"git+https://github.com/UniqueNetwork/solidity-interfaces.git"},"bugs":{"url":"https://github.com/UniqueNetwork/solidity-interfaces/issues"},"license":"MIT","readme":"# Unique Solidity interfaces\n\n## Usage\n\n```ts\nimport {ethers} from 'ethers'\nimport {Address} from '@unique-nft/utils'\nimport {\n  CollectionHelpersFactory,\n  UniqueNFTFactory,\n} from '@unique-nft/solidity-interfaces'\n\nconst provider = new ethers.providers.JsonRpcProvider('https://rpc-opal.unique.network')\nconst wallet = new ethers.Wallet('<Private key>', provider)\n\n// or, with browser extension:\n// const provider = new ethers.providers.Web3Provider(window.ethereum)\n// const wallet = provider.getSigner()\n\nconst collectionHelpers = await CollectionHelpersFactory(wallet, ethers) // ethers parameter is optional\n//when ethers not provided, it's been asynchronously loaded on demand to reduce package size and TTFP\n\nconst txCreateCollection = await (await collectionHelpers.createNFTCollection(\n  'My Collection', // collection name\n  'Fancy collection description', // collection description\n  'MYCL', // token prefix - short, up to 4 letters string\n  {value: await collectionHelpers.collectionCreationFee()}\n)).wait()\n\nconst collectionAddress = txCreateCollection.events?.[0].args?.collectionId as string\n\n// make collection ERC721Metadata compatible, to create necessary properties and activate\n// corresponding supportsInterface and enable mintWithTokenURI and tokenURI methods \n//\n// Actually it's optional but if we want to make it compatible with \n// common ethereum-world NFT collections, it's better to enable this compatibility.\n// anyway, it just improves the collection and doesn't brake or mangle anything. \nconst txMakeCompatible = await (await collectionHelpers.makeCollectionERC721MetadataCompatible(\n  collectionAddress,\n  '' // baseURI\n)).wait()\nconsole.log(`Collection #${collectionId} (address ${collectionAddress}) is now ERC721Compatible`)\n\nconst collection = await UniqueNFTFactory(collectionAddress, wallet, ethers)\n\nconst txMintToken = await (await collection.mintWithTokenURI(\n  wallet.address,\n  'ipfs://QmZ8Syn28bEhZJKYeZCxUTM5Ut74ccKKDbQCqk5AuYsEnp'\n)).wait()\n\n// this .toNumber() type casting is safe because tokenId upper boundary is 2**32\nconst tokenId = txMintToken.events?.[0].args?.tokenId.toNumber()\nconst tokenUri = await collection.tokenURI(tokenId)\n\nconsole.log(`Successfully minted token #${tokenId}, it's URI is: ${tokenUri}`)\n```\n\n## Exports\n\n### Solidity interfaces and smart contracts and ABI:\n\n`import {...} from '@unique-nft/solidity-interfaces/contracts'`\n\n`import {...} from '@unique-nft/solidity-interfaces/abi'`\n\nUnique interfaces and smart contracts solidity sources:\n\n- CollectionHelpers.sol / .json\n- ContractHelpers.sol / .json\n- UniqueFungible.sol / .json\n- UniqueNFT.sol / .json\n- UniqueRefungible.sol / .json\n- UniqueRefungibleToken.sol / .json\n\n### Ethers ready-to-use factories and typescript types\n\n```ts\nimport {\n  CollectionHelpers__factory,\n  ContractHelpers__factory,\n  UniqueFungible__factory,\n  UniqueNFT__factory,\n  UniqueRefungible__factory,\n  UniqueRefungibleToken__factory,\n  //typescript types:\n  CollectionHelpers,\n  ContractHelpers,\n  UniqueNFT,\n  UniqueFungible,\n  UniqueRefungible,\n  UniqueRefungibleToken,\n} from '@unique-nft/solidity-interfaces/ethers'\n```\n\n### Web3.js typescript types\n\n```ts\nimport {\n  CollectionHelpers,\n  ContractHelpers,\n  UniqueNFT,\n  UniqueFungible,\n  UniqueRefungible,\n  UniqueRefungibleToken,\n} from '@unique-nft/solidity-interfaces/web3'\n```\n\n_note: it requires web3.js installed on your own, web3.js is a peer dependency for this project_\n\n### Static addresses for Helpers interfaces:\n\n|Interface|Address|\n|---|---|\n|collectionHelpers|0x6C4E9fE1AE37a41E93CEE429e8E1881aBdcbb54F|\n|contractHelpers|0x842899ECF380553E8a4de75bF534cdf6fBF64049|\n\n```ts\nimport {constants} from '@unique-nft/solidity-interfaces'\n\nconsole.log(constants.STATIC_ADDRESSES.collectionHelpers)\nconsole.log(constants.STATIC_ADDRESSES.contractHelpers)\n```\n","readmeFilename":"README.md"}