create-dubhe 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/template/101/aptos-template/package.json +4 -4
- package/template/101/aptos-template/src/pages/home/index.tsx +1 -2
- package/template/101/initia-template/package.json +1 -1
- package/template/101/movement-template/package.json +7 -7
- package/template/101/movement-template/scripts/checkBalance.ts +2 -2
- package/template/101/movement-template/src/pages/home/index.tsx +1 -2
- package/template/101/rooch-template/package.json +1 -1
- package/template/101/rooch-template/src/pages/home/index.tsx +3 -1
- package/template/101/sui-template/package.json +1 -1
- package/template/101/sui-template/src/pages/home/index.tsx +9 -4
- package/template/cocos/sui-template/assets/lib/dubhe.js +12 -2
- package/template/cocos/sui-template/package.json +1 -1
- package/template/contract/sui-template/package.json +1 -1
- package/template/nextjs/sui-template/package.json +1 -1
- package/template/nextjs/sui-template/src/pages/home/index.tsx +9 -4
package/package.json
CHANGED
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"start:localnet": "pnpm dubhe localnode start",
|
|
13
13
|
"faucet": "pnpm dubhe faucet --network",
|
|
14
14
|
"check-balance": "NODE_NO_WARNINGS=1 ts-node scripts/checkBalance.ts",
|
|
15
|
-
"deploy:localnet": "NODE_NO_WARNINGS=1 pnpm dubhe publish --network
|
|
15
|
+
"deploy:localnet": "NODE_NO_WARNINGS=1 pnpm dubhe publish --network localnet && pnpm config:store localnet",
|
|
16
16
|
"deploy:testnet": "NODE_NO_WARNINGS=1 pnpm dubhe publish --network testnet && pnpm config:store testnet",
|
|
17
17
|
"// Development Environment": "----------------",
|
|
18
18
|
"dev": "pnpm dev:localnet",
|
|
19
19
|
"dev:localnet": "pnpm setup:localnet && pnpm next",
|
|
20
20
|
"dev:testnet": "pnpm setup:testnet && pnpm next",
|
|
21
|
-
"setup:localnet": "pnpm account:gen && pnpm faucet
|
|
21
|
+
"setup:localnet": "pnpm account:gen && pnpm faucet localnet && pnpm deploy:localnet",
|
|
22
22
|
"setup:testnet": "pnpm account:gen && pnpm check-balance testnet && pnpm deploy:testnet",
|
|
23
23
|
"build": "next build",
|
|
24
24
|
"start": "next start",
|
|
@@ -28,8 +28,8 @@
|
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@0xobelisk/aptos-common": "^0.0.7",
|
|
31
|
-
"@0xobelisk/aptos-client": "^0.0.
|
|
32
|
-
"@0xobelisk/aptos-cli": "^0.0.
|
|
31
|
+
"@0xobelisk/aptos-client": "^0.0.19",
|
|
32
|
+
"@0xobelisk/aptos-cli": "^0.0.15",
|
|
33
33
|
"clsx": "^1.2.1",
|
|
34
34
|
"dotenv": "^16.4.5",
|
|
35
35
|
"framer-motion": "^10.12.16",
|
|
@@ -49,8 +49,7 @@ const Home = () => {
|
|
|
49
49
|
description: new Date().toUTCString(),
|
|
50
50
|
action: {
|
|
51
51
|
label: 'Check in Explorer',
|
|
52
|
-
onClick: () =>
|
|
53
|
-
window.open(`https://explorer.aptoslabs.com/txn/${response.hash}?network=${NETWORK}`, '_blank'),
|
|
52
|
+
onClick: () => window.open(dubhe.getTxExplorerUrl(response.hash), '_blank'),
|
|
54
53
|
},
|
|
55
54
|
});
|
|
56
55
|
setLoading(false);
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"prod:testnet": "pnpm config:store testnet && pnpm next"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
|
-
"@0xobelisk/initia-client": "^0.0.
|
|
30
|
+
"@0xobelisk/initia-client": "^0.0.5",
|
|
31
31
|
"@0xobelisk/initia-cli": "^0.0.3",
|
|
32
32
|
"@0xobelisk/sui-common": "^0.5.21",
|
|
33
33
|
"clsx": "^1.2.1",
|
|
@@ -12,24 +12,24 @@
|
|
|
12
12
|
"start:localnet": "pnpm dubhe localnode start",
|
|
13
13
|
"faucet": "pnpm dubhe faucet --network",
|
|
14
14
|
"check-balance": "NODE_NO_WARNINGS=1 ts-node scripts/checkBalance.ts",
|
|
15
|
-
"deploy:localnet": "NODE_NO_WARNINGS=1 pnpm dubhe publish --network
|
|
16
|
-
"deploy:
|
|
15
|
+
"deploy:localnet": "NODE_NO_WARNINGS=1 pnpm dubhe publish --network localnet && pnpm config:store localnet",
|
|
16
|
+
"deploy:movementtestnet": "NODE_NO_WARNINGS=1 pnpm dubhe publish --network movementtestnet && pnpm config:store movementtestnet",
|
|
17
17
|
"// Development Environment": "----------------",
|
|
18
18
|
"dev": "pnpm dev:localnet",
|
|
19
19
|
"dev:localnet": "pnpm setup:localnet && pnpm next",
|
|
20
20
|
"dev:testnet": "pnpm setup:testnet && pnpm next",
|
|
21
|
-
"setup:localnet": "pnpm account:gen && pnpm faucet
|
|
22
|
-
"setup:testnet": "pnpm account:gen && pnpm check-balance movementtestnet && pnpm deploy:
|
|
21
|
+
"setup:localnet": "pnpm account:gen && pnpm faucet localnet && pnpm deploy:localnet",
|
|
22
|
+
"setup:testnet": "pnpm account:gen && pnpm check-balance movementtestnet && pnpm deploy:movementtestnet",
|
|
23
23
|
"build": "next build",
|
|
24
24
|
"start": "next start",
|
|
25
25
|
"// Production Environment": "----------------",
|
|
26
26
|
"prod:localnet": "pnpm config:store localnet && pnpm next",
|
|
27
|
-
"prod:testnet": "pnpm config:store
|
|
27
|
+
"prod:testnet": "pnpm config:store movementtestnet && pnpm next"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@0xobelisk/aptos-common": "^0.0.7",
|
|
31
|
-
"@0xobelisk/aptos-client": "^0.0.
|
|
32
|
-
"@0xobelisk/aptos-cli": "^0.0.
|
|
31
|
+
"@0xobelisk/aptos-client": "^0.0.19",
|
|
32
|
+
"@0xobelisk/aptos-cli": "^0.0.15",
|
|
33
33
|
"clsx": "^1.2.1",
|
|
34
34
|
"dotenv": "^16.4.5",
|
|
35
35
|
"framer-motion": "^10.12.16",
|
|
@@ -21,12 +21,12 @@ async function checkBalance(network: string) {
|
|
|
21
21
|
});
|
|
22
22
|
|
|
23
23
|
const balance = await dubhe.getBalance();
|
|
24
|
-
if (balance ===
|
|
24
|
+
if (balance === 0) {
|
|
25
25
|
console.log(chalk.yellow(`Account balance is 0, need to get ${network} coins`));
|
|
26
26
|
process.exit(1);
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
console.log(chalk.green(`Current account balance: ${(Number(balance) / 100_000_000).toFixed(4)}
|
|
29
|
+
console.log(chalk.green(`Current account balance: ${(Number(balance) / 100_000_000).toFixed(4)} MOVE`));
|
|
30
30
|
process.exit(0);
|
|
31
31
|
} catch (error) {
|
|
32
32
|
console.error(chalk.red('Failed to check balance:', error));
|
|
@@ -49,8 +49,7 @@ const Home = () => {
|
|
|
49
49
|
description: new Date().toUTCString(),
|
|
50
50
|
action: {
|
|
51
51
|
label: 'Check in Explorer',
|
|
52
|
-
onClick: () =>
|
|
53
|
-
window.open(`https://explorer.aptoslabs.com/txn/${response.hash}?network=${NETWORK}`, '_blank'),
|
|
52
|
+
onClick: () => window.open(dubhe.getTxExplorerUrl(response.hash), '_blank'),
|
|
54
53
|
},
|
|
55
54
|
});
|
|
56
55
|
setLoading(false);
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
"prod:testnet": "pnpm config:store testnet && pnpm next"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@0xobelisk/rooch-client": "^0.0.
|
|
29
|
+
"@0xobelisk/rooch-client": "^0.0.5",
|
|
30
30
|
"@0xobelisk/rooch-cli": "^0.0.3",
|
|
31
31
|
"@0xobelisk/sui-common": "^0.5.21",
|
|
32
32
|
"clsx": "^1.2.1",
|
|
@@ -39,7 +39,9 @@ const Home = () => {
|
|
|
39
39
|
});
|
|
40
40
|
|
|
41
41
|
const tx = new Transaction();
|
|
42
|
-
const response = await dubhe.tx.counter.increase(
|
|
42
|
+
const response = await dubhe.tx.counter.increase({
|
|
43
|
+
tx,
|
|
44
|
+
});
|
|
43
45
|
console.log(response.execution_info.tx_hash, response.execution_info.status.type);
|
|
44
46
|
if (response.execution_info.status.type == 'executed') {
|
|
45
47
|
setTimeout(async () => {
|
|
@@ -40,9 +40,10 @@ const Home = () => {
|
|
|
40
40
|
metadata: metadata,
|
|
41
41
|
});
|
|
42
42
|
const tx = new Transaction();
|
|
43
|
-
const query_value = (await dubhe.query.counter_schema.get_value(
|
|
44
|
-
tx
|
|
45
|
-
|
|
43
|
+
const query_value = (await dubhe.query.counter_schema.get_value({
|
|
44
|
+
tx,
|
|
45
|
+
params: [tx.object(Counter_Object_Id)],
|
|
46
|
+
})) as DevInspectResults;
|
|
46
47
|
console.log('Counter value:', dubhe.view(query_value)[0]);
|
|
47
48
|
setValue(dubhe.view(query_value)[0]);
|
|
48
49
|
};
|
|
@@ -58,7 +59,11 @@ const Home = () => {
|
|
|
58
59
|
secretKey: PRIVATEKEY,
|
|
59
60
|
});
|
|
60
61
|
const tx = new Transaction();
|
|
61
|
-
(await dubhe.tx.counter_system.inc(
|
|
62
|
+
(await dubhe.tx.counter_system.inc({
|
|
63
|
+
tx,
|
|
64
|
+
params: [tx.object(Counter_Object_Id)],
|
|
65
|
+
isRaw: true,
|
|
66
|
+
})) as TransactionResult;
|
|
62
67
|
const response = await dubhe.signAndSendTxn(tx);
|
|
63
68
|
if (response.effects.status.status == 'success') {
|
|
64
69
|
setTimeout(async () => {
|
|
@@ -4590,13 +4590,23 @@ function withMeta(meta, creator) {
|
|
|
4590
4590
|
return creator;
|
|
4591
4591
|
}
|
|
4592
4592
|
function createQuery(meta, fn) {
|
|
4593
|
-
return withMeta(meta, async (
|
|
4593
|
+
return withMeta(meta, async ({
|
|
4594
|
+
tx,
|
|
4595
|
+
params,
|
|
4596
|
+
typeArguments,
|
|
4597
|
+
isRaw
|
|
4598
|
+
}) => {
|
|
4594
4599
|
const result = await fn(tx, params, typeArguments, isRaw);
|
|
4595
4600
|
return result;
|
|
4596
4601
|
});
|
|
4597
4602
|
}
|
|
4598
4603
|
function createTx(meta, fn) {
|
|
4599
|
-
return withMeta(meta, async (
|
|
4604
|
+
return withMeta(meta, async ({
|
|
4605
|
+
tx,
|
|
4606
|
+
params,
|
|
4607
|
+
typeArguments,
|
|
4608
|
+
isRaw
|
|
4609
|
+
}) => {
|
|
4600
4610
|
return await fn(tx, params, typeArguments, isRaw);
|
|
4601
4611
|
});
|
|
4602
4612
|
}
|
|
@@ -45,9 +45,10 @@ const Home: React.FC = () => {
|
|
|
45
45
|
metadata: metadata,
|
|
46
46
|
});
|
|
47
47
|
const tx = new Transaction();
|
|
48
|
-
const queryValue = (await dubhe.query.counter_schema.get_value(
|
|
49
|
-
tx
|
|
50
|
-
|
|
48
|
+
const queryValue = (await dubhe.query.counter_schema.get_value({
|
|
49
|
+
tx,
|
|
50
|
+
params: [tx.object(Counter_Object_Id)],
|
|
51
|
+
})) as DevInspectResults;
|
|
51
52
|
console.log('Counter value:', dubhe.view(queryValue)[0]);
|
|
52
53
|
setValue(dubhe.view(queryValue)[0]);
|
|
53
54
|
} catch (error) {
|
|
@@ -82,7 +83,11 @@ const Home: React.FC = () => {
|
|
|
82
83
|
metadata: metadata,
|
|
83
84
|
});
|
|
84
85
|
const tx = new Transaction();
|
|
85
|
-
await dubhe.tx.counter_system.inc(
|
|
86
|
+
await dubhe.tx.counter_system.inc({
|
|
87
|
+
tx,
|
|
88
|
+
params: [tx.object(Counter_Object_Id)],
|
|
89
|
+
isRaw: true,
|
|
90
|
+
});
|
|
86
91
|
await signAndExecuteTransaction(
|
|
87
92
|
{
|
|
88
93
|
transaction: tx.serialize(),
|