@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.
@@ -85,17 +85,15 @@ export async function coreClientResolveTransactionPlugin(
85
85
  }
86
86
 
87
87
  const needsSystemState = needsGasPrice || (needsPayment && usesGasCoin);
88
- const [, systemStateResult, balanceResult, coinsResult, protocolConfigResult, chainIdResult] =
89
- await Promise.all([
90
- normalizeInputs(transactionData, client),
91
- needsSystemState ? client.core.getCurrentSystemState() : null,
92
- needsPayment && gasPayer ? client.core.getBalance({ owner: gasPayer }) : null,
93
- needsPayment && gasPayer
94
- ? client.core.listCoins({ owner: gasPayer, coinType: SUI_TYPE_ARG })
95
- : null,
96
- needsPayment && usesGasCoin ? client.core.getProtocolConfig() : null,
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,
@@ -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 string values.
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
- /** Successfully rendered display field values, keyed by field name. */
185
- output: Record<string, string> | null;
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
  }
@@ -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, string> | null) ?? null,
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, string> | null)
812
+ ? (Value.toJson(display.output) as Record<string, unknown> | null)
813
813
  : null,
814
814
  errors:
815
815
  display.errors !== undefined
@@ -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, string>, errors: null }
750
+ ? { output: object.display.data as Record<string, unknown>, errors: null }
751
751
  : null
752
752
  : undefined;
753
753
 
@@ -187,7 +187,7 @@ export interface DevInspectResults {
187
187
  }
188
188
  export interface DisplayFieldsResponse {
189
189
  data?: {
190
- [key: string]: string;
190
+ [key: string]: unknown;
191
191
  } | null;
192
192
  error?: ObjectResponseError | null;
193
193
  }
@@ -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
@@ -3,5 +3,5 @@
3
3
 
4
4
  // This file is generated by genversion.mjs. Do not edit it directly.
5
5
 
6
- export const PACKAGE_VERSION = '2.13.4';
6
+ export const PACKAGE_VERSION = '2.14.1';
7
7
  export const TARGETED_RPC_VERSION = '1.70.0';