Skip to content

Commit

Permalink
role
Browse files Browse the repository at this point in the history
  • Loading branch information
dfstio committed Dec 25, 2024
1 parent b2d82c7 commit 7d6b009
Show file tree
Hide file tree
Showing 27 changed files with 221 additions and 169 deletions.
3 changes: 3 additions & 0 deletions .syncpackrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"formatRepository": false
}
2 changes: 1 addition & 1 deletion guides/trade.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ order: 3

1. Open [minatokens.com](https://minatokens.com/)
2. Connect your wallet
3. Click on 'Explore' and then click on TESTME token to open its page, or open directly the [token TESTME page](https://minatokens.com/token/B62qnw9rRAuE8vnHWk28TXxNVf3jPEdjRK3kk1H6utYk8pQTC9ycdyU). For Zeko, use this [link](https://zekotokens.com/token/B62qjqdRCu4bjNnPfYTLX6NYCWGcMNPTasYfVuekMoYEz6jDHxebvJe)
3. Click on 'Explore' and then click on TESTME token to open its page, or open directly the [token TESTME page](https://minatokens.com/token/B62qrhyVjXDBscG7i7KYJoMq6s4Gho3KQByu9KSmgVGHUKNnfsaH8q7). For Zeko, use this [link](https://zekotokens.com/token/B62qjqdRCu4bjNnPfYTLX6NYCWGcMNPTasYfVuekMoYEz6jDHxebvJe)
4. Click on 'Trade' button or scroll down to 'Orderbook' section
5. Select the offer you want to buy and enter the amount you want to buy
6. Click on Buy TESTME, sign the transaction, and wait for transaction to be included in a block
Expand Down
49 changes: 25 additions & 24 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

44 changes: 22 additions & 22 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,44 +1,44 @@
{
"name": "minatokens-lib",
"description": "MinaTokens API Library",
"version": "0.12.5",
"author": "DFST",
"dependencies": {},
"devDependencies": {
"@types/node": "^22.10.2",
"o1js": "^2.2.0",
"ts-node": "^10.9.2",
"typedoc": "^0.27.3",
"typedoc-plugin-markdown": "^4.3.2",
"typescript": "^5.7.2"
},
"license": "Apache-2.0",
"private": true,
"type": "module",
"scripts": {
"build": "npm run build -w @minatokens/api && npm run build -w @minatokens/storage && npm run build -w @minatokens/token && npm run build -w @minatokens/upgradable && npm run build -w @minatokens/nft && npm run build -w @minatokens/abi",
"release": "node --trace-uncaught --loader=ts-node/esm --enable-source-maps scripts/release.ts",
"version": "node --trace-uncaught --loader=ts-node/esm --enable-source-maps scripts/version.ts",
"openapi": "rdme openapi packages/api/open-api.yaml --update",
"generate": "npm run generate -w @minatokens/api",
"guides": "rdme docs guides",
"docs": "rm -rf docs && typedoc && node --trace-uncaught --loader=ts-node/esm --enable-source-maps scripts/build-docs_v2.ts && rdme docs:prune guides --confirm && rdme docs docs",
"clean": "rm -rf cache && rm -rf node_modules && rm -rf dist && rm -rf packages/*/node_modules && rm -rf packages/*/dist && rm package-lock.json",
"compile": "npm run compile:devnet && npm run compile:mainnet",
"compile:devnet": "CHAIN=devnet node --trace-uncaught --loader=ts-node/esm --enable-source-maps --test scripts/compile.ts && npm run build -w @minatokens/abi",
"compile:mainnet": "CHAIN=mainnet node --trace-uncaught --loader=ts-node/esm --enable-source-maps --test scripts/compile.ts && npm run build -w @minatokens/abi",
"docs": "rm -rf docs && typedoc && node --trace-uncaught --loader=ts-node/esm --enable-source-maps scripts/build-docs_v2.ts && rdme docs:prune guides --confirm && rdme docs docs",
"format": "syncpack format",
"generate": "npm run generate -w @minatokens/api",
"guides": "rdme docs guides",
"lint": "syncpack lint",
"login": "npm login",
"sync": "syncpack list-mismatches",
"openapi": "rdme openapi packages/api/open-api.yaml --update",
"rebuild": "npm run clean && npm i && npm run build",
"compile:devnet": "CHAIN=devnet node --trace-uncaught --loader=ts-node/esm --enable-source-maps --test scripts/compile.ts && npm run build -w @minatokens/abi",
"compile:mainnet": "CHAIN=mainnet node --trace-uncaught --loader=ts-node/esm --enable-source-maps --test scripts/compile.ts && npm run build -w @minatokens/abi",
"compile": "npm run compile:devnet && npm run compile:mainnet"
"release": "node --trace-uncaught --loader=ts-node/esm --enable-source-maps scripts/release.ts",
"sync": "syncpack list-mismatches",
"version": "node --trace-uncaught --loader=ts-node/esm --enable-source-maps scripts/version.ts"
},
"type": "module",
"workspaces": [
"packages/api",
"packages/abi",
"packages/nft",
"packages/storage",
"packages/token",
"packages/upgradable"
],
"version": "0.12.2",
"dependencies": {},
"devDependencies": {
"o1js": "^2.2.0",
"@types/node": "^22.10.2",
"ts-node": "^10.9.2",
"typescript": "^5.7.2",
"typedoc": "^0.27.3",
"typedoc-plugin-markdown": "^4.3.2"
}
]
}
32 changes: 15 additions & 17 deletions packages/abi/dist/node/index.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -426,31 +426,16 @@ async function buildTokenTransaction(params) {
const accountCreationFee = (isNewBidOfferAccount ? 1e9 : 0) + (isNewBuyAccount ? 1e9 : 0) + (isNewSellAccount ? 1e9 : 0) + (isNewTransferMintAccount ? 1e9 : 0) + (isToNewAccount && txType === "token:mint" && isAdvanced && advancedAdminContract.whitelist.get().isSome().toBoolean() ? 1e9 : 0);
console.log("accountCreationFee", accountCreationFee / 1e9);
switch (txType) {
case "token:mint":
case "token:transfer":
case "token:airdrop":
case "token:offer:create":
case "token:bid:create":
case "token:offer:buy":
case "token:offer:withdraw":
case "token:bid:sell":
if (import_o1js2.Mina.getAccount(zkToken.address).zkapp?.verificationKey?.hash.toJSON() !== vk.FungibleToken.hash)
throw new Error("Invalid token verification key, token contract has to be upgraded");
break;
}
switch (txType) {
case "token:offer:create":
case "token:offer:buy":
case "token:offer:withdraw":
case "token:offer:whitelist":
if (offerContract === void 0)
throw new Error("Offer contract is required");
if (import_o1js2.Mina.getAccount(offerContract.address).zkapp?.verificationKey?.hash.toJSON() !== vk.FungibleTokenOfferContract.hash)
if (import_o1js2.Mina.getAccount(offerContract.address, tokenId).zkapp?.verificationKey?.hash.toJSON() !== vk.FungibleTokenOfferContract.hash)
throw new Error("Invalid offer verification key, offer contract has to be upgraded");
break;
}
switch (txType) {
case "token:bid:create":
case "token:bid:sell":
case "token:bid:withdraw":
case "token:bid:whitelist":
Expand All @@ -460,6 +445,19 @@ async function buildTokenTransaction(params) {
throw new Error("Invalid bid verification key, bid contract has to be upgraded");
break;
}
switch (txType) {
case "token:mint":
case "token:transfer":
case "token:airdrop":
case "token:offer:create":
case "token:bid:create":
case "token:offer:buy":
case "token:offer:withdraw":
case "token:bid:sell":
if (import_o1js2.Mina.getAccount(zkToken.address).zkapp?.verificationKey?.hash.toJSON() !== vk.FungibleToken.hash)
throw new Error("Invalid token verification key, token contract has to be upgraded");
break;
}
const tx = await import_o1js2.Mina.transaction({ sender, fee, memo, nonce }, async () => {
const feeAccountUpdate = import_o1js2.AccountUpdate.createSigned(sender);
if (accountCreationFee > 0) {
Expand Down Expand Up @@ -831,7 +829,7 @@ async function getContractInfo(params) {
info0.totalSupply = {
type: "bigint",
value: totalSupply.toString(),
presentation: formatBalanceInternal(Number(totalSupply / BigInt(1 << decimals2.toNumber())))
presentation: formatBalanceInternal(Number(totalSupply / BigInt(10 ** decimals2.toNumber())))
};
const info1 = await getContractInfo({
address: admin,
Expand Down
30 changes: 14 additions & 16 deletions packages/abi/dist/node/token/build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/abi/dist/node/token/build.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion packages/abi/dist/tsconfig.web.tsbuildinfo

Large diffs are not rendered by default.

30 changes: 14 additions & 16 deletions packages/abi/dist/web/token/build.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/abi/dist/web/token/build.js.map

Large diffs are not rendered by default.

Loading

0 comments on commit 7d6b009

Please sign in to comment.