@adelos/sdk 0.1.9 → 0.1.10

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/dist/index.d.mts CHANGED
@@ -145,6 +145,8 @@ declare class AdelosSDK {
145
145
  }>;
146
146
  /** Membuat transaksi pendaftaran identitas */
147
147
  createRegisterTransaction(owner: PublicKey, metaPubkey: Uint8Array, version?: "legacy" | "v0"): Promise<Transaction | VersionedTransaction>;
148
+ /** Membuat transaksi pembaruan identitas (jika sudah terdaftar) */
149
+ createUpdateTransaction(owner: PublicKey, metaPubkey: Uint8Array, version?: "legacy" | "v0"): Promise<Transaction | VersionedTransaction>;
148
150
  buildTransaction(payer: PublicKey, instructions: TransactionInstruction[], version?: "legacy" | "v0"): Promise<Transaction | VersionedTransaction>;
149
151
  /** Satu fungsi kirim untuk semua jenis transaksi (Legacy/V0) */
150
152
  sendAndConfirm(signedTx: Transaction | VersionedTransaction): Promise<string>;
package/dist/index.d.ts CHANGED
@@ -145,6 +145,8 @@ declare class AdelosSDK {
145
145
  }>;
146
146
  /** Membuat transaksi pendaftaran identitas */
147
147
  createRegisterTransaction(owner: PublicKey, metaPubkey: Uint8Array, version?: "legacy" | "v0"): Promise<Transaction | VersionedTransaction>;
148
+ /** Membuat transaksi pembaruan identitas (jika sudah terdaftar) */
149
+ createUpdateTransaction(owner: PublicKey, metaPubkey: Uint8Array, version?: "legacy" | "v0"): Promise<Transaction | VersionedTransaction>;
148
150
  buildTransaction(payer: PublicKey, instructions: TransactionInstruction[], version?: "legacy" | "v0"): Promise<Transaction | VersionedTransaction>;
149
151
  /** Satu fungsi kirim untuk semua jenis transaksi (Legacy/V0) */
150
152
  sendAndConfirm(signedTx: Transaction | VersionedTransaction): Promise<string>;
package/dist/index.js CHANGED
@@ -356,6 +356,21 @@ var AdelosSDK = class {
356
356
  });
357
357
  return this.buildTransaction(owner, [ix], version);
358
358
  }
359
+ /** Membuat transaksi pembaruan identitas (jika sudah terdaftar) */
360
+ async createUpdateTransaction(owner, metaPubkey, version = "v0") {
361
+ const [registryPda] = deriveRegistryPda(owner, this.programId);
362
+ const data = Buffer.concat([Buffer.from(getDiscriminator("update_identity")), Buffer.from(metaPubkey)]);
363
+ const ix = new import_web33.TransactionInstruction({
364
+ keys: [
365
+ { pubkey: owner, isSigner: true, isWritable: true },
366
+ { pubkey: registryPda, isSigner: false, isWritable: true },
367
+ { pubkey: import_web33.SystemProgram.programId, isSigner: false, isWritable: false }
368
+ ],
369
+ programId: this.programId,
370
+ data
371
+ });
372
+ return this.buildTransaction(owner, [ix], version);
373
+ }
359
374
  // --- 3. Core Engine (Internal Helpers) ---
360
375
  async buildTransaction(payer, instructions, version = "v0") {
361
376
  const { blockhash } = await this.connection.getLatestBlockhash();
package/dist/index.mjs CHANGED
@@ -307,6 +307,21 @@ var AdelosSDK = class {
307
307
  });
308
308
  return this.buildTransaction(owner, [ix], version);
309
309
  }
310
+ /** Membuat transaksi pembaruan identitas (jika sudah terdaftar) */
311
+ async createUpdateTransaction(owner, metaPubkey, version = "v0") {
312
+ const [registryPda] = deriveRegistryPda(owner, this.programId);
313
+ const data = Buffer.concat([Buffer.from(getDiscriminator("update_identity")), Buffer.from(metaPubkey)]);
314
+ const ix = new TransactionInstruction({
315
+ keys: [
316
+ { pubkey: owner, isSigner: true, isWritable: true },
317
+ { pubkey: registryPda, isSigner: false, isWritable: true },
318
+ { pubkey: SystemProgram.programId, isSigner: false, isWritable: false }
319
+ ],
320
+ programId: this.programId,
321
+ data
322
+ });
323
+ return this.buildTransaction(owner, [ix], version);
324
+ }
310
325
  // --- 3. Core Engine (Internal Helpers) ---
311
326
  async buildTransaction(payer, instructions, version = "v0") {
312
327
  const { blockhash } = await this.connection.getLatestBlockhash();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@adelos/sdk",
3
- "version": "0.1.9",
3
+ "version": "0.1.10",
4
4
  "description": "Adelos Protocol SDK - Privacy Stealth Transfers on Solana",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",