@aura-protocol/cli 0.1.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 (78) hide show
  1. package/README.md +307 -0
  2. package/bin/aura.js +8 -0
  3. package/dist/commands/confidential.d.ts +2 -0
  4. package/dist/commands/confidential.js +564 -0
  5. package/dist/commands/confidential.js.map +1 -0
  6. package/dist/commands/config.d.ts +2 -0
  7. package/dist/commands/config.js +123 -0
  8. package/dist/commands/config.js.map +1 -0
  9. package/dist/commands/dashboard.d.ts +2 -0
  10. package/dist/commands/dashboard.js +29 -0
  11. package/dist/commands/dashboard.js.map +1 -0
  12. package/dist/commands/dwallet.d.ts +2 -0
  13. package/dist/commands/dwallet.js +131 -0
  14. package/dist/commands/dwallet.js.map +1 -0
  15. package/dist/commands/execution.d.ts +2 -0
  16. package/dist/commands/execution.js +261 -0
  17. package/dist/commands/execution.js.map +1 -0
  18. package/dist/commands/governance.d.ts +2 -0
  19. package/dist/commands/governance.js +169 -0
  20. package/dist/commands/governance.js.map +1 -0
  21. package/dist/commands/helpers.d.ts +79 -0
  22. package/dist/commands/helpers.js +219 -0
  23. package/dist/commands/helpers.js.map +1 -0
  24. package/dist/commands/treasury.d.ts +2 -0
  25. package/dist/commands/treasury.js +319 -0
  26. package/dist/commands/treasury.js.map +1 -0
  27. package/dist/config.d.ts +35 -0
  28. package/dist/config.js +96 -0
  29. package/dist/config.js.map +1 -0
  30. package/dist/context.d.ts +37 -0
  31. package/dist/context.js +57 -0
  32. package/dist/context.js.map +1 -0
  33. package/dist/dashboard.d.ts +7 -0
  34. package/dist/dashboard.js +95 -0
  35. package/dist/dashboard.js.map +1 -0
  36. package/dist/domain.d.ts +16 -0
  37. package/dist/domain.js +86 -0
  38. package/dist/domain.js.map +1 -0
  39. package/dist/format.d.ts +9 -0
  40. package/dist/format.js +92 -0
  41. package/dist/format.js.map +1 -0
  42. package/dist/ika.d.ts +76 -0
  43. package/dist/ika.js +178 -0
  44. package/dist/ika.js.map +1 -0
  45. package/dist/index.d.ts +3 -0
  46. package/dist/index.js +43 -0
  47. package/dist/index.js.map +1 -0
  48. package/dist/output.d.ts +32 -0
  49. package/dist/output.js +134 -0
  50. package/dist/output.js.map +1 -0
  51. package/dist/protocol.d.ts +99 -0
  52. package/dist/protocol.js +353 -0
  53. package/dist/protocol.js.map +1 -0
  54. package/dist/sdk.d.ts +6 -0
  55. package/dist/sdk.js +6 -0
  56. package/dist/sdk.js.map +1 -0
  57. package/dist/treasury-view.d.ts +11 -0
  58. package/dist/treasury-view.js +103 -0
  59. package/dist/treasury-view.js.map +1 -0
  60. package/dist/vendor/encrypt/generated/grpc/encrypt_service.d.ts +195 -0
  61. package/dist/vendor/encrypt/generated/grpc/encrypt_service.js +514 -0
  62. package/dist/vendor/encrypt/generated/grpc/encrypt_service.js.map +1 -0
  63. package/dist/vendor/encrypt/grpc.d.ts +70 -0
  64. package/dist/vendor/encrypt/grpc.js +108 -0
  65. package/dist/vendor/encrypt/grpc.js.map +1 -0
  66. package/dist/vendor/ika/bcs-types.d.ts +1045 -0
  67. package/dist/vendor/ika/bcs-types.js +185 -0
  68. package/dist/vendor/ika/bcs-types.js.map +1 -0
  69. package/dist/vendor/ika/generated/grpc/ika_dwallet.d.ts +141 -0
  70. package/dist/vendor/ika/generated/grpc/ika_dwallet.js +531 -0
  71. package/dist/vendor/ika/generated/grpc/ika_dwallet.js.map +1 -0
  72. package/dist/vendor/ika/grpc.d.ts +16 -0
  73. package/dist/vendor/ika/grpc.js +129 -0
  74. package/dist/vendor/ika/grpc.js.map +1 -0
  75. package/dist/wallet.d.ts +2 -0
  76. package/dist/wallet.js +21 -0
  77. package/dist/wallet.js.map +1 -0
  78. package/package.json +54 -0
@@ -0,0 +1,32 @@
1
+ import { type TransactionInstruction } from "@solana/web3.js";
2
+ export interface OutputOptions {
3
+ json: boolean;
4
+ quiet: boolean;
5
+ }
6
+ export interface SpinnerHandle {
7
+ setText(text: string): void;
8
+ succeed(message?: string): void;
9
+ fail(message?: string): void;
10
+ stop(): void;
11
+ }
12
+ export declare function serializeForJson(value: unknown): unknown;
13
+ export declare function emitJson(output: OutputOptions, value: unknown): void;
14
+ export declare function printBanner(output: OutputOptions, title: string): void;
15
+ export declare function createTable(head: string[]): any;
16
+ export declare function printTable(output: OutputOptions, table: {
17
+ toString(): string;
18
+ }): void;
19
+ export declare function printSuccess(output: OutputOptions, message: string): void;
20
+ export declare function printInfo(output: OutputOptions, message: string): void;
21
+ export declare function formatError(error: unknown): string;
22
+ export declare function printError(error: unknown): void;
23
+ export declare function startSpinner(output: OutputOptions, text: string): SpinnerHandle;
24
+ export declare function serializeInstruction(instruction: TransactionInstruction): {
25
+ programId: string;
26
+ accounts: {
27
+ pubkey: string;
28
+ isSigner: boolean;
29
+ isWritable: boolean;
30
+ }[];
31
+ dataBase64: string;
32
+ };
package/dist/output.js ADDED
@@ -0,0 +1,134 @@
1
+ import boxen from "boxen";
2
+ import BN from "bn.js";
3
+ import chalk from "chalk";
4
+ import Table from "cli-table3";
5
+ import ora from "ora";
6
+ import { PublicKey } from "@solana/web3.js";
7
+ export function serializeForJson(value) {
8
+ if (value instanceof PublicKey) {
9
+ return value.toBase58();
10
+ }
11
+ if (BN.isBN(value)) {
12
+ return value.toString();
13
+ }
14
+ if (Buffer.isBuffer(value)) {
15
+ return value.toString("base64");
16
+ }
17
+ if (Array.isArray(value)) {
18
+ return value.map((item) => serializeForJson(item));
19
+ }
20
+ if (value && typeof value === "object") {
21
+ return Object.fromEntries(Object.entries(value).map(([key, entry]) => [
22
+ key,
23
+ serializeForJson(entry),
24
+ ]));
25
+ }
26
+ return value;
27
+ }
28
+ export function emitJson(output, value) {
29
+ if (!output.quiet) {
30
+ console.log(JSON.stringify(serializeForJson(value), null, 2));
31
+ }
32
+ }
33
+ export function printBanner(output, title) {
34
+ if (output.quiet || output.json) {
35
+ return;
36
+ }
37
+ console.log(boxen(chalk.bold(title), {
38
+ padding: { top: 0, bottom: 0, left: 1, right: 1 },
39
+ borderColor: "cyan",
40
+ borderStyle: "round",
41
+ margin: { bottom: 1 },
42
+ }));
43
+ }
44
+ export function createTable(head) {
45
+ return new Table({
46
+ head,
47
+ style: {
48
+ head: ["cyan"],
49
+ border: ["gray"],
50
+ compact: false,
51
+ },
52
+ wordWrap: true,
53
+ });
54
+ }
55
+ export function printTable(output, table) {
56
+ if (output.quiet || output.json) {
57
+ return;
58
+ }
59
+ console.log(table.toString());
60
+ }
61
+ export function printSuccess(output, message) {
62
+ if (output.quiet || output.json) {
63
+ return;
64
+ }
65
+ console.log(chalk.green(`✓ ${message}`));
66
+ }
67
+ export function printInfo(output, message) {
68
+ if (output.quiet || output.json) {
69
+ return;
70
+ }
71
+ console.log(message);
72
+ }
73
+ export function formatError(error) {
74
+ const message = error instanceof Error ? error.message : String(error);
75
+ if (message.includes("429") || message.toLowerCase().includes("rate limit")) {
76
+ return `${message}\nSuggestion: set AURA_RPC_URL or AURA_DEVNET_RPC_URL to a dedicated RPC endpoint.`;
77
+ }
78
+ if (message.includes("Could not load wallet keypair")) {
79
+ return `${message}\nSuggestion: run 'aura config init' or pass --wallet /path/to/id.json.`;
80
+ }
81
+ if (message.includes("Account does not exist") || message.includes("not exist")) {
82
+ return `${message}\nSuggestion: verify the treasury PDA or agent ID, or create the treasury first.`;
83
+ }
84
+ if (message.includes("publicKeyHex") || message.includes("messageMetadataDigest")) {
85
+ return `${message}\nSuggestion: re-register the live dWallet with --dwallet-account, --authorized-user, --message-metadata-digest, and --public-key-hex.`;
86
+ }
87
+ if (message.includes("Scalar confidential guardrails are not configured")) {
88
+ return `${message}\nSuggestion: run 'aura confidential guardrails scalar ...' before proposing a confidential spend.`;
89
+ }
90
+ return message;
91
+ }
92
+ export function printError(error) {
93
+ console.error(chalk.red(`Error: ${formatError(error)}`));
94
+ }
95
+ export function startSpinner(output, text) {
96
+ if (output.quiet || output.json) {
97
+ return {
98
+ setText(_text) { },
99
+ succeed(_message) { },
100
+ fail(_message) { },
101
+ stop() { },
102
+ };
103
+ }
104
+ const spinner = ora({
105
+ text,
106
+ color: "cyan",
107
+ }).start();
108
+ return {
109
+ setText(nextText) {
110
+ spinner.text = nextText;
111
+ },
112
+ succeed(message) {
113
+ spinner.succeed(message);
114
+ },
115
+ fail(message) {
116
+ spinner.fail(message);
117
+ },
118
+ stop() {
119
+ spinner.stop();
120
+ },
121
+ };
122
+ }
123
+ export function serializeInstruction(instruction) {
124
+ return {
125
+ programId: instruction.programId.toBase58(),
126
+ accounts: instruction.keys.map((key) => ({
127
+ pubkey: key.pubkey.toBase58(),
128
+ isSigner: key.isSigner,
129
+ isWritable: key.isWritable,
130
+ })),
131
+ dataBase64: Buffer.from(instruction.data).toString("base64"),
132
+ };
133
+ }
134
+ //# sourceMappingURL=output.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"output.js","sourceRoot":"","sources":["../src/output.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,MAAM,OAAO,CAAC;AACvB,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,MAAM,YAAY,CAAC;AAC/B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EAAE,SAAS,EAA+B,MAAM,iBAAiB,CAAC;AAczE,MAAM,UAAU,gBAAgB,CAAC,KAAc;IAC7C,IAAI,KAAK,YAAY,SAAS,EAAE,CAAC;QAC/B,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC;QACnB,OAAO,KAAK,CAAC,QAAQ,EAAE,CAAC;IAC1B,CAAC;IACD,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC3B,OAAO,KAAK,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IAClC,CAAC;IACD,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EA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C;QACD,IAAI,CAAC,OAAgB;YACnB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;QACxB,CAAC;QACD,IAAI;YACF,OAAO,CAAC,IAAI,EAAE,CAAC;QACjB,CAAC;KACF,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,oBAAoB,CAAC,WAAmC;IACtE,OAAO;QACL,SAAS,EAAE,WAAW,CAAC,SAAS,CAAC,QAAQ,EAAE;QAC3C,QAAQ,EAAE,WAAW,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACvC,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,QAAQ,EAAE;YAC7B,QAAQ,EAAE,GAAG,CAAC,QAAQ;YACtB,UAAU,EAAE,GAAG,CAAC,UAAU;SAC3B,CAAC,CAAC;QACH,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;KAC7D,CAAC;AACJ,CAAC"}
@@ -0,0 +1,99 @@
1
+ import { Keypair, PublicKey, TransactionInstruction, type AccountInfo, type Commitment, type Connection, type SendOptions, type Signer } from "@solana/web3.js";
2
+ import { type TreasuryAccountRecord } from "./sdk.js";
3
+ export declare const ENCRYPT_NETWORK_KEY: Uint8Array<ArrayBuffer>;
4
+ type PendingProposal = NonNullable<TreasuryAccountRecord["pending"]>;
5
+ type DwalletRecord = TreasuryAccountRecord["dwallets"][number];
6
+ type BufferAccountInfo = AccountInfo<Buffer<ArrayBufferLike>>;
7
+ export interface EncryptAccountsBundle {
8
+ config: PublicKey;
9
+ deposit: PublicKey;
10
+ depositBump: number;
11
+ networkEncryptionKey: PublicKey;
12
+ eventAuthority: PublicKey;
13
+ cpiAuthority: PublicKey;
14
+ encryptProgram: PublicKey;
15
+ }
16
+ export interface EnsureEncryptDepositResult {
17
+ accounts: EncryptAccountsBundle;
18
+ created: boolean;
19
+ signature?: string;
20
+ }
21
+ export interface ApprovedExecutionAccounts {
22
+ pending: PendingProposal;
23
+ dwallet: DwalletRecord;
24
+ messageApproval: PublicKey;
25
+ dwalletAccount: PublicKey;
26
+ dwalletCoordinator: PublicKey;
27
+ cpiAuthority: PublicKey;
28
+ dwalletProgram: PublicKey;
29
+ }
30
+ export type MessageApprovalState = "missing" | "pending" | "signed";
31
+ export declare function deriveEncryptAccounts(payer: PublicKey, options?: {
32
+ auraProgramId?: PublicKey;
33
+ encryptProgramId?: PublicKey;
34
+ }): EncryptAccountsBundle;
35
+ export declare function deriveDwalletCoordinatorAddress(dwalletProgramId?: PublicKey): [PublicKey, number];
36
+ export declare function resolveScalarGuardrails(account: TreasuryAccountRecord): {
37
+ dailyLimitCiphertext: PublicKey;
38
+ perTxLimitCiphertext: PublicKey;
39
+ spentTodayCiphertext: PublicKey;
40
+ };
41
+ export declare function resolveVectorGuardrail(account: TreasuryAccountRecord): PublicKey;
42
+ export declare function resolvePendingProposal(account: TreasuryAccountRecord): PendingProposal;
43
+ export declare function resolvePendingPolicyOutput(account: TreasuryAccountRecord): PublicKey;
44
+ export declare function resolvePendingRequestAccount(account: TreasuryAccountRecord): PublicKey;
45
+ export declare function deriveApprovedExecutionAccounts(account: TreasuryAccountRecord, options?: {
46
+ auraProgramId?: PublicKey;
47
+ dwalletProgramId?: PublicKey;
48
+ }): ApprovedExecutionAccounts;
49
+ export declare function deriveMetadataV2MessageApprovalAddress(pending: PendingProposal, dwallet: DwalletRecord, dwalletProgramId?: PublicKey): [PublicKey, number];
50
+ export declare function buildMessageDigestHex(pending: PendingProposal, dwallet: DwalletRecord): string;
51
+ export declare function buildPolicyPlaintextDigestHex(plaintextBytes: Buffer): string;
52
+ export declare function createEphemeralKeypair(): Keypair;
53
+ export declare function markInstructionSigner(instruction: TransactionInstruction, pubkey: PublicKey): void;
54
+ export declare function sendInstructionsWithBudget(options: {
55
+ connection: Connection;
56
+ payer: Signer;
57
+ instructions: TransactionInstruction[];
58
+ extraSigners?: Signer[];
59
+ sendOptions?: SendOptions;
60
+ computeUnitLimit?: number;
61
+ heapFrameBytes?: number;
62
+ }): Promise<string>;
63
+ export declare function ensureEncryptDeposit(options: {
64
+ connection: Connection;
65
+ payer: Signer;
66
+ auraProgramId?: PublicKey;
67
+ encryptProgramId?: PublicKey;
68
+ }): Promise<EnsureEncryptDepositResult>;
69
+ export declare function waitForAccountState(connection: Connection, pubkey: PublicKey, predicate: (account: BufferAccountInfo) => boolean, options?: {
70
+ timeoutMs?: number;
71
+ intervalMs?: number;
72
+ commitment?: Commitment;
73
+ }): Promise<BufferAccountInfo>;
74
+ export declare function waitForCiphertextVerified(connection: Connection, ciphertext: PublicKey, options?: {
75
+ timeoutMs?: number;
76
+ intervalMs?: number;
77
+ commitment?: Commitment;
78
+ }): Promise<BufferAccountInfo>;
79
+ export declare function waitForDecryptionReady(connection: Connection, requestAccount: PublicKey, options?: {
80
+ timeoutMs?: number;
81
+ intervalMs?: number;
82
+ commitment?: Commitment;
83
+ }): Promise<BufferAccountInfo>;
84
+ export declare function waitForMessageApproval(connection: Connection, messageApproval: PublicKey, targetState?: Exclude<MessageApprovalState, "missing">, options?: {
85
+ timeoutMs?: number;
86
+ intervalMs?: number;
87
+ commitment?: Commitment;
88
+ }): Promise<BufferAccountInfo>;
89
+ export declare function getMessageApprovalState(connection: Connection, messageApproval: PublicKey, commitment?: Commitment): Promise<MessageApprovalState>;
90
+ export declare function parseMessageApprovalState(data: Buffer): MessageApprovalState;
91
+ export declare function parseDecryptionReady(account: BufferAccountInfo | null): boolean;
92
+ export declare function parseCiphertextVerified(account: BufferAccountInfo | null): boolean;
93
+ export declare function buildDryRunKeypair(path: string | undefined, load: (path: string) => Keypair): Keypair;
94
+ export declare function buildConfirmPolicySummary(account: TreasuryAccountRecord): {
95
+ approved: boolean;
96
+ violation: number;
97
+ status: number;
98
+ };
99
+ export {};
@@ -0,0 +1,353 @@
1
+ import { createHash } from "node:crypto";
2
+ import BN from "bn.js";
3
+ import { ComputeBudgetProgram, Keypair, PublicKey, SystemProgram, Transaction, TransactionInstruction, } from "@solana/web3.js";
4
+ import { AURA_PROGRAM_ID, deriveDwalletCpiAuthorityAddress, deriveEncryptCpiAuthorityAddress, deriveEncryptEventAuthorityAddress, DWALLET_DEVNET_PROGRAM_ID, ENCRYPT_DEVNET_PROGRAM_ID, } from "./sdk.js";
5
+ import { chainNameForDigest, transactionTypeNameForDigest } from "./domain.js";
6
+ import sha3 from "js-sha3";
7
+ const { keccak_256 } = sha3;
8
+ const ENCRYPT_CONFIG_SEED = Buffer.from("encrypt_config");
9
+ const ENCRYPT_DEPOSIT_SEED = Buffer.from("encrypt_deposit");
10
+ const NETWORK_ENCRYPTION_KEY_SEED = Buffer.from("network_encryption_key");
11
+ const ENCRYPT_EVENT_AUTHORITY_SEED = Buffer.from("__event_authority");
12
+ const DWALLET_COORDINATOR_SEED = Buffer.from("dwallet_coordinator");
13
+ const DWALLET_SEED = Buffer.from("dwallet");
14
+ const MESSAGE_APPROVAL_SEED = Buffer.from("message_approval");
15
+ const ZERO_DIGEST = Buffer.alloc(32);
16
+ const ZERO_PUBKEY = new PublicKey(new Uint8Array(32));
17
+ const ENCRYPT_DEPOSIT_DISC = 14;
18
+ const MESSAGE_APPROVAL_DISC = 14;
19
+ const MESSAGE_APPROVAL_ACCOUNT_LEN_V2 = 304;
20
+ const MESSAGE_APPROVAL_STATUS_OFFSET_V2 = 172;
21
+ const MESSAGE_APPROVAL_STATUS_OFFSET_V1 = 139;
22
+ const DEFAULT_COMPUTE_UNIT_LIMIT = 1_400_000;
23
+ const DEFAULT_HEAP_FRAME_BYTES = 256 * 1024;
24
+ export const ENCRYPT_NETWORK_KEY = Uint8Array.from({ length: 32 }, () => 0x55);
25
+ function asBigInt(value) {
26
+ if (typeof value === "bigint") {
27
+ return value;
28
+ }
29
+ if (typeof value === "number") {
30
+ return BigInt(Math.trunc(value));
31
+ }
32
+ if (typeof value === "string") {
33
+ return BigInt(value);
34
+ }
35
+ if (BN.isBN(value)) {
36
+ return BigInt(value.toString());
37
+ }
38
+ throw new Error(`Unsupported integer value: ${String(value)}`);
39
+ }
40
+ function fixedU16LE(value) {
41
+ const out = Buffer.alloc(2);
42
+ out.writeUInt16LE(value, 0);
43
+ return out;
44
+ }
45
+ function decodeOptionalDigest(value, label) {
46
+ if (!value) {
47
+ return Buffer.from(ZERO_DIGEST);
48
+ }
49
+ if (!/^[0-9a-fA-F]{64}$/.test(value)) {
50
+ throw new Error(`${label} must be a 32-byte hex digest`);
51
+ }
52
+ return Buffer.from(value, "hex");
53
+ }
54
+ function decodePublicKeyHex(value) {
55
+ if (!value) {
56
+ throw new Error("dWallet publicKeyHex is required for metadata-v2 message approval derivation");
57
+ }
58
+ if (!/^[0-9a-fA-F]+$/.test(value) || value.length % 2 !== 0) {
59
+ throw new Error("dWallet publicKeyHex must contain valid hex bytes");
60
+ }
61
+ return Buffer.from(value, "hex");
62
+ }
63
+ function getDwalletRuntimePubkey(value, label) {
64
+ if (!value) {
65
+ throw new Error(`${label} is not configured on this dWallet registration`);
66
+ }
67
+ return value;
68
+ }
69
+ function findDwalletForPending(account, pending) {
70
+ const dwallet = account.dwallets.find((entry) => entry.chain === pending.targetChain);
71
+ if (!dwallet) {
72
+ throw new Error(`No dWallet is registered for pending chain ${chainNameForDigest(pending.targetChain)}`);
73
+ }
74
+ return dwallet;
75
+ }
76
+ function buildPendingMessage(pending, dwallet) {
77
+ return [
78
+ asBigInt(pending.proposalId).toString(),
79
+ pending.proposalDigest,
80
+ chainNameForDigest(pending.targetChain),
81
+ transactionTypeNameForDigest(pending.txType),
82
+ dwallet.address,
83
+ pending.recipientOrContract,
84
+ asBigInt(pending.amountUsd).toString(),
85
+ pending.policyOutputDigest,
86
+ ].join(":");
87
+ }
88
+ function keccakDigest(message) {
89
+ return Buffer.from(keccak_256.arrayBuffer(Buffer.from(message, "utf8")));
90
+ }
91
+ function sha256Hex(data) {
92
+ return createHash("sha256").update(data).digest("hex");
93
+ }
94
+ export function deriveEncryptAccounts(payer, options = {}) {
95
+ const auraProgramId = options.auraProgramId ?? AURA_PROGRAM_ID;
96
+ const encryptProgramId = options.encryptProgramId ?? ENCRYPT_DEVNET_PROGRAM_ID;
97
+ const [config] = PublicKey.findProgramAddressSync([ENCRYPT_CONFIG_SEED], encryptProgramId);
98
+ const [deposit, depositBump] = PublicKey.findProgramAddressSync([ENCRYPT_DEPOSIT_SEED, payer.toBuffer()], encryptProgramId);
99
+ const [networkEncryptionKey] = PublicKey.findProgramAddressSync([NETWORK_ENCRYPTION_KEY_SEED, Buffer.from(ENCRYPT_NETWORK_KEY)], encryptProgramId);
100
+ const [eventAuthority] = deriveEncryptEventAuthorityAddress(encryptProgramId);
101
+ const [cpiAuthority] = deriveEncryptCpiAuthorityAddress(auraProgramId);
102
+ return {
103
+ config,
104
+ deposit,
105
+ depositBump,
106
+ networkEncryptionKey,
107
+ eventAuthority,
108
+ cpiAuthority,
109
+ encryptProgram: encryptProgramId,
110
+ };
111
+ }
112
+ export function deriveDwalletCoordinatorAddress(dwalletProgramId = DWALLET_DEVNET_PROGRAM_ID) {
113
+ return PublicKey.findProgramAddressSync([DWALLET_COORDINATOR_SEED], dwalletProgramId);
114
+ }
115
+ export function resolveScalarGuardrails(account) {
116
+ const guardrails = account.confidentialGuardrails;
117
+ if (!guardrails?.dailyLimitCiphertext ||
118
+ !guardrails.perTxLimitCiphertext ||
119
+ !guardrails.spentTodayCiphertext) {
120
+ throw new Error("Scalar confidential guardrails are not configured on this treasury.");
121
+ }
122
+ return {
123
+ dailyLimitCiphertext: guardrails.dailyLimitCiphertext,
124
+ perTxLimitCiphertext: guardrails.perTxLimitCiphertext,
125
+ spentTodayCiphertext: guardrails.spentTodayCiphertext,
126
+ };
127
+ }
128
+ export function resolveVectorGuardrail(account) {
129
+ const ciphertext = account.confidentialGuardrails?.guardrailVectorCiphertext;
130
+ if (!ciphertext) {
131
+ throw new Error("Vector confidential guardrails are not configured on this treasury.");
132
+ }
133
+ return ciphertext;
134
+ }
135
+ export function resolvePendingProposal(account) {
136
+ if (!account.pending) {
137
+ throw new Error("This treasury has no pending proposal.");
138
+ }
139
+ return account.pending;
140
+ }
141
+ export function resolvePendingPolicyOutput(account) {
142
+ const pending = resolvePendingProposal(account);
143
+ if (!pending.policyOutputCiphertextAccount) {
144
+ throw new Error("The pending proposal does not have a confidential policy output ciphertext.");
145
+ }
146
+ return new PublicKey(pending.policyOutputCiphertextAccount);
147
+ }
148
+ export function resolvePendingRequestAccount(account) {
149
+ const pending = resolvePendingProposal(account);
150
+ const requestAccount = pending.decryptionRequest?.requestAccount;
151
+ if (!requestAccount) {
152
+ throw new Error("The pending proposal does not have an active decryption request.");
153
+ }
154
+ return new PublicKey(requestAccount);
155
+ }
156
+ export function deriveApprovedExecutionAccounts(account, options = {}) {
157
+ const pending = resolvePendingProposal(account);
158
+ if (!pending.decision.approved) {
159
+ throw new Error("The current pending proposal is denied and does not require dWallet signing.");
160
+ }
161
+ const dwalletProgramId = options.dwalletProgramId ?? DWALLET_DEVNET_PROGRAM_ID;
162
+ const auraProgramId = options.auraProgramId ?? AURA_PROGRAM_ID;
163
+ const dwallet = findDwalletForPending(account, pending);
164
+ const dwalletAccount = getDwalletRuntimePubkey(dwallet.dwalletAccount, "dWallet runtime account");
165
+ const messageApproval = pending.signatureRequest?.messageApprovalAccount
166
+ ? new PublicKey(pending.signatureRequest.messageApprovalAccount)
167
+ : deriveMetadataV2MessageApprovalAddress(pending, dwallet, dwalletProgramId)[0];
168
+ const [dwalletCoordinator] = deriveDwalletCoordinatorAddress(dwalletProgramId);
169
+ const [cpiAuthority] = deriveDwalletCpiAuthorityAddress(auraProgramId);
170
+ return {
171
+ pending,
172
+ dwallet,
173
+ messageApproval,
174
+ dwalletAccount,
175
+ dwalletCoordinator,
176
+ cpiAuthority,
177
+ dwalletProgram: dwalletProgramId,
178
+ };
179
+ }
180
+ export function deriveMetadataV2MessageApprovalAddress(pending, dwallet, dwalletProgramId = DWALLET_DEVNET_PROGRAM_ID) {
181
+ const publicKey = decodePublicKeyHex(dwallet.publicKeyHex);
182
+ const payload = Buffer.concat([fixedU16LE(dwallet.curve), publicKey]);
183
+ const schemeSeed = fixedU16LE(dwallet.signatureScheme);
184
+ const messageDigest = keccakDigest(buildPendingMessage(pending, dwallet));
185
+ const metadataDigest = decodeOptionalDigest(dwallet.messageMetadataDigest, "dWallet messageMetadataDigest");
186
+ const seeds = [DWALLET_SEED];
187
+ for (let offset = 0; offset < payload.length; offset += 32) {
188
+ seeds.push(payload.subarray(offset, offset + 32));
189
+ }
190
+ seeds.push(MESSAGE_APPROVAL_SEED, schemeSeed, messageDigest);
191
+ if (!metadataDigest.equals(ZERO_DIGEST)) {
192
+ seeds.push(metadataDigest);
193
+ }
194
+ return PublicKey.findProgramAddressSync(seeds, dwalletProgramId);
195
+ }
196
+ export function buildMessageDigestHex(pending, dwallet) {
197
+ return Buffer.from(keccakDigest(buildPendingMessage(pending, dwallet))).toString("hex");
198
+ }
199
+ export function buildPolicyPlaintextDigestHex(plaintextBytes) {
200
+ return sha256Hex(plaintextBytes);
201
+ }
202
+ export function createEphemeralKeypair() {
203
+ return Keypair.generate();
204
+ }
205
+ export function markInstructionSigner(instruction, pubkey) {
206
+ const entry = instruction.keys.find((key) => key.pubkey.equals(pubkey));
207
+ if (!entry) {
208
+ throw new Error(`Instruction is missing account meta for signer ${pubkey.toBase58()}`);
209
+ }
210
+ entry.isSigner = true;
211
+ }
212
+ export async function sendInstructionsWithBudget(options) {
213
+ const { connection, payer, instructions, extraSigners = [], sendOptions, computeUnitLimit = DEFAULT_COMPUTE_UNIT_LIMIT, heapFrameBytes = DEFAULT_HEAP_FRAME_BYTES, } = options;
214
+ const commitment = sendOptions?.preflightCommitment ?? "confirmed";
215
+ const latest = await connection.getLatestBlockhash(commitment);
216
+ const tx = new Transaction();
217
+ tx.add(ComputeBudgetProgram.requestHeapFrame({ bytes: heapFrameBytes }), ComputeBudgetProgram.setComputeUnitLimit({ units: computeUnitLimit }), ...instructions);
218
+ tx.feePayer = payer.publicKey;
219
+ tx.recentBlockhash = latest.blockhash;
220
+ tx.sign(payer, ...extraSigners);
221
+ const signature = await connection.sendRawTransaction(tx.serialize(), {
222
+ preflightCommitment: commitment,
223
+ ...sendOptions,
224
+ });
225
+ const confirmation = await connection.confirmTransaction({
226
+ signature,
227
+ blockhash: latest.blockhash,
228
+ lastValidBlockHeight: latest.lastValidBlockHeight,
229
+ }, commitment);
230
+ if (confirmation.value.err) {
231
+ throw new Error(`Transaction ${signature} failed confirmation`);
232
+ }
233
+ return signature;
234
+ }
235
+ export async function ensureEncryptDeposit(options) {
236
+ const accounts = deriveEncryptAccounts(options.payer.publicKey, {
237
+ auraProgramId: options.auraProgramId,
238
+ encryptProgramId: options.encryptProgramId,
239
+ });
240
+ const existing = await options.connection.getAccountInfo(accounts.deposit, "confirmed");
241
+ if (existing) {
242
+ return { accounts, created: false };
243
+ }
244
+ const configInfo = await options.connection.getAccountInfo(accounts.config, "confirmed");
245
+ if (!configInfo || configInfo.data.length < 132) {
246
+ throw new Error("Encrypt config account not found or too small for fee-vault lookup.");
247
+ }
248
+ const feeVault = new PublicKey(configInfo.data.subarray(100, 132));
249
+ const vaultIsPayer = feeVault.equals(ZERO_PUBKEY);
250
+ const vaultAccount = vaultIsPayer ? options.payer.publicKey : feeVault;
251
+ const data = Buffer.alloc(18);
252
+ data[0] = ENCRYPT_DEPOSIT_DISC;
253
+ data[1] = accounts.depositBump;
254
+ const instruction = new TransactionInstruction({
255
+ programId: accounts.encryptProgram,
256
+ data,
257
+ keys: [
258
+ { pubkey: accounts.deposit, isSigner: false, isWritable: true },
259
+ { pubkey: accounts.config, isSigner: false, isWritable: false },
260
+ { pubkey: options.payer.publicKey, isSigner: true, isWritable: false },
261
+ { pubkey: options.payer.publicKey, isSigner: true, isWritable: true },
262
+ { pubkey: options.payer.publicKey, isSigner: true, isWritable: true },
263
+ { pubkey: vaultAccount, isSigner: vaultIsPayer, isWritable: true },
264
+ { pubkey: ZERO_PUBKEY, isSigner: false, isWritable: false },
265
+ { pubkey: ZERO_PUBKEY, isSigner: false, isWritable: false },
266
+ ],
267
+ });
268
+ const signature = await sendInstructionsWithBudget({
269
+ connection: options.connection,
270
+ payer: options.payer,
271
+ instructions: [instruction],
272
+ });
273
+ return { accounts, created: true, signature };
274
+ }
275
+ export async function waitForAccountState(connection, pubkey, predicate, options = {}) {
276
+ const timeoutMs = options.timeoutMs ?? 120_000;
277
+ const intervalMs = options.intervalMs ?? 1_000;
278
+ const commitment = options.commitment ?? "confirmed";
279
+ const startedAt = Date.now();
280
+ while (Date.now() - startedAt < timeoutMs) {
281
+ const account = await connection.getAccountInfo(pubkey, commitment);
282
+ if (account && predicate(account)) {
283
+ return account;
284
+ }
285
+ await new Promise((resolve) => setTimeout(resolve, intervalMs));
286
+ }
287
+ throw new Error(`Timed out waiting for ${pubkey.toBase58()}`);
288
+ }
289
+ export async function waitForCiphertextVerified(connection, ciphertext, options) {
290
+ return await waitForAccountState(connection, ciphertext, (account) => account.data.length >= 100 && account.data[99] === 1, options);
291
+ }
292
+ export async function waitForDecryptionReady(connection, requestAccount, options) {
293
+ return await waitForAccountState(connection, requestAccount, (account) => {
294
+ if (account.data.length < 107) {
295
+ return false;
296
+ }
297
+ const total = account.data.readUInt32LE(99);
298
+ const written = account.data.readUInt32LE(103);
299
+ return total > 0 && written === total;
300
+ }, options);
301
+ }
302
+ export async function waitForMessageApproval(connection, messageApproval, targetState = "signed", options) {
303
+ return await waitForAccountState(connection, messageApproval, (account) => {
304
+ const state = parseMessageApprovalState(account.data);
305
+ return state === targetState || (targetState === "pending" && state === "signed");
306
+ }, options);
307
+ }
308
+ export async function getMessageApprovalState(connection, messageApproval, commitment = "confirmed") {
309
+ const account = await connection.getAccountInfo(messageApproval, commitment);
310
+ if (!account) {
311
+ return "missing";
312
+ }
313
+ return parseMessageApprovalState(account.data);
314
+ }
315
+ export function parseMessageApprovalState(data) {
316
+ if (data.length < 2 || data[0] !== MESSAGE_APPROVAL_DISC) {
317
+ return "missing";
318
+ }
319
+ if (data.length >= MESSAGE_APPROVAL_ACCOUNT_LEN_V2) {
320
+ const v2Status = data[MESSAGE_APPROVAL_STATUS_OFFSET_V2];
321
+ return v2Status === 1 ? "signed" : "pending";
322
+ }
323
+ const v1Status = data.length > MESSAGE_APPROVAL_STATUS_OFFSET_V1
324
+ ? data[MESSAGE_APPROVAL_STATUS_OFFSET_V1]
325
+ : undefined;
326
+ if (v1Status !== undefined) {
327
+ return v1Status === 1 ? "signed" : "pending";
328
+ }
329
+ return "pending";
330
+ }
331
+ export function parseDecryptionReady(account) {
332
+ if (!account || account.data.length < 107) {
333
+ return false;
334
+ }
335
+ const total = account.data.readUInt32LE(99);
336
+ const written = account.data.readUInt32LE(103);
337
+ return total > 0 && written === total;
338
+ }
339
+ export function parseCiphertextVerified(account) {
340
+ return !!account && account.data.length >= 100 && account.data[99] === 1;
341
+ }
342
+ export function buildDryRunKeypair(path, load) {
343
+ return path ? load(path) : createEphemeralKeypair();
344
+ }
345
+ export function buildConfirmPolicySummary(account) {
346
+ const pending = resolvePendingProposal(account);
347
+ return {
348
+ approved: pending.decision.approved,
349
+ violation: pending.decision.violation,
350
+ status: pending.status,
351
+ };
352
+ }
353
+ //# sourceMappingURL=protocol.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"protocol.js","sourceRoot":"","sources":["../src/protocol.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEzC,OAAO,EAAE,MAAM,OAAO,CAAC;AACvB,OAAO,EACL,oBAAoB,EACpB,OAAO,EACP,SAAS,EACT,aAAa,EACb,WAAW,EACX,sBAAsB,GAMvB,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EACL,eAAe,EACf,gCAAgC,EAChC,gCAAgC,EAChC,kCAAkC,EAClC,yBAAyB,EACzB,yBAAyB,GAE1B,MAAM,UAAU,CAAC;AAClB,OAAO,EAAE,kBAAkB,EAAE,4BAA4B,EAAE,MAAM,aAAa,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AC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,GAAG,GAAG,EAAE,CAAC;QAC1C,OAAO,KAAK,CAAC;IACf,CAAC;IACD,MAAM,KAAK,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAC5C,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC;IAC/C,OAAO,KAAK,GAAG,CAAC,IAAI,OAAO,KAAK,KAAK,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,uBAAuB,CAAC,OAAiC;IACvE,OAAO,CAAC,CAAC,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;AAC3E,CAAC;AAED,MAAM,UAAU,kBAAkB,CAAC,IAAwB,EAAE,IAA+B;IAC1F,OAAO,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,sBAAsB,EAAE,CAAC;AACtD,CAAC;AAED,MAAM,UAAU,yBAAyB,CAAC,OAA8B;IAKtE,MAAM,OAAO,GAAG,sBAAsB,CAAC,OAAO,CAAC,CAAC;IAChD,OAAO;QACL,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,QAAQ;QACnC,SAAS,EAAE,OAAO,CAAC,QAAQ,CAAC,SAAS;QACrC,MAAM,EAAE,OAAO,CAAC,MAAM;KACvB,CAAC;AACJ,CAAC"}
package/dist/sdk.d.ts ADDED
@@ -0,0 +1,6 @@
1
+ export { Aura } from "@aura-protocol/sdk-ts";
2
+ export { AuraClient } from "@aura-protocol/sdk-ts";
3
+ export { AURA_PROGRAM_ID, DEVNET_RPC_URL, DWALLET_DEVNET_PROGRAM_ID, ENCRYPT_DEVNET_PROGRAM_ID, } from "@aura-protocol/sdk-ts";
4
+ export { deriveDwalletCpiAuthorityAddress, deriveEncryptCpiAuthorityAddress, deriveEncryptEventAuthorityAddress, } from "@aura-protocol/sdk-ts";
5
+ export { validateAddress, validateAgentId, validateAmountUsd, validateDwalletId, validateGuardians, validateMultisigThreshold, validateSwarmMembers, } from "@aura-protocol/sdk-ts";
6
+ export type { ConfigureMultisigArgs, ConfigureSwarmArgs, CreateTreasuryArgs, ProposeConfidentialTransactionArgs, ProposeTransactionArgs, RegisterDwalletArgs, TreasuryAccountRecord, } from "@aura-protocol/sdk-ts";