create-dubhe 0.0.11 → 0.0.12
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 +1 -1
- package/template/101/initia-template/package.json +1 -1
- package/template/101/movement-template/package.json +1 -1
- 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
|
@@ -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",
|
|
@@ -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(),
|