@mysten/sui 2.13.4 → 2.14.1
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/CHANGELOG.md +20 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/bcs/index.d.mts +20 -20
- package/dist/client/core-resolver.mjs +3 -5
- package/dist/client/core-resolver.mjs.map +1 -1
- package/dist/client/types.d.mts +12 -3
- package/dist/client/types.d.mts.map +1 -1
- package/dist/graphql/core.mjs.map +1 -1
- package/dist/grpc/core.mjs.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
- package/dist/jsonRpc/core.mjs.map +1 -1
- package/dist/jsonRpc/types/generated.d.mts +1 -1
- package/dist/transactions/Transaction.d.mts +9 -9
- package/dist/transactions/Transaction.d.mts.map +1 -1
- package/dist/utils/sui-types.d.mts.map +1 -1
- package/dist/utils/sui-types.mjs +1 -0
- package/dist/utils/sui-types.mjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/dist/zklogin/bcs.d.mts.map +1 -1
- package/package.json +1 -1
- package/src/client/core-resolver.ts +10 -21
- package/src/client/types.ts +12 -3
- package/src/graphql/core.ts +1 -1
- package/src/grpc/core.ts +1 -1
- package/src/jsonRpc/core.ts +1 -1
- package/src/jsonRpc/types/generated.ts +1 -1
- package/src/utils/sui-types.ts +6 -0
- package/src/version.ts +1 -1
|
@@ -85,17 +85,15 @@ export async function coreClientResolveTransactionPlugin(
|
|
|
85
85
|
}
|
|
86
86
|
|
|
87
87
|
const needsSystemState = needsGasPrice || (needsPayment && usesGasCoin);
|
|
88
|
-
const [, systemStateResult, balanceResult, coinsResult,
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
needsPayment && usesGasCoin ? client.core.getChainIdentifier() : null,
|
|
98
|
-
]);
|
|
88
|
+
const [, systemStateResult, balanceResult, coinsResult, chainIdResult] = await Promise.all([
|
|
89
|
+
normalizeInputs(transactionData, client),
|
|
90
|
+
needsSystemState ? client.core.getCurrentSystemState() : null,
|
|
91
|
+
needsPayment && gasPayer ? client.core.getBalance({ owner: gasPayer }) : null,
|
|
92
|
+
needsPayment && gasPayer
|
|
93
|
+
? client.core.listCoins({ owner: gasPayer, coinType: SUI_TYPE_ARG })
|
|
94
|
+
: null,
|
|
95
|
+
needsPayment && usesGasCoin ? client.core.getChainIdentifier() : null,
|
|
96
|
+
]);
|
|
99
97
|
|
|
100
98
|
await resolveObjectReferences(transactionData, client);
|
|
101
99
|
|
|
@@ -120,7 +118,6 @@ export async function coreClientResolveTransactionPlugin(
|
|
|
120
118
|
coins: coinsResult,
|
|
121
119
|
usesGasCoin,
|
|
122
120
|
withdrawals,
|
|
123
|
-
protocolConfig: protocolConfigResult?.protocolConfig,
|
|
124
121
|
gasPayer: gasPayer!,
|
|
125
122
|
chainIdentifier: chainIdResult?.chainIdentifier ?? null,
|
|
126
123
|
epoch: systemState?.epoch ?? null,
|
|
@@ -178,7 +175,6 @@ function setGasPayment({
|
|
|
178
175
|
coins,
|
|
179
176
|
usesGasCoin,
|
|
180
177
|
withdrawals,
|
|
181
|
-
protocolConfig,
|
|
182
178
|
gasPayer,
|
|
183
179
|
chainIdentifier,
|
|
184
180
|
epoch,
|
|
@@ -188,7 +184,6 @@ function setGasPayment({
|
|
|
188
184
|
coins: SuiClientTypes.ListCoinsResponse;
|
|
189
185
|
usesGasCoin: boolean;
|
|
190
186
|
withdrawals: bigint;
|
|
191
|
-
protocolConfig: SuiClientTypes.ProtocolConfig | undefined;
|
|
192
187
|
gasPayer: string;
|
|
193
188
|
chainIdentifier: string | null;
|
|
194
189
|
epoch: string | null;
|
|
@@ -221,13 +216,7 @@ function setGasPayment({
|
|
|
221
216
|
|
|
222
217
|
const reservationAmount = addressBalance - withdrawals;
|
|
223
218
|
|
|
224
|
-
if (
|
|
225
|
-
usesGasCoin &&
|
|
226
|
-
reservationAmount > 0n &&
|
|
227
|
-
protocolConfig?.featureFlags?.['enable_coin_reservation_obj_refs'] &&
|
|
228
|
-
chainIdentifier &&
|
|
229
|
-
epoch
|
|
230
|
-
) {
|
|
219
|
+
if (usesGasCoin && reservationAmount > 0n && chainIdentifier && epoch) {
|
|
231
220
|
transactionData.gasData.payment = [
|
|
232
221
|
createCoinReservationRef(reservationAmount, gasPayer, chainIdentifier, epoch),
|
|
233
222
|
...paymentCoins,
|
package/src/client/types.ts
CHANGED
|
@@ -88,7 +88,10 @@ export namespace SuiClientTypes {
|
|
|
88
88
|
/**
|
|
89
89
|
* Include the Display v2 rendered output for the object.
|
|
90
90
|
*
|
|
91
|
-
* Returns a map of display field names to their rendered
|
|
91
|
+
* Returns a map of display field names to their rendered values. Most values
|
|
92
|
+
* are strings, but Display v2 templates can produce structured JSON values
|
|
93
|
+
* (objects, arrays) for fields that use the `:json` transform or reference
|
|
94
|
+
* non-string Move types.
|
|
92
95
|
* Returns `null` if the object's type does not have an associated Display template.
|
|
93
96
|
*/
|
|
94
97
|
display?: boolean;
|
|
@@ -181,8 +184,14 @@ export namespace SuiClientTypes {
|
|
|
181
184
|
}
|
|
182
185
|
|
|
183
186
|
export interface Display {
|
|
184
|
-
/**
|
|
185
|
-
|
|
187
|
+
/**
|
|
188
|
+
* Successfully rendered display field values, keyed by field name.
|
|
189
|
+
*
|
|
190
|
+
* Most values are strings, but Display v2 templates can produce structured
|
|
191
|
+
* JSON values (objects, arrays) for fields that reference non-string Move
|
|
192
|
+
* types or use the `:json` transform.
|
|
193
|
+
*/
|
|
194
|
+
output: Record<string, unknown> | null;
|
|
186
195
|
/** Per-field rendering errors, keyed by field name. `null` if all fields succeeded. */
|
|
187
196
|
errors: Record<string, string> | null;
|
|
188
197
|
}
|
package/src/graphql/core.ts
CHANGED
|
@@ -792,7 +792,7 @@ function mapDisplay(
|
|
|
792
792
|
if (!include) return undefined;
|
|
793
793
|
if (!display) return null;
|
|
794
794
|
return {
|
|
795
|
-
output: (display.output as Record<string,
|
|
795
|
+
output: (display.output as Record<string, unknown> | null) ?? null,
|
|
796
796
|
errors: (display.errors as Record<string, string> | null) ?? null,
|
|
797
797
|
};
|
|
798
798
|
}
|
package/src/grpc/core.ts
CHANGED
|
@@ -809,7 +809,7 @@ function mapDisplayProto(
|
|
|
809
809
|
return {
|
|
810
810
|
output:
|
|
811
811
|
display.output !== undefined
|
|
812
|
-
? (Value.toJson(display.output) as Record<string,
|
|
812
|
+
? (Value.toJson(display.output) as Record<string, unknown> | null)
|
|
813
813
|
: null,
|
|
814
814
|
errors:
|
|
815
815
|
display.errors !== undefined
|
package/src/jsonRpc/core.ts
CHANGED
|
@@ -747,7 +747,7 @@ function parseObject<Include extends SuiClientTypes.ObjectInclude = {}>(
|
|
|
747
747
|
|
|
748
748
|
const displayData = include?.display
|
|
749
749
|
? object.display?.data != null
|
|
750
|
-
? { output: object.display.data as Record<string,
|
|
750
|
+
? { output: object.display.data as Record<string, unknown>, errors: null }
|
|
751
751
|
: null
|
|
752
752
|
: undefined;
|
|
753
753
|
|
package/src/utils/sui-types.ts
CHANGED
|
@@ -154,6 +154,12 @@ export function parseStructTag(type: string): StructTag {
|
|
|
154
154
|
}
|
|
155
155
|
|
|
156
156
|
export function normalizeStructTag(type: string | StructTag): string {
|
|
157
|
+
if (typeof type === 'string' && type.startsWith('vector<')) {
|
|
158
|
+
throw new Error(
|
|
159
|
+
'normalizeStructTag does not support vector types. Use normalizeTypeTag instead.',
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
|
|
157
163
|
const { address, module, name, typeParams } =
|
|
158
164
|
typeof type === 'string' ? parseStructTag(type) : type;
|
|
159
165
|
|
package/src/version.ts
CHANGED