@usearete/automations 0.0.0-stage → 0.44.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/LICENSE +21 -0
- package/README.md +299 -2
- package/dist/cli.js +4518 -0
- package/dist/index.cjs +3735 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +1379 -0
- package/dist/index.js +3690 -0
- package/dist/index.js.map +1 -0
- package/dist/keypair.cjs +267 -0
- package/dist/keypair.cjs.map +1 -0
- package/dist/keypair.d.ts +70 -0
- package/dist/keypair.js +265 -0
- package/dist/keypair.js.map +1 -0
- package/dist/postgres.cjs +757 -0
- package/dist/postgres.cjs.map +1 -0
- package/dist/postgres.d.ts +449 -0
- package/dist/postgres.js +749 -0
- package/dist/postgres.js.map +1 -0
- package/dist/privy.cjs +618 -0
- package/dist/privy.cjs.map +1 -0
- package/dist/privy.d.ts +236 -0
- package/dist/privy.js +614 -0
- package/dist/privy.js.map +1 -0
- package/dist/testing.cjs +467 -0
- package/dist/testing.cjs.map +1 -0
- package/dist/testing.d.ts +381 -0
- package/dist/testing.js +465 -0
- package/dist/testing.js.map +1 -0
- package/package.json +108 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"privy.cjs","sources":["../src/policy/encoding.ts","../src/policy/authority.ts","../src/consent/consent.ts","../src/policy/decode.ts","../src/policy/policy.ts","../src/signer/signer.ts","../src/privy/privy.ts"],"sourcesContent":[null,null,null,null,null,null,null],"names":["base58","base64"],"mappings":";;;;;AAEM,SAAU,YAAY,CAAC,KAAiB,EAAA;AAC5C,IAAA,OAAOA,WAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAeD;AACM,SAAU,YAAY,CAAC,IAAY,EAAA;AACvC,IAAA,IAAI;AACF,QAAA,OAAOC,WAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;KAC5B;AAAC,IAAA,MAAM;AACN,QAAA,OAAO,IAAI,C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GAAG;QACjB,gGAAgG;QAChG,wMAAwM;QACxM,uLAAuL;QACvL,kGAAkG;QAClG,uFAAuF;QACvF,qEAAqE;QACrE,4FAA4F;QAC5F,qLAAqL;KACtL,CAAC;IACF,OAAO;AACL,QAAA,MAAM,EAAE;AACN,YAAA,OAAO,EAAE,KAAK;AACd,YAAA,IAAI,EAAE,OAAO,CAAC,IAAI,IAAI,yBAAyB,OAAO,CAAC,MAAM,CAAA,CAAE,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,CAAC;AAC5E,YAAA,UAAU,EAAE,QAAQ;YACpB,KAAK;AACN,SAAA;QACD,UAAU;KACX,CAAC;AACJ;;;;;;"}
|
package/dist/privy.d.ts
ADDED
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
import { ProtocolTransactionFormat, ExecutionIntentV1, ProtocolPreparedTransaction } from '@usearete/sdk';
|
|
2
|
+
|
|
3
|
+
/** Spending limits of a consent grant, per asset: `SOL` (in lamports) or a mint (in base units). */
|
|
4
|
+
interface StoredConsentLimits {
|
|
5
|
+
/** The most one step may move out of the wallet. An asset without one may not leave. */
|
|
6
|
+
readonly perExecution: Readonly<Record<string, string>>;
|
|
7
|
+
/** The most all steps together may move out within a rolling window. */
|
|
8
|
+
readonly perWindow: Readonly<Record<string, {
|
|
9
|
+
readonly amount: string;
|
|
10
|
+
readonly windowMs: number;
|
|
11
|
+
}>>;
|
|
12
|
+
}
|
|
13
|
+
/** The signed proof a grant was made from. */
|
|
14
|
+
interface ConsentProof {
|
|
15
|
+
/** The exact message the wallet signed. */
|
|
16
|
+
readonly message: string;
|
|
17
|
+
/** Base58 Ed25519 signature by the wallet. */
|
|
18
|
+
readonly signature: string;
|
|
19
|
+
readonly nonce: string;
|
|
20
|
+
readonly issuedAt: number;
|
|
21
|
+
}
|
|
22
|
+
/** A user's consent for automations to run steps for their wallet. */
|
|
23
|
+
interface ConsentGrant {
|
|
24
|
+
readonly wallet: string;
|
|
25
|
+
readonly deploymentId: string;
|
|
26
|
+
/** `null` for every instance of the deployment. */
|
|
27
|
+
readonly instanceId: string | null;
|
|
28
|
+
readonly steps: readonly string[];
|
|
29
|
+
readonly limits: StoredConsentLimits;
|
|
30
|
+
/** The user's own settings for the steps (amount, weekday, ...). */
|
|
31
|
+
readonly params: Readonly<Record<string, unknown>>;
|
|
32
|
+
/** Milliseconds since the epoch. */
|
|
33
|
+
readonly expiresAt: number;
|
|
34
|
+
readonly grantedAt: number;
|
|
35
|
+
readonly revokedAt: number | null;
|
|
36
|
+
readonly proof: ConsentProof;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Consent: what a user signs to let automations run steps for their wallet.
|
|
41
|
+
*
|
|
42
|
+
* The proof is a human-readable, domain-bound message in the style of
|
|
43
|
+
* Sign-In-With-Solana. It is built from the grant's fields, so the backend
|
|
44
|
+
* rebuilds it from the fields it is given and checks the wallet's signature
|
|
45
|
+
* over that, rather than parsing a message. Raising a limit or changing a
|
|
46
|
+
* setting needs a new signature; revoking does not.
|
|
47
|
+
*
|
|
48
|
+
* The signature is an accountability and anti-bug record. It does not
|
|
49
|
+
* protect against a compromised backend; the wallet provider's policy and
|
|
50
|
+
* the protocol's on-chain rules do.
|
|
51
|
+
*/
|
|
52
|
+
|
|
53
|
+
interface NormalizedConsent {
|
|
54
|
+
readonly wallet: string;
|
|
55
|
+
readonly deploymentId: string;
|
|
56
|
+
readonly instanceId: string | null;
|
|
57
|
+
readonly steps: string[];
|
|
58
|
+
readonly limits: StoredConsentLimits;
|
|
59
|
+
readonly params: Record<string, unknown>;
|
|
60
|
+
readonly expiresAt: number;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* What a signer may sign for a user: the static policy.
|
|
65
|
+
*
|
|
66
|
+
* The rules, their names and the refusal shape match the Arete MCP server's
|
|
67
|
+
* local signer, and both implementations run the shared vectors in
|
|
68
|
+
* `test-vectors/signer-policy/`. The caps hold per transaction, measured by
|
|
69
|
+
* simulating the exact prepared bytes. Wrapped SOL counts against
|
|
70
|
+
* `maxSolPerTransaction`, as do the lamports of a token account closed to
|
|
71
|
+
* someone else. Instructions that hand control of the signer's funds to
|
|
72
|
+
* someone else (token approvals, authority changes, System assignments) are
|
|
73
|
+
* always refused, and so is any transaction whose effect on the signer
|
|
74
|
+
* could not be simulated.
|
|
75
|
+
*/
|
|
76
|
+
|
|
77
|
+
/** A validated policy. */
|
|
78
|
+
interface SignerPolicy {
|
|
79
|
+
readonly deployments: readonly string[];
|
|
80
|
+
readonly maxLamportsPerTransaction: bigint;
|
|
81
|
+
readonly programs: readonly string[] | null;
|
|
82
|
+
readonly maxTokenAmounts: ReadonlyMap<string, bigint> | null;
|
|
83
|
+
readonly clusters: readonly string[];
|
|
84
|
+
/** Whether the input listed `clusters` (rather than the default). */
|
|
85
|
+
readonly clustersListed: boolean;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* What a signer is given. Hand it copies and keep your own snapshot of the
|
|
90
|
+
* prepared transactions for `checkSignedTransactions`: `readonly` is not
|
|
91
|
+
* enforced at run time, and a signer that changed the objects it was given
|
|
92
|
+
* could change a shared baseline too. The runtime does this.
|
|
93
|
+
*/
|
|
94
|
+
interface SignTransactionsInput {
|
|
95
|
+
/** The wallet whose signature slot to fill. */
|
|
96
|
+
readonly wallet: string;
|
|
97
|
+
/** What the prepare committed to. */
|
|
98
|
+
readonly intent: ExecutionIntentV1;
|
|
99
|
+
/** The prepared transactions, base64 wire bytes, in intent order. */
|
|
100
|
+
readonly transactions: readonly ProtocolPreparedTransaction[];
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* Signs prepared protocol transactions for a wallet the backend controls by
|
|
104
|
+
* delegation (a dev keypair, an embedded-wallet provider, a KMS).
|
|
105
|
+
*
|
|
106
|
+
* A signer fills the wallet's signature slot of each transaction and
|
|
107
|
+
* nothing else: it must not change the message, add instructions, touch
|
|
108
|
+
* other signatures, or broadcast. The runtime does not trust this: it
|
|
109
|
+
* re-hashes every returned message against the intent and verifies the
|
|
110
|
+
* wallet's signature before anything is submitted.
|
|
111
|
+
*/
|
|
112
|
+
interface ProtocolSigner {
|
|
113
|
+
/** A short name for logs and refusals, for example `keypair` or `privy`. */
|
|
114
|
+
readonly kind: string;
|
|
115
|
+
/** Formats the signer can sign, in order of preference. */
|
|
116
|
+
readonly supportedTransactionFormats: readonly ProtocolTransactionFormat[];
|
|
117
|
+
/** Whether this signer can sign for `wallet` now. */
|
|
118
|
+
canSign(wallet: string): Promise<boolean>;
|
|
119
|
+
/** The signed transactions, base64 wire bytes, one per input in the same order. */
|
|
120
|
+
signTransactions(input: SignTransactionsInput): Promise<string[]>;
|
|
121
|
+
/**
|
|
122
|
+
* Whether the backend holds delegated access to `wallet`, and whether a
|
|
123
|
+
* provider-side policy bounds what it may sign. Granting consent warns
|
|
124
|
+
* when either is missing.
|
|
125
|
+
*/
|
|
126
|
+
delegationStatus?(wallet: string): Promise<DelegationStatus>;
|
|
127
|
+
}
|
|
128
|
+
interface DelegationStatus {
|
|
129
|
+
readonly delegated: boolean;
|
|
130
|
+
readonly providerPolicy: boolean;
|
|
131
|
+
readonly detail?: string;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* A signer over Privy server wallets, and the Privy policy that bounds it.
|
|
136
|
+
*
|
|
137
|
+
* The signer asks Privy to sign (never to sign and send) each prepared
|
|
138
|
+
* transaction, authorized by your app's authorization key. The runtime
|
|
139
|
+
* checks the returned bytes against the intent, as for any signer.
|
|
140
|
+
*
|
|
141
|
+
* The provider policy is the bound that holds if the backend running
|
|
142
|
+
* automations is compromised, because Privy enforces it in its enclave.
|
|
143
|
+
* Privy's Solana policies see top-level instructions only, so they bound
|
|
144
|
+
* which programs a wallet may call and when, and the amounts of direct
|
|
145
|
+
* transfers, but not what a protocol program moves by CPI.
|
|
146
|
+
* `privyPolicyFor` returns the rules it could not express alongside the
|
|
147
|
+
* policy; see docs/privy-policy-expressiveness.md.
|
|
148
|
+
*/
|
|
149
|
+
|
|
150
|
+
/** The parts of a `@privy-io/node` `PrivyClient` the signer uses. */
|
|
151
|
+
interface PrivyClientLike {
|
|
152
|
+
wallets(): {
|
|
153
|
+
solana(): {
|
|
154
|
+
signTransaction(walletId: string, input: {
|
|
155
|
+
transaction: string;
|
|
156
|
+
authorization_context?: {
|
|
157
|
+
authorization_private_keys: string[];
|
|
158
|
+
};
|
|
159
|
+
}): Promise<{
|
|
160
|
+
signedTransaction?: string;
|
|
161
|
+
signed_transaction?: string;
|
|
162
|
+
}>;
|
|
163
|
+
};
|
|
164
|
+
get?(walletId: string): Promise<{
|
|
165
|
+
policy_ids?: readonly string[] | null;
|
|
166
|
+
}>;
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
interface PrivySignerOptions {
|
|
170
|
+
readonly privy: PrivyClientLike;
|
|
171
|
+
/** The Privy wallet id of a wallet address, or `null` when your app has no server access to it. */
|
|
172
|
+
readonly walletIdFor: (wallet: string) => Promise<string | null>;
|
|
173
|
+
/** Your app's authorization private key (the key quorum Privy lets sign for the wallet). */
|
|
174
|
+
readonly authorizationPrivateKey: string;
|
|
175
|
+
/**
|
|
176
|
+
* Formats to offer. Defaults to v0 only: Privy's documentation covers
|
|
177
|
+
* legacy and v0 transactions, and v1 message signing is not verified.
|
|
178
|
+
*/
|
|
179
|
+
readonly transactionFormats?: readonly ProtocolTransactionFormat[];
|
|
180
|
+
/**
|
|
181
|
+
* Refuse, before asking Privy, transactions with top-level System or Token
|
|
182
|
+
* instructions that `privyPolicyFor` cannot allow (see
|
|
183
|
+
* {@link PRIVY_ALLOWED_INSTRUCTIONS}), with a reason that says so. On by
|
|
184
|
+
* default; turn it off if your Privy policy allows more.
|
|
185
|
+
*/
|
|
186
|
+
readonly refuseUnsupported?: boolean;
|
|
187
|
+
}
|
|
188
|
+
/**
|
|
189
|
+
* The System and Token instructions a policy from `privyPolicyFor` allows.
|
|
190
|
+
* Privy's Solana policies cannot express the others (for example Token
|
|
191
|
+
* `syncNative`, which wrapping SOL needs), so its default deny refuses them.
|
|
192
|
+
*/
|
|
193
|
+
declare const PRIVY_ALLOWED_INSTRUCTIONS: Readonly<Record<'system' | 'token', readonly string[]>>;
|
|
194
|
+
/** A {@link ProtocolSigner} over Privy server wallets. */
|
|
195
|
+
declare function privySigner(options: PrivySignerOptions): ProtocolSigner;
|
|
196
|
+
interface PrivyPolicyCondition {
|
|
197
|
+
readonly field_source: string;
|
|
198
|
+
readonly field: string;
|
|
199
|
+
readonly operator: 'eq' | 'neq' | 'lt' | 'lte' | 'gt' | 'gte' | 'in';
|
|
200
|
+
readonly value: string | readonly string[];
|
|
201
|
+
}
|
|
202
|
+
interface PrivyPolicyRule {
|
|
203
|
+
readonly name: string;
|
|
204
|
+
readonly method: string;
|
|
205
|
+
readonly conditions: readonly PrivyPolicyCondition[];
|
|
206
|
+
readonly action: 'ALLOW' | 'DENY';
|
|
207
|
+
}
|
|
208
|
+
interface PrivyPolicy {
|
|
209
|
+
readonly version: '1.0';
|
|
210
|
+
readonly name: string;
|
|
211
|
+
readonly chain_type: 'solana';
|
|
212
|
+
readonly rules: readonly PrivyPolicyRule[];
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* The Privy policy for a wallet's consent under a signing policy, and the
|
|
216
|
+
* rules Privy cannot enforce (which the runtime still enforces, but which a
|
|
217
|
+
* compromised backend could skip).
|
|
218
|
+
*
|
|
219
|
+
* Every rule is for `signTransaction` only and holds until the consent
|
|
220
|
+
* expires. Programs from `policy.programs` (plus compute budget, memo and
|
|
221
|
+
* associated token account programs) are allowed. System transfers and
|
|
222
|
+
* token `TransferChecked` are allowed up to the smaller of the policy's and
|
|
223
|
+
* the consent's per-run caps, per instruction (wrapped SOL up to the SOL
|
|
224
|
+
* cap, as it counts as SOL); token accounts may be
|
|
225
|
+
* closed only to the wallet itself. Everything else is denied, including
|
|
226
|
+
* key export.
|
|
227
|
+
*/
|
|
228
|
+
declare function privyPolicyFor(policy: SignerPolicy, consent: Pick<NormalizedConsent | ConsentGrant, 'wallet' | 'expiresAt' | 'limits'>, options?: {
|
|
229
|
+
readonly name?: string;
|
|
230
|
+
}): {
|
|
231
|
+
policy: PrivyPolicy;
|
|
232
|
+
unenforced: string[];
|
|
233
|
+
};
|
|
234
|
+
|
|
235
|
+
export { PRIVY_ALLOWED_INSTRUCTIONS, privyPolicyFor, privySigner };
|
|
236
|
+
export type { PrivyClientLike, PrivyPolicy, PrivyPolicyCondition, PrivyPolicyRule, PrivySignerOptions };
|