@loyal-labs/loyal-smart-accounts 0.1.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.
package/README.md ADDED
@@ -0,0 +1,114 @@
1
+ # @loyal-labs/loyal-smart-accounts
2
+
3
+ Universal TypeScript SDK for the Squads Smart Account program, packaged for Loyal's monorepo and applications.
4
+
5
+ This package does not depend on Squads' unpublished npm package. Loyal owns:
6
+
7
+ - a pinned upstream snapshot in `@loyal-labs/loyal-smart-accounts-core`
8
+ - a Loyal-normalized IDL and generated low-level artifacts
9
+ - a vertical-slice SDK with explicit `instructions`, `prepare`, `queries`, and client send flows
10
+ - an optional Loyal env adapter at `@loyal-labs/loyal-smart-accounts-core/loyal`
11
+
12
+ The public SDK exposes:
13
+
14
+ - `generated` for low-level generated accounts, instructions, types, and errors
15
+ - `programConfig`
16
+ - `smartAccounts`
17
+ - `proposals`
18
+ - `transactions`
19
+ - `batches`
20
+ - `policies`
21
+ - `spendingLimits`
22
+ - `execution`
23
+ - `pda`, `codecs`, and `errors` for shared protocol helpers
24
+
25
+ ## Installation
26
+
27
+ ```bash
28
+ bun add @loyal-labs/loyal-smart-accounts @solana/web3.js
29
+ # or
30
+ npm install @loyal-labs/loyal-smart-accounts @solana/web3.js
31
+ ```
32
+
33
+ ## Quick Start
34
+
35
+ ```ts
36
+ import {
37
+ createLoyalSmartAccountsClient,
38
+ smartAccounts,
39
+ pda,
40
+ codecs,
41
+ } from "@loyal-labs/loyal-smart-accounts";
42
+ import { Connection, Keypair } from "@solana/web3.js";
43
+
44
+ const connection = new Connection("https://api.devnet.solana.com");
45
+ const creator = Keypair.generate();
46
+
47
+ const [settingsPda] = pda.getSettingsPda({
48
+ accountIndex: 1n,
49
+ });
50
+
51
+ const instruction = smartAccounts.instructions.create({
52
+ treasury: creator.publicKey,
53
+ creator: creator.publicKey,
54
+ settings: settingsPda,
55
+ settingsAuthority: null,
56
+ threshold: 1,
57
+ signers: [
58
+ {
59
+ key: creator.publicKey,
60
+ permissions: codecs.Permissions.all(),
61
+ },
62
+ ],
63
+ timeLock: 0,
64
+ rentCollector: null,
65
+ });
66
+
67
+ const prepared = await smartAccounts.prepare.create({
68
+ treasury: creator.publicKey,
69
+ creator: creator.publicKey,
70
+ settings: settingsPda,
71
+ settingsAuthority: null,
72
+ threshold: 1,
73
+ signers: [
74
+ {
75
+ key: creator.publicKey,
76
+ permissions: codecs.Permissions.all(),
77
+ },
78
+ ],
79
+ timeLock: 0,
80
+ rentCollector: null,
81
+ });
82
+
83
+ const client = createLoyalSmartAccountsClient({ connection });
84
+
85
+ await client.send(prepared, {
86
+ signers: [creator],
87
+ });
88
+
89
+ await client.smartAccounts.create({
90
+ treasury: creator.publicKey,
91
+ creator,
92
+ settings: settingsPda,
93
+ settingsAuthority: null,
94
+ threshold: 1,
95
+ signers: [
96
+ {
97
+ key: creator.publicKey,
98
+ permissions: codecs.Permissions.all(),
99
+ },
100
+ ],
101
+ timeLock: 0,
102
+ rentCollector: null,
103
+ });
104
+ ```
105
+
106
+ ## Upstream Sync
107
+
108
+ To refresh the pinned upstream snapshot and synced generated artifacts:
109
+
110
+ ```bash
111
+ bun run loyal-smart-accounts:update
112
+ ```
113
+
114
+ The update script stores the fetched upstream commit and IDL snapshots in the core package, validates registry coverage, and refreshes committed generated artifacts.
@@ -0,0 +1 @@
1
+ export * from "./src/index.js";
package/dist/index.js ADDED
@@ -0,0 +1 @@
1
+ export * from "./src/index.js";
@@ -0,0 +1,39 @@
1
+ import type { Signer } from "@solana/web3.js";
2
+ import { type LoyalSmartAccountsConfirmBehavior, type LoyalSmartAccountsClientConfig, type LoyalSmartAccountsSendOptions, type PreparedLoyalSmartAccountsOperation } from "@loyal-labs/loyal-smart-accounts-core";
3
+ import { createProgramConfigClient, programConfig } from "./features/program-config/index.js";
4
+ import { createSmartAccountsClient, smartAccounts } from "./features/smart-accounts/index.js";
5
+ import { createProposalsClient, proposals } from "./features/proposals/index.js";
6
+ import { createTransactionsClient, transactions } from "./features/transactions/index.js";
7
+ import { batches, createBatchesClient } from "./features/batches/index.js";
8
+ import { policies, createPoliciesClient } from "./features/policies/index.js";
9
+ import { createSpendingLimitsClient, spendingLimits } from "./features/spending-limits/index.js";
10
+ import { createExecutionClient, execution } from "./features/execution/index.js";
11
+ export type { LoyalSmartAccountsConfirmBehavior, LoyalSmartAccountsClientConfig, LoyalSmartAccountsSendOptions, PreparedLoyalSmartAccountsOperation, } from "@loyal-labs/loyal-smart-accounts-core";
12
+ export type LoyalSmartAccountsClient = {
13
+ connection: LoyalSmartAccountsClientConfig["connection"];
14
+ programId: Exclude<LoyalSmartAccountsClientConfig["programId"], undefined>;
15
+ send: (prepared: PreparedLoyalSmartAccountsOperation<string>, args: {
16
+ signers: Signer[];
17
+ sendOptions?: LoyalSmartAccountsSendOptions;
18
+ confirm?: LoyalSmartAccountsConfirmBehavior;
19
+ }) => Promise<string>;
20
+ programConfig: ReturnType<typeof createProgramConfigClient>;
21
+ smartAccounts: ReturnType<typeof createSmartAccountsClient>;
22
+ proposals: ReturnType<typeof createProposalsClient>;
23
+ transactions: ReturnType<typeof createTransactionsClient>;
24
+ batches: ReturnType<typeof createBatchesClient>;
25
+ policies: ReturnType<typeof createPoliciesClient>;
26
+ spendingLimits: ReturnType<typeof createSpendingLimitsClient>;
27
+ execution: ReturnType<typeof createExecutionClient>;
28
+ features: {
29
+ programConfig: typeof programConfig;
30
+ smartAccounts: typeof smartAccounts;
31
+ proposals: typeof proposals;
32
+ transactions: typeof transactions;
33
+ batches: typeof batches;
34
+ policies: typeof policies;
35
+ spendingLimits: typeof spendingLimits;
36
+ execution: typeof execution;
37
+ };
38
+ };
39
+ export declare function createLoyalSmartAccountsClient(config: LoyalSmartAccountsClientConfig): LoyalSmartAccountsClient;
@@ -0,0 +1,43 @@
1
+ import { createTransport, sendPreparedOperation, } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import { createProgramConfigClient, programConfig, } from "./features/program-config/index.js";
3
+ import { createSmartAccountsClient, smartAccounts, } from "./features/smart-accounts/index.js";
4
+ import { createProposalsClient, proposals, } from "./features/proposals/index.js";
5
+ import { createTransactionsClient, transactions, } from "./features/transactions/index.js";
6
+ import { batches, createBatchesClient } from "./features/batches/index.js";
7
+ import { policies, createPoliciesClient } from "./features/policies/index.js";
8
+ import { createSpendingLimitsClient, spendingLimits, } from "./features/spending-limits/index.js";
9
+ import { createExecutionClient, execution, } from "./features/execution/index.js";
10
+ export function createLoyalSmartAccountsClient(config) {
11
+ const transport = createTransport(config);
12
+ return {
13
+ connection: transport.connection,
14
+ programId: transport.programId,
15
+ send(prepared, args) {
16
+ return sendPreparedOperation({
17
+ transport,
18
+ prepared,
19
+ signers: [...args.signers],
20
+ sendOptions: args.sendOptions,
21
+ confirm: args.confirm,
22
+ });
23
+ },
24
+ programConfig: createProgramConfigClient(transport),
25
+ smartAccounts: createSmartAccountsClient(transport),
26
+ proposals: createProposalsClient(transport),
27
+ transactions: createTransactionsClient(transport),
28
+ batches: createBatchesClient(transport),
29
+ policies: createPoliciesClient(transport),
30
+ spendingLimits: createSpendingLimitsClient(transport),
31
+ execution: createExecutionClient(transport),
32
+ features: {
33
+ programConfig,
34
+ smartAccounts,
35
+ proposals,
36
+ transactions,
37
+ batches,
38
+ policies,
39
+ spendingLimits,
40
+ execution,
41
+ },
42
+ };
43
+ }
@@ -0,0 +1,52 @@
1
+ import type { Commitment, Connection, GetAccountInfoConfig, PublicKey } from "@solana/web3.js";
2
+ import type { LoyalSmartAccountsTransport } from "@loyal-labs/loyal-smart-accounts-core";
3
+ import type { LoyalSmartAccountsFeatureName, RuntimeOperationsForFeature } from "./operation-registry.js";
4
+ type QueryFunction = (connection: Connection, ...args: any[]) => Promise<unknown>;
5
+ type QueryFactories = Record<string, QueryFunction>;
6
+ type Simplify<T> = {
7
+ [K in keyof T]: T[K];
8
+ } & {};
9
+ type InstructionsApi<Operations> = {
10
+ [K in keyof Operations as Operations[K] extends {
11
+ instruction: (...args: never[]) => unknown;
12
+ } ? K : never]: Operations[K] extends {
13
+ instruction: infer T;
14
+ } ? T : never;
15
+ };
16
+ type PrepareApi<Operations> = {
17
+ [K in keyof Operations]: Operations[K] extends {
18
+ prepare: infer T;
19
+ } ? T : never;
20
+ };
21
+ type BoundPrepareApi<Operations> = {
22
+ [K in keyof Operations]: Operations[K] extends {
23
+ boundPrepare: infer T;
24
+ } ? T : never;
25
+ };
26
+ type ClientMethodApi<Operations> = {
27
+ [K in keyof Operations]: Operations[K] extends {
28
+ client: infer T;
29
+ } ? T : never;
30
+ };
31
+ type FeatureModule<Operations extends Record<string, unknown>, Accounts extends Record<string, unknown>, Queries extends QueryFactories> = {
32
+ accounts: Accounts;
33
+ instructions: InstructionsApi<Operations>;
34
+ prepare: PrepareApi<Operations>;
35
+ queries: Queries;
36
+ client: (transport: LoyalSmartAccountsTransport) => Simplify<ClientMethodApi<Operations> & {
37
+ prepare: BoundPrepareApi<Operations>;
38
+ queries: {
39
+ [K in keyof Queries]: Queries[K] extends (connection: Connection, ...args: infer Rest) => infer Result ? (...args: Rest) => Result : never;
40
+ };
41
+ }>;
42
+ };
43
+ export declare function createAccountFetcher<T>(accountClass: {
44
+ fromAccountAddress(connection: Connection, address: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<T>;
45
+ }): (connection: Connection, address: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig) => Promise<T>;
46
+ export declare function createFeatureModule<Feature extends LoyalSmartAccountsFeatureName, Operations extends RuntimeOperationsForFeature<Feature>, Accounts extends Record<string, unknown>, Queries extends QueryFactories>(args: {
47
+ feature: Feature;
48
+ accounts: Accounts;
49
+ operations: Operations;
50
+ queries: Queries;
51
+ }): FeatureModule<Operations, Accounts, Queries>;
52
+ export type { FeatureModule };
@@ -0,0 +1,33 @@
1
+ export function createAccountFetcher(accountClass) {
2
+ return (connection, address, commitmentOrConfig) => accountClass.fromAccountAddress(connection, address, commitmentOrConfig);
3
+ }
4
+ function bindQueries(queries, connection) {
5
+ return Object.fromEntries(Object.entries(queries).map(([name, query]) => [
6
+ name,
7
+ (...args) => query(connection, ...args),
8
+ ]));
9
+ }
10
+ export function createFeatureModule(args) {
11
+ const operationEntries = Object.entries(args.operations);
12
+ const instructions = Object.fromEntries(operationEntries
13
+ .filter(([, operation]) => typeof operation.instruction === "function")
14
+ .map(([name, operation]) => [name, operation.instruction]));
15
+ const prepare = Object.fromEntries(operationEntries.map(([name, operation]) => [name, operation.prepare]));
16
+ return {
17
+ accounts: args.accounts,
18
+ instructions,
19
+ prepare,
20
+ queries: args.queries,
21
+ client: (transport) => ({
22
+ ...Object.fromEntries(operationEntries.map(([name, operation]) => [
23
+ name,
24
+ (clientArgs) => operation.client(transport, clientArgs),
25
+ ])),
26
+ prepare: Object.fromEntries(operationEntries.map(([name, operation]) => [
27
+ name,
28
+ (prepareArgs) => operation.boundPrepare(transport, prepareArgs),
29
+ ])),
30
+ queries: bindQueries(args.queries, transport.connection),
31
+ }),
32
+ };
33
+ }
@@ -0,0 +1,10 @@
1
+ import { Batch, BatchTransaction } from "@loyal-labs/loyal-smart-accounts-core";
2
+ export declare const batches: import("../../feature-factory.js").FeatureModule<import("../../operation-registry.js").RuntimeOperationsForFeature<"batches">, {
3
+ Batch: typeof Batch;
4
+ BatchTransaction: typeof BatchTransaction;
5
+ }, {
6
+ fetchBatch: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<Batch>;
7
+ fetchBatchTransaction: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<BatchTransaction>;
8
+ }>;
9
+ export type BatchesFeature = typeof batches;
10
+ export declare const createBatchesClient: BatchesFeature["client"];
@@ -0,0 +1,16 @@
1
+ import { Batch, BatchTransaction } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import { createAccountFetcher, createFeatureModule } from "../../feature-factory.js";
3
+ import { getRuntimeOperationsForFeature } from "../../operation-registry.js";
4
+ export const batches = createFeatureModule({
5
+ feature: "batches",
6
+ accounts: {
7
+ Batch,
8
+ BatchTransaction,
9
+ },
10
+ operations: getRuntimeOperationsForFeature("batches"),
11
+ queries: {
12
+ fetchBatch: createAccountFetcher(Batch),
13
+ fetchBatchTransaction: createAccountFetcher(BatchTransaction),
14
+ },
15
+ });
16
+ export const createBatchesClient = batches.client;
@@ -0,0 +1,16 @@
1
+ import { Batch, BatchTransaction, Policy, SettingsTransaction, Transaction } from "@loyal-labs/loyal-smart-accounts-core";
2
+ export declare const execution: import("../../feature-factory.js").FeatureModule<import("../../operation-registry.js").RuntimeOperationsForFeature<"execution">, {
3
+ Batch: typeof Batch;
4
+ BatchTransaction: typeof BatchTransaction;
5
+ Policy: typeof Policy;
6
+ SettingsTransaction: typeof SettingsTransaction;
7
+ Transaction: typeof Transaction;
8
+ }, {
9
+ fetchBatch: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<Batch>;
10
+ fetchBatchTransaction: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<BatchTransaction>;
11
+ fetchPolicy: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<Policy>;
12
+ fetchSettingsTransaction: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<SettingsTransaction>;
13
+ fetchTransaction: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<Transaction>;
14
+ }>;
15
+ export type ExecutionFeature = typeof execution;
16
+ export declare const createExecutionClient: ExecutionFeature["client"];
@@ -0,0 +1,22 @@
1
+ import { Batch, BatchTransaction, Policy, SettingsTransaction, Transaction, } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import { createAccountFetcher, createFeatureModule } from "../../feature-factory.js";
3
+ import { getRuntimeOperationsForFeature } from "../../operation-registry.js";
4
+ export const execution = createFeatureModule({
5
+ feature: "execution",
6
+ accounts: {
7
+ Batch,
8
+ BatchTransaction,
9
+ Policy,
10
+ SettingsTransaction,
11
+ Transaction,
12
+ },
13
+ operations: getRuntimeOperationsForFeature("execution"),
14
+ queries: {
15
+ fetchBatch: createAccountFetcher(Batch),
16
+ fetchBatchTransaction: createAccountFetcher(BatchTransaction),
17
+ fetchPolicy: createAccountFetcher(Policy),
18
+ fetchSettingsTransaction: createAccountFetcher(SettingsTransaction),
19
+ fetchTransaction: createAccountFetcher(Transaction),
20
+ },
21
+ });
22
+ export const createExecutionClient = execution.client;
@@ -0,0 +1,8 @@
1
+ import { Policy } from "@loyal-labs/loyal-smart-accounts-core";
2
+ export declare const policies: import("../../feature-factory.js").FeatureModule<import("../../operation-registry.js").RuntimeOperationsForFeature<"policies">, {
3
+ Policy: typeof Policy;
4
+ }, {
5
+ fetchPolicy: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<Policy>;
6
+ }>;
7
+ export type PoliciesFeature = typeof policies;
8
+ export declare const createPoliciesClient: PoliciesFeature["client"];
@@ -0,0 +1,14 @@
1
+ import { Policy } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import { createAccountFetcher, createFeatureModule } from "../../feature-factory.js";
3
+ import { getRuntimeOperationsForFeature } from "../../operation-registry.js";
4
+ export const policies = createFeatureModule({
5
+ feature: "policies",
6
+ accounts: {
7
+ Policy,
8
+ },
9
+ operations: getRuntimeOperationsForFeature("policies"),
10
+ queries: {
11
+ fetchPolicy: createAccountFetcher(Policy),
12
+ },
13
+ });
14
+ export const createPoliciesClient = policies.client;
@@ -0,0 +1,8 @@
1
+ import { ProgramConfig } from "@loyal-labs/loyal-smart-accounts-core";
2
+ export declare const programConfig: import("../../feature-factory.js").FeatureModule<import("../../operation-registry.js").RuntimeOperationsForFeature<"programConfig">, {
3
+ ProgramConfig: typeof ProgramConfig;
4
+ }, {
5
+ fetchProgramConfig: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<ProgramConfig>;
6
+ }>;
7
+ export type ProgramConfigFeature = typeof programConfig;
8
+ export declare const createProgramConfigClient: ProgramConfigFeature["client"];
@@ -0,0 +1,14 @@
1
+ import { ProgramConfig } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import { createAccountFetcher, createFeatureModule } from "../../feature-factory.js";
3
+ import { getRuntimeOperationsForFeature } from "../../operation-registry.js";
4
+ export const programConfig = createFeatureModule({
5
+ feature: "programConfig",
6
+ accounts: {
7
+ ProgramConfig,
8
+ },
9
+ operations: getRuntimeOperationsForFeature("programConfig"),
10
+ queries: {
11
+ fetchProgramConfig: createAccountFetcher(ProgramConfig),
12
+ },
13
+ });
14
+ export const createProgramConfigClient = programConfig.client;
@@ -0,0 +1,8 @@
1
+ import { Proposal } from "@loyal-labs/loyal-smart-accounts-core";
2
+ export declare const proposals: import("../../feature-factory.js").FeatureModule<import("../../operation-registry.js").RuntimeOperationsForFeature<"proposals">, {
3
+ Proposal: typeof Proposal;
4
+ }, {
5
+ fetchProposal: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<Proposal>;
6
+ }>;
7
+ export type ProposalsFeature = typeof proposals;
8
+ export declare const createProposalsClient: ProposalsFeature["client"];
@@ -0,0 +1,14 @@
1
+ import { Proposal } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import { createAccountFetcher, createFeatureModule } from "../../feature-factory.js";
3
+ import { getRuntimeOperationsForFeature } from "../../operation-registry.js";
4
+ export const proposals = createFeatureModule({
5
+ feature: "proposals",
6
+ accounts: {
7
+ Proposal,
8
+ },
9
+ operations: getRuntimeOperationsForFeature("proposals"),
10
+ queries: {
11
+ fetchProposal: createAccountFetcher(Proposal),
12
+ },
13
+ });
14
+ export const createProposalsClient = proposals.client;
@@ -0,0 +1,10 @@
1
+ import { Settings, SettingsTransaction } from "@loyal-labs/loyal-smart-accounts-core";
2
+ export declare const smartAccounts: import("../../feature-factory.js").FeatureModule<import("../../operation-registry.js").RuntimeOperationsForFeature<"smartAccounts">, {
3
+ Settings: typeof Settings;
4
+ SettingsTransaction: typeof SettingsTransaction;
5
+ }, {
6
+ fetchSettings: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<Settings>;
7
+ fetchSettingsTransaction: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<SettingsTransaction>;
8
+ }>;
9
+ export type SmartAccountsFeature = typeof smartAccounts;
10
+ export declare const createSmartAccountsClient: SmartAccountsFeature["client"];
@@ -0,0 +1,16 @@
1
+ import { Settings, SettingsTransaction, } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import { createAccountFetcher, createFeatureModule } from "../../feature-factory.js";
3
+ import { getRuntimeOperationsForFeature } from "../../operation-registry.js";
4
+ export const smartAccounts = createFeatureModule({
5
+ feature: "smartAccounts",
6
+ accounts: {
7
+ Settings,
8
+ SettingsTransaction,
9
+ },
10
+ operations: getRuntimeOperationsForFeature("smartAccounts"),
11
+ queries: {
12
+ fetchSettings: createAccountFetcher(Settings),
13
+ fetchSettingsTransaction: createAccountFetcher(SettingsTransaction),
14
+ },
15
+ });
16
+ export const createSmartAccountsClient = smartAccounts.client;
@@ -0,0 +1,8 @@
1
+ import { SpendingLimit } from "@loyal-labs/loyal-smart-accounts-core";
2
+ export declare const spendingLimits: import("../../feature-factory.js").FeatureModule<import("../../operation-registry.js").RuntimeOperationsForFeature<"spendingLimits">, {
3
+ SpendingLimit: typeof SpendingLimit;
4
+ }, {
5
+ fetchSpendingLimit: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<SpendingLimit>;
6
+ }>;
7
+ export type SpendingLimitsFeature = typeof spendingLimits;
8
+ export declare const createSpendingLimitsClient: SpendingLimitsFeature["client"];
@@ -0,0 +1,14 @@
1
+ import { SpendingLimit } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import { createAccountFetcher, createFeatureModule } from "../../feature-factory.js";
3
+ import { getRuntimeOperationsForFeature } from "../../operation-registry.js";
4
+ export const spendingLimits = createFeatureModule({
5
+ feature: "spendingLimits",
6
+ accounts: {
7
+ SpendingLimit,
8
+ },
9
+ operations: getRuntimeOperationsForFeature("spendingLimits"),
10
+ queries: {
11
+ fetchSpendingLimit: createAccountFetcher(SpendingLimit),
12
+ },
13
+ });
14
+ export const createSpendingLimitsClient = spendingLimits.client;
@@ -0,0 +1,12 @@
1
+ import { LegacyTransaction, Transaction, TransactionBuffer } from "@loyal-labs/loyal-smart-accounts-core";
2
+ export declare const transactions: import("../../feature-factory.js").FeatureModule<import("../../operation-registry.js").RuntimeOperationsForFeature<"transactions">, {
3
+ LegacyTransaction: typeof LegacyTransaction;
4
+ Transaction: typeof Transaction;
5
+ TransactionBuffer: typeof TransactionBuffer;
6
+ }, {
7
+ fetchLegacyTransaction: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<LegacyTransaction>;
8
+ fetchTransaction: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<Transaction>;
9
+ fetchTransactionBuffer: (connection: import("@solana/web3.js").Connection, address: import("@solana/web3.js").PublicKey, commitmentOrConfig?: import("@solana/web3.js").Commitment | import("@solana/web3.js").GetAccountInfoConfig) => Promise<TransactionBuffer>;
10
+ }>;
11
+ export type TransactionsFeature = typeof transactions;
12
+ export declare const createTransactionsClient: TransactionsFeature["client"];
@@ -0,0 +1,18 @@
1
+ import { LegacyTransaction, Transaction, TransactionBuffer, } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import { createAccountFetcher, createFeatureModule } from "../../feature-factory.js";
3
+ import { getRuntimeOperationsForFeature } from "../../operation-registry.js";
4
+ export const transactions = createFeatureModule({
5
+ feature: "transactions",
6
+ accounts: {
7
+ LegacyTransaction,
8
+ Transaction,
9
+ TransactionBuffer,
10
+ },
11
+ operations: getRuntimeOperationsForFeature("transactions"),
12
+ queries: {
13
+ fetchLegacyTransaction: createAccountFetcher(LegacyTransaction),
14
+ fetchTransaction: createAccountFetcher(Transaction),
15
+ fetchTransactionBuffer: createAccountFetcher(TransactionBuffer),
16
+ },
17
+ });
18
+ export const createTransactionsClient = transactions.client;
@@ -0,0 +1,10 @@
1
+ export { generated, PROGRAM_ID, PROGRAM_ADDRESS, spec, pda, codecs, errors, accounts, } from "@loyal-labs/loyal-smart-accounts-core";
2
+ export * from "./client.js";
3
+ export { programConfig } from "./features/program-config/index.js";
4
+ export { smartAccounts } from "./features/smart-accounts/index.js";
5
+ export { proposals } from "./features/proposals/index.js";
6
+ export { transactions } from "./features/transactions/index.js";
7
+ export { batches } from "./features/batches/index.js";
8
+ export { policies } from "./features/policies/index.js";
9
+ export { spendingLimits } from "./features/spending-limits/index.js";
10
+ export { execution } from "./features/execution/index.js";
@@ -0,0 +1,10 @@
1
+ export { generated, PROGRAM_ID, PROGRAM_ADDRESS, spec, pda, codecs, errors, accounts, } from "@loyal-labs/loyal-smart-accounts-core";
2
+ export * from "./client.js";
3
+ export { programConfig } from "./features/program-config/index.js";
4
+ export { smartAccounts } from "./features/smart-accounts/index.js";
5
+ export { proposals } from "./features/proposals/index.js";
6
+ export { transactions } from "./features/transactions/index.js";
7
+ export { batches } from "./features/batches/index.js";
8
+ export { policies } from "./features/policies/index.js";
9
+ export { spendingLimits } from "./features/spending-limits/index.js";
10
+ export { execution } from "./features/execution/index.js";
@@ -0,0 +1,85 @@
1
+ import { OPERATION_REGISTRY as CORE_OPERATION_REGISTRY, type LoyalSmartAccountsConfirmBehavior, type LoyalSmartAccountsFeature, type LoyalSmartAccountsSendOptions, type LoyalSmartAccountsTransport, type LoyalSmartAccountsOperationMetadata, type PreparedLoyalSmartAccountsOperation } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import * as internal from "@loyal-labs/loyal-smart-accounts-core/internal";
3
+ import type { PublicKey, Signer, TransactionInstruction } from "@solana/web3.js";
4
+ export declare const OPERATION_BUILDERS: {
5
+ readonly initializeProgramConfig: typeof internal.initializeProgramConfig;
6
+ readonly setProgramConfigAuthority: typeof internal.setProgramConfigAuthority;
7
+ readonly setProgramConfigSmartAccountCreationFee: typeof internal.setProgramConfigSmartAccountCreationFee;
8
+ readonly setProgramConfigTreasury: typeof internal.setProgramConfigTreasury;
9
+ readonly createSmartAccount: typeof internal.createSmartAccount;
10
+ readonly addSignerAsAuthority: typeof internal.addSignerAsAuthority;
11
+ readonly removeSignerAsAuthority: typeof internal.removeSignerAsAuthority;
12
+ readonly setTimeLockAsAuthority: typeof internal.setTimeLockAsAuthority;
13
+ readonly changeThresholdAsAuthority: typeof internal.changeThresholdAsAuthority;
14
+ readonly setNewSettingsAuthorityAsAuthority: typeof internal.setNewSettingsAuthorityAsAuthority;
15
+ readonly setArchivalAuthorityAsAuthority: typeof internal.setArchivalAuthorityAsAuthority;
16
+ readonly createSettingsTransaction: typeof internal.createSettingsTransaction;
17
+ readonly closeSettingsTransaction: typeof internal.closeSettingsTransaction;
18
+ readonly createProposal: typeof internal.createProposal;
19
+ readonly activateProposal: typeof internal.activateProposal;
20
+ readonly approveProposal: typeof internal.approveProposal;
21
+ readonly rejectProposal: typeof internal.rejectProposal;
22
+ readonly cancelProposal: typeof internal.cancelProposal;
23
+ readonly createTransaction: typeof internal.createTransaction;
24
+ readonly createTransactionBuffer: typeof internal.createTransactionBuffer;
25
+ readonly closeTransactionBuffer: typeof internal.closeTransactionBuffer;
26
+ readonly extendTransactionBuffer: typeof internal.extendTransactionBuffer;
27
+ readonly createTransactionFromBuffer: typeof internal.createTransactionFromBuffer;
28
+ readonly closeTransaction: typeof internal.closeTransaction;
29
+ readonly logEvent: typeof internal.logEvent;
30
+ readonly createBatch: typeof internal.createBatch;
31
+ readonly addTransactionToBatch: typeof internal.addTransactionToBatch;
32
+ readonly closeBatchTransaction: typeof internal.closeBatchTransaction;
33
+ readonly closeBatch: typeof internal.closeBatch;
34
+ readonly createPolicyTransaction: typeof internal.createPolicyTransaction;
35
+ readonly closeEmptyPolicyTransaction: typeof internal.closeEmptyPolicyTransaction;
36
+ readonly addSpendingLimitAsAuthority: typeof internal.addSpendingLimitAsAuthority;
37
+ readonly removeSpendingLimitAsAuthority: typeof internal.removeSpendingLimitAsAuthority;
38
+ readonly useSpendingLimit: typeof internal.useSpendingLimit;
39
+ readonly executeSettingsTransaction: typeof internal.executeSettingsTransaction;
40
+ readonly executeTransaction: typeof internal.executeTransaction;
41
+ readonly executeBatchTransaction: typeof internal.executeBatchTransaction;
42
+ readonly executeTransactionSync: typeof internal.executeTransactionSync;
43
+ readonly executeTransactionSyncV2: typeof internal.executeTransactionSyncV2;
44
+ readonly executeSettingsTransactionSync: typeof internal.executeSettingsTransactionSync;
45
+ readonly executePolicyTransaction: typeof internal.executePolicyTransaction;
46
+ readonly executePolicyPayloadSync: typeof internal.executePolicyPayloadSync;
47
+ };
48
+ type Simplify<T> = {
49
+ [K in keyof T]: T[K];
50
+ } & {};
51
+ type OperationName = keyof typeof CORE_OPERATION_REGISTRY;
52
+ type MetadataFor<K extends OperationName> = LoyalSmartAccountsOperationMetadata & (typeof CORE_OPERATION_REGISTRY)[K];
53
+ type BuilderArgs<K extends OperationName> = Parameters<(typeof OPERATION_BUILDERS)[K]>[0];
54
+ type ExportNameFor<K extends OperationName> = MetadataFor<K>["exportName"];
55
+ type FeatureName = LoyalSmartAccountsFeature;
56
+ type OperationNameForFeature<F extends FeatureName> = {
57
+ [K in OperationName]: MetadataFor<K>["feature"] extends F ? K : never;
58
+ }[OperationName];
59
+ type BoundPrepareArgs<K extends OperationName> = MetadataFor<K>["requiresConnection"] extends true ? Omit<BuilderArgs<K>, "connection"> : BuilderArgs<K>;
60
+ type SignerAware<T> = T extends PublicKey ? PublicKey | Signer : T extends readonly (infer U)[] ? Array<SignerAware<U>> : T extends (infer U)[] ? Array<SignerAware<U>> : T;
61
+ type ClientArgsFor<K extends OperationName> = Simplify<{
62
+ [P in keyof Omit<BuilderArgs<K>, "connection">]: P extends MetadataFor<K>["signerRoles"][number] ? SignerAware<Omit<BuilderArgs<K>, "connection">[P]> : Omit<BuilderArgs<K>, "connection">[P];
63
+ } & {
64
+ additionalSigners?: Signer[];
65
+ sendOptions?: LoyalSmartAccountsSendOptions;
66
+ confirm?: LoyalSmartAccountsConfirmBehavior;
67
+ }>;
68
+ type RuntimeOperationDefinition<K extends OperationName = OperationName> = {
69
+ readonly name: K;
70
+ readonly metadata: MetadataFor<K>;
71
+ readonly instruction?: MetadataFor<K>["phase"] extends "offline" ? MetadataFor<K>["exposeInstruction"] extends false ? never : (args: BuilderArgs<K>) => TransactionInstruction : never;
72
+ readonly prepare: (args: BuilderArgs<K>) => Promise<PreparedLoyalSmartAccountsOperation<ExportNameFor<K>>>;
73
+ readonly boundPrepare: (transport: LoyalSmartAccountsTransport, args: BoundPrepareArgs<K>) => Promise<PreparedLoyalSmartAccountsOperation<ExportNameFor<K>>>;
74
+ readonly client: (transport: LoyalSmartAccountsTransport, args: ClientArgsFor<K>) => Promise<string>;
75
+ };
76
+ type RuntimeOperationsForFeature<F extends FeatureName> = {
77
+ [K in OperationNameForFeature<F> as ExportNameFor<K>]: RuntimeOperationDefinition<K>;
78
+ };
79
+ export declare function findRuntimeBindingIssues(): {
80
+ missingBuilders: ("initializeProgramConfig" | "setProgramConfigAuthority" | "setProgramConfigSmartAccountCreationFee" | "setProgramConfigTreasury" | "createSmartAccount" | "addSignerAsAuthority" | "removeSignerAsAuthority" | "setTimeLockAsAuthority" | "changeThresholdAsAuthority" | "setNewSettingsAuthorityAsAuthority" | "setArchivalAuthorityAsAuthority" | "createSettingsTransaction" | "closeSettingsTransaction" | "createProposal" | "activateProposal" | "approveProposal" | "rejectProposal" | "cancelProposal" | "createTransaction" | "createTransactionBuffer" | "closeTransactionBuffer" | "extendTransactionBuffer" | "createTransactionFromBuffer" | "closeTransaction" | "logEvent" | "createBatch" | "addTransactionToBatch" | "closeBatchTransaction" | "closeBatch" | "createPolicyTransaction" | "closeEmptyPolicyTransaction" | "addSpendingLimitAsAuthority" | "removeSpendingLimitAsAuthority" | "useSpendingLimit" | "executeSettingsTransaction" | "executeTransaction" | "executeBatchTransaction" | "executeTransactionSync" | "executeTransactionSyncV2" | "executeSettingsTransactionSync" | "executePolicyTransaction" | "executePolicyPayloadSync")[];
81
+ extraBuilders: string[];
82
+ };
83
+ export declare function assertRuntimeBindingCoverage(): void;
84
+ export declare function getRuntimeOperationsForFeature<F extends FeatureName>(feature: F): RuntimeOperationsForFeature<F>;
85
+ export type { BoundPrepareArgs, ClientArgsFor, FeatureName as LoyalSmartAccountsFeatureName, RuntimeOperationDefinition, RuntimeOperationsForFeature, };
@@ -0,0 +1,209 @@
1
+ import { InvalidRoleResolutionError, MissingOperationConnectionError, MissingRequiredSignerError, OPERATION_NAMES, OPERATION_REGISTRY as CORE_OPERATION_REGISTRY, OperationRegistryCoverageError, PROGRAM_ID, freezePreparedOperation, getOperationsForFeature, } from "@loyal-labs/loyal-smart-accounts-core";
2
+ import * as internal from "@loyal-labs/loyal-smart-accounts-core/internal";
3
+ import { sendPreparedOperation } from "@loyal-labs/loyal-smart-accounts-core";
4
+ export const OPERATION_BUILDERS = {
5
+ initializeProgramConfig: internal.initializeProgramConfig,
6
+ setProgramConfigAuthority: internal.setProgramConfigAuthority,
7
+ setProgramConfigSmartAccountCreationFee: internal.setProgramConfigSmartAccountCreationFee,
8
+ setProgramConfigTreasury: internal.setProgramConfigTreasury,
9
+ createSmartAccount: internal.createSmartAccount,
10
+ addSignerAsAuthority: internal.addSignerAsAuthority,
11
+ removeSignerAsAuthority: internal.removeSignerAsAuthority,
12
+ setTimeLockAsAuthority: internal.setTimeLockAsAuthority,
13
+ changeThresholdAsAuthority: internal.changeThresholdAsAuthority,
14
+ setNewSettingsAuthorityAsAuthority: internal.setNewSettingsAuthorityAsAuthority,
15
+ setArchivalAuthorityAsAuthority: internal.setArchivalAuthorityAsAuthority,
16
+ createSettingsTransaction: internal.createSettingsTransaction,
17
+ closeSettingsTransaction: internal.closeSettingsTransaction,
18
+ createProposal: internal.createProposal,
19
+ activateProposal: internal.activateProposal,
20
+ approveProposal: internal.approveProposal,
21
+ rejectProposal: internal.rejectProposal,
22
+ cancelProposal: internal.cancelProposal,
23
+ createTransaction: internal.createTransaction,
24
+ createTransactionBuffer: internal.createTransactionBuffer,
25
+ closeTransactionBuffer: internal.closeTransactionBuffer,
26
+ extendTransactionBuffer: internal.extendTransactionBuffer,
27
+ createTransactionFromBuffer: internal.createTransactionFromBuffer,
28
+ closeTransaction: internal.closeTransaction,
29
+ logEvent: internal.logEvent,
30
+ createBatch: internal.createBatch,
31
+ addTransactionToBatch: internal.addTransactionToBatch,
32
+ closeBatchTransaction: internal.closeBatchTransaction,
33
+ closeBatch: internal.closeBatch,
34
+ createPolicyTransaction: internal.createPolicyTransaction,
35
+ closeEmptyPolicyTransaction: internal.closeEmptyPolicyTransaction,
36
+ addSpendingLimitAsAuthority: internal.addSpendingLimitAsAuthority,
37
+ removeSpendingLimitAsAuthority: internal.removeSpendingLimitAsAuthority,
38
+ useSpendingLimit: internal.useSpendingLimit,
39
+ executeSettingsTransaction: internal.executeSettingsTransaction,
40
+ executeTransaction: internal.executeTransaction,
41
+ executeBatchTransaction: internal.executeBatchTransaction,
42
+ executeTransactionSync: internal.executeTransactionSync,
43
+ executeTransactionSyncV2: internal.executeTransactionSyncV2,
44
+ executeSettingsTransactionSync: internal.executeSettingsTransactionSync,
45
+ executePolicyTransaction: internal.executePolicyTransaction,
46
+ executePolicyPayloadSync: internal.executePolicyPayloadSync,
47
+ };
48
+ function isSigner(value) {
49
+ return Boolean(value &&
50
+ typeof value === "object" &&
51
+ "publicKey" in value &&
52
+ value.publicKey &&
53
+ typeof value.publicKey?.toBase58 ===
54
+ "function");
55
+ }
56
+ function isPublicKey(value) {
57
+ return Boolean(value &&
58
+ typeof value === "object" &&
59
+ (value.constructor?.name === "PublicKey" ||
60
+ (typeof value.toBase58 === "function" &&
61
+ typeof value.toBytes === "function")));
62
+ }
63
+ function normalizePreparedInstruction(result) {
64
+ if ("instruction" in result) {
65
+ return {
66
+ instruction: result.instruction,
67
+ lookupTableAccounts: [...(result.lookupTableAccounts ?? [])],
68
+ };
69
+ }
70
+ return {
71
+ instruction: result,
72
+ lookupTableAccounts: [],
73
+ };
74
+ }
75
+ function normalizeSignerValue(value) {
76
+ if (Array.isArray(value)) {
77
+ return value.map((entry) => normalizeSignerValue(entry));
78
+ }
79
+ if (isSigner(value)) {
80
+ return value.publicKey;
81
+ }
82
+ return value;
83
+ }
84
+ function resolvePublicKey(operation, role, value) {
85
+ if (isSigner(value)) {
86
+ return value.publicKey;
87
+ }
88
+ if (isPublicKey(value)) {
89
+ return value;
90
+ }
91
+ throw new InvalidRoleResolutionError(operation, role);
92
+ }
93
+ function normalizePreparedArgsFromClientArgs(metadata, args, transport) {
94
+ const next = {
95
+ ...args,
96
+ };
97
+ for (const [field, fallbackField] of Object.entries(metadata.signerFallbacks ?? {})) {
98
+ if (next[field] == null && next[fallbackField] != null) {
99
+ next[field] = normalizeSignerValue(next[fallbackField]);
100
+ }
101
+ }
102
+ for (const [field, value] of Object.entries(next)) {
103
+ next[field] = normalizeSignerValue(value);
104
+ }
105
+ delete next.additionalSigners;
106
+ delete next.sendOptions;
107
+ delete next.confirm;
108
+ if (metadata.requiresConnection) {
109
+ next.connection = transport.connection;
110
+ }
111
+ return next;
112
+ }
113
+ function collectClientSigners(metadata, args) {
114
+ const signers = [];
115
+ for (const role of metadata.signerRoles) {
116
+ const fallbackRole = metadata.signerFallbacks?.[role];
117
+ const candidate = args[role] ??
118
+ (fallbackRole
119
+ ? args[fallbackRole]
120
+ : undefined);
121
+ if (candidate == null) {
122
+ continue;
123
+ }
124
+ if (Array.isArray(candidate)) {
125
+ const missingSigner = candidate.find((entry) => !isSigner(entry));
126
+ if (missingSigner) {
127
+ throw new MissingRequiredSignerError(metadata.exportName, role);
128
+ }
129
+ signers.push(...candidate);
130
+ continue;
131
+ }
132
+ if (!isSigner(candidate)) {
133
+ throw new MissingRequiredSignerError(metadata.exportName, role);
134
+ }
135
+ signers.push(candidate);
136
+ }
137
+ if (Array.isArray(args.additionalSigners)) {
138
+ signers.push(...args.additionalSigners);
139
+ }
140
+ return signers;
141
+ }
142
+ async function prepareOperation(operationName, args) {
143
+ const metadata = CORE_OPERATION_REGISTRY[operationName];
144
+ const builder = OPERATION_BUILDERS[operationName];
145
+ if (metadata.requiresConnection && !("connection" in args && args.connection)) {
146
+ throw new MissingOperationConnectionError(metadata.exportName);
147
+ }
148
+ const result = await builder(args);
149
+ const normalized = normalizePreparedInstruction(result);
150
+ return freezePreparedOperation({
151
+ operation: metadata.exportName,
152
+ payer: resolvePublicKey(metadata.exportName, metadata.payerRole, args[metadata.payerRole]),
153
+ programId: args.programId ?? PROGRAM_ID,
154
+ requiresConfirmation: metadata.requiresConfirmation ?? false,
155
+ instructions: [normalized.instruction],
156
+ lookupTableAccounts: normalized.lookupTableAccounts,
157
+ });
158
+ }
159
+ function createRuntimeOperationDefinition(operationName) {
160
+ const metadata = CORE_OPERATION_REGISTRY[operationName];
161
+ const builder = OPERATION_BUILDERS[operationName];
162
+ const instruction = metadata.phase === "offline" && metadata.exposeInstruction !== false
163
+ ? ((args) => normalizePreparedInstruction(builder(args)).instruction)
164
+ : undefined;
165
+ return {
166
+ name: operationName,
167
+ metadata,
168
+ instruction: instruction,
169
+ prepare: (args) => prepareOperation(operationName, args),
170
+ boundPrepare: (transport, args) => prepareOperation(operationName, {
171
+ ...args,
172
+ ...(metadata.requiresConnection ? { connection: transport.connection } : {}),
173
+ }),
174
+ client: async (transport, args) => {
175
+ const prepared = await prepareOperation(operationName, normalizePreparedArgsFromClientArgs(metadata, args, transport));
176
+ return sendPreparedOperation({
177
+ transport,
178
+ prepared,
179
+ signers: collectClientSigners(metadata, args),
180
+ sendOptions: args.sendOptions,
181
+ confirm: args.confirm,
182
+ });
183
+ },
184
+ };
185
+ }
186
+ export function findRuntimeBindingIssues() {
187
+ const coreOperationNames = new Set(OPERATION_NAMES);
188
+ const builderNames = new Set(Object.keys(OPERATION_BUILDERS));
189
+ const missingBuilders = OPERATION_NAMES.filter((name) => !builderNames.has(name));
190
+ const extraBuilders = Object.keys(OPERATION_BUILDERS).filter((name) => !coreOperationNames.has(name));
191
+ return {
192
+ missingBuilders,
193
+ extraBuilders,
194
+ };
195
+ }
196
+ export function assertRuntimeBindingCoverage() {
197
+ const issues = findRuntimeBindingIssues();
198
+ if (issues.missingBuilders.length === 0 && issues.extraBuilders.length === 0) {
199
+ return;
200
+ }
201
+ throw new OperationRegistryCoverageError(`Runtime operation binding coverage failed: missing=[${issues.missingBuilders.join(", ")}] extra=[${issues.extraBuilders.join(", ")}]`);
202
+ }
203
+ export function getRuntimeOperationsForFeature(feature) {
204
+ assertRuntimeBindingCoverage();
205
+ return Object.fromEntries(getOperationsForFeature(feature).map((operationName) => {
206
+ const metadata = CORE_OPERATION_REGISTRY[operationName];
207
+ return [metadata.exportName, createRuntimeOperationDefinition(operationName)];
208
+ }));
209
+ }
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@loyal-labs/loyal-smart-accounts",
3
+ "version": "0.1.1",
4
+ "description": "Universal TypeScript SDK for the Squads Smart Account program",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./package.json": "./package.json"
15
+ },
16
+ "files": [
17
+ "dist"
18
+ ],
19
+ "scripts": {
20
+ "typecheck": "tsc --noEmit",
21
+ "build": "bun run clean && tsc -p tsconfig.build.json",
22
+ "prepublishOnly": "bun run build",
23
+ "clean": "rm -rf dist",
24
+ "test": "bun test",
25
+ "validate:surface": "bun test tests/operation-registry.test.ts"
26
+ },
27
+ "keywords": [
28
+ "solana",
29
+ "smart-account",
30
+ "squads",
31
+ "wallet",
32
+ "multisig",
33
+ "web3",
34
+ "blockchain"
35
+ ],
36
+ "author": "Loyal",
37
+ "license": "MIT",
38
+ "repository": {
39
+ "type": "git",
40
+ "url": "https://github.com/loyal-labs/loyal-app.git",
41
+ "directory": "sdk/loyal-smart-accounts"
42
+ },
43
+ "bugs": {
44
+ "url": "https://github.com/loyal/loyal-app/issues"
45
+ },
46
+ "homepage": "https://github.com/loyal/loyal-app/tree/main/sdk/loyal-smart-accounts#readme",
47
+ "peerDependencies": {
48
+ "@solana/web3.js": "^1.98.0"
49
+ },
50
+ "dependencies": {
51
+ "@loyal-labs/loyal-smart-accounts-core": "^0.1.1"
52
+ },
53
+ "devDependencies": {
54
+ "@types/bun": "latest",
55
+ "@types/node": "^24.0.15",
56
+ "typescript": "^5.7.3"
57
+ },
58
+ "publishConfig": {
59
+ "access": "public"
60
+ }
61
+ }