@typemove/sui 2.0.5 → 2.0.6
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/esm/builtin/0x2.d.ts +14 -0
- package/dist/esm/builtin/0x2.d.ts.map +1 -1
- package/dist/esm/builtin/0x2.js +30 -1
- package/dist/esm/builtin/0x2.js.map +1 -1
- package/dist/esm/builtin/0x3.d.ts +0 -5
- package/dist/esm/builtin/0x3.d.ts.map +1 -1
- package/dist/esm/builtin/0x3.js +1 -27
- package/dist/esm/builtin/0x3.js.map +1 -1
- package/dist/esm/move-coder.d.ts.map +1 -1
- package/dist/esm/move-coder.js +12 -0
- package/dist/esm/move-coder.js.map +1 -1
- package/package.json +2 -2
- package/src/abis/0x2.json +84 -1
- package/src/abis/0x3.json +0 -202
- package/src/builtin/0x2.ts +52 -1
- package/src/builtin/0x3.ts +1 -45
- package/src/move-coder.ts +12 -0
package/src/move-coder.ts
CHANGED
|
@@ -61,6 +61,18 @@ export class MoveCoder extends AbstractMoveCoder<ModuleWithAddress, SuiEventInpu
|
|
|
61
61
|
}
|
|
62
62
|
return super.decode(data, type)
|
|
63
63
|
}
|
|
64
|
+
// gRPC's unified Object.json also flattens 0x1::type_name::TypeName to its
|
|
65
|
+
// inner string (e.g. "<addr>::coin::COIN") — re-wrap to `{ name: '...' }` so
|
|
66
|
+
// downstream `.name` accessors keep working. Without this the string falls
|
|
67
|
+
// into the generic struct walk and decodes to `{ name: undefined }`. The
|
|
68
|
+
// BCS-shaped path (`{ name: { bytes: ... } }`) is delegated to super.decode,
|
|
69
|
+
// whose field walk hits the ascii::String case.
|
|
70
|
+
if (type.qname === '0x1::type_name::TypeName') {
|
|
71
|
+
if (typeof data === 'string') {
|
|
72
|
+
return { name: data } as any
|
|
73
|
+
}
|
|
74
|
+
return super.decode(data, type)
|
|
75
|
+
}
|
|
64
76
|
switch (type.qname) {
|
|
65
77
|
case '0x1::ascii::Char':
|
|
66
78
|
if (data !== undefined && typeof data !== 'string') {
|