@mysten/deepbook-v3 1.6.3 → 1.6.5

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.
@@ -8,7 +8,11 @@ import {
8
8
  BcsTuple,
9
9
  } from '@mysten/sui/bcs';
10
10
  import { normalizeStructTag, normalizeSuiAddress } from '@mysten/sui/utils';
11
- import { type TransactionArgument, isArgument } from '@mysten/sui/transactions';
11
+ import {
12
+ type TransactionArgument,
13
+ type TransactionObjectArgument,
14
+ isArgument,
15
+ } from '@mysten/sui/transactions';
12
16
  import { type ClientWithCoreApi, type SuiClientTypes } from '@mysten/sui/client';
13
17
 
14
18
  const MOVE_STDLIB_ADDRESS = normalizeSuiAddress('0x1');
@@ -106,6 +110,12 @@ export function normalizeMoveArguments(
106
110
  continue;
107
111
  }
108
112
 
113
+ if (argType === '0x2::accumulator::AccumulatorRoot') {
114
+ // Chain-wide shared singleton at a fixed address (SUI_ACCUMULATOR_ROOT_OBJECT_ID).
115
+ normalizedArgs.push((tx) => tx.object('0xacc'));
116
+ continue;
117
+ }
118
+
109
119
  if (argType === '0x3::sui_system::SuiSystemState') {
110
120
  normalizedArgs.push((tx) => tx.object.system());
111
121
  continue;
@@ -124,7 +134,10 @@ export function normalizeMoveArguments(
124
134
  throw new Error(`Expected arguments to be passed as an array`);
125
135
  }
126
136
  const name = parameterNames[index];
127
- arg = args[name as keyof typeof args];
137
+ arg =
138
+ name !== undefined && Object.prototype.hasOwnProperty.call(args, name)
139
+ ? args[name as keyof typeof args]
140
+ : undefined;
128
141
 
129
142
  if (arg === undefined) {
130
143
  throw new Error(`Parameter ${name} is required`);
@@ -157,6 +170,40 @@ export function normalizeMoveArguments(
157
170
  return normalizedArgs;
158
171
  }
159
172
 
173
+ /* -------------------------- Config-mapped arguments -------------------------- */
174
+
175
+ /** Context passed to config resolver functions. */
176
+ export interface ConfigResolverContext {
177
+ /**
178
+ * The matched parameter's own instantiated type arguments (not the whole function's type
179
+ * argument tuple). Concrete instantiations are canonical type tags; generic positions pass
180
+ * the caller's `typeArguments` strings through as provided.
181
+ */
182
+ typeArguments: string[];
183
+ /** The package address the generated call will be sent to. */
184
+ packageAddress: string;
185
+ /** The Move module of the generated call. */
186
+ moduleName: string;
187
+ /** The Move function of the generated call. */
188
+ functionName: string;
189
+ /** The Move name of the matched parameter, when the summary includes parameter names. */
190
+ parameterName?: string;
191
+ /** The matched parameter's position in the generated function's arguments. */
192
+ parameterIndex: number;
193
+ }
194
+
195
+ /**
196
+ * A non-callback transaction argument in a generated config object, used for keys whose matched
197
+ * parameter can't be supplied as an object id string.
198
+ */
199
+ export type ConfigObjectValue = Exclude<TransactionObjectArgument, (...args: never[]) => unknown>;
200
+
201
+ /**
202
+ * A plain value in a generated config object: an object id or a non-callback transaction
203
+ * argument. Keys that can resolve multiple bindings are typed as resolver functions instead.
204
+ */
205
+ export type ConfigValue = string | ConfigObjectValue;
206
+
160
207
  /* -------------------------- Move type tags -------------------------- */
161
208
 
162
209
  /** A type argument: a type tag string, or a BCS type whose name is a Move type. */