mintbase / mintbase-js Goto Github PK
View Code? Open in Web Editor NEWPowerful open-source library for doing all things NFTs on the NEAR protocol.
Home Page: https://docs.mintbase.xyz
License: MIT License
Powerful open-source library for doing all things NFTs on the NEAR protocol.
Home Page: https://docs.mintbase.xyz
License: MIT License
Allow batch/multi transactions to multiple contracts.
See Storage Staking
data obj is inside another data obj property.
should be on top level
create-mintbase-app
for examples.The goal of this is to allow using the different modules of Mintbase independently.
mainnet
and testnet
MintbaseJS (only one query)
Examples (migrate queries to new schema)
Hasura REST API endpoints - could use auditing. Who is using this?
Let's simplify the API by reducing the amount of methods that can for example list tokens in the marketplace to one. Similarly to how transfer
works.
Instead of throwing errors, return an object { data: any, error?: string }
, for example.
Implementation should follow apollo lib design.
Plz check and update the telegram link on https://docs.mintbase.io/dev/mintbasejs, thanks!
Files: mocks.ts
and setupTest.ts
Assure fetch by id, returns a unique result and not an array.
This will allow us to change queries on the fly.
Update Medatada fields to match NEAR standards.
just a test
A plan for implementations of specific user use cases.
As a mintbase platform developer I want to ______ so that I can ______
How should we approach testing to improve our test coverage on Mintbase.js?
As started here: #106
We should spend some time to finish the implementation.
Support for batch calls have been done.
List - wrap batch deposit + approve
Note: create task for Buy next sprint
We minted programmatically an NFT (probably we did it in a different way or missed something) and it broke Mintbase UI:
https://testnet.mintbase.io/store/cryptokids.mintspace2.testnet
Returns «An unexpected error has occurred.»
{ "id": "q5LiLpH0QNJ2PojWl4lmUZ3zSss8hbtz--iBLCk5T_g:cryptokids.mintspace2.testnet", "metaId": "q5LiLpH0QNJ2PojWl4lmUZ3zSss8hbtz--iBLCk5T_g", "storeId": "cryptokids.mintspace2.testnet", "store": { "id": "cryptokids.mintspace2.testnet", "name": "cryptokids", "symbol": "crk", "owner": "deus.testnet", "__typename": "stores" }, "tokens": [], "__typename": "things" }
Steps to reproduce:
Expected behavior
If the response contains an empty array of tokens, the app should handle it correctly and render the store page.
Work is under storage-calc
Thor's explanation:
These are storage costs. Multiply them by 10^19 to get cost in Near.
Eg: if the cost is 440 bytes, it's 4.4 * 10^21 yoctoNear = 0.0044Near.Mint:
First, you don't actually have to pay the whole cost at each mint. You DO have to pay ONE_YOCTO for a mint, but anything beyond that is unnecessary if you've already deposited enough onto the contract. This is because minting tokens is friggin complicated when in comes to gas costs, and only minters can call mint_tokens in any case.
This one's the most complicated. The size of the metadata AND the size of the royalty AND the size of the split owners can vary.
These costs are paid once, not per token:
100 bytes to create a record that the owner owns a new set of tokens
100 bytes or less, (usually! This can be as large as you want to make it in fact)
80 bytes for each royalty address.These costs are paid for each token
80 bytes for each split address
360 bytes for the tokenSupposing we mint N tokens with S splits, R royalties; this will fail if metadata is larger than expected:
100 + 100 + 80R + N(360 + 80S)
= 200 + 80R + N*(360 + 80*S)Approve (list):
Here, the complexity is that we have to accomodate the storage costs on both the Store and the Market.
Store:
80 bytes per approvalMarket:
360 bytes per listSo 440 bytes per token approved.
=440*NTransfer:
one yoctoⓝ
Line 143 in 4a5906f
Should be result.thing.tokens[0]
Google doc with links to code in github to locations to update queries
Doc: https://docs.google.com/spreadsheets/d/1fBVLuhDBeztbJI5pqZ_VEIwxZrzD28Dpuiuor4Ezzzw/edit#gid=0
near-api-js allows the specification of success and failure URLs.
This will be useful not just for mintbase.js users, but for the marketplace login/auth flow refactoring
At the moment, it appears that once an NFT is listed for sale via wallet.list()
it isn't possible to cancel that operation.
Would it be possible to add a wallet.unlist()
function? Assumption is needs complementary contract logic so not a quick fix?
This will allow to finish minting through mintbase.js
check omni-site components/Uploader.tsx
to see how uploads are done
I'm uploading metadata to form as the reference for a mint. For example:
const metadata = Buffer.from(JSON.stringify({
extra: "sample"
}));
const response = await uploadFileToArweave(metadata, "sample-name");
const url = `https://arweave.net/${response.id}`;
If I run this, I will get the following exception, which is misleading because the actual exception being thrown does not work with httpError.response.text:
Cannot read properties of undefined (reading 'text')
The actual exception is:
Failed to execute 'append' on 'FormData': parameter 2 is not of type 'Blob'.
I think somebody just needs to wrap the buffer in "new Blob([buffer])". Wasn't caught because append function is mocked in test.
I have limited anonymous
role to 100 req./min.
TODO: Need to find a solution to generate and distribute an API key to developers.
I bootstrapped my project from Mintbase Boilerplate and Starter for Next JS 12+, Tailwind CSS 3, and TypeScript.
The application successfully connects to a near wallet when the connect method is invoked, but when I call the
wallet.mint()
nothing happens.
I implemented it in a previous version of the application and it worked but it doesn't seem to work on this recent project I'm working on.
What could be the issue?
This supports a future looking POC.
Looking to bypass the arweave.net upload workflow to enable use of simple/small SVGs media on-chain.
Wallet.mint_simple_nft
method which bypasses the arweave requirements.A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.