@mysten/sui 2.16.0 → 2.16.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +21 -0
- package/dist/grpc/proto/sui/rpc/v2/ledger_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/move_package_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/state_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/subscription_service.client.d.mts +4 -4
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.mts +4 -4
- package/dist/jsonRpc/http-transport.mjs +1 -2
- package/dist/jsonRpc/http-transport.mjs.map +1 -1
- package/dist/transactions/Transaction.d.mts +7 -7
- package/dist/transactions/data/internal.d.mts +109 -109
- package/dist/transactions/data/internal.d.mts.map +1 -1
- package/dist/transactions/data/v1.d.mts +220 -220
- package/dist/transactions/data/v1.d.mts.map +1 -1
- package/dist/transactions/data/v2.d.mts +16 -16
- package/dist/version.mjs +2 -3
- package/dist/version.mjs.map +1 -1
- package/docs/bcs.md +17 -14
- package/docs/clients/core.md +68 -62
- package/docs/clients/graphql.md +6 -4
- package/docs/clients/grpc.md +18 -13
- package/docs/clients/index.md +17 -15
- package/docs/clients/json-rpc.md +21 -17
- package/docs/cryptography/keypairs.md +16 -7
- package/docs/cryptography/multisig.md +7 -5
- package/docs/cryptography/passkey.md +16 -15
- package/docs/cryptography/webcrypto-signer.md +9 -9
- package/docs/executors.md +25 -22
- package/docs/faucet.md +4 -4
- package/docs/hello-sui.md +8 -7
- package/docs/index.md +20 -21
- package/docs/install.md +4 -4
- package/docs/llm-docs.md +10 -10
- package/docs/llms-index.md +41 -57
- package/docs/migrations/0.38.md +10 -9
- package/docs/migrations/sui-1.0.md +35 -33
- package/docs/migrations/sui-2.0/agent-prompt.md +4 -4
- package/docs/migrations/sui-2.0/dapp-kit.md +47 -47
- package/docs/migrations/sui-2.0/deepbook-v3.md +2 -2
- package/docs/migrations/sui-2.0/index.md +38 -37
- package/docs/migrations/sui-2.0/json-rpc-migration.md +59 -50
- package/docs/migrations/sui-2.0/kiosk.md +9 -9
- package/docs/migrations/sui-2.0/sdk-maintainers.md +8 -8
- package/docs/migrations/sui-2.0/seal.md +2 -2
- package/docs/migrations/sui-2.0/sui.md +17 -17
- package/docs/migrations/sui-2.0/suins.md +6 -4
- package/docs/migrations/sui-2.0/wallet-builders.md +6 -6
- package/docs/migrations/sui-2.0/walrus.md +4 -4
- package/docs/migrations/sui-2.0/zksend.md +7 -6
- package/docs/plugins.md +19 -16
- package/docs/sdk-building.md +37 -33
- package/docs/transaction-building/basics.md +16 -14
- package/docs/transaction-building/gas.md +3 -4
- package/docs/transaction-building/intents.md +6 -5
- package/docs/transaction-building/offline.md +11 -9
- package/docs/transaction-building/sponsored-transactions.md +2 -2
- package/docs/utils/derived_objects.md +13 -13
- package/docs/utils/index.md +2 -2
- package/docs/zklogin.md +7 -2
- package/package.json +4 -5
- package/src/jsonRpc/http-transport.ts +1 -2
- package/src/version.ts +1 -2
- package/src/transactions/__tests__/Transaction.test.ts +0 -184
- package/src/transactions/__tests__/bcs.test.ts +0 -205
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,26 @@
|
|
|
1
1
|
# @mysten/sui.js
|
|
2
2
|
|
|
3
|
+
## 2.16.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- f7de3e5: Restore docs in published tarballs.
|
|
8
|
+
- Updated dependencies [f7de3e5]
|
|
9
|
+
- @mysten/bcs@2.0.5
|
|
10
|
+
- @mysten/utils@0.3.3
|
|
11
|
+
|
|
12
|
+
## 2.16.1
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- 9e067cf: Validate the new per-package release flow end-to-end across every public @mysten package.
|
|
17
|
+
No functional changes — empty patch bump to force the orchestrator to dispatch every
|
|
18
|
+
release-<pkg>.yml workflow with `dry_run=false` so each package publishes via OIDC trusted
|
|
19
|
+
publishing.
|
|
20
|
+
- Updated dependencies [9e067cf]
|
|
21
|
+
- @mysten/bcs@2.0.4
|
|
22
|
+
- @mysten/utils@0.3.2
|
|
23
|
+
|
|
3
24
|
## 2.16.0
|
|
4
25
|
|
|
5
26
|
### Minor Changes
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { BatchGetObjectsRequest, BatchGetObjectsResponse, BatchGetTransactionsRequest, BatchGetTransactionsResponse, GetCheckpointRequest, GetCheckpointResponse, GetEpochRequest, GetEpochResponse, GetObjectRequest, GetObjectResponse, GetServiceInfoRequest, GetServiceInfoResponse, GetTransactionRequest, GetTransactionResponse } from "./ledger_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime5 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc5 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/ledger_service.client.d.ts
|
|
@@ -45,9 +45,9 @@ interface ILedgerServiceClient {
|
|
|
45
45
|
declare class LedgerServiceClient implements ILedgerServiceClient, ServiceInfo {
|
|
46
46
|
private readonly _transport;
|
|
47
47
|
typeName: string;
|
|
48
|
-
methods:
|
|
48
|
+
methods: _protobuf_ts_runtime_rpc5.MethodInfo<any, any>[];
|
|
49
49
|
options: {
|
|
50
|
-
[extensionName: string]:
|
|
50
|
+
[extensionName: string]: _protobuf_ts_runtime5.JsonValue;
|
|
51
51
|
};
|
|
52
52
|
constructor(_transport: RpcTransport);
|
|
53
53
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetDatatypeRequest, GetDatatypeResponse, GetFunctionRequest, GetFunctionResponse, GetPackageRequest, GetPackageResponse, ListPackageVersionsRequest, ListPackageVersionsResponse } from "./move_package_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime4 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc4 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/move_package_service.client.d.ts
|
|
@@ -31,9 +31,9 @@ interface IMovePackageServiceClient {
|
|
|
31
31
|
declare class MovePackageServiceClient implements IMovePackageServiceClient, ServiceInfo {
|
|
32
32
|
private readonly _transport;
|
|
33
33
|
typeName: string;
|
|
34
|
-
methods:
|
|
34
|
+
methods: _protobuf_ts_runtime_rpc4.MethodInfo<any, any>[];
|
|
35
35
|
options: {
|
|
36
|
-
[extensionName: string]:
|
|
36
|
+
[extensionName: string]: _protobuf_ts_runtime4.JsonValue;
|
|
37
37
|
};
|
|
38
38
|
constructor(_transport: RpcTransport);
|
|
39
39
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { VerifySignatureRequest, VerifySignatureResponse } from "./signature_verification_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime0 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc0 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/signature_verification_service.client.d.ts
|
|
@@ -21,9 +21,9 @@ interface ISignatureVerificationServiceClient {
|
|
|
21
21
|
declare class SignatureVerificationServiceClient implements ISignatureVerificationServiceClient, ServiceInfo {
|
|
22
22
|
private readonly _transport;
|
|
23
23
|
typeName: string;
|
|
24
|
-
methods:
|
|
24
|
+
methods: _protobuf_ts_runtime_rpc0.MethodInfo<any, any>[];
|
|
25
25
|
options: {
|
|
26
|
-
[extensionName: string]:
|
|
26
|
+
[extensionName: string]: _protobuf_ts_runtime0.JsonValue;
|
|
27
27
|
};
|
|
28
28
|
constructor(_transport: RpcTransport);
|
|
29
29
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { GetBalanceRequest, GetBalanceResponse, GetCoinInfoRequest, GetCoinInfoResponse, ListBalancesRequest, ListBalancesResponse, ListDynamicFieldsRequest, ListDynamicFieldsResponse, ListOwnedObjectsRequest, ListOwnedObjectsResponse } from "./state_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime1 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc1 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/state_service.client.d.ts
|
|
@@ -35,9 +35,9 @@ interface IStateServiceClient {
|
|
|
35
35
|
declare class StateServiceClient implements IStateServiceClient, ServiceInfo {
|
|
36
36
|
private readonly _transport;
|
|
37
37
|
typeName: string;
|
|
38
|
-
methods:
|
|
38
|
+
methods: _protobuf_ts_runtime_rpc1.MethodInfo<any, any>[];
|
|
39
39
|
options: {
|
|
40
|
-
[extensionName: string]:
|
|
40
|
+
[extensionName: string]: _protobuf_ts_runtime1.JsonValue;
|
|
41
41
|
};
|
|
42
42
|
constructor(_transport: RpcTransport);
|
|
43
43
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SubscribeCheckpointsRequest, SubscribeCheckpointsResponse } from "./subscription_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime2 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc2 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServerStreamingCall, ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/subscription_service.client.d.ts
|
|
@@ -31,9 +31,9 @@ interface ISubscriptionServiceClient {
|
|
|
31
31
|
declare class SubscriptionServiceClient implements ISubscriptionServiceClient, ServiceInfo {
|
|
32
32
|
private readonly _transport;
|
|
33
33
|
typeName: string;
|
|
34
|
-
methods:
|
|
34
|
+
methods: _protobuf_ts_runtime_rpc2.MethodInfo<any, any>[];
|
|
35
35
|
options: {
|
|
36
|
-
[extensionName: string]:
|
|
36
|
+
[extensionName: string]: _protobuf_ts_runtime2.JsonValue;
|
|
37
37
|
};
|
|
38
38
|
constructor(_transport: RpcTransport);
|
|
39
39
|
/**
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExecuteTransactionRequest, ExecuteTransactionResponse, SimulateTransactionRequest, SimulateTransactionResponse } from "./transaction_execution_service.mjs";
|
|
2
|
-
import * as
|
|
3
|
-
import * as
|
|
2
|
+
import * as _protobuf_ts_runtime3 from "@protobuf-ts/runtime";
|
|
3
|
+
import * as _protobuf_ts_runtime_rpc3 from "@protobuf-ts/runtime-rpc";
|
|
4
4
|
import { RpcOptions, RpcTransport, ServiceInfo, UnaryCall } from "@protobuf-ts/runtime-rpc";
|
|
5
5
|
|
|
6
6
|
//#region src/grpc/proto/sui/rpc/v2/transaction_execution_service.client.d.ts
|
|
@@ -23,9 +23,9 @@ interface ITransactionExecutionServiceClient {
|
|
|
23
23
|
declare class TransactionExecutionServiceClient implements ITransactionExecutionServiceClient, ServiceInfo {
|
|
24
24
|
private readonly _transport;
|
|
25
25
|
typeName: string;
|
|
26
|
-
methods:
|
|
26
|
+
methods: _protobuf_ts_runtime_rpc3.MethodInfo<any, any>[];
|
|
27
27
|
options: {
|
|
28
|
-
[extensionName: string]:
|
|
28
|
+
[extensionName: string]: _protobuf_ts_runtime3.JsonValue;
|
|
29
29
|
};
|
|
30
30
|
constructor(_transport: RpcTransport);
|
|
31
31
|
/**
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PACKAGE_VERSION
|
|
1
|
+
import { PACKAGE_VERSION } from "../version.mjs";
|
|
2
2
|
import { JsonRpcError, SuiHTTPStatusError } from "./errors.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/jsonRpc/http-transport.ts
|
|
@@ -22,7 +22,6 @@ var JsonRpcHTTPTransport = class {
|
|
|
22
22
|
"Content-Type": "application/json",
|
|
23
23
|
"Client-Sdk-Type": "typescript",
|
|
24
24
|
"Client-Sdk-Version": PACKAGE_VERSION,
|
|
25
|
-
"Client-Target-Api-Version": TARGETED_RPC_VERSION,
|
|
26
25
|
"Client-Request-Method": input.method,
|
|
27
26
|
...this.#options.rpc?.headers
|
|
28
27
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http-transport.mjs","names":["#options","#requestId"],"sources":["../../src/jsonRpc/http-transport.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PACKAGE_VERSION
|
|
1
|
+
{"version":3,"file":"http-transport.mjs","names":["#options","#requestId"],"sources":["../../src/jsonRpc/http-transport.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport { PACKAGE_VERSION } from '../version.js';\nimport { JsonRpcError, SuiHTTPStatusError } from './errors.js';\n\n/**\n * An object defining headers to be passed to the RPC server\n */\nexport type HttpHeaders = { [header: string]: string };\n\nexport interface JsonRpcHTTPTransportOptions {\n\tfetch?: typeof fetch;\n\turl: string;\n\trpc?: {\n\t\theaders?: HttpHeaders;\n\t\turl?: string;\n\t};\n}\n\nexport interface JsonRpcTransportRequestOptions {\n\tmethod: string;\n\tparams: unknown[];\n\tsignal?: AbortSignal;\n}\n\nexport interface JsonRpcTransport {\n\trequest<T = unknown>(input: JsonRpcTransportRequestOptions): Promise<T>;\n}\n\nexport class JsonRpcHTTPTransport implements JsonRpcTransport {\n\t#requestId = 0;\n\t#options: JsonRpcHTTPTransportOptions;\n\n\tconstructor(options: JsonRpcHTTPTransportOptions) {\n\t\tthis.#options = options;\n\t}\n\n\tfetch(input: RequestInfo, init?: RequestInit): Promise<Response> {\n\t\tconst fetchFn = this.#options.fetch ?? fetch;\n\n\t\tif (!fetchFn) {\n\t\t\tthrow new Error(\n\t\t\t\t'The current environment does not support fetch, you can provide a fetch implementation in the options for SuiHTTPTransport.',\n\t\t\t);\n\t\t}\n\n\t\treturn fetchFn(input, init);\n\t}\n\n\tasync request<T>(input: JsonRpcTransportRequestOptions): Promise<T> {\n\t\tthis.#requestId += 1;\n\n\t\tconst res = await this.fetch(this.#options.rpc?.url ?? this.#options.url, {\n\t\t\tmethod: 'POST',\n\t\t\tsignal: input.signal,\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t'Client-Sdk-Type': 'typescript',\n\t\t\t\t'Client-Sdk-Version': PACKAGE_VERSION,\n\t\t\t\t'Client-Request-Method': input.method,\n\t\t\t\t...this.#options.rpc?.headers,\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tjsonrpc: '2.0',\n\t\t\t\tid: this.#requestId,\n\t\t\t\tmethod: input.method,\n\t\t\t\tparams: input.params,\n\t\t\t}),\n\t\t});\n\n\t\tif (!res.ok) {\n\t\t\tthrow new SuiHTTPStatusError(\n\t\t\t\t`Unexpected status code: ${res.status}`,\n\t\t\t\tres.status,\n\t\t\t\tres.statusText,\n\t\t\t);\n\t\t}\n\n\t\tconst data = await res.json();\n\n\t\tif ('error' in data && data.error != null) {\n\t\t\tthrow new JsonRpcError(data.error.message, data.error.code);\n\t\t}\n\n\t\treturn data.result;\n\t}\n}\n"],"mappings":";;;;AA8BA,IAAa,uBAAb,MAA8D;CAC7D,aAAa;CACb;CAEA,YAAY,SAAsC;AACjD,QAAKA,UAAW;;CAGjB,MAAM,OAAoB,MAAuC;EAChE,MAAM,UAAU,MAAKA,QAAS,SAAS;AAEvC,MAAI,CAAC,QACJ,OAAM,IAAI,MACT,8HACA;AAGF,SAAO,QAAQ,OAAO,KAAK;;CAG5B,MAAM,QAAW,OAAmD;AACnE,QAAKC,aAAc;EAEnB,MAAM,MAAM,MAAM,KAAK,MAAM,MAAKD,QAAS,KAAK,OAAO,MAAKA,QAAS,KAAK;GACzE,QAAQ;GACR,QAAQ,MAAM;GACd,SAAS;IACR,gBAAgB;IAChB,mBAAmB;IACnB,sBAAsB;IACtB,yBAAyB,MAAM;IAC/B,GAAG,MAAKA,QAAS,KAAK;IACtB;GACD,MAAM,KAAK,UAAU;IACpB,SAAS;IACT,IAAI,MAAKC;IACT,QAAQ,MAAM;IACd,QAAQ,MAAM;IACd,CAAC;GACF,CAAC;AAEF,MAAI,CAAC,IAAI,GACR,OAAM,IAAI,mBACT,2BAA2B,IAAI,UAC/B,IAAI,QACJ,IAAI,WACJ;EAGF,MAAM,OAAO,MAAM,IAAI,MAAM;AAE7B,MAAI,WAAW,QAAQ,KAAK,SAAS,KACpC,OAAM,IAAI,aAAa,KAAK,MAAM,SAAS,KAAK,MAAM,KAAK;AAG5D,SAAO,KAAK"}
|
|
@@ -8,7 +8,7 @@ import { createPure } from "./pure.mjs";
|
|
|
8
8
|
import { SignatureWithBytes, Signer } from "../cryptography/keypair.mjs";
|
|
9
9
|
import "../cryptography/index.mjs";
|
|
10
10
|
import { ClientWithCoreApi } from "../client/core.mjs";
|
|
11
|
-
import * as
|
|
11
|
+
import * as _mysten_bcs1111 from "@mysten/bcs";
|
|
12
12
|
import { SerializedBcs } from "@mysten/bcs";
|
|
13
13
|
import { InferInput } from "valibot";
|
|
14
14
|
|
|
@@ -77,7 +77,7 @@ declare class Transaction {
|
|
|
77
77
|
getData(): {
|
|
78
78
|
version: 2;
|
|
79
79
|
sender?: string | null | undefined;
|
|
80
|
-
expiration?:
|
|
80
|
+
expiration?: _mysten_bcs1111.EnumOutputShapeWithKeys<{
|
|
81
81
|
None: true;
|
|
82
82
|
Epoch: string | number;
|
|
83
83
|
ValidDuring: {
|
|
@@ -99,8 +99,8 @@ declare class Transaction {
|
|
|
99
99
|
digest: string;
|
|
100
100
|
}[] | null;
|
|
101
101
|
};
|
|
102
|
-
inputs:
|
|
103
|
-
Object:
|
|
102
|
+
inputs: _mysten_bcs1111.EnumOutputShapeWithKeys<{
|
|
103
|
+
Object: _mysten_bcs1111.EnumOutputShapeWithKeys<{
|
|
104
104
|
ImmOrOwnedObject: {
|
|
105
105
|
objectId: string;
|
|
106
106
|
version: string | number;
|
|
@@ -139,13 +139,13 @@ declare class Transaction {
|
|
|
139
139
|
Balance: string;
|
|
140
140
|
$kind: "Balance";
|
|
141
141
|
};
|
|
142
|
-
withdrawFrom:
|
|
142
|
+
withdrawFrom: _mysten_bcs1111.EnumOutputShapeWithKeys<{
|
|
143
143
|
Sender: true;
|
|
144
144
|
Sponsor: true;
|
|
145
145
|
}, "Sender" | "Sponsor">;
|
|
146
146
|
};
|
|
147
147
|
}, "Object" | "Pure" | "FundsWithdrawal" | "UnresolvedPure" | "UnresolvedObject">[];
|
|
148
|
-
commands:
|
|
148
|
+
commands: _mysten_bcs1111.EnumOutputShapeWithKeys<{
|
|
149
149
|
MoveCall: {
|
|
150
150
|
package: string;
|
|
151
151
|
module: string;
|
|
@@ -166,7 +166,7 @@ declare class Transaction {
|
|
|
166
166
|
$kind: "NestedResult";
|
|
167
167
|
})[];
|
|
168
168
|
_argumentTypes?: {
|
|
169
|
-
reference: "mutable" | "
|
|
169
|
+
reference: "mutable" | "immutable" | "unknown" | null;
|
|
170
170
|
body: SuiClientTypes.OpenSignatureBody;
|
|
171
171
|
}[] | null | undefined;
|
|
172
172
|
};
|