@haneullabs/haneul 2.4.0 → 2.5.1

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 (95) hide show
  1. package/dist/bcs/bcs.d.mts +6 -6
  2. package/dist/bcs/bcs.mjs +1 -1
  3. package/dist/bcs/bcs.mjs.map +1 -1
  4. package/dist/bcs/index.d.mts +4 -4
  5. package/dist/client/core-resolver.mjs +2 -2
  6. package/dist/client/core-resolver.mjs.map +1 -1
  7. package/dist/client/core.mjs +1 -1
  8. package/dist/client/core.mjs.map +1 -1
  9. package/dist/cryptography/keypair.d.mts +1 -1
  10. package/dist/cryptography/keypair.mjs +3 -3
  11. package/dist/cryptography/keypair.mjs.map +1 -1
  12. package/dist/cryptography/publickey.d.mts +1 -1
  13. package/dist/cryptography/publickey.mjs +2 -2
  14. package/dist/cryptography/publickey.mjs.map +1 -1
  15. package/dist/cryptography/signature.d.mts +6 -6
  16. package/dist/grpc/proto/haneul/rpc/v2/ledger_service.client.d.mts +4 -4
  17. package/dist/grpc/proto/haneul/rpc/v2/name_service.client.d.mts +4 -4
  18. package/dist/grpc/proto/haneul/rpc/v2/signature_verification_service.client.d.mts +4 -4
  19. package/dist/grpc/proto/haneul/rpc/v2/state_service.client.d.mts +4 -4
  20. package/dist/grpc/proto/haneul/rpc/v2/subscription_service.client.d.mts +4 -4
  21. package/dist/grpc/proto/haneul/rpc/v2/system_state.d.mts +2 -2
  22. package/dist/grpc/proto/haneul/rpc/v2/system_state.mjs +1 -1
  23. package/dist/grpc/proto/haneul/rpc/v2/system_state.mjs.map +1 -1
  24. package/dist/grpc/proto/haneul/rpc/v2/transaction_execution_service.client.d.mts +4 -4
  25. package/dist/jsonRpc/client.d.mts +5 -5
  26. package/dist/jsonRpc/client.d.mts.map +1 -1
  27. package/dist/jsonRpc/client.mjs +56 -56
  28. package/dist/jsonRpc/client.mjs.map +1 -1
  29. package/dist/jsonRpc/core.mjs +6 -6
  30. package/dist/jsonRpc/core.mjs.map +1 -1
  31. package/dist/jsonRpc/index.d.mts +4 -4
  32. package/dist/jsonRpc/index.mjs +2 -2
  33. package/dist/jsonRpc/types/generated.d.mts +14 -14
  34. package/dist/jsonRpc/types/generated.d.mts.map +1 -1
  35. package/dist/jsonRpc/types/index.d.mts +2 -2
  36. package/dist/jsonRpc/types/params.d.mts +8 -8
  37. package/dist/jsonRpc/types/params.d.mts.map +1 -1
  38. package/dist/multisig/publickey.d.mts +1 -1
  39. package/dist/multisig/publickey.mjs +1 -1
  40. package/dist/multisig/publickey.mjs.map +1 -1
  41. package/dist/multisig/signer.mjs +2 -2
  42. package/dist/multisig/signer.mjs.map +1 -1
  43. package/dist/transactions/Commands.mjs +3 -3
  44. package/dist/transactions/Commands.mjs.map +1 -1
  45. package/dist/transactions/Transaction.d.mts +6 -6
  46. package/dist/transactions/data/internal.d.mts +109 -109
  47. package/dist/transactions/data/v1.d.mts +220 -220
  48. package/dist/transactions/data/v1.d.mts.map +1 -1
  49. package/dist/transactions/data/v2.d.mts +16 -16
  50. package/dist/transactions/data/v2.d.mts.map +1 -1
  51. package/dist/transactions/executor/caching.mjs +1 -1
  52. package/dist/transactions/executor/caching.mjs.map +1 -1
  53. package/dist/transactions/executor/parallel.mjs +3 -3
  54. package/dist/transactions/executor/parallel.mjs.map +1 -1
  55. package/dist/transactions/executor/serial.mjs +1 -1
  56. package/dist/transactions/executor/serial.mjs.map +1 -1
  57. package/dist/utils/haneul-types.d.mts +2 -2
  58. package/dist/utils/haneul-types.d.mts.map +1 -1
  59. package/dist/utils/haneul-types.mjs +2 -2
  60. package/dist/utils/haneul-types.mjs.map +1 -1
  61. package/dist/utils/index.d.mts +2 -2
  62. package/dist/utils/index.mjs +2 -2
  63. package/dist/verify/verify.mjs +1 -1
  64. package/dist/verify/verify.mjs.map +1 -1
  65. package/dist/version.mjs +1 -1
  66. package/dist/version.mjs.map +1 -1
  67. package/dist/zklogin/bcs.d.mts +14 -14
  68. package/dist/zklogin/bcs.d.mts.map +1 -1
  69. package/dist/zklogin/publickey.d.mts +1 -1
  70. package/dist/zklogin/publickey.d.mts.map +1 -1
  71. package/dist/zklogin/publickey.mjs +9 -9
  72. package/dist/zklogin/publickey.mjs.map +1 -1
  73. package/package.json +199 -199
  74. package/src/bcs/bcs.ts +1 -1
  75. package/src/client/core-resolver.ts +2 -2
  76. package/src/client/core.ts +1 -1
  77. package/src/cryptography/keypair.ts +3 -3
  78. package/src/cryptography/publickey.ts +2 -2
  79. package/src/grpc/proto/haneul/rpc/v2/system_state.ts +3 -3
  80. package/src/jsonRpc/client.ts +57 -57
  81. package/src/jsonRpc/core.ts +7 -7
  82. package/src/jsonRpc/index.ts +1 -1
  83. package/src/jsonRpc/types/generated.ts +13 -13
  84. package/src/jsonRpc/types/params.ts +7 -7
  85. package/src/multisig/publickey.ts +1 -1
  86. package/src/multisig/signer.ts +2 -2
  87. package/src/transactions/Commands.ts +3 -3
  88. package/src/transactions/executor/caching.ts +1 -1
  89. package/src/transactions/executor/parallel.ts +3 -3
  90. package/src/transactions/executor/serial.ts +1 -1
  91. package/src/utils/haneul-types.ts +1 -1
  92. package/src/utils/index.ts +1 -1
  93. package/src/verify/verify.ts +1 -1
  94. package/src/version.ts +1 -1
  95. package/src/zklogin/publickey.ts +9 -9
@@ -5,7 +5,7 @@ import { toBase64 } from '@haneullabs/bcs';
5
5
  import type { InferInput } from 'valibot';
6
6
  import { parse } from 'valibot';
7
7
 
8
- import { normalizeSuiObjectId } from '../utils/haneul-types.js';
8
+ import { normalizeHaneulObjectId } from '../utils/haneul-types.js';
9
9
  import type { Argument, CallArg, Command } from './data/internal.js';
10
10
  import { ArgumentSchema } from './data/internal.js';
11
11
  import type { AsyncTransactionThunk, Transaction } from './Transaction.js';
@@ -111,7 +111,7 @@ export const TransactionCommands = {
111
111
  modules: modules.map((module) =>
112
112
  typeof module === 'string' ? module : toBase64(new Uint8Array(module)),
113
113
  ),
114
- dependencies: dependencies.map((dep) => normalizeSuiObjectId(dep)),
114
+ dependencies: dependencies.map((dep) => normalizeHaneulObjectId(dep)),
115
115
  },
116
116
  };
117
117
  },
@@ -132,7 +132,7 @@ export const TransactionCommands = {
132
132
  modules: modules.map((module) =>
133
133
  typeof module === 'string' ? module : toBase64(new Uint8Array(module)),
134
134
  ),
135
- dependencies: dependencies.map((dep) => normalizeSuiObjectId(dep)),
135
+ dependencies: dependencies.map((dep) => normalizeHaneulObjectId(dep)),
136
136
  package: packageId,
137
137
  ticket: parse(ArgumentSchema, ticket),
138
138
  },
@@ -95,7 +95,7 @@ export class CachingTransactionExecutor {
95
95
  signer: Signer;
96
96
  include?: Include;
97
97
  }): Promise<HaneulClientTypes.TransactionResult<Include & { effects: true }>> {
98
- transaction.setSenderIfNotSet(signer.toSuiAddress());
98
+ transaction.setSenderIfNotSet(signer.toHaneulAddress());
99
99
  const bytes = await this.buildTransaction({ transaction });
100
100
  const { signature } = await signer.signTransaction(bytes);
101
101
  return this.executeTransaction({
@@ -206,7 +206,7 @@ export class ParallelTransactionExecutor {
206
206
  ): Promise<HaneulClientTypes.TransactionResult<Include & { effects: true }>> {
207
207
  let gasCoin: CoinWithBalance | null = null;
208
208
  try {
209
- transaction.setSenderIfNotSet(this.#signer.toSuiAddress());
209
+ transaction.setSenderIfNotSet(this.#signer.toHaneulAddress());
210
210
 
211
211
  await this.#buildQueue.runTask(async () => {
212
212
  const data = transaction.getData();
@@ -259,7 +259,7 @@ export class ParallelTransactionExecutor {
259
259
  const coin = gasCoin as CoinWithBalance;
260
260
  const gasOwner = gasObject.outputOwner?.AddressOwner ?? gasObject.outputOwner?.ObjectOwner;
261
261
 
262
- if (gasOwner === this.#signer.toSuiAddress()) {
262
+ if (gasOwner === this.#signer.toHaneulAddress()) {
263
263
  const totalUsed =
264
264
  BigInt(gasUsed.computationCost) +
265
265
  BigInt(gasUsed.storageCost) +
@@ -431,7 +431,7 @@ export class ParallelTransactionExecutor {
431
431
  }
432
432
 
433
433
  const txb = new Transaction();
434
- const address = this.#signer.toSuiAddress();
434
+ const address = this.#signer.toHaneulAddress();
435
435
  txb.setSender(address);
436
436
 
437
437
  if (this.#sourceCoins) {
@@ -102,7 +102,7 @@ export class SerialTransactionExecutor {
102
102
  }
103
103
 
104
104
  copy.setGasBudgetIfNotSet(this.#defaultGasBudget);
105
- copy.setSenderIfNotSet(this.#signer.toSuiAddress());
105
+ copy.setSenderIfNotSet(this.#signer.toHaneulAddress());
106
106
 
107
107
  return this.#cache.buildTransaction({ transaction: copy });
108
108
  };
@@ -163,7 +163,7 @@ export function normalizeHaneulAddress(value: string, forceAdd0x: boolean = fals
163
163
  return `0x${address.padStart(HANEUL_ADDRESS_LENGTH * 2, '0')}`;
164
164
  }
165
165
 
166
- export function normalizeSuiObjectId(value: string, forceAdd0x: boolean = false): string {
166
+ export function normalizeHaneulObjectId(value: string, forceAdd0x: boolean = false): string {
167
167
  return normalizeHaneulAddress(value, forceAdd0x);
168
168
  }
169
169
 
@@ -9,7 +9,7 @@ export {
9
9
  isValidTransactionDigest,
10
10
  normalizeStructTag,
11
11
  normalizeHaneulAddress,
12
- normalizeSuiObjectId,
12
+ normalizeHaneulObjectId,
13
13
  parseStructTag,
14
14
  HANEUL_ADDRESS_LENGTH,
15
15
  } from './haneul-types.js';
@@ -129,7 +129,7 @@ export function publicKeyFromRawBytes(
129
129
  throw new Error(`Unsupported signature scheme ${signatureScheme}`);
130
130
  }
131
131
 
132
- if (options.address && publicKey.toSuiAddress() !== options.address) {
132
+ if (options.address && publicKey.toHaneulAddress() !== options.address) {
133
133
  throw new Error(`Public key bytes do not match the provided address`);
134
134
  }
135
135
 
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 = '2.4.0';
6
+ export const PACKAGE_VERSION = '2.5.1';
7
7
  export const TARGETED_RPC_VERSION = '1.0.0';
@@ -69,7 +69,7 @@ export class ZkLoginPublicIdentifier extends PublicKey {
69
69
  client,
70
70
  });
71
71
 
72
- if (publicKey.toSuiAddress() !== address) {
72
+ if (publicKey.toHaneulAddress() !== address) {
73
73
  publicKey = new ZkLoginPublicIdentifier(normalizeZkLoginPublicKeyBytes(bytes, true), {
74
74
  client,
75
75
  });
@@ -80,7 +80,7 @@ export class ZkLoginPublicIdentifier extends PublicKey {
80
80
  });
81
81
  }
82
82
 
83
- if (address && publicKey.toSuiAddress() !== address) {
83
+ if (address && publicKey.toHaneulAddress() !== address) {
84
84
  throw new Error('Public key bytes do not match the provided address');
85
85
  }
86
86
 
@@ -95,7 +95,7 @@ export class ZkLoginPublicIdentifier extends PublicKey {
95
95
  legacyAddress: true,
96
96
  });
97
97
 
98
- if (legacyPublicKey.toSuiAddress() === address) {
98
+ if (legacyPublicKey.toHaneulAddress() === address) {
99
99
  return legacyPublicKey;
100
100
  }
101
101
 
@@ -103,7 +103,7 @@ export class ZkLoginPublicIdentifier extends PublicKey {
103
103
  legacyAddress: false,
104
104
  });
105
105
 
106
- if (publicKey.toSuiAddress() !== address) {
106
+ if (publicKey.toHaneulAddress() !== address) {
107
107
  throw new Error('Proof does not match address');
108
108
  }
109
109
 
@@ -117,12 +117,12 @@ export class ZkLoginPublicIdentifier extends PublicKey {
117
117
  return super.equals(publicKey);
118
118
  }
119
119
 
120
- override toSuiAddress(): string {
120
+ override toHaneulAddress(): string {
121
121
  if (this.#legacyAddress) {
122
122
  return this.#toLegacyAddress();
123
123
  }
124
124
 
125
- return super.toSuiAddress();
125
+ return super.toHaneulAddress();
126
126
  }
127
127
 
128
128
  #toLegacyAddress() {
@@ -161,7 +161,7 @@ export class ZkLoginPublicIdentifier extends PublicKey {
161
161
  */
162
162
  verifyPersonalMessage(message: Uint8Array, signature: Uint8Array | string): Promise<boolean> {
163
163
  const parsedSignature = parseSerializedZkLoginSignature(signature);
164
- const address = new ZkLoginPublicIdentifier(parsedSignature.publicKey).toSuiAddress();
164
+ const address = new ZkLoginPublicIdentifier(parsedSignature.publicKey).toHaneulAddress();
165
165
 
166
166
  return graphqlVerifyZkLoginSignature({
167
167
  address: address,
@@ -177,7 +177,7 @@ export class ZkLoginPublicIdentifier extends PublicKey {
177
177
  */
178
178
  verifyTransaction(transaction: Uint8Array, signature: Uint8Array | string): Promise<boolean> {
179
179
  const parsedSignature = parseSerializedZkLoginSignature(signature);
180
- const address = new ZkLoginPublicIdentifier(parsedSignature.publicKey).toSuiAddress();
180
+ const address = new ZkLoginPublicIdentifier(parsedSignature.publicKey).toHaneulAddress();
181
181
  return graphqlVerifyZkLoginSignature({
182
182
  address: address,
183
183
  bytes: toBase64(transaction),
@@ -191,7 +191,7 @@ export class ZkLoginPublicIdentifier extends PublicKey {
191
191
  * Verifies that the public key is associated with the provided address
192
192
  */
193
193
  override verifyAddress(address: string): boolean {
194
- return address === super.toSuiAddress() || address === this.#toLegacyAddress();
194
+ return address === super.toHaneulAddress() || address === this.#toLegacyAddress();
195
195
  }
196
196
  }
197
197