@mysten/sui
Advanced tools
Comparing version 0.0.0-experimental-20240717170907 to 0.0.0-experimental-20240717180855
# @mysten/sui.js | ||
## 0.0.0-experimental-20240717170907 | ||
## 0.0.0-experimental-20240717180855 | ||
### Minor Changes | ||
- 086b2bc: Add waitForLastTransaction methods to all executor classes | ||
- cdedf69: Add Argument helpers for constructing transaction arguments without a Transaction | ||
instance | ||
- beed646: Add tx.pure.vector and tx.pure.option methods | ||
@@ -17,3 +19,3 @@ ### Patch Changes | ||
- Updated dependencies [0f27a97] | ||
- @mysten/bcs@0.0.0-experimental-20240717170907 | ||
- @mysten/bcs@0.0.0-experimental-20240717180855 | ||
@@ -20,0 +22,0 @@ ## 1.2.1 |
import type { Transaction, TransactionObjectInput } from './Transaction.js'; | ||
export declare const Arguments: { | ||
pure: { | ||
<T extends import("./pure.js").PureTypeName>(type: T extends import("./pure.js").PureTypeName ? import("./pure.js").ValidPureTypeName<T> : T, value: T extends import("./pure.js").BasePureType ? Parameters<{ | ||
<T_1 extends import("./pure.js").PureTypeName>(type: T_1 extends import("./pure.js").PureTypeName ? import("./pure.js").ValidPureTypeName<T_1> : T_1, value: T_1 extends import("./pure.js").BasePureType ? Parameters<any[T_1]>[0] : T_1 extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : T_1 extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never): T_1; | ||
(value: import("@mysten/bcs").SerializedBcs<any, any> | Uint8Array): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u8(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u16(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u32(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u64(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u128(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u256(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
bool(value: boolean): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
string(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
address(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
id: (value: string) => { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
vector<Type extends import("./pure.js").PureTypeName>(type: Type, value: Iterable<Type extends import("./pure.js").BasePureType ? Parameters<any[Type]>[0] : Type extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never> & { | ||
length: number; | ||
}): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
option<Type extends import("./pure.js").PureTypeName>(type: Type, value: (Type extends import("./pure.js").BasePureType ? Parameters<any[Type]>[0] : Type extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never) | null | undefined): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
}[T]>[0] : T extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : T extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never): T; | ||
(value: import("@mysten/bcs").SerializedBcs<any, any> | Uint8Array): (tx: Transaction) => { | ||
@@ -202,2 +441,516 @@ $kind: "GasCoin"; | ||
}; | ||
vector<Type extends import("./pure.js").PureTypeName>(type: Type, value: Iterable<Type extends import("./pure.js").BasePureType ? Parameters<{ | ||
<T extends import("./pure.js").PureTypeName>(type: T extends import("./pure.js").PureTypeName ? import("./pure.js").ValidPureTypeName<T> : T, value: T extends import("./pure.js").BasePureType ? Parameters<any[T]>[0] : T extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : T extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never): T; | ||
(value: import("@mysten/bcs").SerializedBcs<any, any> | Uint8Array): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u8(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u16(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u32(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u64(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u128(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u256(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
bool(value: boolean): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
string(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
address(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
id: (value: string) => { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
vector<Type_1 extends import("./pure.js").PureTypeName>(type: Type_1, value: Iterable<Type_1 extends import("./pure.js").BasePureType ? Parameters<any[Type_1]>[0] : Type_1 extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type_1 extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never> & { | ||
length: number; | ||
}): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
option<Type_1 extends import("./pure.js").PureTypeName>(type: Type_1, value: (Type_1 extends import("./pure.js").BasePureType ? Parameters<any[Type_1]>[0] : Type_1 extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type_1 extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never) | null | undefined): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
}[Type]>[0] : Type extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never> & { | ||
length: number; | ||
}): (tx: Transaction) => { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
option<Type extends import("./pure.js").PureTypeName>(type: Type, value: (Type extends import("./pure.js").BasePureType ? Parameters<{ | ||
<T extends import("./pure.js").PureTypeName>(type: T extends import("./pure.js").PureTypeName ? import("./pure.js").ValidPureTypeName<T> : T, value: T extends import("./pure.js").BasePureType ? Parameters<any[T]>[0] : T extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : T extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never): T; | ||
(value: import("@mysten/bcs").SerializedBcs<any, any> | Uint8Array): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u8(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u16(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u32(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u64(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u128(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u256(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
bool(value: boolean): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
string(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
address(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
id: (value: string) => { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
vector<Type_1 extends import("./pure.js").PureTypeName>(type: Type_1, value: Iterable<Type_1 extends import("./pure.js").BasePureType ? Parameters<any[Type_1]>[0] : Type_1 extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type_1 extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never> & { | ||
length: number; | ||
}): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
option<Type_1 extends import("./pure.js").PureTypeName>(type: Type_1, value: (Type_1 extends import("./pure.js").BasePureType ? Parameters<any[Type_1]>[0] : Type_1 extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type_1 extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never) | null | undefined): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
}[Type]>[0] : Type extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never) | null | undefined): (tx: Transaction) => { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
}; | ||
@@ -204,0 +957,0 @@ object: (value: TransactionObjectInput) => (tx: Transaction) => { |
@@ -30,2 +30,3 @@ import { bcs } from '../../bcs/index.js'; | ||
applyEffects(effects: typeof bcs.TransactionEffects.$inferType): Promise<void>; | ||
waitForLastTransaction(): Promise<void>; | ||
} |
@@ -34,3 +34,3 @@ "use strict"; | ||
var import_Transaction = require("../Transaction.js"); | ||
var _client; | ||
var _client, _lastDigest; | ||
class CachingTransactionExecutor { | ||
@@ -42,2 +42,3 @@ constructor({ | ||
__privateAdd(this, _client); | ||
__privateAdd(this, _lastDigest, null); | ||
__privateSet(this, _client, client); | ||
@@ -51,4 +52,7 @@ this.cache = new import_ObjectCache.ObjectCache(options); | ||
async reset() { | ||
await this.cache.clearOwnedObjects(); | ||
await this.cache.clearCustom(); | ||
await Promise.all([ | ||
this.cache.clearOwnedObjects(), | ||
this.cache.clearCustom(), | ||
this.waitForLastTransaction() | ||
]); | ||
} | ||
@@ -101,6 +105,14 @@ async buildTransaction({ | ||
async applyEffects(effects) { | ||
__privateSet(this, _lastDigest, effects.V2?.transactionDigest ?? null); | ||
await this.cache.applyEffects(effects); | ||
} | ||
async waitForLastTransaction() { | ||
if (__privateGet(this, _lastDigest)) { | ||
await __privateGet(this, _client).waitForTransaction({ digest: __privateGet(this, _lastDigest) }); | ||
__privateSet(this, _lastDigest, null); | ||
} | ||
} | ||
} | ||
_client = new WeakMap(); | ||
_lastDigest = new WeakMap(); | ||
//# sourceMappingURL=caching.js.map |
@@ -31,2 +31,3 @@ import type { SuiClient } from '../../client/index.js'; | ||
resetCache(): Promise<void>; | ||
waitForLastTransaction(): Promise<void>; | ||
executeTransaction(transaction: Transaction): Promise<{ | ||
@@ -33,0 +34,0 @@ digest: string; |
@@ -95,2 +95,5 @@ "use strict"; | ||
} | ||
async waitForLastTransaction() { | ||
await __privateMethod(this, _ParallelTransactionExecutor_instances, updateCache_fn).call(this, () => __privateMethod(this, _ParallelTransactionExecutor_instances, waitForLastDigest_fn).call(this)); | ||
} | ||
async executeTransaction(transaction) { | ||
@@ -349,3 +352,3 @@ const { promise, resolve, reject } = promiseWithResolvers(); | ||
txb.transferObjects(coinResults, address); | ||
await __privateMethod(this, _ParallelTransactionExecutor_instances, updateCache_fn).call(this, () => __privateMethod(this, _ParallelTransactionExecutor_instances, waitForLastDigest_fn).call(this)); | ||
await this.waitForLastTransaction(); | ||
const result = await __privateGet(this, _client).signAndExecuteTransaction({ | ||
@@ -352,0 +355,0 @@ transaction: txb, |
@@ -14,3 +14,4 @@ import { bcs } from '../../bcs/index.js'; | ||
buildTransaction(transaction: Transaction): Promise<Uint8Array>; | ||
resetCache(): Promise<[void, void]>; | ||
resetCache(): Promise<void>; | ||
waitForLastTransaction(): Promise<void>; | ||
executeTransaction(transaction: Transaction | Uint8Array): Promise<{ | ||
@@ -17,0 +18,0 @@ digest: string; |
@@ -26,3 +26,2 @@ "use strict"; | ||
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); | ||
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); | ||
var serial_exports = {}; | ||
@@ -39,3 +38,3 @@ __export(serial_exports, { | ||
var import_queue = require("./queue.js"); | ||
var _queue, _signer, _cache, _client, _lastDigest, _cacheGasCoin, _buildTransaction, _SerialTransactionExecutor_instances, waitForLastTransaction_fn; | ||
var _queue, _signer, _cache, _cacheGasCoin, _buildTransaction; | ||
class SerialTransactionExecutor { | ||
@@ -46,8 +45,5 @@ constructor({ | ||
}) { | ||
__privateAdd(this, _SerialTransactionExecutor_instances); | ||
__privateAdd(this, _queue, new import_queue.SerialQueue()); | ||
__privateAdd(this, _signer); | ||
__privateAdd(this, _cache); | ||
__privateAdd(this, _client); | ||
__privateAdd(this, _lastDigest, null); | ||
__privateAdd(this, _cacheGasCoin, async (effects) => { | ||
@@ -74,3 +70,2 @@ if (!effects.V2) { | ||
__privateSet(this, _signer, signer); | ||
__privateSet(this, _client, options.client); | ||
__privateSet(this, _cache, new import_caching.CachingTransactionExecutor({ | ||
@@ -88,4 +83,7 @@ client: options.client, | ||
resetCache() { | ||
return Promise.all([__privateGet(this, _cache).reset(), __privateMethod(this, _SerialTransactionExecutor_instances, waitForLastTransaction_fn).call(this)]); | ||
return __privateGet(this, _cache).reset(); | ||
} | ||
waitForLastTransaction() { | ||
return __privateGet(this, _cache).waitForLastTransaction(); | ||
} | ||
executeTransaction(transaction) { | ||
@@ -105,3 +103,2 @@ return __privateGet(this, _queue).runTask(async () => { | ||
await this.applyEffects(effects); | ||
__privateSet(this, _lastDigest, results.digest); | ||
return { | ||
@@ -117,13 +114,4 @@ digest: results.digest, | ||
_cache = new WeakMap(); | ||
_client = new WeakMap(); | ||
_lastDigest = new WeakMap(); | ||
_cacheGasCoin = new WeakMap(); | ||
_buildTransaction = new WeakMap(); | ||
_SerialTransactionExecutor_instances = new WeakSet(); | ||
waitForLastTransaction_fn = async function() { | ||
if (__privateGet(this, _lastDigest)) { | ||
await __privateGet(this, _client).waitForTransaction({ digest: __privateGet(this, _lastDigest) }); | ||
__privateSet(this, _lastDigest, null); | ||
} | ||
}; | ||
function getGasCoinFromEffects(effects) { | ||
@@ -130,0 +118,0 @@ if (!effects.V2) { |
import type { SerializedBcs } from '@mysten/bcs'; | ||
import type { Argument } from './data/internal.js'; | ||
export declare function createPure<T>(makePure: (value: SerializedBcs<any, any> | Uint8Array) => T): { | ||
<T_1 extends PureTypeName>(type: T_1 extends PureTypeName ? ValidPureTypeName<T_1> : T_1, value: ShapeFromPureTypeName<T_1>): T_1; | ||
(value: SerializedBcs<any, any> | Uint8Array): T; | ||
@@ -14,2 +16,14 @@ u8(value: number): T; | ||
id: (value: string) => T; | ||
vector<Type extends PureTypeName>(type: T extends PureTypeName ? ValidPureTypeName<Type> : Type, value: Iterable<ShapeFromPureTypeName<Type>> & { | ||
length: number; | ||
}): T; | ||
option<Type extends PureTypeName>(type: T extends PureTypeName ? ValidPureTypeName<Type> : Type, value: ShapeFromPureTypeName<Type> | null | undefined): T; | ||
}; | ||
export type BasePureType = 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'bool' | 'id' | 'string' | 'address'; | ||
export type PureTypeName = BasePureType | `vector<${string}>` | `option<${string}>`; | ||
export type ValidPureTypeName<T extends string> = T extends BasePureType ? PureTypeName : T extends `vector<${infer U}>` ? ValidPureTypeName<U> : T extends `option<${infer U}>` ? ValidPureTypeName<U> : PureTypeValidationError<T>; | ||
type ShapeFromPureTypeName<T extends PureTypeName> = T extends BasePureType ? Parameters<ReturnType<typeof createPure<Argument>>[T]>[0] : T extends `vector<${infer U extends PureTypeName}>` ? ShapeFromPureTypeName<U>[] : T extends `option<${infer U extends PureTypeName}>` ? ShapeFromPureTypeName<U> | null : never; | ||
type PureTypeValidationError<T extends string> = T & { | ||
error: `Invalid Pure type name: ${T}`; | ||
}; | ||
export {}; |
@@ -24,19 +24,65 @@ "use strict"; | ||
module.exports = __toCommonJS(pure_exports); | ||
var import_bcs = require("../bcs/index.js"); | ||
var import_bcs = require("@mysten/bcs"); | ||
var import_bcs2 = require("../bcs/index.js"); | ||
function createPure(makePure) { | ||
function pure(value) { | ||
return makePure(value); | ||
function pure(typeOrSerializedValue, value) { | ||
if (typeof typeOrSerializedValue === "string") { | ||
return makePure(schemaFromName(typeOrSerializedValue).serialize(value)); | ||
} | ||
if (typeOrSerializedValue instanceof Uint8Array || (0, import_bcs.isSerializedBcs)(typeOrSerializedValue)) { | ||
return makePure(typeOrSerializedValue); | ||
} | ||
throw new Error("tx.pure must be called either a bcs type name, or a serialized bcs value"); | ||
} | ||
pure.u8 = (value) => makePure(import_bcs.bcs.U8.serialize(value)); | ||
pure.u16 = (value) => makePure(import_bcs.bcs.U16.serialize(value)); | ||
pure.u32 = (value) => makePure(import_bcs.bcs.U32.serialize(value)); | ||
pure.u64 = (value) => makePure(import_bcs.bcs.U64.serialize(value)); | ||
pure.u128 = (value) => makePure(import_bcs.bcs.U128.serialize(value)); | ||
pure.u256 = (value) => makePure(import_bcs.bcs.U256.serialize(value)); | ||
pure.bool = (value) => makePure(import_bcs.bcs.Bool.serialize(value)); | ||
pure.string = (value) => makePure(import_bcs.bcs.String.serialize(value)); | ||
pure.address = (value) => makePure(import_bcs.bcs.Address.serialize(value)); | ||
pure.u8 = (value) => makePure(import_bcs2.bcs.U8.serialize(value)); | ||
pure.u16 = (value) => makePure(import_bcs2.bcs.U16.serialize(value)); | ||
pure.u32 = (value) => makePure(import_bcs2.bcs.U32.serialize(value)); | ||
pure.u64 = (value) => makePure(import_bcs2.bcs.U64.serialize(value)); | ||
pure.u128 = (value) => makePure(import_bcs2.bcs.U128.serialize(value)); | ||
pure.u256 = (value) => makePure(import_bcs2.bcs.U256.serialize(value)); | ||
pure.bool = (value) => makePure(import_bcs2.bcs.Bool.serialize(value)); | ||
pure.string = (value) => makePure(import_bcs2.bcs.String.serialize(value)); | ||
pure.address = (value) => makePure(import_bcs2.bcs.Address.serialize(value)); | ||
pure.id = pure.address; | ||
pure.vector = (type, value) => { | ||
return makePure(import_bcs2.bcs.vector(schemaFromName(type)).serialize(value)); | ||
}; | ||
pure.option = (type, value) => { | ||
return makePure(import_bcs2.bcs.option(schemaFromName(type)).serialize(value)); | ||
}; | ||
return pure; | ||
} | ||
function schemaFromName(name) { | ||
switch (name) { | ||
case "u8": | ||
return import_bcs2.bcs.u8(); | ||
case "u16": | ||
return import_bcs2.bcs.u16(); | ||
case "u32": | ||
return import_bcs2.bcs.u32(); | ||
case "u64": | ||
return import_bcs2.bcs.u64(); | ||
case "u128": | ||
return import_bcs2.bcs.u128(); | ||
case "u256": | ||
return import_bcs2.bcs.u256(); | ||
case "bool": | ||
return import_bcs2.bcs.bool(); | ||
case "string": | ||
return import_bcs2.bcs.string(); | ||
case "id": | ||
case "address": | ||
return import_bcs2.bcs.Address; | ||
} | ||
const generic = name.match(/^(vector|option)<(.+)>$/); | ||
if (generic) { | ||
const [kind, inner] = generic.slice(1); | ||
if (kind === "vector") { | ||
return import_bcs2.bcs.vector(schemaFromName(inner)); | ||
} else { | ||
return import_bcs2.bcs.option(schemaFromName(inner)); | ||
} | ||
} | ||
throw new Error(`Invalid Pure type name: ${name}`); | ||
} | ||
//# sourceMappingURL=pure.js.map |
@@ -1,2 +0,2 @@ | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240717170907"; | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240717180855"; | ||
export declare const TARGETED_RPC_VERSION = "1.30.0"; |
@@ -25,4 +25,4 @@ "use strict"; | ||
module.exports = __toCommonJS(version_exports); | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240717170907"; | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240717180855"; | ||
const TARGETED_RPC_VERSION = "1.30.0"; | ||
//# sourceMappingURL=version.js.map |
import type { Transaction, TransactionObjectInput } from './Transaction.js'; | ||
export declare const Arguments: { | ||
pure: { | ||
<T extends import("./pure.js").PureTypeName>(type: T extends import("./pure.js").PureTypeName ? import("./pure.js").ValidPureTypeName<T> : T, value: T extends import("./pure.js").BasePureType ? Parameters<{ | ||
<T_1 extends import("./pure.js").PureTypeName>(type: T_1 extends import("./pure.js").PureTypeName ? import("./pure.js").ValidPureTypeName<T_1> : T_1, value: T_1 extends import("./pure.js").BasePureType ? Parameters<any[T_1]>[0] : T_1 extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : T_1 extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never): T_1; | ||
(value: import("@mysten/bcs").SerializedBcs<any, any> | Uint8Array): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u8(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u16(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u32(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u64(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u128(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u256(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
bool(value: boolean): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
string(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
address(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
id: (value: string) => { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
vector<Type extends import("./pure.js").PureTypeName>(type: Type, value: Iterable<Type extends import("./pure.js").BasePureType ? Parameters<any[Type]>[0] : Type extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never> & { | ||
length: number; | ||
}): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
option<Type extends import("./pure.js").PureTypeName>(type: Type, value: (Type extends import("./pure.js").BasePureType ? Parameters<any[Type]>[0] : Type extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never) | null | undefined): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
}[T]>[0] : T extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : T extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never): T; | ||
(value: import("@mysten/bcs").SerializedBcs<any, any> | Uint8Array): (tx: Transaction) => { | ||
@@ -202,2 +441,516 @@ $kind: "GasCoin"; | ||
}; | ||
vector<Type extends import("./pure.js").PureTypeName>(type: Type, value: Iterable<Type extends import("./pure.js").BasePureType ? Parameters<{ | ||
<T extends import("./pure.js").PureTypeName>(type: T extends import("./pure.js").PureTypeName ? import("./pure.js").ValidPureTypeName<T> : T, value: T extends import("./pure.js").BasePureType ? Parameters<any[T]>[0] : T extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : T extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never): T; | ||
(value: import("@mysten/bcs").SerializedBcs<any, any> | Uint8Array): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u8(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u16(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u32(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u64(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u128(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u256(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
bool(value: boolean): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
string(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
address(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
id: (value: string) => { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
vector<Type_1 extends import("./pure.js").PureTypeName>(type: Type_1, value: Iterable<Type_1 extends import("./pure.js").BasePureType ? Parameters<any[Type_1]>[0] : Type_1 extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type_1 extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never> & { | ||
length: number; | ||
}): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
option<Type_1 extends import("./pure.js").PureTypeName>(type: Type_1, value: (Type_1 extends import("./pure.js").BasePureType ? Parameters<any[Type_1]>[0] : Type_1 extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type_1 extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never) | null | undefined): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
}[Type]>[0] : Type extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never> & { | ||
length: number; | ||
}): (tx: Transaction) => { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
option<Type extends import("./pure.js").PureTypeName>(type: Type, value: (Type extends import("./pure.js").BasePureType ? Parameters<{ | ||
<T extends import("./pure.js").PureTypeName>(type: T extends import("./pure.js").PureTypeName ? import("./pure.js").ValidPureTypeName<T> : T, value: T extends import("./pure.js").BasePureType ? Parameters<any[T]>[0] : T extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : T extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never): T; | ||
(value: import("@mysten/bcs").SerializedBcs<any, any> | Uint8Array): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u8(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u16(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u32(value: number): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u64(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u128(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
u256(value: bigint | number | string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
bool(value: boolean): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
string(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
address(value: string): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
id: (value: string) => { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
vector<Type_1 extends import("./pure.js").PureTypeName>(type: Type_1, value: Iterable<Type_1 extends import("./pure.js").BasePureType ? Parameters<any[Type_1]>[0] : Type_1 extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type_1 extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never> & { | ||
length: number; | ||
}): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
option<Type_1 extends import("./pure.js").PureTypeName>(type: Type_1, value: (Type_1 extends import("./pure.js").BasePureType ? Parameters<any[Type_1]>[0] : Type_1 extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type_1 extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never) | null | undefined): { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
}[Type]>[0] : Type extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? (U extends import("./pure.js").BasePureType ? Parameters<any[U]>[0] : U extends `vector<${infer U extends import("./pure.js").PureTypeName}>` ? any[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : U extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never)[] : Type extends `option<${infer U_1 extends import("./pure.js").PureTypeName}>` ? any | null : never) | null | undefined): (tx: Transaction) => { | ||
$kind: "GasCoin"; | ||
GasCoin: true; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "pure"; | ||
} | { | ||
$kind: "Input"; | ||
Input: number; | ||
type?: "object"; | ||
} | { | ||
$kind: "Result"; | ||
Result: number; | ||
} | { | ||
$kind: "NestedResult"; | ||
NestedResult: [number, number]; | ||
}; | ||
}; | ||
@@ -204,0 +957,0 @@ object: (value: TransactionObjectInput) => (tx: Transaction) => { |
@@ -30,2 +30,3 @@ import { bcs } from '../../bcs/index.js'; | ||
applyEffects(effects: typeof bcs.TransactionEffects.$inferType): Promise<void>; | ||
waitForLastTransaction(): Promise<void>; | ||
} |
@@ -8,3 +8,3 @@ var __typeError = (msg) => { | ||
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); | ||
var _client; | ||
var _client, _lastDigest; | ||
import { bcs } from "../../bcs/index.js"; | ||
@@ -19,2 +19,3 @@ import { ObjectCache } from "../ObjectCache.js"; | ||
__privateAdd(this, _client); | ||
__privateAdd(this, _lastDigest, null); | ||
__privateSet(this, _client, client); | ||
@@ -28,4 +29,7 @@ this.cache = new ObjectCache(options); | ||
async reset() { | ||
await this.cache.clearOwnedObjects(); | ||
await this.cache.clearCustom(); | ||
await Promise.all([ | ||
this.cache.clearOwnedObjects(), | ||
this.cache.clearCustom(), | ||
this.waitForLastTransaction() | ||
]); | ||
} | ||
@@ -78,6 +82,14 @@ async buildTransaction({ | ||
async applyEffects(effects) { | ||
__privateSet(this, _lastDigest, effects.V2?.transactionDigest ?? null); | ||
await this.cache.applyEffects(effects); | ||
} | ||
async waitForLastTransaction() { | ||
if (__privateGet(this, _lastDigest)) { | ||
await __privateGet(this, _client).waitForTransaction({ digest: __privateGet(this, _lastDigest) }); | ||
__privateSet(this, _lastDigest, null); | ||
} | ||
} | ||
} | ||
_client = new WeakMap(); | ||
_lastDigest = new WeakMap(); | ||
export { | ||
@@ -84,0 +96,0 @@ CachingTransactionExecutor |
@@ -31,2 +31,3 @@ import type { SuiClient } from '../../client/index.js'; | ||
resetCache(): Promise<void>; | ||
waitForLastTransaction(): Promise<void>; | ||
executeTransaction(transaction: Transaction): Promise<{ | ||
@@ -33,0 +34,0 @@ digest: string; |
@@ -72,2 +72,5 @@ var __typeError = (msg) => { | ||
} | ||
async waitForLastTransaction() { | ||
await __privateMethod(this, _ParallelTransactionExecutor_instances, updateCache_fn).call(this, () => __privateMethod(this, _ParallelTransactionExecutor_instances, waitForLastDigest_fn).call(this)); | ||
} | ||
async executeTransaction(transaction) { | ||
@@ -326,3 +329,3 @@ const { promise, resolve, reject } = promiseWithResolvers(); | ||
txb.transferObjects(coinResults, address); | ||
await __privateMethod(this, _ParallelTransactionExecutor_instances, updateCache_fn).call(this, () => __privateMethod(this, _ParallelTransactionExecutor_instances, waitForLastDigest_fn).call(this)); | ||
await this.waitForLastTransaction(); | ||
const result = await __privateGet(this, _client).signAndExecuteTransaction({ | ||
@@ -329,0 +332,0 @@ transaction: txb, |
@@ -14,3 +14,4 @@ import { bcs } from '../../bcs/index.js'; | ||
buildTransaction(transaction: Transaction): Promise<Uint8Array>; | ||
resetCache(): Promise<[void, void]>; | ||
resetCache(): Promise<void>; | ||
waitForLastTransaction(): Promise<void>; | ||
executeTransaction(transaction: Transaction | Uint8Array): Promise<{ | ||
@@ -17,0 +18,0 @@ digest: string; |
@@ -8,4 +8,3 @@ var __typeError = (msg) => { | ||
var __privateSet = (obj, member, value, setter) => (__accessCheck(obj, member, "write to private field"), setter ? setter.call(obj, value) : member.set(obj, value), value); | ||
var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "access private method"), method); | ||
var _queue, _signer, _cache, _client, _lastDigest, _cacheGasCoin, _buildTransaction, _SerialTransactionExecutor_instances, waitForLastTransaction_fn; | ||
var _queue, _signer, _cache, _cacheGasCoin, _buildTransaction; | ||
import { toB64 } from "@mysten/bcs"; | ||
@@ -21,8 +20,5 @@ import { bcs } from "../../bcs/index.js"; | ||
}) { | ||
__privateAdd(this, _SerialTransactionExecutor_instances); | ||
__privateAdd(this, _queue, new SerialQueue()); | ||
__privateAdd(this, _signer); | ||
__privateAdd(this, _cache); | ||
__privateAdd(this, _client); | ||
__privateAdd(this, _lastDigest, null); | ||
__privateAdd(this, _cacheGasCoin, async (effects) => { | ||
@@ -49,3 +45,2 @@ if (!effects.V2) { | ||
__privateSet(this, _signer, signer); | ||
__privateSet(this, _client, options.client); | ||
__privateSet(this, _cache, new CachingTransactionExecutor({ | ||
@@ -63,4 +58,7 @@ client: options.client, | ||
resetCache() { | ||
return Promise.all([__privateGet(this, _cache).reset(), __privateMethod(this, _SerialTransactionExecutor_instances, waitForLastTransaction_fn).call(this)]); | ||
return __privateGet(this, _cache).reset(); | ||
} | ||
waitForLastTransaction() { | ||
return __privateGet(this, _cache).waitForLastTransaction(); | ||
} | ||
executeTransaction(transaction) { | ||
@@ -80,3 +78,2 @@ return __privateGet(this, _queue).runTask(async () => { | ||
await this.applyEffects(effects); | ||
__privateSet(this, _lastDigest, results.digest); | ||
return { | ||
@@ -92,13 +89,4 @@ digest: results.digest, | ||
_cache = new WeakMap(); | ||
_client = new WeakMap(); | ||
_lastDigest = new WeakMap(); | ||
_cacheGasCoin = new WeakMap(); | ||
_buildTransaction = new WeakMap(); | ||
_SerialTransactionExecutor_instances = new WeakSet(); | ||
waitForLastTransaction_fn = async function() { | ||
if (__privateGet(this, _lastDigest)) { | ||
await __privateGet(this, _client).waitForTransaction({ digest: __privateGet(this, _lastDigest) }); | ||
__privateSet(this, _lastDigest, null); | ||
} | ||
}; | ||
function getGasCoinFromEffects(effects) { | ||
@@ -105,0 +93,0 @@ if (!effects.V2) { |
import type { SerializedBcs } from '@mysten/bcs'; | ||
import type { Argument } from './data/internal.js'; | ||
export declare function createPure<T>(makePure: (value: SerializedBcs<any, any> | Uint8Array) => T): { | ||
<T_1 extends PureTypeName>(type: T_1 extends PureTypeName ? ValidPureTypeName<T_1> : T_1, value: ShapeFromPureTypeName<T_1>): T_1; | ||
(value: SerializedBcs<any, any> | Uint8Array): T; | ||
@@ -14,2 +16,14 @@ u8(value: number): T; | ||
id: (value: string) => T; | ||
vector<Type extends PureTypeName>(type: T extends PureTypeName ? ValidPureTypeName<Type> : Type, value: Iterable<ShapeFromPureTypeName<Type>> & { | ||
length: number; | ||
}): T; | ||
option<Type extends PureTypeName>(type: T extends PureTypeName ? ValidPureTypeName<Type> : Type, value: ShapeFromPureTypeName<Type> | null | undefined): T; | ||
}; | ||
export type BasePureType = 'u8' | 'u16' | 'u32' | 'u64' | 'u128' | 'u256' | 'bool' | 'id' | 'string' | 'address'; | ||
export type PureTypeName = BasePureType | `vector<${string}>` | `option<${string}>`; | ||
export type ValidPureTypeName<T extends string> = T extends BasePureType ? PureTypeName : T extends `vector<${infer U}>` ? ValidPureTypeName<U> : T extends `option<${infer U}>` ? ValidPureTypeName<U> : PureTypeValidationError<T>; | ||
type ShapeFromPureTypeName<T extends PureTypeName> = T extends BasePureType ? Parameters<ReturnType<typeof createPure<Argument>>[T]>[0] : T extends `vector<${infer U extends PureTypeName}>` ? ShapeFromPureTypeName<U>[] : T extends `option<${infer U extends PureTypeName}>` ? ShapeFromPureTypeName<U> | null : never; | ||
type PureTypeValidationError<T extends string> = T & { | ||
error: `Invalid Pure type name: ${T}`; | ||
}; | ||
export {}; |
@@ -0,5 +1,12 @@ | ||
import { isSerializedBcs } from "@mysten/bcs"; | ||
import { bcs } from "../bcs/index.js"; | ||
function createPure(makePure) { | ||
function pure(value) { | ||
return makePure(value); | ||
function pure(typeOrSerializedValue, value) { | ||
if (typeof typeOrSerializedValue === "string") { | ||
return makePure(schemaFromName(typeOrSerializedValue).serialize(value)); | ||
} | ||
if (typeOrSerializedValue instanceof Uint8Array || isSerializedBcs(typeOrSerializedValue)) { | ||
return makePure(typeOrSerializedValue); | ||
} | ||
throw new Error("tx.pure must be called either a bcs type name, or a serialized bcs value"); | ||
} | ||
@@ -16,4 +23,43 @@ pure.u8 = (value) => makePure(bcs.U8.serialize(value)); | ||
pure.id = pure.address; | ||
pure.vector = (type, value) => { | ||
return makePure(bcs.vector(schemaFromName(type)).serialize(value)); | ||
}; | ||
pure.option = (type, value) => { | ||
return makePure(bcs.option(schemaFromName(type)).serialize(value)); | ||
}; | ||
return pure; | ||
} | ||
function schemaFromName(name) { | ||
switch (name) { | ||
case "u8": | ||
return bcs.u8(); | ||
case "u16": | ||
return bcs.u16(); | ||
case "u32": | ||
return bcs.u32(); | ||
case "u64": | ||
return bcs.u64(); | ||
case "u128": | ||
return bcs.u128(); | ||
case "u256": | ||
return bcs.u256(); | ||
case "bool": | ||
return bcs.bool(); | ||
case "string": | ||
return bcs.string(); | ||
case "id": | ||
case "address": | ||
return bcs.Address; | ||
} | ||
const generic = name.match(/^(vector|option)<(.+)>$/); | ||
if (generic) { | ||
const [kind, inner] = generic.slice(1); | ||
if (kind === "vector") { | ||
return bcs.vector(schemaFromName(inner)); | ||
} else { | ||
return bcs.option(schemaFromName(inner)); | ||
} | ||
} | ||
throw new Error(`Invalid Pure type name: ${name}`); | ||
} | ||
export { | ||
@@ -20,0 +66,0 @@ createPure |
@@ -1,2 +0,2 @@ | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240717170907"; | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240717180855"; | ||
export declare const TARGETED_RPC_VERSION = "1.30.0"; |
@@ -1,2 +0,2 @@ | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240717170907"; | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240717180855"; | ||
const TARGETED_RPC_VERSION = "1.30.0"; | ||
@@ -3,0 +3,0 @@ export { |
@@ -6,3 +6,3 @@ { | ||
"homepage": "https://sdk.mystenlabs.com", | ||
"version": "0.0.0-experimental-20240717170907", | ||
"version": "0.0.0-experimental-20240717180855", | ||
"license": "Apache-2.0", | ||
@@ -136,3 +136,3 @@ "sideEffects": false, | ||
"valibot": "^0.36.0", | ||
"@mysten/bcs": "0.0.0-experimental-20240717170907" | ||
"@mysten/bcs": "0.0.0-experimental-20240717180855" | ||
}, | ||
@@ -139,0 +139,0 @@ "scripts": { |
@@ -15,2 +15,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
#client: SuiClient; | ||
#lastDigest: string | null = null; | ||
cache: ObjectCache; | ||
@@ -33,4 +34,7 @@ | ||
async reset() { | ||
await this.cache.clearOwnedObjects(); | ||
await this.cache.clearCustom(); | ||
await Promise.all([ | ||
this.cache.clearOwnedObjects(), | ||
this.cache.clearCustom(), | ||
this.waitForLastTransaction(), | ||
]); | ||
} | ||
@@ -99,4 +103,12 @@ | ||
async applyEffects(effects: typeof bcs.TransactionEffects.$inferType) { | ||
this.#lastDigest = effects.V2?.transactionDigest ?? null; | ||
await this.cache.applyEffects(effects); | ||
} | ||
async waitForLastTransaction() { | ||
if (this.#lastDigest) { | ||
await this.#client.waitForTransaction({ digest: this.#lastDigest }); | ||
this.#lastDigest = null; | ||
} | ||
} | ||
} |
@@ -103,2 +103,6 @@ // Copyright (c) Mysten Labs, Inc. | ||
async waitForLastTransaction() { | ||
await this.#updateCache(() => this.#waitForLastDigest()); | ||
} | ||
async executeTransaction(transaction: Transaction) { | ||
@@ -408,3 +412,3 @@ const { promise, resolve, reject } = promiseWithResolvers<{ | ||
await this.#updateCache(() => this.#waitForLastDigest()); | ||
await this.waitForLastTransaction(); | ||
@@ -411,0 +415,0 @@ const result = await this.#client.signAndExecuteTransaction({ |
@@ -18,4 +18,2 @@ // Copyright (c) Mysten Labs, Inc. | ||
#cache: CachingTransactionExecutor; | ||
#client: SuiClient; | ||
#lastDigest: string | null = null; | ||
@@ -30,3 +28,2 @@ constructor({ | ||
this.#signer = signer; | ||
this.#client = options.client; | ||
this.#cache = new CachingTransactionExecutor({ | ||
@@ -77,10 +74,7 @@ client: options.client, | ||
resetCache() { | ||
return Promise.all([this.#cache.reset(), this.#waitForLastTransaction()]); | ||
return this.#cache.reset(); | ||
} | ||
async #waitForLastTransaction() { | ||
if (this.#lastDigest) { | ||
await this.#client.waitForTransaction({ digest: this.#lastDigest }); | ||
this.#lastDigest = null; | ||
} | ||
waitForLastTransaction() { | ||
return this.#cache.waitForLastTransaction(); | ||
} | ||
@@ -108,3 +102,2 @@ | ||
await this.applyEffects(effects); | ||
this.#lastDigest = results.digest; | ||
@@ -111,0 +104,0 @@ return { |
// Copyright (c) Mysten Labs, Inc. | ||
// SPDX-License-Identifier: Apache-2.0 | ||
import type { SerializedBcs } from '@mysten/bcs'; | ||
import { isSerializedBcs } from '@mysten/bcs'; | ||
import type { BcsType, SerializedBcs } from '@mysten/bcs'; | ||
import { bcs } from '../bcs/index.js'; | ||
import type { Argument } from './data/internal.js'; | ||
export function createPure<T>(makePure: (value: SerializedBcs<any, any> | Uint8Array) => T) { | ||
function pure<T extends PureTypeName>( | ||
type: T extends PureTypeName ? ValidPureTypeName<T> : T, | ||
value: ShapeFromPureTypeName<T>, | ||
): T; | ||
function pure( | ||
@@ -15,4 +22,17 @@ /** | ||
value: SerializedBcs<any, any> | Uint8Array, | ||
): T; | ||
function pure( | ||
typeOrSerializedValue?: PureTypeName | SerializedBcs<any, any> | Uint8Array, | ||
value?: unknown, | ||
): T { | ||
return makePure(value); | ||
if (typeof typeOrSerializedValue === 'string') { | ||
return makePure(schemaFromName(typeOrSerializedValue).serialize(value as never)); | ||
} | ||
if (typeOrSerializedValue instanceof Uint8Array || isSerializedBcs(typeOrSerializedValue)) { | ||
return makePure(typeOrSerializedValue); | ||
} | ||
throw new Error('tx.pure must be called either a bcs type name, or a serialized bcs value'); | ||
} | ||
@@ -30,4 +50,87 @@ | ||
pure.id = pure.address; | ||
pure.vector = <Type extends PureTypeName>( | ||
type: T extends PureTypeName ? ValidPureTypeName<Type> : Type, | ||
value: Iterable<ShapeFromPureTypeName<Type>> & { length: number }, | ||
) => { | ||
return makePure(bcs.vector(schemaFromName(type as BasePureType)).serialize(value as never)); | ||
}; | ||
pure.option = <Type extends PureTypeName>( | ||
type: T extends PureTypeName ? ValidPureTypeName<Type> : Type, | ||
value: ShapeFromPureTypeName<Type> | null | undefined, | ||
) => { | ||
return makePure(bcs.option(schemaFromName(type)).serialize(value as never)); | ||
}; | ||
return pure; | ||
} | ||
export type BasePureType = | ||
| 'u8' | ||
| 'u16' | ||
| 'u32' | ||
| 'u64' | ||
| 'u128' | ||
| 'u256' | ||
| 'bool' | ||
| 'id' | ||
| 'string' | ||
| 'address'; | ||
export type PureTypeName = BasePureType | `vector<${string}>` | `option<${string}>`; | ||
export type ValidPureTypeName<T extends string> = T extends BasePureType | ||
? PureTypeName | ||
: T extends `vector<${infer U}>` | ||
? ValidPureTypeName<U> | ||
: T extends `option<${infer U}>` | ||
? ValidPureTypeName<U> | ||
: PureTypeValidationError<T>; | ||
type ShapeFromPureTypeName<T extends PureTypeName> = T extends BasePureType | ||
? Parameters<ReturnType<typeof createPure<Argument>>[T]>[0] | ||
: T extends `vector<${infer U extends PureTypeName}>` | ||
? ShapeFromPureTypeName<U>[] | ||
: T extends `option<${infer U extends PureTypeName}>` | ||
? ShapeFromPureTypeName<U> | null | ||
: never; | ||
type PureTypeValidationError<T extends string> = T & { | ||
error: `Invalid Pure type name: ${T}`; | ||
}; | ||
function schemaFromName<T extends PureTypeName>( | ||
name: T extends PureTypeName ? ValidPureTypeName<T> : T, | ||
): BcsType<ShapeFromPureTypeName<T>> { | ||
switch (name) { | ||
case 'u8': | ||
return bcs.u8() as never; | ||
case 'u16': | ||
return bcs.u16() as never; | ||
case 'u32': | ||
return bcs.u32() as never; | ||
case 'u64': | ||
return bcs.u64() as never; | ||
case 'u128': | ||
return bcs.u128() as never; | ||
case 'u256': | ||
return bcs.u256() as never; | ||
case 'bool': | ||
return bcs.bool() as never; | ||
case 'string': | ||
return bcs.string() as never; | ||
case 'id': | ||
case 'address': | ||
return bcs.Address as never; | ||
} | ||
const generic = name.match(/^(vector|option)<(.+)>$/); | ||
if (generic) { | ||
const [kind, inner] = generic.slice(1); | ||
if (kind === 'vector') { | ||
return bcs.vector(schemaFromName(inner as PureTypeName)) as never; | ||
} else { | ||
return bcs.option(schemaFromName(inner as PureTypeName)) as never; | ||
} | ||
} | ||
throw new Error(`Invalid Pure type name: ${name}`); | ||
} |
@@ -6,3 +6,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
export const PACKAGE_VERSION = '0.0.0-experimental-20240717170907'; | ||
export const PACKAGE_VERSION = '0.0.0-experimental-20240717180855'; | ||
export const TARGETED_RPC_VERSION = '1.30.0'; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5378209
91149
+ Added@mysten/bcs@0.0.0-experimental-20240717180855(transitive)
- Removed@mysten/bcs@0.0.0-experimental-20240717170907(transitive)