@1claw/sdk 0.61.16 → 0.61.18
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 +28 -0
- package/dist/generated/api-types.d.ts +304 -15
- package/dist/generated/api-types.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/resources/agents.d.ts +11 -1
- package/dist/resources/agents.d.ts.map +1 -1
- package/dist/resources/agents.js +13 -0
- package/dist/resources/agents.js.map +1 -1
- package/dist/types.d.ts +21 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -438,6 +438,34 @@ When `execution_require_tee` is true:
|
|
|
438
438
|
|
|
439
439
|
Both require `intents_api_enabled` / `execution_intents_enabled` to be on first.
|
|
440
440
|
|
|
441
|
+
### Agent pairing with a fingerprint
|
|
442
|
+
|
|
443
|
+
An agent can enrol itself with its own Ed25519 public key. The vault returns an SSH-style `SHA256:` fingerprint the human compares on the approval page, and the agent collects its API key itself once approved — nothing travels by email.
|
|
444
|
+
|
|
445
|
+
```typescript
|
|
446
|
+
import { AgentsResource } from "@1claw/sdk";
|
|
447
|
+
|
|
448
|
+
const result = await AgentsResource.pair(
|
|
449
|
+
"https://api.1claw.co",
|
|
450
|
+
{ name: "my-agent", public_key: "ssh-ed25519 AAAA…" },
|
|
451
|
+
(fingerprint, approvalUrl) => console.log(`Show the human: ${fingerprint}\n${approvalUrl}`),
|
|
452
|
+
);
|
|
453
|
+
// result.status === "approved" → result.api_key (shown once)
|
|
454
|
+
```
|
|
455
|
+
|
|
456
|
+
### Passkey-owned Safes: spend under a grant
|
|
457
|
+
|
|
458
|
+
When a human owns an EVM Safe with a passkey (`custody: passkey_owner`) and has granted this agent an on-chain allowance (Safe Allowance Module), the agent spends within it without a touch; the module enforces the cap.
|
|
459
|
+
|
|
460
|
+
```typescript
|
|
461
|
+
const spend = await client.agents.spendFromPasskeySafe(agentId, safeId, {
|
|
462
|
+
to: "0xRecipient…",
|
|
463
|
+
amount: "10000000000000000", // base units (0.01 ETH)
|
|
464
|
+
// token: "0xUSDC…" // omit for the native token
|
|
465
|
+
});
|
|
466
|
+
console.log(spend.data.tx_hash, spend.data.remaining_after);
|
|
467
|
+
```
|
|
468
|
+
|
|
441
469
|
### Agent-to-Agent Delegation
|
|
442
470
|
|
|
443
471
|
Human-controlled authorization for inter-agent task delegation. Agents cannot delegate to other agents without an explicit delegation record created by a human.
|
|
@@ -3659,6 +3659,10 @@ export interface paths {
|
|
|
3659
3659
|
* is the SafeTx hash. The address is counterfactual (CREATE2) until the
|
|
3660
3660
|
* first `execute` deploys it. Chains: base, optimism, arbitrum, polygon
|
|
3661
3661
|
* (RIP-7212 precompile + fallback verifier), ethereum, sepolia, base-sepolia.
|
|
3662
|
+
* The passkey must have been registered on the domain making this
|
|
3663
|
+
* request (its rpId): a credential from `1claw.xyz` cannot sign on
|
|
3664
|
+
* `1claw.co`, so such a passkey is refused here (400) rather than
|
|
3665
|
+
* producing a Safe no browser here can sign for.
|
|
3662
3666
|
*/
|
|
3663
3667
|
post: operations["createPasskeySafe"];
|
|
3664
3668
|
delete?: never;
|
|
@@ -3740,6 +3744,90 @@ export interface paths {
|
|
|
3740
3744
|
patch?: never;
|
|
3741
3745
|
trace?: never;
|
|
3742
3746
|
};
|
|
3747
|
+
"/v1/treasury/passkey-safes/{id}/grants": {
|
|
3748
|
+
parameters: {
|
|
3749
|
+
query?: never;
|
|
3750
|
+
header?: never;
|
|
3751
|
+
path: {
|
|
3752
|
+
id: string;
|
|
3753
|
+
};
|
|
3754
|
+
cookie?: never;
|
|
3755
|
+
};
|
|
3756
|
+
/** List agent spending grants on a passkey Safe */
|
|
3757
|
+
get: operations["listPasskeySafeGrants"];
|
|
3758
|
+
put?: never;
|
|
3759
|
+
/**
|
|
3760
|
+
* Prepare an agent spending grant (Allowance Module)
|
|
3761
|
+
* @description Gives one agent's server-custody Ethereum signing key a bounded, on-chain
|
|
3762
|
+
* allowance from this Safe through Safe's Allowance Module v1.0.0: one Safe
|
|
3763
|
+
* transaction (delegatecall into MultiSendCallOnly) that enables the module if
|
|
3764
|
+
* needed, adds the agent's key as a delegate and sets the allowance per reset
|
|
3765
|
+
* period. Returns the grant (`pending`) and the SafeTx for the owner's passkey
|
|
3766
|
+
* to sign; pass `operation` and `grant_id` from `prepare` to `execute`. The cap
|
|
3767
|
+
* is enforced by the module on-chain — 1claw holding the delegate key gives it
|
|
3768
|
+
* exactly the allowance and nothing more. Audited as `passkey_safe.grant_activated`.
|
|
3769
|
+
*/
|
|
3770
|
+
post: operations["createPasskeySafeGrant"];
|
|
3771
|
+
delete?: never;
|
|
3772
|
+
options?: never;
|
|
3773
|
+
head?: never;
|
|
3774
|
+
patch?: never;
|
|
3775
|
+
trace?: never;
|
|
3776
|
+
};
|
|
3777
|
+
"/v1/treasury/passkey-safes/{id}/grants/{grant_id}/revoke": {
|
|
3778
|
+
parameters: {
|
|
3779
|
+
query?: never;
|
|
3780
|
+
header?: never;
|
|
3781
|
+
path: {
|
|
3782
|
+
id: string;
|
|
3783
|
+
grant_id: string;
|
|
3784
|
+
};
|
|
3785
|
+
cookie?: never;
|
|
3786
|
+
};
|
|
3787
|
+
get?: never;
|
|
3788
|
+
put?: never;
|
|
3789
|
+
/**
|
|
3790
|
+
* Prepare a grant revocation
|
|
3791
|
+
* @description Prepares `AllowanceModule.removeDelegate(delegate, true)` for the owner's
|
|
3792
|
+
* passkey to sign; `execute` with `grant_id` relays it and marks the grant
|
|
3793
|
+
* `revoked`. Audited as `passkey_safe.grant_revoked`.
|
|
3794
|
+
*/
|
|
3795
|
+
post: operations["revokePasskeySafeGrant"];
|
|
3796
|
+
delete?: never;
|
|
3797
|
+
options?: never;
|
|
3798
|
+
head?: never;
|
|
3799
|
+
patch?: never;
|
|
3800
|
+
trace?: never;
|
|
3801
|
+
};
|
|
3802
|
+
"/v1/agents/{agent_id}/passkey-safes/{safe_id}/spend": {
|
|
3803
|
+
parameters: {
|
|
3804
|
+
query?: never;
|
|
3805
|
+
header?: never;
|
|
3806
|
+
path: {
|
|
3807
|
+
agent_id: string;
|
|
3808
|
+
safe_id: string;
|
|
3809
|
+
};
|
|
3810
|
+
cookie?: never;
|
|
3811
|
+
};
|
|
3812
|
+
get?: never;
|
|
3813
|
+
put?: never;
|
|
3814
|
+
/**
|
|
3815
|
+
* Spend from a passkey-owned Safe under an active grant
|
|
3816
|
+
* @description Agent credential only. Runs the agent's guardrails (chains, allowlists, caps,
|
|
3817
|
+
* daily limits, approval policy) and the sanctions screen, reads the module's
|
|
3818
|
+
* current allowance and nonce, signs the Allowance Module transfer hash with the
|
|
3819
|
+
* agent's Ethereum signing key, and relays `executeAllowanceTransfer` from the
|
|
3820
|
+
* Safe owner's Ethereum treasury wallet. Above the on-chain remaining allowance
|
|
3821
|
+
* the request is refused before any gas is spent; the module would refuse it
|
|
3822
|
+
* anyway. Counts as one signature. Audited as `passkey_safe.allowance_spent`.
|
|
3823
|
+
*/
|
|
3824
|
+
post: operations["spendFromPasskeySafeGrant"];
|
|
3825
|
+
delete?: never;
|
|
3826
|
+
options?: never;
|
|
3827
|
+
head?: never;
|
|
3828
|
+
patch?: never;
|
|
3829
|
+
trace?: never;
|
|
3830
|
+
};
|
|
3743
3831
|
"/v1/treasury/wallets/generate": {
|
|
3744
3832
|
parameters: {
|
|
3745
3833
|
query?: never;
|
|
@@ -15996,6 +16084,10 @@ export interface components {
|
|
|
15996
16084
|
safe_address?: string;
|
|
15997
16085
|
/** Format: uuid */
|
|
15998
16086
|
passkey_id?: string;
|
|
16087
|
+
/** @description The owning passkey's name — only that credential can sign for the Safe. */
|
|
16088
|
+
passkey_name?: string | null;
|
|
16089
|
+
/** @description The domain the owning passkey was registered under (WebAuthn rpId); a browser on another domain cannot use it. */
|
|
16090
|
+
passkey_rp_id?: string | null;
|
|
15999
16091
|
/** @enum {string} */
|
|
16000
16092
|
custody?: "passkey_owner";
|
|
16001
16093
|
/** @enum {string} */
|
|
@@ -16006,6 +16098,58 @@ export interface components {
|
|
|
16006
16098
|
/** Format: date-time */
|
|
16007
16099
|
created_at?: string;
|
|
16008
16100
|
};
|
|
16101
|
+
PasskeySafePrepare: {
|
|
16102
|
+
/** Format: uuid */
|
|
16103
|
+
safe_id?: string;
|
|
16104
|
+
safe_address?: string;
|
|
16105
|
+
chain?: string;
|
|
16106
|
+
chain_id?: number;
|
|
16107
|
+
to?: string;
|
|
16108
|
+
value_wei?: string;
|
|
16109
|
+
data?: string;
|
|
16110
|
+
nonce?: number;
|
|
16111
|
+
/** @description Pass back to `execute` unchanged. */
|
|
16112
|
+
operation?: number;
|
|
16113
|
+
/**
|
|
16114
|
+
* Format: uuid
|
|
16115
|
+
* @description Present for grant setup / revoke; pass back to `execute`.
|
|
16116
|
+
*/
|
|
16117
|
+
grant_id?: string;
|
|
16118
|
+
deploy_required?: boolean;
|
|
16119
|
+
/** @description Hex SafeTx hash — the WebAuthn challenge (raw 32 bytes). */
|
|
16120
|
+
safe_tx_hash?: string;
|
|
16121
|
+
credential_id?: string;
|
|
16122
|
+
/** @description The passkey's registered transports (`internal`, `hybrid`, `usb`…) — pass as the `allowCredentials` hint so the browser asks the right authenticator. */
|
|
16123
|
+
transports?: string[] | null;
|
|
16124
|
+
passkey_name?: string | null;
|
|
16125
|
+
rp_id?: string;
|
|
16126
|
+
};
|
|
16127
|
+
PasskeySafeGrant: {
|
|
16128
|
+
/** Format: uuid */
|
|
16129
|
+
id?: string;
|
|
16130
|
+
/** Format: uuid */
|
|
16131
|
+
safe_id?: string;
|
|
16132
|
+
/** Format: uuid */
|
|
16133
|
+
agent_id?: string;
|
|
16134
|
+
chain?: string;
|
|
16135
|
+
/** @description The agent's Ethereum signing key at grant time. */
|
|
16136
|
+
delegate_address?: string;
|
|
16137
|
+
/** @description 0x000…0 for the native token. */
|
|
16138
|
+
token_address?: string;
|
|
16139
|
+
/** @description Base units per reset period. */
|
|
16140
|
+
allowance_amount?: string;
|
|
16141
|
+
reset_time_min?: number;
|
|
16142
|
+
/** @enum {string} */
|
|
16143
|
+
status?: "pending" | "active" | "revoking" | "revoked";
|
|
16144
|
+
setup_tx_hash?: string | null;
|
|
16145
|
+
revoke_tx_hash?: string | null;
|
|
16146
|
+
/** Format: date-time */
|
|
16147
|
+
created_at?: string;
|
|
16148
|
+
};
|
|
16149
|
+
PasskeySafeGrantPrepare: {
|
|
16150
|
+
grant?: components["schemas"]["PasskeySafeGrant"];
|
|
16151
|
+
prepare?: components["schemas"]["PasskeySafePrepare"];
|
|
16152
|
+
};
|
|
16009
16153
|
ClientShareListResponse: {
|
|
16010
16154
|
/** Format: uuid */
|
|
16011
16155
|
key_id?: string;
|
|
@@ -24463,21 +24607,7 @@ export interface operations {
|
|
|
24463
24607
|
[name: string]: unknown;
|
|
24464
24608
|
};
|
|
24465
24609
|
content: {
|
|
24466
|
-
"application/json":
|
|
24467
|
-
/** Format: uuid */
|
|
24468
|
-
safe_id?: string;
|
|
24469
|
-
safe_address?: string;
|
|
24470
|
-
chain?: string;
|
|
24471
|
-
chain_id?: number;
|
|
24472
|
-
to?: string;
|
|
24473
|
-
value_wei?: string;
|
|
24474
|
-
data?: string;
|
|
24475
|
-
nonce?: number;
|
|
24476
|
-
deploy_required?: boolean;
|
|
24477
|
-
safe_tx_hash?: string;
|
|
24478
|
-
credential_id?: string;
|
|
24479
|
-
rp_id?: string;
|
|
24480
|
-
};
|
|
24610
|
+
"application/json": components["schemas"]["PasskeySafePrepare"];
|
|
24481
24611
|
};
|
|
24482
24612
|
};
|
|
24483
24613
|
400: components["responses"]["BadRequest"];
|
|
@@ -24502,6 +24632,18 @@ export interface operations {
|
|
|
24502
24632
|
value_wei: string;
|
|
24503
24633
|
data?: string;
|
|
24504
24634
|
nonce: number;
|
|
24635
|
+
/**
|
|
24636
|
+
* @description 0 = call. 1 = delegatecall, accepted only with a `grant_id` whose
|
|
24637
|
+
* prepared setup calldata this is, and only to the pinned
|
|
24638
|
+
* MultiSendCallOnly — the API cannot delegatecall arbitrary code.
|
|
24639
|
+
* @default 0
|
|
24640
|
+
*/
|
|
24641
|
+
operation?: number;
|
|
24642
|
+
/**
|
|
24643
|
+
* Format: uuid
|
|
24644
|
+
* @description Pass back from a grant or revoke prepare; activates / revokes the grant on success.
|
|
24645
|
+
*/
|
|
24646
|
+
grant_id?: string;
|
|
24505
24647
|
/** @description Base64url. */
|
|
24506
24648
|
authenticator_data: string;
|
|
24507
24649
|
/** @description Base64url. */
|
|
@@ -24537,6 +24679,153 @@ export interface operations {
|
|
|
24537
24679
|
409: components["responses"]["Conflict"];
|
|
24538
24680
|
};
|
|
24539
24681
|
};
|
|
24682
|
+
listPasskeySafeGrants: {
|
|
24683
|
+
parameters: {
|
|
24684
|
+
query?: never;
|
|
24685
|
+
header?: never;
|
|
24686
|
+
path: {
|
|
24687
|
+
id: string;
|
|
24688
|
+
};
|
|
24689
|
+
cookie?: never;
|
|
24690
|
+
};
|
|
24691
|
+
requestBody?: never;
|
|
24692
|
+
responses: {
|
|
24693
|
+
/** @description Grants */
|
|
24694
|
+
200: {
|
|
24695
|
+
headers: {
|
|
24696
|
+
[name: string]: unknown;
|
|
24697
|
+
};
|
|
24698
|
+
content: {
|
|
24699
|
+
"application/json": {
|
|
24700
|
+
grants?: components["schemas"]["PasskeySafeGrant"][];
|
|
24701
|
+
};
|
|
24702
|
+
};
|
|
24703
|
+
};
|
|
24704
|
+
401: components["responses"]["Unauthorized"];
|
|
24705
|
+
404: components["responses"]["NotFound"];
|
|
24706
|
+
};
|
|
24707
|
+
};
|
|
24708
|
+
createPasskeySafeGrant: {
|
|
24709
|
+
parameters: {
|
|
24710
|
+
query?: never;
|
|
24711
|
+
header?: never;
|
|
24712
|
+
path: {
|
|
24713
|
+
id: string;
|
|
24714
|
+
};
|
|
24715
|
+
cookie?: never;
|
|
24716
|
+
};
|
|
24717
|
+
requestBody: {
|
|
24718
|
+
content: {
|
|
24719
|
+
"application/json": {
|
|
24720
|
+
/** Format: uuid */
|
|
24721
|
+
agent_id: string;
|
|
24722
|
+
/** @description ERC-20 contract; omit for the native token. */
|
|
24723
|
+
token?: string;
|
|
24724
|
+
/** @description Base units */
|
|
24725
|
+
allowance_amount: string;
|
|
24726
|
+
/**
|
|
24727
|
+
* @description Reset period in minutes.
|
|
24728
|
+
* @default 1440
|
|
24729
|
+
*/
|
|
24730
|
+
reset_time_min?: number;
|
|
24731
|
+
};
|
|
24732
|
+
};
|
|
24733
|
+
};
|
|
24734
|
+
responses: {
|
|
24735
|
+
/** @description Grant and what to sign */
|
|
24736
|
+
200: {
|
|
24737
|
+
headers: {
|
|
24738
|
+
[name: string]: unknown;
|
|
24739
|
+
};
|
|
24740
|
+
content: {
|
|
24741
|
+
"application/json": components["schemas"]["PasskeySafeGrantPrepare"];
|
|
24742
|
+
};
|
|
24743
|
+
};
|
|
24744
|
+
400: components["responses"]["BadRequest"];
|
|
24745
|
+
401: components["responses"]["Unauthorized"];
|
|
24746
|
+
404: components["responses"]["NotFound"];
|
|
24747
|
+
409: components["responses"]["Conflict"];
|
|
24748
|
+
};
|
|
24749
|
+
};
|
|
24750
|
+
revokePasskeySafeGrant: {
|
|
24751
|
+
parameters: {
|
|
24752
|
+
query?: never;
|
|
24753
|
+
header?: never;
|
|
24754
|
+
path: {
|
|
24755
|
+
id: string;
|
|
24756
|
+
grant_id: string;
|
|
24757
|
+
};
|
|
24758
|
+
cookie?: never;
|
|
24759
|
+
};
|
|
24760
|
+
requestBody?: never;
|
|
24761
|
+
responses: {
|
|
24762
|
+
/** @description Grant and what to sign */
|
|
24763
|
+
200: {
|
|
24764
|
+
headers: {
|
|
24765
|
+
[name: string]: unknown;
|
|
24766
|
+
};
|
|
24767
|
+
content: {
|
|
24768
|
+
"application/json": components["schemas"]["PasskeySafeGrantPrepare"];
|
|
24769
|
+
};
|
|
24770
|
+
};
|
|
24771
|
+
401: components["responses"]["Unauthorized"];
|
|
24772
|
+
404: components["responses"]["NotFound"];
|
|
24773
|
+
409: components["responses"]["Conflict"];
|
|
24774
|
+
};
|
|
24775
|
+
};
|
|
24776
|
+
spendFromPasskeySafeGrant: {
|
|
24777
|
+
parameters: {
|
|
24778
|
+
query?: never;
|
|
24779
|
+
header?: never;
|
|
24780
|
+
path: {
|
|
24781
|
+
agent_id: string;
|
|
24782
|
+
safe_id: string;
|
|
24783
|
+
};
|
|
24784
|
+
cookie?: never;
|
|
24785
|
+
};
|
|
24786
|
+
requestBody: {
|
|
24787
|
+
content: {
|
|
24788
|
+
"application/json": {
|
|
24789
|
+
to: string;
|
|
24790
|
+
/** @description Base units */
|
|
24791
|
+
amount: string;
|
|
24792
|
+
/** @description ERC-20 contract; omit for the native token. */
|
|
24793
|
+
token?: string;
|
|
24794
|
+
};
|
|
24795
|
+
};
|
|
24796
|
+
};
|
|
24797
|
+
responses: {
|
|
24798
|
+
/** @description Broadcast */
|
|
24799
|
+
200: {
|
|
24800
|
+
headers: {
|
|
24801
|
+
[name: string]: unknown;
|
|
24802
|
+
};
|
|
24803
|
+
content: {
|
|
24804
|
+
"application/json": {
|
|
24805
|
+
/** Format: uuid */
|
|
24806
|
+
grant_id?: string;
|
|
24807
|
+
safe_address?: string;
|
|
24808
|
+
chain?: string;
|
|
24809
|
+
to?: string;
|
|
24810
|
+
amount?: string;
|
|
24811
|
+
token_address?: string;
|
|
24812
|
+
/** @description Allowance left in this period after this transfer. */
|
|
24813
|
+
remaining_after?: string;
|
|
24814
|
+
/** @description The module's delegate nonce used. */
|
|
24815
|
+
nonce?: number;
|
|
24816
|
+
tx_hash?: string;
|
|
24817
|
+
status?: string;
|
|
24818
|
+
};
|
|
24819
|
+
};
|
|
24820
|
+
};
|
|
24821
|
+
400: components["responses"]["BadRequest"];
|
|
24822
|
+
401: components["responses"]["Unauthorized"];
|
|
24823
|
+
402: components["responses"]["PaymentRequired"];
|
|
24824
|
+
403: components["responses"]["Forbidden"];
|
|
24825
|
+
404: components["responses"]["NotFound"];
|
|
24826
|
+
409: components["responses"]["Conflict"];
|
|
24827
|
+
};
|
|
24828
|
+
};
|
|
24540
24829
|
generateTreasuryWallets: {
|
|
24541
24830
|
parameters: {
|
|
24542
24831
|
query?: never;
|