@mysten/sui
Advanced tools
Comparing version 0.0.0-experimental-20240806174754 to 0.0.0-experimental-20240813182818
# @mysten/sui.js | ||
## 0.0.0-experimental-20240806174754 | ||
## 0.0.0-experimental-20240813182818 | ||
### Minor Changes | ||
- a3e32fe: `WaitForLocalExecution` now waits using client.waitForTransaction rather than sending | ||
requestType to the RPC node. This change will preserve readAfterWrite consistency when local | ||
execution is removed from fullnodes, at the cost of more network requests and higher latency. | ||
## 1.5.0 | ||
### Minor Changes | ||
- 0851b31: Deprecate requestType option when executing transactions | ||
@@ -13,3 +21,3 @@ | ||
- Updated dependencies [f37b3c2] | ||
- @mysten/bcs@0.0.0-experimental-20240806174754 | ||
- @mysten/bcs@1.0.4 | ||
@@ -16,0 +24,0 @@ ## 1.4.0 |
@@ -106,3 +106,3 @@ import type { Signer } from '../cryptography/index.js'; | ||
multiGetTransactionBlocks(input: MultiGetTransactionBlocksParams): Promise<SuiTransactionBlockResponse[]>; | ||
executeTransactionBlock(input: ExecuteTransactionBlockParams): Promise<SuiTransactionBlockResponse>; | ||
executeTransactionBlock({ transactionBlock, signature, options, requestType, }: ExecuteTransactionBlockParams): Promise<SuiTransactionBlockResponse>; | ||
signAndExecuteTransaction({ transaction, signer, ...input }: { | ||
@@ -109,0 +109,0 @@ transaction: Uint8Array | Transaction; |
@@ -267,12 +267,25 @@ "use strict"; | ||
} | ||
async executeTransactionBlock(input) { | ||
return await this.transport.request({ | ||
async executeTransactionBlock({ | ||
transactionBlock, | ||
signature, | ||
options, | ||
requestType | ||
}) { | ||
const result = await this.transport.request({ | ||
method: "sui_executeTransactionBlock", | ||
params: [ | ||
typeof input.transactionBlock === "string" ? input.transactionBlock : (0, import_bcs.toB64)(input.transactionBlock), | ||
Array.isArray(input.signature) ? input.signature : [input.signature], | ||
input.options, | ||
input.requestType | ||
typeof transactionBlock === "string" ? transactionBlock : (0, import_bcs.toB64)(transactionBlock), | ||
Array.isArray(signature) ? signature : [signature], | ||
options | ||
] | ||
}); | ||
if (requestType === "WaitForLocalExecution") { | ||
try { | ||
await this.waitForTransaction({ | ||
digest: result.digest | ||
}); | ||
} catch (_) { | ||
} | ||
} | ||
return result; | ||
} | ||
@@ -279,0 +292,0 @@ async signAndExecuteTransaction({ |
@@ -1,2 +0,2 @@ | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240806174754"; | ||
export declare const TARGETED_RPC_VERSION = "1.31.0"; | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240813182818"; | ||
export declare const TARGETED_RPC_VERSION = "1.32.0"; |
@@ -25,4 +25,4 @@ "use strict"; | ||
module.exports = __toCommonJS(version_exports); | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240806174754"; | ||
const TARGETED_RPC_VERSION = "1.31.0"; | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240813182818"; | ||
const TARGETED_RPC_VERSION = "1.32.0"; | ||
//# sourceMappingURL=version.js.map |
@@ -106,3 +106,3 @@ import type { Signer } from '../cryptography/index.js'; | ||
multiGetTransactionBlocks(input: MultiGetTransactionBlocksParams): Promise<SuiTransactionBlockResponse[]>; | ||
executeTransactionBlock(input: ExecuteTransactionBlockParams): Promise<SuiTransactionBlockResponse>; | ||
executeTransactionBlock({ transactionBlock, signature, options, requestType, }: ExecuteTransactionBlockParams): Promise<SuiTransactionBlockResponse>; | ||
signAndExecuteTransaction({ transaction, signer, ...input }: { | ||
@@ -109,0 +109,0 @@ transaction: Uint8Array | Transaction; |
@@ -249,12 +249,25 @@ import { fromB58, toB64, toHEX } from "@mysten/bcs"; | ||
} | ||
async executeTransactionBlock(input) { | ||
return await this.transport.request({ | ||
async executeTransactionBlock({ | ||
transactionBlock, | ||
signature, | ||
options, | ||
requestType | ||
}) { | ||
const result = await this.transport.request({ | ||
method: "sui_executeTransactionBlock", | ||
params: [ | ||
typeof input.transactionBlock === "string" ? input.transactionBlock : toB64(input.transactionBlock), | ||
Array.isArray(input.signature) ? input.signature : [input.signature], | ||
input.options, | ||
input.requestType | ||
typeof transactionBlock === "string" ? transactionBlock : toB64(transactionBlock), | ||
Array.isArray(signature) ? signature : [signature], | ||
options | ||
] | ||
}); | ||
if (requestType === "WaitForLocalExecution") { | ||
try { | ||
await this.waitForTransaction({ | ||
digest: result.digest | ||
}); | ||
} catch (_) { | ||
} | ||
} | ||
return result; | ||
} | ||
@@ -261,0 +274,0 @@ async signAndExecuteTransaction({ |
@@ -1,2 +0,2 @@ | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240806174754"; | ||
export declare const TARGETED_RPC_VERSION = "1.31.0"; | ||
export declare const PACKAGE_VERSION = "0.0.0-experimental-20240813182818"; | ||
export declare const TARGETED_RPC_VERSION = "1.32.0"; |
@@ -1,3 +0,3 @@ | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240806174754"; | ||
const TARGETED_RPC_VERSION = "1.31.0"; | ||
const PACKAGE_VERSION = "0.0.0-experimental-20240813182818"; | ||
const TARGETED_RPC_VERSION = "1.32.0"; | ||
export { | ||
@@ -4,0 +4,0 @@ PACKAGE_VERSION, |
@@ -6,3 +6,3 @@ { | ||
"homepage": "https://sdk.mystenlabs.com", | ||
"version": "0.0.0-experimental-20240806174754", | ||
"version": "0.0.0-experimental-20240813182818", | ||
"license": "Apache-2.0", | ||
@@ -136,3 +136,3 @@ "sideEffects": false, | ||
"valibot": "^0.36.0", | ||
"@mysten/bcs": "0.0.0-experimental-20240806174754" | ||
"@mysten/bcs": "1.0.4" | ||
}, | ||
@@ -139,0 +139,0 @@ "scripts": { |
@@ -409,16 +409,28 @@ // Copyright (c) Mysten Labs, Inc. | ||
async executeTransactionBlock( | ||
input: ExecuteTransactionBlockParams, | ||
): Promise<SuiTransactionBlockResponse> { | ||
return await this.transport.request({ | ||
async executeTransactionBlock({ | ||
transactionBlock, | ||
signature, | ||
options, | ||
requestType, | ||
}: ExecuteTransactionBlockParams): Promise<SuiTransactionBlockResponse> { | ||
const result: SuiTransactionBlockResponse = await this.transport.request({ | ||
method: 'sui_executeTransactionBlock', | ||
params: [ | ||
typeof input.transactionBlock === 'string' | ||
? input.transactionBlock | ||
: toB64(input.transactionBlock), | ||
Array.isArray(input.signature) ? input.signature : [input.signature], | ||
input.options, | ||
input.requestType, | ||
typeof transactionBlock === 'string' ? transactionBlock : toB64(transactionBlock), | ||
Array.isArray(signature) ? signature : [signature], | ||
options, | ||
], | ||
}); | ||
if (requestType === 'WaitForLocalExecution') { | ||
try { | ||
await this.waitForTransaction({ | ||
digest: result.digest, | ||
}); | ||
} catch (_) { | ||
// Ignore error while waiting for transaction | ||
} | ||
} | ||
return result; | ||
} | ||
@@ -425,0 +437,0 @@ |
@@ -6,3 +6,3 @@ // Copyright (c) Mysten Labs, Inc. | ||
export const PACKAGE_VERSION = '0.0.0-experimental-20240806174754'; | ||
export const TARGETED_RPC_VERSION = '1.31.0'; | ||
export const PACKAGE_VERSION = '0.0.0-experimental-20240813182818'; | ||
export const TARGETED_RPC_VERSION = '1.32.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
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
5388832
91344
+ Added@mysten/bcs@1.0.4(transitive)
- Removed@mysten/bcs@0.0.0-experimental-20240806174754(transitive)
Updated@mysten/bcs@1.0.4