@mysten/sui 1.43.1 → 1.44.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/cjs/experimental/core.d.ts +1 -0
  3. package/dist/cjs/experimental/core.js.map +2 -2
  4. package/dist/cjs/experimental/types.d.ts +6 -8
  5. package/dist/cjs/experimental/types.js.map +1 -1
  6. package/dist/cjs/graphql/core.d.ts +1 -1
  7. package/dist/cjs/graphql/core.js +81 -78
  8. package/dist/cjs/graphql/core.js.map +2 -2
  9. package/dist/cjs/graphql/generated/latest/tada-env.d.ts +3870 -5429
  10. package/dist/cjs/graphql/generated/latest/tada-env.js +3958 -5702
  11. package/dist/cjs/graphql/generated/latest/tada-env.js.map +2 -2
  12. package/dist/cjs/graphql/generated/queries.d.ts +2485 -3397
  13. package/dist/cjs/graphql/generated/queries.js +137 -172
  14. package/dist/cjs/graphql/generated/queries.js.map +3 -3
  15. package/dist/cjs/graphql/types.d.ts +1 -0
  16. package/dist/cjs/graphql/types.js.map +1 -1
  17. package/dist/cjs/grpc/client.d.ts +2 -0
  18. package/dist/cjs/grpc/client.js +2 -0
  19. package/dist/cjs/grpc/client.js.map +2 -2
  20. package/dist/cjs/grpc/core.d.ts +1 -0
  21. package/dist/cjs/grpc/core.js +10 -0
  22. package/dist/cjs/grpc/core.js.map +2 -2
  23. package/dist/cjs/jsonRpc/core.d.ts +1 -1
  24. package/dist/cjs/jsonRpc/core.js +7 -2
  25. package/dist/cjs/jsonRpc/core.js.map +2 -2
  26. package/dist/cjs/transactions/Transaction.js +2 -2
  27. package/dist/cjs/transactions/Transaction.js.map +1 -1
  28. package/dist/cjs/version.d.ts +2 -2
  29. package/dist/cjs/version.js +2 -2
  30. package/dist/cjs/version.js.map +1 -1
  31. package/dist/cjs/zklogin/publickey.js +1 -1
  32. package/dist/cjs/zklogin/publickey.js.map +1 -1
  33. package/dist/esm/experimental/core.d.ts +1 -0
  34. package/dist/esm/experimental/core.js.map +2 -2
  35. package/dist/esm/experimental/types.d.ts +6 -8
  36. package/dist/esm/graphql/core.d.ts +1 -1
  37. package/dist/esm/graphql/core.js +85 -82
  38. package/dist/esm/graphql/core.js.map +2 -2
  39. package/dist/esm/graphql/generated/latest/tada-env.d.ts +3870 -5429
  40. package/dist/esm/graphql/generated/latest/tada-env.js +3958 -5702
  41. package/dist/esm/graphql/generated/latest/tada-env.js.map +2 -2
  42. package/dist/esm/graphql/generated/queries.d.ts +2485 -3397
  43. package/dist/esm/graphql/generated/queries.js +137 -172
  44. package/dist/esm/graphql/generated/queries.js.map +3 -3
  45. package/dist/esm/graphql/types.d.ts +1 -0
  46. package/dist/esm/grpc/client.d.ts +2 -0
  47. package/dist/esm/grpc/client.js +2 -0
  48. package/dist/esm/grpc/client.js.map +2 -2
  49. package/dist/esm/grpc/core.d.ts +1 -0
  50. package/dist/esm/grpc/core.js +10 -0
  51. package/dist/esm/grpc/core.js.map +2 -2
  52. package/dist/esm/jsonRpc/core.d.ts +1 -1
  53. package/dist/esm/jsonRpc/core.js +7 -2
  54. package/dist/esm/jsonRpc/core.js.map +2 -2
  55. package/dist/esm/transactions/Transaction.js +2 -2
  56. package/dist/esm/transactions/Transaction.js.map +1 -1
  57. package/dist/esm/version.d.ts +2 -2
  58. package/dist/esm/version.js +2 -2
  59. package/dist/esm/version.js.map +1 -1
  60. package/dist/esm/zklogin/publickey.js +1 -1
  61. package/dist/esm/zklogin/publickey.js.map +1 -1
  62. package/dist/tsconfig.esm.tsbuildinfo +1 -1
  63. package/dist/tsconfig.tsbuildinfo +1 -1
  64. package/package.json +2 -2
  65. package/src/experimental/core.ts +4 -0
  66. package/src/experimental/types.ts +8 -10
  67. package/src/graphql/core.ts +95 -95
  68. package/src/graphql/generated/latest/schema.graphql +2139 -2671
  69. package/src/graphql/generated/latest/tada-env.ts +3958 -5702
  70. package/src/graphql/generated/queries.ts +2344 -3281
  71. package/src/graphql/queries/getAllBalances.graphql +0 -1
  72. package/src/graphql/queries/getBalance.graphql +2 -3
  73. package/src/graphql/queries/getCoins.graphql +9 -4
  74. package/src/graphql/queries/getDynamicFields.graphql +1 -1
  75. package/src/graphql/queries/nameService.graphql +2 -10
  76. package/src/graphql/queries/objects.graphql +11 -22
  77. package/src/graphql/queries/transactions.graphql +16 -12
  78. package/src/graphql/queries/verifyZkLoginSignature.graphql +2 -2
  79. package/src/graphql/types.ts +1 -0
  80. package/src/grpc/client.ts +3 -0
  81. package/src/grpc/core.ts +16 -0
  82. package/src/jsonRpc/core.ts +9 -4
  83. package/src/transactions/Transaction.ts +2 -2
  84. package/src/version.ts +2 -2
  85. package/src/zklogin/publickey.ts +1 -1
@@ -12,7 +12,6 @@ query getAllBalances($owner: SuiAddress!, $limit: Int, $cursor: String) {
12
12
  coinType {
13
13
  repr
14
14
  }
15
- coinObjectCount
16
15
  totalBalance
17
16
  }
18
17
  }
@@ -1,13 +1,12 @@
1
1
  # Copyright (c) Mysten Labs, Inc.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
- query getBalance($owner: SuiAddress!, $type: String = "0x2::sui::SUI") {
4
+ query getBalance($owner: SuiAddress!, $coinType: String! = "0x2::sui::SUI") {
5
5
  address(address: $owner) {
6
- balance(type: $type) {
6
+ balance(coinType: $coinType) {
7
7
  coinType {
8
8
  repr
9
9
  }
10
- coinObjectCount
11
10
  totalBalance
12
11
  }
13
12
  }
@@ -1,21 +1,26 @@
1
1
  # Copyright (c) Mysten Labs, Inc.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
- query getCoins($owner: SuiAddress!, $first: Int, $cursor: String, $type: String = "0x2::sui::SUI") {
4
+ query getCoins(
5
+ $owner: SuiAddress!
6
+ $first: Int
7
+ $cursor: String
8
+ $type: String! = "0x2::coin::Coin<0x2::sui::SUI>"
9
+ ) {
5
10
  address(address: $owner) {
6
11
  address
7
- coins(first: $first, after: $cursor, type: $type) {
12
+ objects(first: $first, after: $cursor, filter: { type: $type }) {
8
13
  pageInfo {
9
14
  hasNextPage
10
15
  endCursor
11
16
  }
12
17
  nodes {
13
- coinBalance
14
18
  owner {
15
19
  ...OBJECT_OWNER_FIELDS
16
20
  }
17
21
  contents {
18
22
  bcs
23
+ json
19
24
  type {
20
25
  repr
21
26
  }
@@ -23,7 +28,7 @@ query getCoins($owner: SuiAddress!, $first: Int, $cursor: String, $type: String
23
28
  address
24
29
  version
25
30
  digest
26
- previousTransactionBlock {
31
+ previousTransaction {
27
32
  digest
28
33
  }
29
34
  }
@@ -2,7 +2,7 @@
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
4
  query getDynamicFields($parentId: SuiAddress!, $first: Int, $cursor: String) {
5
- owner(address: $parentId) {
5
+ address(address: $parentId) {
6
6
  dynamicFields(first: $first, after: $cursor) {
7
7
  pageInfo {
8
8
  hasNextPage
@@ -1,16 +1,8 @@
1
1
  # Copyright (c) Mysten Labs, Inc.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
- query resolveNameServiceNames($address: SuiAddress!, $limit: Int, $cursor: String) {
4
+ query defaultSuinsName($address: SuiAddress!) {
5
5
  address(address: $address) {
6
- suinsRegistrations(first: $limit, after: $cursor) {
7
- pageInfo {
8
- hasNextPage
9
- endCursor
10
- }
11
- nodes {
12
- domain
13
- }
14
- }
6
+ defaultSuinsName
15
7
  }
16
8
  }
@@ -15,15 +15,9 @@ query getOwnedObjects($owner: SuiAddress!, $limit: Int, $cursor: String, $filter
15
15
  }
16
16
  }
17
17
 
18
- query multiGetObjects($objectIds: [SuiAddress!]!, $limit: Int, $cursor: String) {
19
- objects(first: $limit, after: $cursor, filter: { objectIds: $objectIds }) {
20
- pageInfo {
21
- hasNextPage
22
- endCursor
23
- }
24
- nodes {
25
- ...OBJECT_FIELDS
26
- }
18
+ query multiGetObjects($objectKeys: [ObjectKey!]!) {
19
+ multiGetObjects(keys: $objectKeys) {
20
+ ...OBJECT_FIELDS
27
21
  }
28
22
  }
29
23
 
@@ -42,7 +36,7 @@ fragment OBJECT_FIELDS on Object {
42
36
  owner {
43
37
  ...OBJECT_OWNER_FIELDS
44
38
  }
45
- previousTransactionBlock {
39
+ previousTransaction {
46
40
  digest
47
41
  }
48
42
  }
@@ -60,25 +54,20 @@ fragment MOVE_OBJECT_FIELDS on MoveObject {
60
54
  owner {
61
55
  ...OBJECT_OWNER_FIELDS
62
56
  }
63
- previousTransactionBlock {
57
+ previousTransaction {
64
58
  digest
65
59
  }
66
60
  }
67
61
 
68
- fragment OBJECT_OWNER_FIELDS on ObjectOwner {
62
+ fragment OBJECT_OWNER_FIELDS on Owner {
69
63
  __typename
70
64
  ... on AddressOwner {
71
- owner {
72
- asObject {
73
- address
74
- }
75
- asAddress {
76
- address
77
- }
65
+ address {
66
+ address
78
67
  }
79
68
  }
80
- ... on Parent {
81
- parent {
69
+ ... on ObjectOwner {
70
+ address {
82
71
  address
83
72
  }
84
73
  }
@@ -87,7 +76,7 @@ fragment OBJECT_OWNER_FIELDS on ObjectOwner {
87
76
  }
88
77
  ... on ConsensusAddressOwner {
89
78
  startVersion
90
- owner {
79
+ address {
91
80
  address
92
81
  }
93
82
  }
@@ -1,20 +1,22 @@
1
1
  # Copyright (c) Mysten Labs, Inc.
2
2
  # SPDX-License-Identifier: Apache-2.0
3
3
 
4
- query dryRunTransactionBlock($txBytes: String!) {
5
- dryRunTransactionBlock(txBytes: $txBytes) {
4
+ query simulateTransaction($transaction: JSON!) {
5
+ simulateTransaction(transaction: $transaction) {
6
6
  error
7
- transaction {
8
- ...TRANSACTION_FIELDS
7
+ effects {
8
+ transaction {
9
+ ...TRANSACTION_FIELDS
10
+ }
9
11
  }
10
12
  }
11
13
  }
12
14
 
13
- mutation executeTransactionBlock($txBytes: String!, $signatures: [String!]!) {
14
- executeTransactionBlock(txBytes: $txBytes, signatures: $signatures) {
15
+ mutation executeTransaction($transactionDataBcs: Base64!, $signatures: [Base64!]!) {
16
+ executeTransaction(transactionDataBcs: $transactionDataBcs, signatures: $signatures) {
15
17
  errors
16
18
  effects {
17
- transactionBlock {
19
+ transaction {
18
20
  ...TRANSACTION_FIELDS
19
21
  }
20
22
  }
@@ -22,17 +24,19 @@ mutation executeTransactionBlock($txBytes: String!, $signatures: [String!]!) {
22
24
  }
23
25
 
24
26
  query getTransactionBlock($digest: String!) {
25
- transactionBlock(digest: $digest) {
27
+ transaction(digest: $digest) {
26
28
  ...TRANSACTION_FIELDS
27
29
  }
28
30
  }
29
31
 
30
- fragment TRANSACTION_FIELDS on TransactionBlock {
32
+ fragment TRANSACTION_FIELDS on Transaction {
31
33
  digest
32
- bcs
33
- signatures
34
+ transactionBcs
35
+ signatures {
36
+ signatureBytes
37
+ }
34
38
  effects {
35
- bcs
39
+ effectsBcs
36
40
  epoch {
37
41
  epochId
38
42
  }
@@ -4,13 +4,13 @@ query verifyZkLoginSignature(
4
4
  $intentScope: ZkLoginIntentScope!
5
5
  $author: SuiAddress!
6
6
  ) {
7
- verifyZkloginSignature(
7
+ verifyZkLoginSignature(
8
8
  bytes: $bytes
9
9
  signature: $signature
10
10
  intentScope: $intentScope
11
11
  author: $author
12
12
  ) {
13
13
  success
14
- errors
14
+ error
15
15
  }
16
16
  }
@@ -83,4 +83,5 @@ export interface CustomScalars {
83
83
  MoveTypeSignature: MoveTypeSignature;
84
84
  OpenMoveTypeSignature: OpenMoveTypeSignature;
85
85
  SuiAddress: string;
86
+ UInt53: number;
86
87
  }
@@ -13,6 +13,7 @@ import { SubscriptionServiceClient } from './proto/sui/rpc/v2/subscription_servi
13
13
  import { GrpcCoreClient } from './core.js';
14
14
  import type { Experimental_SuiClientTypes } from '../experimental/index.js';
15
15
  import { Experimental_BaseClient } from '../experimental/index.js';
16
+ import { NameServiceClient } from './proto/sui/rpc/v2/name_service.client.js';
16
17
 
17
18
  interface SuiGrpcTransportOptions extends GrpcWebOptions {
18
19
  transport?: never;
@@ -36,6 +37,7 @@ export class SuiGrpcClient extends Experimental_BaseClient {
36
37
  subscriptionService: SubscriptionServiceClient;
37
38
  movePackageService: MovePackageServiceClient;
38
39
  signatureVerificationService: SignatureVerificationServiceClient;
40
+ nameService: NameServiceClient;
39
41
 
40
42
  constructor(options: SuiGrpcClientOptions) {
41
43
  super({ network: options.network });
@@ -48,6 +50,7 @@ export class SuiGrpcClient extends Experimental_BaseClient {
48
50
  this.subscriptionService = new SubscriptionServiceClient(transport);
49
51
  this.movePackageService = new MovePackageServiceClient(transport);
50
52
  this.signatureVerificationService = new SignatureVerificationServiceClient(transport);
53
+ this.nameService = new NameServiceClient(transport);
51
54
 
52
55
  this.core = new GrpcCoreClient({
53
56
  client: this,
package/src/grpc/core.ts CHANGED
@@ -344,6 +344,22 @@ export class GrpcCoreClient extends Experimental_CoreClient {
344
344
  };
345
345
  }
346
346
 
347
+ async defaultNameServiceName(
348
+ options: Experimental_SuiClientTypes.DefaultNameServiceNameOptions,
349
+ ): Promise<Experimental_SuiClientTypes.DefaultNameServiceNameResponse> {
350
+ const name =
351
+ (
352
+ await this.#client.nameService.reverseLookupName({
353
+ address: options.address,
354
+ })
355
+ ).response.record?.name ?? null;
356
+ return {
357
+ data: {
358
+ name,
359
+ },
360
+ };
361
+ }
362
+
347
363
  async getMoveFunction(
348
364
  options: Experimental_SuiClientTypes.GetMoveFunctionOptions,
349
365
  ): Promise<Experimental_SuiClientTypes.GetMoveFunctionResponse> {
@@ -273,10 +273,15 @@ export class JSONRpcCoreClient extends Experimental_CoreClient {
273
273
  };
274
274
  }
275
275
 
276
- resolveNameServiceNames(
277
- options: Experimental_SuiClientTypes.ResolveNameServiceNamesOptions,
278
- ): Promise<Experimental_SuiClientTypes.ResolveNameServiceNamesResponse> {
279
- return this.#jsonRpcClient.resolveNameServiceNames(options);
276
+ async defaultNameServiceName(
277
+ options: Experimental_SuiClientTypes.DefaultNameServiceNameOptions,
278
+ ): Promise<Experimental_SuiClientTypes.DefaultNameServiceNameResponse> {
279
+ const name = (await this.#jsonRpcClient.resolveNameServiceNames(options)).data[0];
280
+ return {
281
+ data: {
282
+ name,
283
+ },
284
+ };
280
285
  }
281
286
 
282
287
  resolveTransactionPlugin() {
@@ -508,13 +508,13 @@ export class Transaction {
508
508
  this.#data.mapCommandArguments(resultIndex, (arg) => {
509
509
  if (arg.$kind === 'Result' && !this.#availableResults.has(arg.Result)) {
510
510
  throw new Error(
511
- `Result { Result: ${arg.Result} } is not available to use the current transaction`,
511
+ `Result { Result: ${arg.Result} } is not available to use in the current transaction`,
512
512
  );
513
513
  }
514
514
 
515
515
  if (arg.$kind === 'NestedResult' && !this.#availableResults.has(arg.NestedResult[0])) {
516
516
  throw new Error(
517
- `Result { NestedResult: [${arg.NestedResult[0]}, ${arg.NestedResult[1]}] } is not available to use the current transaction`,
517
+ `Result { NestedResult: [${arg.NestedResult[0]}, ${arg.NestedResult[1]}] } is not available to use in the current transaction`,
518
518
  );
519
519
  }
520
520
 
package/src/version.ts CHANGED
@@ -3,5 +3,5 @@
3
3
 
4
4
  // This file is generated by genversion.mjs. Do not edit it directly.
5
5
 
6
- export const PACKAGE_VERSION = '1.43.1';
7
- export const TARGETED_RPC_VERSION = '1.60.0';
6
+ export const PACKAGE_VERSION = '1.44.0';
7
+ export const TARGETED_RPC_VERSION = '1.61.0';
@@ -240,7 +240,7 @@ async function graphqlVerifyZkLoginSignature({
240
240
  signature,
241
241
  intentScope,
242
242
  client = new SuiGraphQLClient({
243
- url: 'https://sui-mainnet.mystenlabs.com/graphql',
243
+ url: 'https://graphql.mainnet.sui.io/graphql',
244
244
  }),
245
245
  }: {
246
246
  address: string;