@0xobelisk/sui-client 1.0.1 → 1.0.3
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/dist/dubhe.d.ts +2 -2
- package/dist/index.js +13 -11
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +13 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/dubhe.ts +14 -12
package/dist/dubhe.d.ts
CHANGED
|
@@ -39,9 +39,9 @@ export declare class Dubhe {
|
|
|
39
39
|
get tx(): MapMoudleFuncTx;
|
|
40
40
|
get object(): MapObjectStruct;
|
|
41
41
|
view(dryResult: DevInspectResults): any[];
|
|
42
|
-
state({ schema,
|
|
42
|
+
state({ schema, field, objectId, storageType, params, }: {
|
|
43
43
|
schema: string;
|
|
44
|
-
|
|
44
|
+
field: string;
|
|
45
45
|
objectId: string;
|
|
46
46
|
storageType: string;
|
|
47
47
|
params: any[];
|
package/dist/index.js
CHANGED
|
@@ -1503,21 +1503,23 @@ var Dubhe = class {
|
|
|
1503
1503
|
}
|
|
1504
1504
|
async state({
|
|
1505
1505
|
schema,
|
|
1506
|
-
|
|
1506
|
+
field,
|
|
1507
1507
|
objectId,
|
|
1508
1508
|
storageType,
|
|
1509
1509
|
params
|
|
1510
1510
|
}) {
|
|
1511
1511
|
const tx = new import_transactions3.Transaction();
|
|
1512
1512
|
const moduleName = `${schema}_schema`;
|
|
1513
|
-
const functionName = `get_${
|
|
1513
|
+
const functionName = `get_${field}`;
|
|
1514
1514
|
const schemaObject = tx.object(objectId);
|
|
1515
1515
|
const storageValueMatch = storageType.match(/^StorageValue<(.+)>$/);
|
|
1516
1516
|
const storageMapMatch = storageType.match(/^StorageMap<(.+),\s*(.+)>$/);
|
|
1517
1517
|
const storageDoubleMapMatch = storageType.match(
|
|
1518
1518
|
/^StorageDoubleMap<(.+),\s*(.+),\s*(.+)>$/
|
|
1519
1519
|
);
|
|
1520
|
-
let processedParams = [
|
|
1520
|
+
let processedParams = [
|
|
1521
|
+
schemaObject
|
|
1522
|
+
];
|
|
1521
1523
|
if (storageValueMatch) {
|
|
1522
1524
|
if (params.length > 0) {
|
|
1523
1525
|
console.warn(
|
|
@@ -1820,21 +1822,21 @@ _processKeyParameter = new WeakSet();
|
|
|
1820
1822
|
processKeyParameter_fn = function(tx, keyType, value) {
|
|
1821
1823
|
switch (keyType.toLowerCase()) {
|
|
1822
1824
|
case "u8":
|
|
1823
|
-
return tx.pure(value
|
|
1825
|
+
return tx.pure.u8(value);
|
|
1824
1826
|
case "u16":
|
|
1825
|
-
return tx.pure(value
|
|
1827
|
+
return tx.pure.u16(value);
|
|
1826
1828
|
case "u32":
|
|
1827
|
-
return tx.pure(value
|
|
1829
|
+
return tx.pure.u32(value);
|
|
1828
1830
|
case "u64":
|
|
1829
|
-
return tx.pure(value
|
|
1831
|
+
return tx.pure.u64(value);
|
|
1830
1832
|
case "u128":
|
|
1831
|
-
return tx.pure(value
|
|
1833
|
+
return tx.pure.u128(value);
|
|
1832
1834
|
case "u256":
|
|
1833
|
-
return tx.pure(value
|
|
1835
|
+
return tx.pure.u256(value);
|
|
1834
1836
|
case "bool":
|
|
1835
|
-
return tx.pure(value
|
|
1837
|
+
return tx.pure.bool(value);
|
|
1836
1838
|
case "address":
|
|
1837
|
-
return tx.pure(value
|
|
1839
|
+
return tx.pure.address(value);
|
|
1838
1840
|
default:
|
|
1839
1841
|
if (keyType.includes("::")) {
|
|
1840
1842
|
return tx.object(value);
|