@mysten/sui 2.5.1 → 2.7.0
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 +29 -0
- package/dist/bcs/bcs.d.mts +6 -6
- package/dist/client/core-resolver.mjs +6 -3
- package/dist/client/core-resolver.mjs.map +1 -1
- package/dist/client/core.d.mts +8 -8
- package/dist/client/core.d.mts.map +1 -1
- package/dist/client/core.mjs +11 -5
- package/dist/client/core.mjs.map +1 -1
- package/dist/client/types.d.mts +73 -18
- package/dist/client/types.d.mts.map +1 -1
- package/dist/cryptography/signature.d.mts +6 -6
- package/dist/graphql/client.d.mts +16 -1
- package/dist/graphql/client.d.mts.map +1 -1
- package/dist/graphql/client.mjs +50 -2
- package/dist/graphql/client.mjs.map +1 -1
- package/dist/graphql/core.d.mts +5 -5
- package/dist/graphql/core.d.mts.map +1 -1
- package/dist/graphql/core.mjs +28 -49
- package/dist/graphql/core.mjs.map +1 -1
- package/dist/graphql/generated/queries.d.mts.map +1 -1
- package/dist/graphql/generated/queries.mjs +25 -7
- package/dist/graphql/generated/queries.mjs.map +1 -1
- package/dist/graphql/generated/tada-env.d.mts +706 -98
- package/dist/grpc/client.d.mts +16 -1
- package/dist/grpc/client.d.mts.map +1 -1
- package/dist/grpc/client.mjs +42 -2
- package/dist/grpc/client.mjs.map +1 -1
- package/dist/grpc/core.d.mts +5 -5
- package/dist/grpc/core.d.mts.map +1 -1
- package/dist/grpc/core.mjs +18 -35
- package/dist/grpc/core.mjs.map +1 -1
- 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/object.d.mts +38 -1
- package/dist/grpc/proto/sui/rpc/v2/object.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/object.mjs +26 -1
- package/dist/grpc/proto/sui/rpc/v2/object.mjs.map +1 -1
- 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.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.d.mts +8 -0
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.d.mts.map +1 -1
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.mjs +23 -12
- package/dist/grpc/proto/sui/rpc/v2/transaction_execution_service.mjs.map +1 -1
- package/dist/grpc/proto/types.d.mts +2 -2
- package/dist/grpc/proto/types.mjs +2 -1
- package/dist/jsonRpc/core.d.mts +6 -6
- package/dist/jsonRpc/core.d.mts.map +1 -1
- package/dist/jsonRpc/core.mjs +14 -5
- package/dist/jsonRpc/core.mjs.map +1 -1
- package/dist/transactions/Transaction.d.mts +6 -6
- package/dist/transactions/Transaction.d.mts.map +1 -1
- package/dist/transactions/executor/caching.mjs.map +1 -1
- package/dist/transactions/executor/parallel.d.mts +1 -1
- package/dist/transactions/executor/parallel.d.mts.map +1 -1
- package/dist/transactions/executor/parallel.mjs.map +1 -1
- package/dist/transactions/executor/serial.d.mts +1 -1
- package/dist/transactions/executor/serial.d.mts.map +1 -1
- package/dist/transactions/executor/serial.mjs.map +1 -1
- package/dist/version.mjs +1 -1
- package/dist/version.mjs.map +1 -1
- package/dist/zklogin/bcs.d.mts +14 -14
- package/package.json +1 -1
- package/src/client/core-resolver.ts +9 -8
- package/src/client/core.ts +28 -18
- package/src/client/types.ts +73 -18
- package/src/graphql/client.ts +96 -4
- package/src/graphql/core.ts +43 -88
- package/src/graphql/generated/queries.ts +271 -44
- package/src/graphql/generated/schema.graphql +328 -25
- package/src/graphql/generated/tada-env.ts +779 -58
- package/src/graphql/queries/getDynamicFields.graphql +8 -1
- package/src/graphql/queries/objects.graphql +10 -0
- package/src/graphql/queries/transactions.graphql +1 -3
- package/src/graphql/queries/verifyZkLoginSignature.graphql +0 -1
- package/src/grpc/client.ts +62 -4
- package/src/grpc/core.ts +42 -39
- package/src/grpc/proto/sui/rpc/v2/object.ts +44 -0
- package/src/grpc/proto/sui/rpc/v2/transaction_execution_service.ts +16 -0
- package/src/jsonRpc/core.ts +18 -7
- package/src/transactions/executor/caching.ts +2 -2
- package/src/transactions/executor/parallel.ts +1 -1
- package/src/transactions/executor/serial.ts +1 -1
- package/src/version.ts +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.mts","names":[],"sources":["../../src/client/types.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;KAaY,gCACD,aAAa;iBAIR;8BACa,MAAM;;KAGvB,qCAAqC,aAAa,cAAc,OAAO;AATvE,kBAWK,cAAA,CAXgB;EACtB,KAAA,OAAA,GAAA,SAAA,GAAA,SAAA,GAAA,QAAA,GAAA,UAAA,GAAA,CAAA,MAAA,GAAA,CAAA,CAAA,CAAA;EAAa,UAAA,gBAAA,CAAA;IAIR,OAAA,EAUL,OAVK;IACa,IAAA,CAAA,EAUpB,UAVoB;IAAM,KAAA,CAAA,EAWzB,WAXyB;EAAS;EAGhC,UAAA,UAAA,CAAA;IAAqC,GAAA,CAAA,EAAA,MAAA;IAAa,QAAA,CAAA,EAAA,MAAA;IAAc,SAAA,CAAA,EAAA;MAAO,QAAA,CAAA,EAerE,MAfqE,CAAA,MAAA,EAAA,MAAA,CAAA;MAAC,KAAA,CAAA,EAgBzE,MAhByE,CAAA,MAAA,EAAA,MAAA,CAAA;IAEnE,CAAA;EAIN;EACF,UAAA,uBAAA,CAAA;IACC,MAAA,CAAA,EAaC,WAbD;EAOI;EACH;EAKA,UAAA,gBAAA,CAAA;IAKoB,UAAA,EAAA,CAAA,gBAAA,aAAA,GAAA,CAAA,CAAA,CAAA,CAAA,OAAA,EACnB,iBADmB,CACD,OADC,CAAA,EAAA,GAExB,OAFwB,CAEhB,kBAFgB,CAEG,OAFH,CAAA,CAAA;IACD,gBAAA,EAAA,CAAA,g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Aa;YAClB;;cAEE,UAAU;;uDAIJ,yCACP;iBACI,aAAa;cAChB,UAAU;;gDAGgC;;sCAIzC,gCACN,QAAQ;;;;;iDAOwC;;uCAI1C,iCACN,QAAQ;;;iBAIA;;8CAGqC;;oCAIvC,8BACN,QAAQ;;;;;;;;;;;;;;;;;gBAmBD;iBACC;kBACC;;;;;;;;;;;;;;;;;;;;;;kDA0BwC;;;;;;;;;;;sCAc5C,kCACL,QAAQ;;;kDAIyC;;;;;;;;;sCAY5C,kCACL,QAAQ;;;;SAMR;;;8BAIqB,6BAA6B,QAAQ;2BACxC,0BAA0B,QAAQ;uBACtC,sBAAsB,QAAQ;;6CAGA;;;0CAIH;;;sCAIJ;;;;;;;;;;;cAchC;;;WAMH;;;;;;+BAWoB,2BAA2B,QAAQ;;0CAGhB;;;;aAKrC;;;;;;aAOA;;;;eAKE;eACA;;;;;;;;eAUE;oBACK;YACR;;;;;;;eAQG;oBACK;cACN;;;;;iBAOC;;;;;;UAOP;;;;;YAME;;2CAGuC;;;;;;cAOrC;;2CAGqC;;;;;;cAOrC;;;;;;;gBASE;;oBAEI;gBACJ;aACH;;;;eAKE;UACL;;;;;;YASI;;;;;sBAMS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBAsEjB,eACA,cACA,cACA,iBACA,wBACA;;;SAKG;;YAEG;aACC;;eAEE;;;;oBAIK;+BACW;;;;;;;;gBASf;;;;iBAIC;;;;;;;;;;;;;;WAmBJ;;;;;;;;;;;;;SAqBJ;;;;;;;;UAQC;;;;eAKK;kBACG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MAiEX;eACQ;eACA;0BACW;uBACH;yBACE;gBACT;uBACO;sBACD;mBACH"}
|
|
@@ -33,12 +33,6 @@ declare function parseSerializedSignature(serializedSignature: string): {
|
|
|
33
33
|
clientDataJson: string;
|
|
34
34
|
userSignature: Uint8Array<ArrayBuffer>;
|
|
35
35
|
publicKey: Uint8Array<ArrayBuffer>;
|
|
36
|
-
} | {
|
|
37
|
-
serializedSignature: string;
|
|
38
|
-
signatureScheme: "ED25519" | "Secp256k1" | "Secp256r1";
|
|
39
|
-
signature: Uint8Array<ArrayBuffer>;
|
|
40
|
-
publicKey: Uint8Array<ArrayBuffer>;
|
|
41
|
-
bytes: Uint8Array<ArrayBuffer>;
|
|
42
36
|
} | {
|
|
43
37
|
serializedSignature: string;
|
|
44
38
|
signatureScheme: "ZkLogin";
|
|
@@ -63,6 +57,12 @@ declare function parseSerializedSignature(serializedSignature: string): {
|
|
|
63
57
|
};
|
|
64
58
|
signature: Uint8Array<ArrayBufferLike>;
|
|
65
59
|
publicKey: Uint8Array<ArrayBuffer>;
|
|
60
|
+
} | {
|
|
61
|
+
serializedSignature: string;
|
|
62
|
+
signatureScheme: "ED25519" | "Secp256k1" | "Secp256r1";
|
|
63
|
+
signature: Uint8Array<ArrayBuffer>;
|
|
64
|
+
publicKey: Uint8Array<ArrayBuffer>;
|
|
65
|
+
bytes: Uint8Array<ArrayBuffer>;
|
|
66
66
|
} | {
|
|
67
67
|
serializedSignature: string;
|
|
68
68
|
signatureScheme: "MultiSig";
|
|
@@ -47,6 +47,19 @@ interface SuiGraphQLClientOptions<Queries extends Record<string, GraphQLDocument
|
|
|
47
47
|
declare class SuiGraphQLRequestError extends Error {}
|
|
48
48
|
declare const SUI_CLIENT_BRAND: never;
|
|
49
49
|
declare function isSuiGraphQLClient(client: unknown): client is SuiGraphQLClient;
|
|
50
|
+
interface DynamicFieldInclude {
|
|
51
|
+
value?: boolean;
|
|
52
|
+
}
|
|
53
|
+
type DynamicFieldEntryWithValue<Include extends DynamicFieldInclude = {}> = SuiClientTypes.DynamicFieldEntry & {
|
|
54
|
+
value: Include extends {
|
|
55
|
+
value: true;
|
|
56
|
+
} ? SuiClientTypes.DynamicFieldValue : undefined;
|
|
57
|
+
};
|
|
58
|
+
interface ListDynamicFieldsWithValueResponse<Include extends DynamicFieldInclude = {}> {
|
|
59
|
+
hasNextPage: boolean;
|
|
60
|
+
cursor: string | null;
|
|
61
|
+
dynamicFields: DynamicFieldEntryWithValue<Include>[];
|
|
62
|
+
}
|
|
50
63
|
declare class SuiGraphQLClient<Queries extends Record<string, GraphQLDocument> = {}> extends BaseClient implements SuiClientTypes.TransportMethods {
|
|
51
64
|
#private;
|
|
52
65
|
[SUI_CLIENT_BRAND]: boolean;
|
|
@@ -75,7 +88,9 @@ declare class SuiGraphQLClient<Queries extends Record<string, GraphQLDocument> =
|
|
|
75
88
|
waitForTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(input: SuiClientTypes.WaitForTransactionOptions<Include>): Promise<SuiClientTypes.TransactionResult<Include>>;
|
|
76
89
|
simulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = {}>(input: SuiClientTypes.SimulateTransactionOptions<Include>): Promise<SuiClientTypes.SimulateTransactionResult<Include>>;
|
|
77
90
|
getReferenceGasPrice(): Promise<SuiClientTypes.GetReferenceGasPriceResponse>;
|
|
78
|
-
listDynamicFields(input: SuiClientTypes.ListDynamicFieldsOptions
|
|
91
|
+
listDynamicFields<Include extends DynamicFieldInclude = {}>(input: SuiClientTypes.ListDynamicFieldsOptions & {
|
|
92
|
+
include?: Include & DynamicFieldInclude;
|
|
93
|
+
}): Promise<ListDynamicFieldsWithValueResponse<Include>>;
|
|
79
94
|
getDynamicField(input: SuiClientTypes.GetDynamicFieldOptions): Promise<SuiClientTypes.GetDynamicFieldResponse>;
|
|
80
95
|
getMoveFunction(input: SuiClientTypes.GetMoveFunctionOptions): Promise<SuiClientTypes.GetMoveFunctionResponse>;
|
|
81
96
|
resolveTransactionPlugin(): TransactionPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.mts","names":[],"sources":["../../src/graphql/client.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"client.d.mts","names":[],"sources":["../../src/graphql/client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
|
|
|
1
|
+
import { normalizeStructTag } from "../utils/sui-types.mjs";
|
|
1
2
|
import { BaseClient } from "../client/client.mjs";
|
|
3
|
+
import { deriveDynamicFieldID } from "../utils/dynamic-fields.mjs";
|
|
4
|
+
import { GetDynamicFieldsDocument } from "./generated/queries.mjs";
|
|
2
5
|
import { GraphQLCoreClient } from "./core.mjs";
|
|
6
|
+
import { fromBase64 } from "@mysten/utils";
|
|
3
7
|
import { print } from "graphql";
|
|
4
8
|
|
|
5
9
|
//#region src/graphql/client.ts
|
|
@@ -93,8 +97,52 @@ var SuiGraphQLClient = class extends BaseClient {
|
|
|
93
97
|
getReferenceGasPrice() {
|
|
94
98
|
return this.core.getReferenceGasPrice();
|
|
95
99
|
}
|
|
96
|
-
listDynamicFields(input) {
|
|
97
|
-
|
|
100
|
+
async listDynamicFields(input) {
|
|
101
|
+
const includeValue = input.include?.value ?? false;
|
|
102
|
+
const { data, errors } = await this.query({
|
|
103
|
+
query: GetDynamicFieldsDocument,
|
|
104
|
+
variables: {
|
|
105
|
+
parentId: input.parentId,
|
|
106
|
+
first: input.limit,
|
|
107
|
+
cursor: input.cursor,
|
|
108
|
+
includeValue
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
if (errors?.length) throw errors.length === 1 ? new Error(errors[0].message) : new AggregateError(errors.map((e) => new Error(e.message)));
|
|
112
|
+
const result = data?.address?.dynamicFields;
|
|
113
|
+
if (!result) throw new Error("Missing response data");
|
|
114
|
+
return {
|
|
115
|
+
dynamicFields: result.nodes.map((dynamicField) => {
|
|
116
|
+
const valueType = dynamicField.value?.__typename === "MoveObject" ? dynamicField.value.contents?.type?.repr : dynamicField.value?.type?.repr;
|
|
117
|
+
const isDynamicObject = dynamicField.value?.__typename === "MoveObject";
|
|
118
|
+
const derivedNameType = isDynamicObject ? `0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>` : dynamicField.name?.type?.repr;
|
|
119
|
+
let value;
|
|
120
|
+
if (includeValue) {
|
|
121
|
+
let valueBcs;
|
|
122
|
+
if (dynamicField.value?.__typename === "MoveValue") valueBcs = fromBase64(dynamicField.value.bcs ?? "");
|
|
123
|
+
else if (dynamicField.value?.__typename === "MoveObject") valueBcs = fromBase64(dynamicField.value.contents?.bcs ?? "");
|
|
124
|
+
else valueBcs = new Uint8Array();
|
|
125
|
+
value = {
|
|
126
|
+
type: valueType,
|
|
127
|
+
bcs: valueBcs
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
return {
|
|
131
|
+
$kind: isDynamicObject ? "DynamicObject" : "DynamicField",
|
|
132
|
+
fieldId: deriveDynamicFieldID(input.parentId, derivedNameType, fromBase64(dynamicField.name?.bcs)),
|
|
133
|
+
type: normalizeStructTag(isDynamicObject ? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>,0x2::object::ID>` : `0x2::dynamic_field::Field<${dynamicField.name?.type?.repr},${valueType}>`),
|
|
134
|
+
name: {
|
|
135
|
+
type: dynamicField.name?.type?.repr,
|
|
136
|
+
bcs: fromBase64(dynamicField.name?.bcs)
|
|
137
|
+
},
|
|
138
|
+
valueType,
|
|
139
|
+
childId: isDynamicObject && dynamicField.value?.__typename === "MoveObject" ? dynamicField.value.address : void 0,
|
|
140
|
+
value: includeValue ? value : void 0
|
|
141
|
+
};
|
|
142
|
+
}),
|
|
143
|
+
cursor: result.pageInfo.endCursor ?? null,
|
|
144
|
+
hasNextPage: result.pageInfo.hasNextPage
|
|
145
|
+
};
|
|
98
146
|
}
|
|
99
147
|
getDynamicField(input) {
|
|
100
148
|
return this.core.getDynamicField(input);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.mjs","names":["#url","#queries","#headers","#fetch"],"sources":["../../src/graphql/client.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TypedDocumentNode } from '@graphql-typed-document-node/core';\nimport type { TadaDocumentNode } from 'gql.tada';\nimport type { DocumentNode } from 'graphql';\nimport { print } from 'graphql';\nimport { BaseClient } from '../client/index.js';\nimport type { SuiClientTypes } from '../client/index.js';\nimport { GraphQLCoreClient } from './core.js';\nimport type { TypedDocumentString } from './generated/queries.js';\nimport type { TransactionPlugin } from '../transactions/index.js';\n\nexport type GraphQLDocument<\n\tResult = Record<string, unknown>,\n\tVariables = Record<string, unknown>,\n> =\n\t| string\n\t| DocumentNode\n\t| TypedDocumentString<Result, Variables>\n\t| TypedDocumentNode<Result, Variables>\n\t| TadaDocumentNode<Result, Variables>;\n\nexport type GraphQLQueryOptions<\n\tResult = Record<string, unknown>,\n\tVariables = Record<string, unknown>,\n> = {\n\tquery: GraphQLDocument<Result, Variables>;\n\toperationName?: string;\n\textensions?: Record<string, unknown>;\n\tsignal?: AbortSignal;\n} & (Variables extends { [key: string]: never }\n\t? { variables?: Variables }\n\t: {\n\t\t\tvariables: Variables;\n\t\t});\n\nexport type GraphQLQueryResult<Result = Record<string, unknown>> = {\n\tdata?: Result;\n\terrors?: GraphQLResponseErrors;\n\textensions?: Record<string, unknown>;\n};\n\nexport type GraphQLResponseErrors = Array<{\n\tmessage: string;\n\tlocations?: { line: number; column: number }[];\n\tpath?: (string | number)[];\n}>;\n\nexport interface SuiGraphQLClientOptions<Queries extends Record<string, GraphQLDocument>> {\n\turl: string;\n\tfetch?: typeof fetch;\n\theaders?: Record<string, string>;\n\tqueries?: Queries;\n\tnetwork: SuiClientTypes.Network;\n\tmvr?: SuiClientTypes.MvrOptions;\n}\n\nexport class SuiGraphQLRequestError extends Error {}\n\nconst SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiGraphQLClient') as never;\n\nexport function isSuiGraphQLClient(client: unknown): client is SuiGraphQLClient {\n\treturn (\n\t\ttypeof client === 'object' && client !== null && (client as any)[SUI_CLIENT_BRAND] === true\n\t);\n}\n\nexport class SuiGraphQLClient<Queries extends Record<string, GraphQLDocument> = {}>\n\textends BaseClient\n\timplements SuiClientTypes.TransportMethods\n{\n\t#url: string;\n\t#queries: Queries;\n\t#headers: Record<string, string>;\n\t#fetch: typeof fetch;\n\tcore: GraphQLCoreClient;\n\tget mvr(): SuiClientTypes.MvrMethods {\n\t\treturn this.core.mvr;\n\t}\n\n\tget [SUI_CLIENT_BRAND]() {\n\t\treturn true;\n\t}\n\n\tconstructor({\n\t\turl,\n\t\tfetch: fetchFn = fetch,\n\t\theaders = {},\n\t\tqueries = {} as Queries,\n\t\tnetwork,\n\t\tmvr,\n\t}: SuiGraphQLClientOptions<Queries>) {\n\t\tsuper({\n\t\t\tnetwork,\n\t\t});\n\t\tthis.#url = url;\n\t\tthis.#queries = queries;\n\t\tthis.#headers = headers;\n\t\tthis.#fetch = (...args) => fetchFn(...args);\n\t\tthis.core = new GraphQLCoreClient({\n\t\t\tgraphqlClient: this,\n\t\t\tmvr,\n\t\t});\n\t}\n\n\tasync query<Result = Record<string, unknown>, Variables = Record<string, unknown>>(\n\t\toptions: GraphQLQueryOptions<Result, Variables>,\n\t): Promise<GraphQLQueryResult<Result>> {\n\t\tconst res = await this.#fetch(this.#url, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t...this.#headers,\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tquery:\n\t\t\t\t\ttypeof options.query === 'string' || options.query instanceof String\n\t\t\t\t\t\t? String(options.query)\n\t\t\t\t\t\t: print(options.query),\n\t\t\t\tvariables: options.variables,\n\t\t\t\textensions: options.extensions,\n\t\t\t\toperationName: options.operationName,\n\t\t\t}),\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\tif (!res.ok) {\n\t\t\tthrow new SuiGraphQLRequestError(`GraphQL request failed: ${res.statusText} (${res.status})`);\n\t\t}\n\n\t\treturn await res.json();\n\t}\n\n\tasync execute<\n\t\tconst Query extends Extract<keyof Queries, string>,\n\t\tResult = Queries[Query] extends GraphQLDocument<infer R, unknown> ? R : Record<string, unknown>,\n\t\tVariables = Queries[Query] extends GraphQLDocument<unknown, infer V>\n\t\t\t? V\n\t\t\t: Record<string, unknown>,\n\t>(\n\t\tquery: Query,\n\t\toptions: Omit<GraphQLQueryOptions<Result, Variables>, 'query'>,\n\t): Promise<GraphQLQueryResult<Result>> {\n\t\treturn this.query({\n\t\t\t...(options as { variables: Record<string, unknown> }),\n\t\t\tquery: this.#queries[query]!,\n\t\t}) as Promise<GraphQLQueryResult<Result>>;\n\t}\n\n\tgetObjects<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.GetObjectsOptions<Include>,\n\t): Promise<SuiClientTypes.GetObjectsResponse<Include>> {\n\t\treturn this.core.getObjects(input);\n\t}\n\n\tgetObject<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.GetObjectOptions<Include>,\n\t): Promise<SuiClientTypes.GetObjectResponse<Include>> {\n\t\treturn this.core.getObject(input);\n\t}\n\n\tlistCoins(input: SuiClientTypes.ListCoinsOptions): Promise<SuiClientTypes.ListCoinsResponse> {\n\t\treturn this.core.listCoins(input);\n\t}\n\n\tlistOwnedObjects<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.ListOwnedObjectsOptions<Include>,\n\t): Promise<SuiClientTypes.ListOwnedObjectsResponse<Include>> {\n\t\treturn this.core.listOwnedObjects(input);\n\t}\n\n\tgetBalance(input: SuiClientTypes.GetBalanceOptions): Promise<SuiClientTypes.GetBalanceResponse> {\n\t\treturn this.core.getBalance(input);\n\t}\n\n\tlistBalances(\n\t\tinput: SuiClientTypes.ListBalancesOptions,\n\t): Promise<SuiClientTypes.ListBalancesResponse> {\n\t\treturn this.core.listBalances(input);\n\t}\n\n\tgetCoinMetadata(\n\t\tinput: SuiClientTypes.GetCoinMetadataOptions,\n\t): Promise<SuiClientTypes.GetCoinMetadataResponse> {\n\t\treturn this.core.getCoinMetadata(input);\n\t}\n\n\tgetTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.GetTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.getTransaction(input);\n\t}\n\n\texecuteTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.ExecuteTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.executeTransaction(input);\n\t}\n\n\tsignAndExecuteTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.SignAndExecuteTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.signAndExecuteTransaction(input);\n\t}\n\n\twaitForTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.WaitForTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.waitForTransaction(input);\n\t}\n\n\tsimulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = {}>(\n\t\tinput: SuiClientTypes.SimulateTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.SimulateTransactionResult<Include>> {\n\t\treturn this.core.simulateTransaction(input);\n\t}\n\n\tgetReferenceGasPrice(): Promise<SuiClientTypes.GetReferenceGasPriceResponse> {\n\t\treturn this.core.getReferenceGasPrice();\n\t}\n\n\tlistDynamicFields(\n\t\tinput: SuiClientTypes.ListDynamicFieldsOptions,\n\t): Promise<SuiClientTypes.ListDynamicFieldsResponse> {\n\t\treturn this.core.listDynamicFields(input);\n\t}\n\n\tgetDynamicField(\n\t\tinput: SuiClientTypes.GetDynamicFieldOptions,\n\t): Promise<SuiClientTypes.GetDynamicFieldResponse> {\n\t\treturn this.core.getDynamicField(input);\n\t}\n\n\tgetMoveFunction(\n\t\tinput: SuiClientTypes.GetMoveFunctionOptions,\n\t): Promise<SuiClientTypes.GetMoveFunctionResponse> {\n\t\treturn this.core.getMoveFunction(input);\n\t}\n\n\tresolveTransactionPlugin(): TransactionPlugin {\n\t\treturn this.core.resolveTransactionPlugin();\n\t}\n\n\tverifyZkLoginSignature(\n\t\tinput: SuiClientTypes.VerifyZkLoginSignatureOptions,\n\t): Promise<SuiClientTypes.ZkLoginVerifyResponse> {\n\t\treturn this.core.verifyZkLoginSignature(input);\n\t}\n\n\tdefaultNameServiceName(\n\t\tinput: SuiClientTypes.DefaultNameServiceNameOptions,\n\t): Promise<SuiClientTypes.DefaultNameServiceNameResponse> {\n\t\treturn this.core.defaultNameServiceName(input);\n\t}\n}\n"],"mappings":";;;;;AA0DA,IAAa,yBAAb,cAA4C,MAAM;AAElD,MAAM,mBAAmB,OAAO,IAAI,2BAA2B;AAE/D,SAAgB,mBAAmB,QAA6C;AAC/E,QACC,OAAO,WAAW,YAAY,WAAW,QAAS,OAAe,sBAAsB;;AAIzF,IAAa,mBAAb,cACS,WAET;CACC;CACA;CACA;CACA;CAEA,IAAI,MAAiC;AACpC,SAAO,KAAK,KAAK;;CAGlB,KAAK,oBAAoB;AACxB,SAAO;;CAGR,YAAY,EACX,KACA,OAAO,UAAU,OACjB,UAAU,EAAE,EACZ,UAAU,EAAE,EACZ,SACA,OACoC;AACpC,QAAM,EACL,SACA,CAAC;AACF,QAAKA,MAAO;AACZ,QAAKC,UAAW;AAChB,QAAKC,UAAW;AAChB,QAAKC,SAAU,GAAG,SAAS,QAAQ,GAAG,KAAK;AAC3C,OAAK,OAAO,IAAI,kBAAkB;GACjC,eAAe;GACf;GACA,CAAC;;CAGH,MAAM,MACL,SACsC;EACtC,MAAM,MAAM,MAAM,MAAKA,MAAO,MAAKH,KAAM;GACxC,QAAQ;GACR,SAAS;IACR,gBAAgB;IAChB,GAAG,MAAKE;IACR;GACD,MAAM,KAAK,UAAU;IACpB,OACC,OAAO,QAAQ,UAAU,YAAY,QAAQ,iBAAiB,SAC3D,OAAO,QAAQ,MAAM,GACrB,MAAM,QAAQ,MAAM;IACxB,WAAW,QAAQ;IACnB,YAAY,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C,2BAA8C;AAC7C,SAAO,KAAK,KAAK,0BAA0B;;CAG5C,uBACC,OACgD;AAChD,SAAO,KAAK,KAAK,uBAAuB,MAAM;;CAG/C,uBACC,OACyD;AACzD,SAAO,KAAK,KAAK,uBAAuB,MAAM"}
|
|
1
|
+
{"version":3,"file":"client.mjs","names":["#url","#queries","#headers","#fetch"],"sources":["../../src/graphql/client.ts"],"sourcesContent":["// Copyright (c) Mysten Labs, Inc.\n// SPDX-License-Identifier: Apache-2.0\n\nimport type { TypedDocumentNode } from '@graphql-typed-document-node/core';\nimport type { TadaDocumentNode } from 'gql.tada';\nimport type { DocumentNode } from 'graphql';\nimport { print } from 'graphql';\nimport { BaseClient } from '../client/index.js';\nimport type { SuiClientTypes } from '../client/index.js';\nimport { GraphQLCoreClient } from './core.js';\nimport type { TypedDocumentString } from './generated/queries.js';\nimport { GetDynamicFieldsDocument } from './generated/queries.js';\nimport { fromBase64 } from '@mysten/utils';\nimport { normalizeStructTag } from '../utils/sui-types.js';\nimport { deriveDynamicFieldID } from '../utils/dynamic-fields.js';\nimport type { TransactionPlugin } from '../transactions/index.js';\n\nexport type GraphQLDocument<\n\tResult = Record<string, unknown>,\n\tVariables = Record<string, unknown>,\n> =\n\t| string\n\t| DocumentNode\n\t| TypedDocumentString<Result, Variables>\n\t| TypedDocumentNode<Result, Variables>\n\t| TadaDocumentNode<Result, Variables>;\n\nexport type GraphQLQueryOptions<\n\tResult = Record<string, unknown>,\n\tVariables = Record<string, unknown>,\n> = {\n\tquery: GraphQLDocument<Result, Variables>;\n\toperationName?: string;\n\textensions?: Record<string, unknown>;\n\tsignal?: AbortSignal;\n} & (Variables extends { [key: string]: never }\n\t? { variables?: Variables }\n\t: {\n\t\t\tvariables: Variables;\n\t\t});\n\nexport type GraphQLQueryResult<Result = Record<string, unknown>> = {\n\tdata?: Result;\n\terrors?: GraphQLResponseErrors;\n\textensions?: Record<string, unknown>;\n};\n\nexport type GraphQLResponseErrors = Array<{\n\tmessage: string;\n\tlocations?: { line: number; column: number }[];\n\tpath?: (string | number)[];\n}>;\n\nexport interface SuiGraphQLClientOptions<Queries extends Record<string, GraphQLDocument>> {\n\turl: string;\n\tfetch?: typeof fetch;\n\theaders?: Record<string, string>;\n\tqueries?: Queries;\n\tnetwork: SuiClientTypes.Network;\n\tmvr?: SuiClientTypes.MvrOptions;\n}\n\nexport class SuiGraphQLRequestError extends Error {}\n\nconst SUI_CLIENT_BRAND = Symbol.for('@mysten/SuiGraphQLClient') as never;\n\nexport function isSuiGraphQLClient(client: unknown): client is SuiGraphQLClient {\n\treturn (\n\t\ttypeof client === 'object' && client !== null && (client as any)[SUI_CLIENT_BRAND] === true\n\t);\n}\n\nexport interface DynamicFieldInclude {\n\tvalue?: boolean;\n}\n\nexport type DynamicFieldEntryWithValue<Include extends DynamicFieldInclude = {}> =\n\tSuiClientTypes.DynamicFieldEntry & {\n\t\tvalue: Include extends { value: true } ? SuiClientTypes.DynamicFieldValue : undefined;\n\t};\n\nexport interface ListDynamicFieldsWithValueResponse<Include extends DynamicFieldInclude = {}> {\n\thasNextPage: boolean;\n\tcursor: string | null;\n\tdynamicFields: DynamicFieldEntryWithValue<Include>[];\n}\n\nexport class SuiGraphQLClient<Queries extends Record<string, GraphQLDocument> = {}>\n\textends BaseClient\n\timplements SuiClientTypes.TransportMethods\n{\n\t#url: string;\n\t#queries: Queries;\n\t#headers: Record<string, string>;\n\t#fetch: typeof fetch;\n\tcore: GraphQLCoreClient;\n\tget mvr(): SuiClientTypes.MvrMethods {\n\t\treturn this.core.mvr;\n\t}\n\n\tget [SUI_CLIENT_BRAND]() {\n\t\treturn true;\n\t}\n\n\tconstructor({\n\t\turl,\n\t\tfetch: fetchFn = fetch,\n\t\theaders = {},\n\t\tqueries = {} as Queries,\n\t\tnetwork,\n\t\tmvr,\n\t}: SuiGraphQLClientOptions<Queries>) {\n\t\tsuper({\n\t\t\tnetwork,\n\t\t});\n\t\tthis.#url = url;\n\t\tthis.#queries = queries;\n\t\tthis.#headers = headers;\n\t\tthis.#fetch = (...args) => fetchFn(...args);\n\t\tthis.core = new GraphQLCoreClient({\n\t\t\tgraphqlClient: this,\n\t\t\tmvr,\n\t\t});\n\t}\n\n\tasync query<Result = Record<string, unknown>, Variables = Record<string, unknown>>(\n\t\toptions: GraphQLQueryOptions<Result, Variables>,\n\t): Promise<GraphQLQueryResult<Result>> {\n\t\tconst res = await this.#fetch(this.#url, {\n\t\t\tmethod: 'POST',\n\t\t\theaders: {\n\t\t\t\t'Content-Type': 'application/json',\n\t\t\t\t...this.#headers,\n\t\t\t},\n\t\t\tbody: JSON.stringify({\n\t\t\t\tquery:\n\t\t\t\t\ttypeof options.query === 'string' || options.query instanceof String\n\t\t\t\t\t\t? String(options.query)\n\t\t\t\t\t\t: print(options.query),\n\t\t\t\tvariables: options.variables,\n\t\t\t\textensions: options.extensions,\n\t\t\t\toperationName: options.operationName,\n\t\t\t}),\n\t\t\tsignal: options.signal,\n\t\t});\n\n\t\tif (!res.ok) {\n\t\t\tthrow new SuiGraphQLRequestError(`GraphQL request failed: ${res.statusText} (${res.status})`);\n\t\t}\n\n\t\treturn await res.json();\n\t}\n\n\tasync execute<\n\t\tconst Query extends Extract<keyof Queries, string>,\n\t\tResult = Queries[Query] extends GraphQLDocument<infer R, unknown> ? R : Record<string, unknown>,\n\t\tVariables = Queries[Query] extends GraphQLDocument<unknown, infer V>\n\t\t\t? V\n\t\t\t: Record<string, unknown>,\n\t>(\n\t\tquery: Query,\n\t\toptions: Omit<GraphQLQueryOptions<Result, Variables>, 'query'>,\n\t): Promise<GraphQLQueryResult<Result>> {\n\t\treturn this.query({\n\t\t\t...(options as { variables: Record<string, unknown> }),\n\t\t\tquery: this.#queries[query]!,\n\t\t}) as Promise<GraphQLQueryResult<Result>>;\n\t}\n\n\tgetObjects<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.GetObjectsOptions<Include>,\n\t): Promise<SuiClientTypes.GetObjectsResponse<Include>> {\n\t\treturn this.core.getObjects(input);\n\t}\n\n\tgetObject<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.GetObjectOptions<Include>,\n\t): Promise<SuiClientTypes.GetObjectResponse<Include>> {\n\t\treturn this.core.getObject(input);\n\t}\n\n\tlistCoins(input: SuiClientTypes.ListCoinsOptions): Promise<SuiClientTypes.ListCoinsResponse> {\n\t\treturn this.core.listCoins(input);\n\t}\n\n\tlistOwnedObjects<Include extends SuiClientTypes.ObjectInclude = {}>(\n\t\tinput: SuiClientTypes.ListOwnedObjectsOptions<Include>,\n\t): Promise<SuiClientTypes.ListOwnedObjectsResponse<Include>> {\n\t\treturn this.core.listOwnedObjects(input);\n\t}\n\n\tgetBalance(input: SuiClientTypes.GetBalanceOptions): Promise<SuiClientTypes.GetBalanceResponse> {\n\t\treturn this.core.getBalance(input);\n\t}\n\n\tlistBalances(\n\t\tinput: SuiClientTypes.ListBalancesOptions,\n\t): Promise<SuiClientTypes.ListBalancesResponse> {\n\t\treturn this.core.listBalances(input);\n\t}\n\n\tgetCoinMetadata(\n\t\tinput: SuiClientTypes.GetCoinMetadataOptions,\n\t): Promise<SuiClientTypes.GetCoinMetadataResponse> {\n\t\treturn this.core.getCoinMetadata(input);\n\t}\n\n\tgetTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.GetTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.getTransaction(input);\n\t}\n\n\texecuteTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.ExecuteTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.executeTransaction(input);\n\t}\n\n\tsignAndExecuteTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.SignAndExecuteTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.signAndExecuteTransaction(input);\n\t}\n\n\twaitForTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(\n\t\tinput: SuiClientTypes.WaitForTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.TransactionResult<Include>> {\n\t\treturn this.core.waitForTransaction(input);\n\t}\n\n\tsimulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = {}>(\n\t\tinput: SuiClientTypes.SimulateTransactionOptions<Include>,\n\t): Promise<SuiClientTypes.SimulateTransactionResult<Include>> {\n\t\treturn this.core.simulateTransaction(input);\n\t}\n\n\tgetReferenceGasPrice(): Promise<SuiClientTypes.GetReferenceGasPriceResponse> {\n\t\treturn this.core.getReferenceGasPrice();\n\t}\n\n\tasync listDynamicFields<Include extends DynamicFieldInclude = {}>(\n\t\tinput: SuiClientTypes.ListDynamicFieldsOptions & { include?: Include & DynamicFieldInclude },\n\t): Promise<ListDynamicFieldsWithValueResponse<Include>> {\n\t\tconst includeValue = input.include?.value ?? false;\n\n\t\tconst { data, errors } = await this.query({\n\t\t\tquery: GetDynamicFieldsDocument,\n\t\t\tvariables: {\n\t\t\t\tparentId: input.parentId,\n\t\t\t\tfirst: input.limit,\n\t\t\t\tcursor: input.cursor,\n\t\t\t\tincludeValue,\n\t\t\t},\n\t\t});\n\n\t\tif (errors?.length) {\n\t\t\tthrow errors.length === 1\n\t\t\t\t? new Error(errors[0].message)\n\t\t\t\t: new AggregateError(errors.map((e) => new Error(e.message)));\n\t\t}\n\n\t\tconst result = data?.address?.dynamicFields;\n\t\tif (!result) {\n\t\t\tthrow new Error('Missing response data');\n\t\t}\n\n\t\treturn {\n\t\t\tdynamicFields: result.nodes.map((dynamicField): DynamicFieldEntryWithValue<Include> => {\n\t\t\t\tconst valueType =\n\t\t\t\t\tdynamicField.value?.__typename === 'MoveObject'\n\t\t\t\t\t\t? dynamicField.value.contents?.type?.repr!\n\t\t\t\t\t\t: dynamicField.value?.type?.repr!;\n\t\t\t\tconst isDynamicObject = dynamicField.value?.__typename === 'MoveObject';\n\t\t\t\tconst derivedNameType = isDynamicObject\n\t\t\t\t\t? `0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>`\n\t\t\t\t\t: dynamicField.name?.type?.repr!;\n\n\t\t\t\tlet value: SuiClientTypes.DynamicFieldValue | undefined;\n\t\t\t\tif (includeValue) {\n\t\t\t\t\tlet valueBcs: Uint8Array;\n\t\t\t\t\tif (dynamicField.value?.__typename === 'MoveValue') {\n\t\t\t\t\t\tvalueBcs = fromBase64(dynamicField.value.bcs ?? '');\n\t\t\t\t\t} else if (dynamicField.value?.__typename === 'MoveObject') {\n\t\t\t\t\t\tvalueBcs = fromBase64(dynamicField.value.contents?.bcs ?? '');\n\t\t\t\t\t} else {\n\t\t\t\t\t\tvalueBcs = new Uint8Array();\n\t\t\t\t\t}\n\t\t\t\t\tvalue = { type: valueType, bcs: valueBcs };\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\t$kind: isDynamicObject ? 'DynamicObject' : 'DynamicField',\n\t\t\t\t\tfieldId: deriveDynamicFieldID(\n\t\t\t\t\t\tinput.parentId,\n\t\t\t\t\t\tderivedNameType,\n\t\t\t\t\t\tfromBase64(dynamicField.name?.bcs!),\n\t\t\t\t\t),\n\t\t\t\t\ttype: normalizeStructTag(\n\t\t\t\t\t\tisDynamicObject\n\t\t\t\t\t\t\t? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>,0x2::object::ID>`\n\t\t\t\t\t\t\t: `0x2::dynamic_field::Field<${dynamicField.name?.type?.repr},${valueType}>`,\n\t\t\t\t\t),\n\t\t\t\t\tname: {\n\t\t\t\t\t\ttype: dynamicField.name?.type?.repr!,\n\t\t\t\t\t\tbcs: fromBase64(dynamicField.name?.bcs!),\n\t\t\t\t\t},\n\t\t\t\t\tvalueType,\n\t\t\t\t\tchildId:\n\t\t\t\t\t\tisDynamicObject && dynamicField.value?.__typename === 'MoveObject'\n\t\t\t\t\t\t\t? dynamicField.value.address\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\tvalue: (includeValue ? value : undefined) as DynamicFieldEntryWithValue<Include>['value'],\n\t\t\t\t} as DynamicFieldEntryWithValue<Include>;\n\t\t\t}),\n\t\t\tcursor: result.pageInfo.endCursor ?? null,\n\t\t\thasNextPage: result.pageInfo.hasNextPage,\n\t\t};\n\t}\n\n\tgetDynamicField(\n\t\tinput: SuiClientTypes.GetDynamicFieldOptions,\n\t): Promise<SuiClientTypes.GetDynamicFieldResponse> {\n\t\treturn this.core.getDynamicField(input);\n\t}\n\n\tgetMoveFunction(\n\t\tinput: SuiClientTypes.GetMoveFunctionOptions,\n\t): Promise<SuiClientTypes.GetMoveFunctionResponse> {\n\t\treturn this.core.getMoveFunction(input);\n\t}\n\n\tresolveTransactionPlugin(): TransactionPlugin {\n\t\treturn this.core.resolveTransactionPlugin();\n\t}\n\n\tverifyZkLoginSignature(\n\t\tinput: SuiClientTypes.VerifyZkLoginSignatureOptions,\n\t): Promise<SuiClientTypes.ZkLoginVerifyResponse> {\n\t\treturn this.core.verifyZkLoginSignature(input);\n\t}\n\n\tdefaultNameServiceName(\n\t\tinput: SuiClientTypes.DefaultNameServiceNameOptions,\n\t): Promise<SuiClientTypes.DefaultNameServiceNameResponse> {\n\t\treturn this.core.defaultNameServiceName(input);\n\t}\n}\n"],"mappings":";;;;;;;;;AA8DA,IAAa,yBAAb,cAA4C,MAAM;AAElD,MAAM,mBAAmB,OAAO,IAAI,2BAA2B;AAE/D,SAAgB,mBAAmB,QAA6C;AAC/E,QACC,OAAO,WAAW,YAAY,WAAW,QAAS,OAAe,sBAAsB;;AAmBzF,IAAa,mBAAb,cACS,WAET;CACC;CACA;CACA;CACA;CAEA,IAAI,MAAiC;AACpC,SAAO,KAAK,KAAK;;CAGlB,KAAK,oBAAoB;AACxB,SAAO;;CAGR,YAAY,EACX,KACA,OAAO,UAAU,OACjB,UAAU,EAAE,EACZ,UAAU,EAAE,EACZ,SACA,OACoC;AAC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5B,aAAQ;MAAE,MAAM;MAAW,KAAK;MAAU;;AAG3C,WAAO;KACN,OAAO,kBAAkB,kBAAkB;KAC3C,SAAS,qBACR,MAAM,UACN,iBACA,WAAW,aAAa,MAAM,IAAK,CACnC;KACD,MAAM,mBACL,kBACG,gEAAgE,aAAa,MAAM,MAAM,KAAK,sBAC9F,6BAA6B,aAAa,MAAM,MAAM,KAAK,GAAG,UAAU,GAC3E;KACD,MAAM;MACL,MAAM,aAAa,MAAM,MAAM;MAC/B,KAAK,WAAW,aAAa,MAAM,IAAK;MACxC;KACD;KACA,SACC,mBAAmB,aAAa,OAAO,eAAe,eACnD,aAAa,MAAM,UACnB;KACJ,OAAQ,eAAe,QAAQ;KAC/B;KACA;GACF,QAAQ,OAAO,SAAS,aAAa;GACrC,aAAa,OAAO,SAAS;GAC7B;;CAGF,gBACC,OACkD;AAClD,SAAO,KAAK,KAAK,gBAAgB,MAAM;;CAGxC,gBACC,OACkD;AAClD,SAAO,KAAK,KAAK,gBAAgB,MAAM;;CAGxC,2BAA8C;AAC7C,SAAO,KAAK,KAAK,0BAA0B;;CAG5C,uBACC,OACgD;AAChD,SAAO,KAAK,KAAK,uBAAuB,MAAM;;CAG/C,uBACC,OACyD;AACzD,SAAO,KAAK,KAAK,uBAAuB,MAAM"}
|
package/dist/graphql/core.d.mts
CHANGED
|
@@ -15,15 +15,15 @@ declare class GraphQLCoreClient extends CoreClient {
|
|
|
15
15
|
graphqlClient: SuiGraphQLClient;
|
|
16
16
|
mvr?: SuiClientTypes.MvrOptions;
|
|
17
17
|
});
|
|
18
|
-
getObjects<Include extends SuiClientTypes.ObjectInclude =
|
|
19
|
-
listOwnedObjects<Include extends SuiClientTypes.ObjectInclude =
|
|
18
|
+
getObjects<Include extends SuiClientTypes.ObjectInclude = {}>(options: SuiClientTypes.GetObjectsOptions<Include>): Promise<SuiClientTypes.GetObjectsResponse<Include>>;
|
|
19
|
+
listOwnedObjects<Include extends SuiClientTypes.ObjectInclude = {}>(options: SuiClientTypes.ListOwnedObjectsOptions<Include>): Promise<SuiClientTypes.ListOwnedObjectsResponse<Include>>;
|
|
20
20
|
listCoins(options: SuiClientTypes.ListCoinsOptions): Promise<SuiClientTypes.ListCoinsResponse>;
|
|
21
21
|
getBalance(options: SuiClientTypes.GetBalanceOptions): Promise<SuiClientTypes.GetBalanceResponse>;
|
|
22
22
|
getCoinMetadata(options: SuiClientTypes.GetCoinMetadataOptions): Promise<SuiClientTypes.GetCoinMetadataResponse>;
|
|
23
23
|
listBalances(options: SuiClientTypes.ListBalancesOptions): Promise<SuiClientTypes.ListBalancesResponse>;
|
|
24
|
-
getTransaction<Include extends SuiClientTypes.TransactionInclude =
|
|
25
|
-
executeTransaction<Include extends SuiClientTypes.TransactionInclude =
|
|
26
|
-
simulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude =
|
|
24
|
+
getTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(options: SuiClientTypes.GetTransactionOptions<Include>): Promise<SuiClientTypes.TransactionResult<Include>>;
|
|
25
|
+
executeTransaction<Include extends SuiClientTypes.TransactionInclude = {}>(options: SuiClientTypes.ExecuteTransactionOptions<Include>): Promise<SuiClientTypes.TransactionResult<Include>>;
|
|
26
|
+
simulateTransaction<Include extends SuiClientTypes.SimulateTransactionInclude = {}>(options: SuiClientTypes.SimulateTransactionOptions<Include>): Promise<SuiClientTypes.SimulateTransactionResult<Include>>;
|
|
27
27
|
getReferenceGasPrice(): Promise<SuiClientTypes.GetReferenceGasPriceResponse>;
|
|
28
28
|
getCurrentSystemState(): Promise<SuiClientTypes.GetCurrentSystemStateResponse>;
|
|
29
29
|
listDynamicFields(options: SuiClientTypes.ListDynamicFieldsOptions): Promise<SuiClientTypes.ListDynamicFieldsResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"core.d.mts","names":[],"sources":["../../src/graphql/core.ts"],"sourcesContent":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"file":"core.d.mts","names":[],"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AndhB,EAAA,OAAA,EAodQ,uBApdR,EAAA,IAAA,EAAA,GAAA,GAqdW,OArdX,CAAA,IAAA,CAAA,EAAA,GAqdwB,OArdxB,CAAA,IAAA,CAAA"}
|
package/dist/graphql/core.mjs
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { deriveDynamicFieldID } from "../utils/dynamic-fields.mjs";
|
|
1
|
+
import { normalizeSuiAddress } from "../utils/sui-types.mjs";
|
|
3
2
|
import { CoreClient } from "../client/core.mjs";
|
|
4
3
|
import { TransactionDataBuilder } from "../transactions/TransactionData.mjs";
|
|
5
4
|
import { formatMoveAbortMessage, parseTransactionEffectsBcs } from "../client/utils.mjs";
|
|
6
5
|
import { ObjectError, SimulationError } from "../client/errors.mjs";
|
|
7
6
|
import { SUI_TYPE_ARG } from "../utils/constants.mjs";
|
|
8
|
-
import { DefaultSuinsNameDocument, ExecuteTransactionDocument, ExecutionStatus, GetAllBalancesDocument, GetBalanceDocument, GetChainIdentifierDocument, GetCoinMetadataDocument, GetCoinsDocument, GetCurrentSystemStateDocument,
|
|
7
|
+
import { DefaultSuinsNameDocument, ExecuteTransactionDocument, ExecutionStatus, GetAllBalancesDocument, GetBalanceDocument, GetChainIdentifierDocument, GetCoinMetadataDocument, GetCoinsDocument, GetCurrentSystemStateDocument, GetMoveFunctionDocument, GetOwnedObjectsDocument, GetReferenceGasPriceDocument, GetTransactionBlockDocument, MultiGetObjectsDocument, ResolveTransactionDocument, SimulateTransactionDocument, VerifyZkLoginSignatureDocument, ZkLoginIntentScope } from "./generated/queries.mjs";
|
|
9
8
|
import { Transaction } from "../grpc/proto/sui/rpc/v2/transaction.mjs";
|
|
10
9
|
import { grpcTransactionToTransactionData, transactionDataToGrpcTransaction, transactionToGrpcJson } from "../client/transaction-resolver.mjs";
|
|
11
10
|
import { BalanceChange } from "../grpc/proto/sui/rpc/v2/balance_change.mjs";
|
|
@@ -41,7 +40,8 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
41
40
|
includeContent: options.include?.content ?? false,
|
|
42
41
|
includePreviousTransaction: options.include?.previousTransaction ?? false,
|
|
43
42
|
includeObjectBcs: options.include?.objectBcs ?? false,
|
|
44
|
-
includeJson: options.include?.json ?? false
|
|
43
|
+
includeJson: options.include?.json ?? false,
|
|
44
|
+
includeDisplay: options.include?.display ?? false
|
|
45
45
|
}
|
|
46
46
|
}, (result) => result.multiGetObjects);
|
|
47
47
|
results.push(...batch.map((id) => normalizeSuiAddress(id)).map((id) => page.find((obj) => obj?.address === id) ?? new ObjectError("notFound", `Object ${id} not found`)).map((obj) => {
|
|
@@ -53,6 +53,7 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
53
53
|
else if (obj.asMoveObject?.contents?.type?.repr) type = obj.asMoveObject.contents.type.repr;
|
|
54
54
|
else type = "";
|
|
55
55
|
const jsonContent = options.include?.json ? obj.asMoveObject?.contents?.json ? obj.asMoveObject.contents.json : null : void 0;
|
|
56
|
+
const displayData = mapDisplay(options.include?.display, obj.asMoveObject?.contents?.display);
|
|
56
57
|
return {
|
|
57
58
|
objectId: obj.address,
|
|
58
59
|
version: obj.version?.toString(),
|
|
@@ -62,7 +63,8 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
62
63
|
content: bcsContent,
|
|
63
64
|
previousTransaction: obj.previousTransaction?.digest ?? void 0,
|
|
64
65
|
objectBcs,
|
|
65
|
-
json: jsonContent
|
|
66
|
+
json: jsonContent,
|
|
67
|
+
display: displayData
|
|
66
68
|
};
|
|
67
69
|
}));
|
|
68
70
|
}
|
|
@@ -79,7 +81,8 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
79
81
|
includeContent: options.include?.content ?? false,
|
|
80
82
|
includePreviousTransaction: options.include?.previousTransaction ?? false,
|
|
81
83
|
includeObjectBcs: options.include?.objectBcs ?? false,
|
|
82
|
-
includeJson: options.include?.json ?? false
|
|
84
|
+
includeJson: options.include?.json ?? false,
|
|
85
|
+
includeDisplay: options.include?.display ?? false
|
|
83
86
|
}
|
|
84
87
|
}, (result) => result.address?.objects);
|
|
85
88
|
return {
|
|
@@ -92,7 +95,8 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
92
95
|
content: obj.contents?.bcs ? fromBase64(obj.contents.bcs) : void 0,
|
|
93
96
|
previousTransaction: obj.previousTransaction?.digest ?? void 0,
|
|
94
97
|
objectBcs: obj.objectBcs ? fromBase64(obj.objectBcs) : void 0,
|
|
95
|
-
json: options.include?.json ? obj.contents?.json ? obj.contents.json : null : void 0
|
|
98
|
+
json: options.include?.json ? obj.contents?.json ? obj.contents.json : null : void 0,
|
|
99
|
+
display: mapDisplay(options.include?.display, obj.contents?.display)
|
|
96
100
|
})),
|
|
97
101
|
hasNextPage: objects.pageInfo.hasNextPage,
|
|
98
102
|
cursor: objects.pageInfo.endCursor ?? null
|
|
@@ -192,7 +196,7 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
192
196
|
}, (result) => result.transaction), options.include);
|
|
193
197
|
}
|
|
194
198
|
async executeTransaction(options) {
|
|
195
|
-
|
|
199
|
+
return parseTransaction((await this.#graphqlQuery({
|
|
196
200
|
query: ExecuteTransactionDocument,
|
|
197
201
|
variables: {
|
|
198
202
|
transactionDataBcs: toBase64(options.transaction),
|
|
@@ -204,12 +208,7 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
204
208
|
includeObjectTypes: options.include?.objectTypes ?? false,
|
|
205
209
|
includeBcs: options.include?.bcs ?? false
|
|
206
210
|
}
|
|
207
|
-
}, (result
|
|
208
|
-
if (result.errors) {
|
|
209
|
-
if (result.errors.length === 1) throw new Error(result.errors[0]);
|
|
210
|
-
throw new AggregateError(result.errors.map((error) => new Error(error)));
|
|
211
|
-
}
|
|
212
|
-
return parseTransaction(result.effects?.transaction, options.include);
|
|
211
|
+
}, (result) => result.executeTransaction)).effects?.transaction, options.include);
|
|
213
212
|
}
|
|
214
213
|
async simulateTransaction(options) {
|
|
215
214
|
if (!(options.transaction instanceof Uint8Array)) await options.transaction.prepareForSerialization({ client: this });
|
|
@@ -226,7 +225,6 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
226
225
|
includeBcs: options.include?.bcs ?? false
|
|
227
226
|
}
|
|
228
227
|
}, (result$1) => result$1.simulateTransaction);
|
|
229
|
-
if (result.error && !result.effects?.transaction) throw new SimulationError(result.error);
|
|
230
228
|
const transactionResult = parseTransaction(result.effects?.transaction, options.include);
|
|
231
229
|
const commandResults = options.include?.commandResults && result.outputs ? result.outputs.map((output) => ({
|
|
232
230
|
returnValues: (output.returnValues ?? []).map((rv) => ({ bcs: rv.value?.bcs ? fromBase64(rv.value.bcs) : null })),
|
|
@@ -284,38 +282,11 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
284
282
|
} };
|
|
285
283
|
}
|
|
286
284
|
async listDynamicFields(options) {
|
|
287
|
-
|
|
288
|
-
query: GetDynamicFieldsDocument,
|
|
289
|
-
variables: {
|
|
290
|
-
parentId: options.parentId,
|
|
291
|
-
first: options.limit,
|
|
292
|
-
cursor: options.cursor
|
|
293
|
-
}
|
|
294
|
-
}, (result$1) => result$1.address?.dynamicFields);
|
|
295
|
-
return {
|
|
296
|
-
dynamicFields: result.nodes.map((dynamicField) => {
|
|
297
|
-
const valueType = dynamicField.value?.__typename === "MoveObject" ? dynamicField.value.contents?.type?.repr : dynamicField.value?.type?.repr;
|
|
298
|
-
const isDynamicObject = dynamicField.value?.__typename === "MoveObject";
|
|
299
|
-
const derivedNameType = isDynamicObject ? `0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>` : dynamicField.name?.type?.repr;
|
|
300
|
-
return {
|
|
301
|
-
$kind: isDynamicObject ? "DynamicObject" : "DynamicField",
|
|
302
|
-
fieldId: deriveDynamicFieldID(options.parentId, derivedNameType, fromBase64(dynamicField.name?.bcs)),
|
|
303
|
-
type: normalizeStructTag(isDynamicObject ? `0x2::dynamic_field::Field<0x2::dynamic_object_field::Wrapper<${dynamicField.name?.type?.repr}>,0x2::object::ID>` : `0x2::dynamic_field::Field<${dynamicField.name?.type?.repr},${valueType}>`),
|
|
304
|
-
name: {
|
|
305
|
-
type: dynamicField.name?.type?.repr,
|
|
306
|
-
bcs: fromBase64(dynamicField.name?.bcs)
|
|
307
|
-
},
|
|
308
|
-
valueType,
|
|
309
|
-
childId: isDynamicObject && dynamicField.value?.__typename === "MoveObject" ? dynamicField.value.address : void 0
|
|
310
|
-
};
|
|
311
|
-
}),
|
|
312
|
-
cursor: result.pageInfo.endCursor ?? null,
|
|
313
|
-
hasNextPage: result.pageInfo.hasNextPage
|
|
314
|
-
};
|
|
285
|
+
return this.#graphqlClient.listDynamicFields(options);
|
|
315
286
|
}
|
|
316
287
|
async verifyZkLoginSignature(options) {
|
|
317
288
|
const intentScope = options.intentScope === "TransactionData" ? ZkLoginIntentScope.TransactionData : ZkLoginIntentScope.PersonalMessage;
|
|
318
|
-
const
|
|
289
|
+
const { data } = await this.#graphqlClient.query({
|
|
319
290
|
query: VerifyZkLoginSignatureDocument,
|
|
320
291
|
variables: {
|
|
321
292
|
bytes: options.bytes,
|
|
@@ -323,10 +294,10 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
323
294
|
intentScope,
|
|
324
295
|
author: options.address
|
|
325
296
|
}
|
|
326
|
-
}
|
|
297
|
+
});
|
|
327
298
|
return {
|
|
328
|
-
success:
|
|
329
|
-
errors:
|
|
299
|
+
success: data?.verifyZkLoginSignature?.success ?? false,
|
|
300
|
+
errors: []
|
|
330
301
|
};
|
|
331
302
|
}
|
|
332
303
|
async defaultNameServiceName(options) {
|
|
@@ -401,7 +372,6 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
401
372
|
}
|
|
402
373
|
});
|
|
403
374
|
handleGraphQLErrors(errors);
|
|
404
|
-
if (data?.simulateTransaction?.error) throw new SimulationError(`Transaction resolution failed: ${data.simulateTransaction.error}`);
|
|
405
375
|
const transactionEffects = data?.simulateTransaction?.effects?.transaction?.effects;
|
|
406
376
|
if (!options.onlyTransactionKind && transactionEffects?.status === ExecutionStatus.Failure) {
|
|
407
377
|
const executionError = parseGraphQLExecutionError(transactionEffects.executionError);
|
|
@@ -425,6 +395,14 @@ var GraphQLCoreClient = class extends CoreClient {
|
|
|
425
395
|
};
|
|
426
396
|
}
|
|
427
397
|
};
|
|
398
|
+
function mapDisplay(include, display) {
|
|
399
|
+
if (!include) return void 0;
|
|
400
|
+
if (!display) return null;
|
|
401
|
+
return {
|
|
402
|
+
output: display.output ?? null,
|
|
403
|
+
errors: display.errors ?? null
|
|
404
|
+
};
|
|
405
|
+
}
|
|
428
406
|
function handleGraphQLErrors(errors) {
|
|
429
407
|
if (!errors || errors.length === 0) return;
|
|
430
408
|
const errorInstances = errors.map((error) => new GraphQLResponseError(error));
|
|
@@ -528,7 +506,8 @@ function parseTransaction(transaction, include) {
|
|
|
528
506
|
module,
|
|
529
507
|
sender: event.sender?.address,
|
|
530
508
|
eventType,
|
|
531
|
-
bcs: event.contents?.bcs ? fromBase64(event.contents.bcs) : new Uint8Array()
|
|
509
|
+
bcs: event.contents?.bcs ? fromBase64(event.contents.bcs) : new Uint8Array(),
|
|
510
|
+
json: event.contents?.json ?? null
|
|
532
511
|
};
|
|
533
512
|
}) ?? [] : void 0
|
|
534
513
|
};
|