@openzeppelin/ui-builder-adapter-stellar 0.12.0 → 0.13.0
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/index.cjs +12 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +12 -12
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/configuration/__tests__/rpc.test.ts +0 -1
- package/src/mapping/constants.ts +12 -6
- package/src/mapping/type-mapper.ts +6 -6
- package/src/networks/README.md +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openzeppelin/ui-builder-adapter-stellar",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.13.0",
|
|
4
4
|
"description": "Stellar Adapter for UI Builder",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"openzeppelin",
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"lossless-json": "^4.0.2",
|
|
43
43
|
"lucide-react": "^0.510.0",
|
|
44
44
|
"react-hook-form": "^7.62.0",
|
|
45
|
-
"@openzeppelin/ui-builder-types": "0.
|
|
46
|
-
"@openzeppelin/ui-builder-ui": "0.
|
|
47
|
-
"@openzeppelin/ui-builder-utils": "^0.
|
|
45
|
+
"@openzeppelin/ui-builder-types": "0.13.0",
|
|
46
|
+
"@openzeppelin/ui-builder-ui": "0.13.0",
|
|
47
|
+
"@openzeppelin/ui-builder-utils": "^0.13.0"
|
|
48
48
|
},
|
|
49
49
|
"devDependencies": {
|
|
50
50
|
"@types/lodash": "^4.17.20",
|
|
@@ -22,7 +22,6 @@ const createMockConfig = (
|
|
|
22
22
|
sorobanRpcUrl: sorobanRpcUrl || '', // Allow undefined or empty for testing error cases
|
|
23
23
|
networkPassphrase: `Test ${id} Network`,
|
|
24
24
|
explorerUrl: `https://stellar.expert/explorer/${id}`,
|
|
25
|
-
icon: 'stellar',
|
|
26
25
|
});
|
|
27
26
|
|
|
28
27
|
// Mock the appConfigService from the correct package
|
package/src/mapping/constants.ts
CHANGED
|
@@ -3,6 +3,12 @@ import type { FieldType } from '@openzeppelin/ui-builder-types';
|
|
|
3
3
|
/**
|
|
4
4
|
* Stellar/Soroban-specific type mapping to default form field types.
|
|
5
5
|
* Based on Soroban type system: https://developers.stellar.org/docs/learn/fundamentals/contract-development/types
|
|
6
|
+
*
|
|
7
|
+
* Note: Large integer types (U64, U128, U256, I64, I128, I256) are mapped to 'bigint'
|
|
8
|
+
* instead of 'number' to avoid JavaScript's Number precision limitations.
|
|
9
|
+
* JavaScript's Number type can only safely represent integers up to 2^53 - 1,
|
|
10
|
+
* but these types can hold much larger values. The BigIntField component stores values
|
|
11
|
+
* as strings and the Stellar adapter handles conversion automatically.
|
|
6
12
|
*/
|
|
7
13
|
export const STELLAR_TYPE_TO_FIELD_TYPE: Record<string, FieldType> = {
|
|
8
14
|
// Address types
|
|
@@ -15,15 +21,15 @@ export const STELLAR_TYPE_TO_FIELD_TYPE: Record<string, FieldType> = {
|
|
|
15
21
|
|
|
16
22
|
// Numeric types - unsigned integers
|
|
17
23
|
U32: 'number',
|
|
18
|
-
U64: '
|
|
19
|
-
U128: '
|
|
20
|
-
U256: '
|
|
24
|
+
U64: 'bigint',
|
|
25
|
+
U128: 'bigint',
|
|
26
|
+
U256: 'bigint',
|
|
21
27
|
|
|
22
28
|
// Numeric types - signed integers
|
|
23
29
|
I32: 'number',
|
|
24
|
-
I64: '
|
|
25
|
-
I128: '
|
|
26
|
-
I256: '
|
|
30
|
+
I64: 'bigint',
|
|
31
|
+
I128: 'bigint',
|
|
32
|
+
I256: 'bigint',
|
|
27
33
|
|
|
28
34
|
// Boolean type
|
|
29
35
|
Bool: 'checkbox',
|
|
@@ -133,15 +133,15 @@ export function getStellarCompatibleFieldTypes(parameterType: string): FieldType
|
|
|
133
133
|
|
|
134
134
|
// Unsigned integers
|
|
135
135
|
U32: ['number', 'amount', 'text'],
|
|
136
|
-
U64: ['number', 'amount', 'text'],
|
|
137
|
-
U128: ['number', 'amount', 'text'],
|
|
138
|
-
U256: ['number', 'amount', 'text'],
|
|
136
|
+
U64: ['bigint', 'number', 'amount', 'text'],
|
|
137
|
+
U128: ['bigint', 'number', 'amount', 'text'],
|
|
138
|
+
U256: ['bigint', 'number', 'amount', 'text'],
|
|
139
139
|
|
|
140
140
|
// Signed integers
|
|
141
141
|
I32: ['number', 'amount', 'text'],
|
|
142
|
-
I64: ['
|
|
143
|
-
I128: ['
|
|
144
|
-
I256: ['
|
|
142
|
+
I64: ['bigint', 'number', 'text'],
|
|
143
|
+
I128: ['bigint', 'number', 'text'],
|
|
144
|
+
I256: ['bigint', 'number', 'text'],
|
|
145
145
|
|
|
146
146
|
// Boolean
|
|
147
147
|
Bool: ['checkbox', 'select', 'radio', 'text'],
|
package/src/networks/README.md
CHANGED
|
@@ -67,7 +67,7 @@ export const stellarCustom: StellarNetworkConfig = {
|
|
|
67
67
|
sorobanRpcUrl: 'https://soroban.custom.example',
|
|
68
68
|
networkPassphrase: 'Custom Network Passphrase',
|
|
69
69
|
explorerUrl: 'https://stellar.expert/explorer/custom',
|
|
70
|
-
|
|
70
|
+
iconComponent: NetworkStellarCustom,
|
|
71
71
|
};
|
|
72
72
|
```
|
|
73
73
|
|