passkey-kit 0.11.3 → 0.12.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.
@@ -1,9 +1,20 @@
1
1
  {
2
2
  "permissions": {
3
3
  "allow": [
4
- "WebSearch"
4
+ "WebSearch",
5
+ "mcp__context7__resolve-library-id",
6
+ "Bash(tree:*)",
7
+ "mcp__deepwiki__read_wiki_structure",
8
+ "mcp__context7__query-docs",
9
+ "mcp__deepwiki__read_wiki_contents",
10
+ "Bash(curl:*)",
11
+ "Bash(pnpm install:*)",
12
+ "Bash(pnpm run build:*)",
13
+ "mcp__github__get_file_contents",
14
+ "mcp__perplexity__perplexity_ask",
15
+ "mcp__perplexity__perplexity_search"
5
16
  ],
6
17
  "deny": [],
7
18
  "ask": []
8
19
  }
9
- }
20
+ }
package/PROPOSAL.md CHANGED
@@ -6,7 +6,7 @@ Over the past months I've been hard at work designing a solid first stab at a v1
6
6
 
7
7
  All the best work can reviewed in my [passkey-kit](https://github.com/kalepail/passkey-kit) repo. This repo includes the factory and wallet contracts, a demo client interface, a `passkey-kit` SDK tool to make interacting with the contract interface simple and painless and finally a [Mercury Zephyr](https://www.mercurydata.app/products/zephyr-vm) program for indexing contract events in order to make the wallet more usable client side.
8
8
 
9
- This repo also makes use of a new [Launchtube service](https://github.com/kalepail/launchtube) which makes submitting Soroban transactions simple by handling the concerns of both transaction fees and sequence numbers.
9
+ This repo also makes use of the [OpenZeppelin Relayer service](https://docs.openzeppelin.com/relayer/1.3.x/guides/stellar-channels-guide) which makes submitting Soroban transactions simple by handling the concerns of both transaction fees and sequence numbers.
10
10
 
11
11
  The primary interest of this proposal is to detail the contract interface itself but many of the design decisions are informed by complexities and available solutions external to the interface. A well rounded understandings of all that's involved to make passkey powered smart wallets on Stellar actually work is necessary in order to arrive at a truly viable contract interface.
12
12
 
package/README.md CHANGED
@@ -1,106 +1,339 @@
1
1
  # Passkey Kit
2
2
 
3
- > [!WARNING]
3
+ > [!TIP]
4
+ > **Looking for the latest smart wallet SDK?**
5
+ >
6
+ > This package is the **legacy precursor** to [OpenZeppelin Smart Accounts](https://docs.openzeppelin.com/stellar-contracts/accounts/smart-account). For new projects, use **[smart-account-kit](https://github.com/kalepail/smart-account-kit)** — a comprehensive SDK built on top of the audited [OpenZeppelin stellar-contracts](https://github.com/OpenZeppelin/stellar-contracts) library.
7
+ >
8
+ > Smart Account Kit includes:
9
+ > - Context rules with fine-grained authorization scopes
10
+ > - Policy support (threshold multisig, spending limits, custom policies)
11
+ > - Session management with automatic credential persistence
12
+ > - External wallet adapter support
13
+ > - Built-in indexer for contract discovery
14
+ >
15
+ > See the [OpenZeppelin Smart Account package](https://github.com/OpenZeppelin/stellar-contracts/tree/main/packages/accounts) and [multisig example](https://github.com/OpenZeppelin/stellar-contracts/tree/main/examples/multisig-smart-account/account) for more details.
16
+
17
+ > [!WARNING]
4
18
  > Code in this repo is demo material only. It has not been audited. Do not use to hold, protect, or secure anything.
5
19
 
6
- Passkey kit is a basic TypeScript SDK for creating and managing Stellar smart wallets. It's intended to be used in tandem with [Launchtube](https://github.com/stellar/launchtube) for submitting passkey signed transactions onchain however this is not a requirement. This is both a client and a server side library. `PasskeyKit` on the client and `PasskeyServer` on the server.
20
+ A TypeScript SDK for creating and managing Stellar smart wallets using passkeys. Works with [OpenZeppelin Relayer](https://docs.openzeppelin.com/relayer/1.3.x/guides/stellar-channels-guide) for submitting passkey-signed transactions onchain.
7
21
 
8
- Demo site: [passkey-kit-demo.pages.dev](https://passkey-kit-demo.pages.dev/)
22
+ **Demo:** [passkey-kit-demo.pages.dev](https://passkey-kit-demo.pages.dev/)
9
23
 
10
- To get started first install the package:
11
- ```
24
+ ## Installation
25
+
26
+ ```bash
12
27
  pnpm i passkey-kit
13
28
  ```
14
29
 
15
- On the client:
30
+ ## Exports
31
+
32
+ ```ts
33
+ import {
34
+ PasskeyKit, // Client-side wallet management
35
+ PasskeyServer, // Server-side utilities
36
+ SACClient, // Stellar Asset Contract helper
37
+ PasskeyClient, // Low-level contract client (from passkey-kit-sdk)
38
+ SignerKey, // Signer key type constructor
39
+ SignerStore, // Storage type enum
40
+ type Signer, // Signer type
41
+ type SignerLimits // Signer limits type
42
+ } from 'passkey-kit'
43
+ ```
44
+
45
+ ---
46
+
47
+ ## PasskeyKit (Client)
48
+
49
+ Handles wallet creation, connection, and transaction signing.
50
+
51
+ ### Constructor
52
+
16
53
  ```ts
17
54
  const account = new PasskeyKit({
18
- rpcUrl: env.PUBLIC_rpcUrl,
19
- networkPassphrase: env.PUBLIC_networkPassphrase,
20
- factoryContractId: env.PUBLIC_factoryContractId,
21
- });
55
+ rpcUrl: string, // Stellar RPC URL
56
+ networkPassphrase: string, // Network passphrase
57
+ walletWasmHash: string, // Smart wallet WASM hash
58
+ timeoutInSeconds?: number, // Transaction timeout (default: 30)
59
+ WebAuthn?: { // Optional WebAuthn override
60
+ startRegistration,
61
+ startAuthentication
62
+ }
63
+ })
22
64
  ```
23
65
 
24
- On the server:
66
+ ### Properties
67
+
68
+ | Property | Type | Description |
69
+ |----------|------|-------------|
70
+ | `keyId` | `string \| undefined` | Current passkey ID (base64url) |
71
+ | `wallet` | `PasskeyClient \| undefined` | Connected wallet client |
72
+ | `networkPassphrase` | `string` | Network passphrase |
73
+
74
+ ### Methods
75
+
76
+ #### `createWallet(app, user, settings?)`
77
+ Creates a new passkey and deploys a smart wallet.
78
+
79
+ ```ts
80
+ const { rawResponse, keyId, keyIdBase64, contractId, signedTx } = await account.createWallet(
81
+ 'My App', // App name shown in passkey prompt
82
+ 'user@example.com', // User identifier
83
+ {
84
+ rpId?: string, // Relying party ID
85
+ authenticatorSelection?: AuthenticatorSelectionCriteria
86
+ }
87
+ )
88
+ ```
89
+
90
+ #### `createKey(app, user, settings?)`
91
+ Creates a new passkey without deploying a wallet.
92
+
25
93
  ```ts
26
- const account = new PasskeyServer({
27
- rpcUrl: env.PUBLIC_rpcUrl,
28
- launchtubeUrl: env.PUBLIC_launchtubeUrl,
29
- launchtubeJwt: env.PRIVATE_launchtubeJwt,
30
- mercuryUrl: env.PUBLIC_mercuryUrl,
31
- mercuryJwt: env.PRIVATE_mercuryJwt,
32
- });
94
+ const { rawResponse, keyId, keyIdBase64, publicKey } = await account.createKey(
95
+ 'My App',
96
+ 'user@example.com',
97
+ { rpId?: string, authenticatorSelection?: AuthenticatorSelectionCriteria }
98
+ )
33
99
  ```
34
100
 
35
- This is a fully typed library so docs aren't provided, however there's a full example showcasing all the core public methods in the `./demo` directory. I also recommend reviewing the [Super Peach](https://github.com/kalepail/superpeach) repo for an example of how you could implement both the client and server side in a more real-world scenario.
101
+ #### `connectWallet(opts?)`
102
+ Connects to an existing wallet using a passkey.
36
103
 
37
- Good luck, have fun, and change the world!
104
+ ```ts
105
+ const { rawResponse, keyId, keyIdBase64, contractId } = await account.connectWallet({
106
+ rpId?: string,
107
+ keyId?: string | Uint8Array, // Skip passkey prompt if provided
108
+ getContractId?: (keyId: string) => Promise<string | undefined>, // Lookup function
109
+ walletPublicKey?: string // For backwards compatibility
110
+ })
111
+ ```
38
112
 
39
- For any questions or to showcase your progress please join the `#passkeys` channel on our [Discord](https://discord.gg/stellardev).
113
+ #### `sign(txn, options?)`
114
+ Signs all auth entries for the connected wallet in a transaction.
40
115
 
41
- ## Deploy the event indexer
116
+ ```ts
117
+ const signedTxn = await account.sign(
118
+ txn, // AssembledTransaction | Tx | string (XDR)
119
+ {
120
+ rpId?: string,
121
+ keyId?: 'any' | string | Uint8Array, // 'any' allows any passkey
122
+ keypair?: Keypair, // Sign with Ed25519 instead
123
+ policy?: string, // Sign with policy instead
124
+ expiration?: number // Ledger expiration
125
+ }
126
+ )
127
+ ```
42
128
 
43
- In order to utilize the Mercury Zephyr indexing service to track available signers and reverse lookup smart wallet contract addresses from passkey ids you'll need to deploy the Zephyr program from inside the `./zephyr` directory.
129
+ #### `signAuthEntry(entry, options?)`
130
+ Signs a single authorization entry. Same options as `sign()`.
131
+
132
+ ```ts
133
+ const signedEntry = await account.signAuthEntry(entry, options)
134
+ ```
135
+
136
+ #### Signer Management
137
+
138
+ Add, update, or remove signers from the wallet.
139
+
140
+ ```ts
141
+ // Add signers
142
+ await account.addSecp256r1(keyId, publicKey, limits, store, expiration?)
143
+ await account.addEd25519(publicKey, limits, store, expiration?)
144
+ await account.addPolicy(policy, limits, store, expiration?)
145
+
146
+ // Update signers
147
+ await account.updateSecp256r1(keyId, publicKey, limits, store, expiration?)
148
+ await account.updateEd25519(publicKey, limits, store, expiration?)
149
+ await account.updatePolicy(policy, limits, store, expiration?)
150
+
151
+ // Remove signer
152
+ await account.remove(signerKey)
153
+ ```
154
+
155
+ **Parameters:**
156
+ - `keyId` - Passkey ID (string or Uint8Array)
157
+ - `publicKey` - Public key (string or Uint8Array for Secp256r1, Stellar public key for Ed25519)
158
+ - `policy` - Policy contract address
159
+ - `limits` - `SignerLimits` (see Types below)
160
+ - `store` - `SignerStore.Persistent` or `SignerStore.Temporary`
161
+ - `expiration` - Optional ledger expiration
162
+
163
+ ---
164
+
165
+ ## PasskeyServer (Server)
166
+
167
+ Server-side utilities for Mercury indexing and OpenZeppelin Relayer.
168
+
169
+ ### Constructor
170
+
171
+ ```ts
172
+ const server = new PasskeyServer({
173
+ rpcUrl?: string,
174
+ relayerUrl?: string, // OpenZeppelin Relayer URL
175
+ relayerApiKey?: string, // Relayer API key
176
+ mercuryProjectName?: string, // Mercury project name
177
+ mercuryUrl?: string, // Mercury URL
178
+ mercuryJwt?: string, // Mercury JWT (use either JWT or Key)
179
+ mercuryKey?: string // Mercury API key
180
+ })
181
+ ```
182
+
183
+ ### Methods
184
+
185
+ #### `getSigners(contractId)`
186
+ Get all signers for a wallet from Mercury.
187
+
188
+ ```ts
189
+ const signers: Signer[] = await server.getSigners('C...')
190
+ ```
191
+
192
+ #### `getContractId(options, index?)`
193
+ Reverse lookup a wallet address from a signer.
194
+
195
+ ```ts
196
+ const contractId = await server.getContractId({
197
+ keyId?: string, // Passkey ID (Secp256r1)
198
+ publicKey?: string, // Ed25519 public key
199
+ policy?: string // Policy address
200
+ }, index) // If multiple wallets, select by index (default: 0)
201
+ ```
202
+
203
+ #### `send(txn)`
204
+ Submit a transaction via OpenZeppelin Relayer.
205
+
206
+ ```ts
207
+ const result = await server.send(txn) // AssembledTransaction | Tx | string
208
+ ```
209
+
210
+ ---
211
+
212
+ ## SACClient
213
+
214
+ Helper for interacting with Stellar Asset Contracts.
215
+
216
+ ```ts
217
+ const sac = new SACClient({
218
+ networkPassphrase: string,
219
+ rpcUrl: string
220
+ })
221
+
222
+ const tokenClient = sac.getSACClient('C...') // SAC contract ID
223
+ ```
224
+
225
+ ---
226
+
227
+ ## Types
228
+
229
+ ### SignerKey
230
+
231
+ ```ts
232
+ SignerKey.Policy(contractAddress) // Policy signer
233
+ SignerKey.Ed25519(publicKey) // Ed25519 signer
234
+ SignerKey.Secp256r1(keyId) // Passkey signer
235
+ ```
236
+
237
+ ### SignerLimits
238
+
239
+ ```ts
240
+ type SignerLimits = Map<string, SignerKey[] | undefined> | undefined
241
+
242
+ // Example: Limit signer to specific contract, requires co-signer
243
+ const limits = new Map([
244
+ ['C...contractAddress', [SignerKey.Ed25519('G...')]]
245
+ ])
246
+ ```
247
+
248
+ ### SignerStore
249
+
250
+ ```ts
251
+ enum SignerStore {
252
+ Persistent = 'Persistent', // Permanent storage
253
+ Temporary = 'Temporary' // Expires, cheaper
254
+ }
255
+ ```
256
+
257
+ ### Signer
258
+
259
+ ```ts
260
+ type Signer = {
261
+ kind: string // 'Secp256r1' | 'Ed25519' | 'Policy'
262
+ key: string // Signer identifier
263
+ val: string // Public key or empty
264
+ expiration: number | null
265
+ storage: 'Persistent' | 'Temporary'
266
+ limits: string // JSON stringified limits
267
+ evicted?: boolean // True if temporary signer was evicted
268
+ }
269
+ ```
270
+
271
+ ---
272
+
273
+ ## Deploy the Mercury Indexer
274
+
275
+ To track signers and reverse lookup wallet addresses, deploy the Zephyr program:
44
276
 
45
277
  ```bash
46
278
  cd ./zephyr
47
279
  cargo install mercury-cli
48
- # Get a JWT from Mercury https://test.mercurydata.app
280
+ # Get a JWT from https://test.mercurydata.app
49
281
  export MERCURY_JWT="<YOUR.MERCURY.JWT>"
50
- # Make sure you're on Rust version 1.79.0 or newer
282
+ # Requires Rust 1.79.0+
51
283
  mercury-cli --jwt $MERCURY_JWT --local false --mainnet false deploy
52
284
  ```
53
285
 
54
- ## TypeScript gotchas
286
+ ---
287
+
288
+ ## TypeScript Configuration
55
289
 
56
- This is a TypeScript library and the npm package doesn't export a JavaScript version. The `@stellar/stellar-sdk` library is enormous and I really don't wan't folks bundling it up twice. Therefore you'll need to ensure you're transpiling this library into your project and that goes for either a TS project or a JS one. For many of you this will "just work" but for others you'll need to do some fiddling.
290
+ This library exports TypeScript only to avoid bundling `@stellar/stellar-sdk` twice. Configure your bundler to transpile it.
57
291
 
58
- For example if you're using NextJS this will mean modifying your `next.config.mjs` file to include the following packages in the `transpilePackages` key:
292
+ **Next.js** (`next.config.mjs`):
59
293
  ```mjs
60
294
  /** @type {import('next').NextConfig} */
61
295
  const nextConfig = {
62
296
  transpilePackages: [
63
- 'passkey-kit',
64
- 'passkey-factory-sdk',
297
+ 'passkey-kit',
298
+ 'passkey-factory-sdk',
65
299
  'passkey-kit-sdk',
66
300
  'sac-sdk',
67
301
  ]
68
- };
302
+ }
69
303
 
70
- export default nextConfig;
304
+ export default nextConfig
71
305
  ```
72
- If someone smarter than me knows how to include an optional JS build from a TS library please submit a PR. I just don't want to deploy a compiled version of this and wind up having folks doubling up on an already gargantuan dependency.
73
306
 
74
- ## Contributing
307
+ ---
75
308
 
76
- Passkey kit consists of three primary directories:
77
- - `./src` - Contains the TypeScript files for the actual TS SDK library.
78
- - `./demo` - Contains a basic demo of the SDK in action.
79
- - `./contracts` - Contains the Rust Soroban smart contracts of the smart wallet implementation.
80
- - `./zephyr` - Contains the [Zephyr](https://www.mercurydata.app/products/zephyr-vm) program for processing smart wallet events.
81
-
82
- To install dependencies:
309
+ ## Contributing
83
310
 
84
311
  ```bash
312
+ # Install dependencies
85
313
  pnpm i
86
- ```
87
-
88
- To build:
89
314
 
90
- ```bash
315
+ # Build
91
316
  pnpm run build
92
- ```
93
-
94
- To run the demo:
95
317
 
96
- ```bash
97
- cd ./demo
98
- pnpm i
99
- pnpm run start
318
+ # Run demo
319
+ cd ./demo && pnpm i && pnpm run start
100
320
  ```
101
321
 
322
+ **Directory structure:**
323
+ - `./src` - TypeScript SDK source
324
+ - `./demo` - Demo application
325
+ - `./contracts` - Rust Soroban smart contracts
326
+ - `./zephyr` - Mercury Zephyr indexer program
327
+
102
328
  > [!IMPORTANT]
103
- > If you fiddle with contracts in `./contracts` you'll need to run the make commands. Just remember to update the `SMART_WALLET_FACTORY` and `SMART_WALLET_WASM` values from the `make deploy` command before running `make init`.
329
+ > If modifying contracts in `./contracts`, run the make commands. Update `SMART_WALLET_FACTORY` and `SMART_WALLET_WASM` values from `make deploy` before running `make init`.
104
330
 
105
331
  > [!IMPORTANT]
106
- > Keep in mind the bindings here in `./packages` have been _heavily_ modified. Be careful when rebuilding and updating. Likely you'll only want to update the `src/index.ts` files in each respective package vs swapping out entire directories.
332
+ > The bindings in `./packages` have been heavily modified. When rebuilding, prefer updating only the `src/index.ts` files in each package.
333
+
334
+ ---
335
+
336
+ ## Resources
337
+
338
+ - [Super Peach](https://github.com/kalepail/superpeach) - Real-world implementation example
339
+ - [Discord #passkeys](https://discord.gg/stellardev) - Questions and showcase
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "passkey-kit",
3
- "version": "0.11.3",
3
+ "version": "0.12.1",
4
4
  "description": "A helper library for creating and using smart wallet accounts on the Stellar blockchain.",
5
5
  "author": "Tyler van der Hoeven",
6
6
  "license": "MIT",
@@ -8,12 +8,13 @@
8
8
  "main": "src/index.ts",
9
9
  "types": "types/index.d.ts",
10
10
  "dependencies": {
11
+ "@openzeppelin/relayer-plugin-channels": "^0.5.0",
11
12
  "@simplewebauthn/browser": "^13.2.0",
12
- "@stellar/stellar-sdk": "^14.2.0",
13
+ "@stellar/stellar-sdk": "16.0.0-rc.1",
13
14
  "base64url": "^3.0.1",
14
15
  "buffer": "^6.0.3",
15
- "sac-sdk": "0.4.2",
16
- "passkey-kit-sdk": "0.7.2"
16
+ "passkey-kit-sdk": "0.7.3",
17
+ "sac-sdk": "0.4.3"
17
18
  },
18
19
  "devDependencies": {
19
20
  "@types/node": "^24.6.0",
@@ -22,8 +23,8 @@
22
23
  "workspaces": [
23
24
  "packages/*"
24
25
  ],
25
- "engine": {
26
- "node": ">=20"
26
+ "engines": {
27
+ "node": ">=22.18.0"
27
28
  },
28
29
  "repository": {
29
30
  "type": "git",
@@ -50,6 +51,7 @@
50
51
  "build:demo": "cd demo && pnpm --ignore-workspace install && pnpm run build",
51
52
  "deploy:demo": "npx wrangler pages deploy",
52
53
  "deploy:demo:prod": "npx wrangler pages deploy --env production",
54
+ "test:p27-auth": "bun bun_tests/9.index.ts",
53
55
  "build:sac": "pnpm --filter=sac-sdk run build",
54
56
  "build:pks": "pnpm --filter=passkey-kit-sdk run build",
55
57
  "build": "pnpm run build:sac && pnpm run build:pks && tsc",
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.7.2",
2
+ "version": "0.7.3",
3
3
  "name": "passkey-kit-sdk",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
@@ -9,10 +9,13 @@
9
9
  "build": "tsc"
10
10
  },
11
11
  "dependencies": {
12
- "@stellar/stellar-sdk": "^14.2.0",
12
+ "@stellar/stellar-sdk": "16.0.0-rc.1",
13
13
  "buffer": "^6.0.3"
14
14
  },
15
15
  "devDependencies": {
16
16
  "typescript": "^5.9.2"
17
+ },
18
+ "engines": {
19
+ "node": ">=22.0.0"
17
20
  }
18
21
  }
@@ -5,11 +5,11 @@ import {
5
5
  ClientOptions as ContractClientOptions,
6
6
  MethodOptions,
7
7
  Spec as ContractSpec,
8
- } from '@stellar/stellar-sdk/minimal/contract';
8
+ } from '@stellar/stellar-sdk/contract';
9
9
  import type {
10
10
  u32,
11
11
  Option,
12
- } from '@stellar/stellar-sdk/minimal/contract';
12
+ } from '@stellar/stellar-sdk/contract';
13
13
 
14
14
  if (typeof window !== 'undefined') {
15
15
  //@ts-ignore Buffer exists
@@ -1,6 +1,6 @@
1
1
  import { Buffer } from "buffer";
2
- import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from '@stellar/stellar-sdk/minimal/contract';
3
- import type { u32, Option } from '@stellar/stellar-sdk/minimal/contract';
2
+ import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from '@stellar/stellar-sdk/contract';
3
+ import type { u32, Option } from '@stellar/stellar-sdk/contract';
4
4
  export declare const Errors: {
5
5
  1: {
6
6
  message: string;
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.4.2",
2
+ "version": "0.4.3",
3
3
  "name": "sac-sdk",
4
4
  "type": "module",
5
5
  "main": "src/index.ts",
@@ -9,10 +9,13 @@
9
9
  "build": "tsc"
10
10
  },
11
11
  "dependencies": {
12
- "@stellar/stellar-sdk": "^14.2.0",
12
+ "@stellar/stellar-sdk": "16.0.0-rc.1",
13
13
  "buffer": "^6.0.3"
14
14
  },
15
15
  "devDependencies": {
16
16
  "typescript": "^5.9.2"
17
+ },
18
+ "engines": {
19
+ "node": ">=22.0.0"
17
20
  }
18
21
  }
@@ -5,11 +5,11 @@ import {
5
5
  ClientOptions as ContractClientOptions,
6
6
  MethodOptions,
7
7
  Spec as ContractSpec,
8
- } from '@stellar/stellar-sdk/minimal/contract';
8
+ } from '@stellar/stellar-sdk/contract';
9
9
  import type {
10
10
  u32,
11
11
  i128,
12
- } from '@stellar/stellar-sdk/minimal/contract';
12
+ } from '@stellar/stellar-sdk/contract';
13
13
 
14
14
  if (typeof window !== 'undefined') {
15
15
  //@ts-ignore Buffer exists
@@ -1,6 +1,6 @@
1
1
  import { Buffer } from "buffer";
2
- import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from '@stellar/stellar-sdk/minimal/contract';
3
- import type { u32, i128 } from '@stellar/stellar-sdk/minimal/contract';
2
+ import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from '@stellar/stellar-sdk/contract';
3
+ import type { u32, i128 } from '@stellar/stellar-sdk/contract';
4
4
  export interface Client {
5
5
  /**
6
6
  * Construct and simulate a allowance transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
package/src/base.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Server } from "@stellar/stellar-sdk/minimal/rpc"
1
+ import { Server } from "@stellar/stellar-sdk/rpc"
2
2
 
3
3
  // TODO consider adding support for a signAuthEntry method that conforms to the ed25519 signature scheme of this passkey interface
4
4
  // once we do that we can clean the code a little with the `xdr.HashIdPreimage.envelopeTypeSorobanAuthorization` stuff
package/src/kit.ts CHANGED
@@ -1,12 +1,138 @@
1
1
  import { Client as PasskeyClient, type Signature, type SignerKey as SDKSignerKey, type SignerLimits as SDKSignerLimits } from 'passkey-kit-sdk'
2
- import { StrKey, hash, xdr, Keypair, Address, TransactionBuilder, Operation } from '@stellar/stellar-sdk/minimal'
2
+ import * as StellarSdk from '@stellar/stellar-sdk'
3
+ import { StrKey, hash, xdr, Keypair, Address, TransactionBuilder, Operation } from '@stellar/stellar-sdk'
3
4
  import { startRegistration, startAuthentication, type AuthenticationResponseJSON, type AuthenticatorAttestationResponseJSON, type AuthenticatorSelectionCriteria } from "@simplewebauthn/browser"
4
5
  import { Buffer } from 'buffer'
5
6
  import base64url from 'base64url'
6
7
  import type { SignerKey, SignerLimits, SignerStore } from './types'
7
8
  import { PasskeyBase } from './base'
8
- import { AssembledTransaction, basicNodeSigner, type AssembledTransactionOptions, type Tx } from '@stellar/stellar-sdk/minimal/contract'
9
- import type { Server } from '@stellar/stellar-sdk/minimal/rpc'
9
+ import { AssembledTransaction, basicNodeSigner, type AssembledTransactionOptions, type Spec as ContractSpec, type Tx } from '@stellar/stellar-sdk/contract'
10
+ import type { Server } from '@stellar/stellar-sdk/rpc'
11
+
12
+ type P27HashIdPreimage = typeof xdr.HashIdPreimage & {
13
+ envelopeTypeSorobanAuthorizationWithAddress?: (value: unknown) => xdr.HashIdPreimage
14
+ }
15
+
16
+ type P27Xdr = typeof xdr & {
17
+ HashIdPreimageSorobanAuthorizationWithAddress?: new (fields: {
18
+ networkId: Buffer
19
+ nonce: xdr.Int64
20
+ signatureExpirationLedger: number
21
+ invocation: xdr.SorobanAuthorizedInvocation
22
+ address: xdr.ScAddress
23
+ }) => unknown
24
+ }
25
+
26
+ type P27AuthSdk = typeof StellarSdk & {
27
+ buildAuthorizationEntryPreimage?: (
28
+ entry: xdr.SorobanAuthorizationEntry,
29
+ validUntilLedgerSeq: number,
30
+ networkPassphrase: string
31
+ ) => xdr.HashIdPreimage
32
+ }
33
+
34
+ type PasskeyClientWithSpec = PasskeyClient & {
35
+ spec: ContractSpec
36
+ }
37
+
38
+ export function getAddressCredentials(credentials: xdr.SorobanCredentials): xdr.SorobanAddressCredentials {
39
+ const typedCredentials = credentials as unknown as {
40
+ address: () => xdr.SorobanAddressCredentials
41
+ addressV2?: () => xdr.SorobanAddressCredentials
42
+ addressWithDelegates?: () => {
43
+ addressCredentials: () => xdr.SorobanAddressCredentials
44
+ }
45
+ }
46
+
47
+ switch (credentials.switch().name as string) {
48
+ case 'sorobanCredentialsAddress':
49
+ return typedCredentials.address()
50
+ case 'sorobanCredentialsAddressV2':
51
+ if (!typedCredentials.addressV2) {
52
+ throw new Error(
53
+ 'ADDRESS_V2 credentials require an SDK with Protocol 27 credential support'
54
+ )
55
+ }
56
+ return typedCredentials.addressV2()
57
+ case 'sorobanCredentialsAddressWithDelegates':
58
+ if (!typedCredentials.addressWithDelegates) {
59
+ throw new Error(
60
+ 'ADDRESS_WITH_DELEGATES credentials require an SDK with Protocol 27 credential support'
61
+ )
62
+ }
63
+ return typedCredentials.addressWithDelegates().addressCredentials()
64
+ }
65
+
66
+ throw new Error(`Soroban credentials do not contain address credentials: ${credentials.switch().name}`)
67
+ }
68
+
69
+ export function usesAddressBoundPayload(credentials: xdr.SorobanCredentials): boolean {
70
+ const credentialType = credentials.switch().name as string
71
+ return credentialType === 'sorobanCredentialsAddressV2'
72
+ || credentialType === 'sorobanCredentialsAddressWithDelegates'
73
+ }
74
+
75
+ export function assertSignatureExpirationLedger(expiration: number): void {
76
+ if (!Number.isInteger(expiration) || expiration < 0 || expiration > 0xffffffff) {
77
+ throw new Error('Soroban signature expiration ledger must be a uint32 integer')
78
+ }
79
+ }
80
+
81
+ export function buildSignaturePayload(
82
+ networkPassphrase: string,
83
+ entry: xdr.SorobanAuthorizationEntry,
84
+ expiration: number
85
+ ): Buffer {
86
+ assertSignatureExpirationLedger(expiration)
87
+
88
+ const credentials = getAddressCredentials(entry.credentials())
89
+ const sdkAuth = StellarSdk as P27AuthSdk
90
+
91
+ if (sdkAuth.buildAuthorizationEntryPreimage) {
92
+ credentials.signatureExpirationLedger(expiration)
93
+ return hash(sdkAuth.buildAuthorizationEntryPreimage(
94
+ entry,
95
+ expiration,
96
+ networkPassphrase
97
+ ).toXDR())
98
+ }
99
+
100
+ if (usesAddressBoundPayload(entry.credentials())) {
101
+ const hashIdPreimage = xdr.HashIdPreimage as P27HashIdPreimage
102
+ const WithAddressPreimage = (xdr as P27Xdr).HashIdPreimageSorobanAuthorizationWithAddress
103
+
104
+ if (!hashIdPreimage.envelopeTypeSorobanAuthorizationWithAddress || !WithAddressPreimage) {
105
+ throw new Error(
106
+ 'Address-bound Soroban auth credentials require an SDK with Protocol 27 auth preimage support'
107
+ )
108
+ }
109
+
110
+ credentials.signatureExpirationLedger(expiration)
111
+ const preimage = hashIdPreimage.envelopeTypeSorobanAuthorizationWithAddress(
112
+ new WithAddressPreimage({
113
+ networkId: hash(Buffer.from(networkPassphrase)),
114
+ nonce: credentials.nonce(),
115
+ signatureExpirationLedger: expiration,
116
+ invocation: entry.rootInvocation(),
117
+ address: credentials.address(),
118
+ })
119
+ )
120
+
121
+ return hash(preimage.toXDR())
122
+ }
123
+
124
+ credentials.signatureExpirationLedger(expiration)
125
+ const preimage = xdr.HashIdPreimage.envelopeTypeSorobanAuthorization(
126
+ new xdr.HashIdPreimageSorobanAuthorization({
127
+ networkId: hash(Buffer.from(networkPassphrase)),
128
+ nonce: credentials.nonce(),
129
+ signatureExpirationLedger: expiration,
130
+ invocation: entry.rootInvocation()
131
+ })
132
+ )
133
+
134
+ return hash(preimage.toXDR())
135
+ }
10
136
 
11
137
  // TODO we should allow setting the rpId in the constructor so we don't have to keep setting it for every call
12
138
  // e.g. if you want to sign with a smol.xyz key on next.smol.xyz key you have to set rpId over and over again
@@ -28,6 +154,10 @@ export class PasskeyKit extends PasskeyBase {
28
154
  public networkPassphrase: string
29
155
  public wallet: PasskeyClient | undefined
30
156
 
157
+ private get walletSpec(): ContractSpec {
158
+ return (this.wallet as PasskeyClientWithSpec).spec
159
+ }
160
+
31
161
  constructor(options: {
32
162
  rpcUrl: string,
33
163
  networkPassphrase: string,
@@ -51,7 +181,7 @@ export class PasskeyKit extends PasskeyBase {
51
181
  this.walletKeypair = Keypair.fromRawEd25519Seed(hash(Buffer.from('kalepail')));
52
182
  this.walletPublicKey = this.walletKeypair.publicKey()
53
183
  this.walletWasmHash = walletWasmHash
54
- this.timeoutInSeconds = options.timeoutInSeconds || 30 // Launchtube requires <= 30 second timeout so let's default to that
184
+ this.timeoutInSeconds = options.timeoutInSeconds || 30 // OpenZeppelin Relayer requires <= 30 second timeout so let's default to that
55
185
  this.WebAuthn = WebAuthn || { startRegistration, startAuthentication }
56
186
  }
57
187
 
@@ -247,7 +377,12 @@ export class PasskeyKit extends PasskeyBase {
247
377
  if ([keyId, keypair, policy].filter((arg) => !!arg).length > 1)
248
378
  throw new Error('Exactly one of `options.keyId`, `options.keypair`, or `options.policy` must be provided.');
249
379
 
250
- const credentials = entry.credentials().address();
380
+ const credentialType = entry.credentials().switch().name as string
381
+ if (credentialType === 'sorobanCredentialsAddressWithDelegates') {
382
+ throw new Error('ADDRESS_WITH_DELEGATES auth entries are not supported by passkey signing yet')
383
+ }
384
+
385
+ const credentials = getAddressCredentials(entry.credentials());
251
386
 
252
387
  if (!expiration) {
253
388
  expiration = credentials.signatureExpirationLedger()
@@ -255,21 +390,11 @@ export class PasskeyKit extends PasskeyBase {
255
390
  if (!expiration) {
256
391
  const { sequence } = await this.rpc.getLatestLedger()
257
392
  expiration = sequence + this.timeoutInSeconds / 5; // assumes 5 second ledger time
393
+ expiration = Math.ceil(expiration)
258
394
  }
259
395
  }
260
396
 
261
- credentials.signatureExpirationLedger(expiration)
262
-
263
- const preimage = xdr.HashIdPreimage.envelopeTypeSorobanAuthorization(
264
- new xdr.HashIdPreimageSorobanAuthorization({
265
- networkId: hash(Buffer.from(this.networkPassphrase)),
266
- nonce: credentials.nonce(),
267
- signatureExpirationLedger: credentials.signatureExpirationLedger(),
268
- invocation: entry.rootInvocation()
269
- })
270
- )
271
-
272
- const payload = hash(preimage.toXDR())
397
+ const payload = buildSignaturePayload(this.networkPassphrase, entry, expiration)
273
398
 
274
399
  // let signatures: Signatures
275
400
  let key: SDKSignerKey
@@ -367,8 +492,8 @@ export class PasskeyKit extends PasskeyBase {
367
492
  const scValType = xdr.ScSpecTypeDef.scSpecTypeUdt(
368
493
  new xdr.ScSpecTypeUdt({ name: "Signature" }),
369
494
  );
370
- const scKey = this.wallet!.spec.nativeToScVal(key, scKeyType);
371
- const scVal = val ? this.wallet!.spec.nativeToScVal(val, scValType) : xdr.ScVal.scvVoid();
495
+ const scKey = this.walletSpec.nativeToScVal(key, scKeyType);
496
+ const scVal = val ? this.walletSpec.nativeToScVal(val, scValType) : xdr.ScVal.scvVoid();
372
497
  const scEntry = new xdr.ScMapEntry({
373
498
  key: scKey,
374
499
  val: scVal,
@@ -434,7 +559,7 @@ export class PasskeyKit extends PasskeyBase {
434
559
  ) {
435
560
  if (!(txn instanceof AssembledTransaction)) {
436
561
  try {
437
- txn = AssembledTransaction.fromXDR(this.wallet!.options, typeof txn === 'string' ? txn : txn.toXDR(), this.wallet!.spec);
562
+ txn = AssembledTransaction.fromXDR(this.wallet!.options, typeof txn === 'string' ? txn : txn.toXDR(), this.walletSpec);
438
563
  } catch {
439
564
  if (!(txn instanceof AssembledTransaction)) {
440
565
  const built = TransactionBuilder.fromXDR(typeof txn === 'string' ? txn : txn.toXDR(), this.networkPassphrase);
@@ -695,4 +820,4 @@ export class PasskeyKit extends PasskeyBase {
695
820
 
696
821
  return concatSignature;
697
822
  }
698
- }
823
+ }
package/src/sac.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Client as SacClient } from 'sac-sdk'
2
2
  import { PasskeyBase } from "./base"
3
- import type { Server } from '@stellar/stellar-sdk/minimal/rpc'
3
+ import type { Server } from '@stellar/stellar-sdk/rpc'
4
4
 
5
5
  export class SACClient extends PasskeyBase {
6
6
  declare rpc: Server
package/src/server.ts CHANGED
@@ -1,29 +1,26 @@
1
- import { xdr } from "@stellar/stellar-sdk/minimal"
1
+ import { xdr } from "@stellar/stellar-sdk"
2
2
  import { PasskeyBase } from "./base"
3
3
  import base64url from "base64url"
4
- import type { Tx } from "@stellar/stellar-sdk/minimal/contract"
4
+ import type { Tx } from "@stellar/stellar-sdk/contract"
5
5
  import type { Signer } from "./types"
6
- import { AssembledTransaction } from "@stellar/stellar-sdk/minimal/contract"
7
- import { Durability } from "@stellar/stellar-sdk/minimal/rpc"
8
- import { version } from '../package.json'
9
-
10
- // TODO set default headers in constructor
6
+ import { AssembledTransaction } from "@stellar/stellar-sdk/contract"
7
+ import { Durability } from "@stellar/stellar-sdk/rpc"
8
+ import { ChannelsClient } from "@openzeppelin/relayer-plugin-channels"
11
9
 
12
10
  export class PasskeyServer extends PasskeyBase {
13
- private launchtubeJwt: string | undefined
11
+ private relayerApiKey: string | undefined
14
12
  private mercuryJwt: string | undefined
15
13
  private mercuryKey: string | undefined
14
+ private channelsClient: ChannelsClient | undefined
16
15
 
17
- public launchtubeUrl: string | undefined
18
- public launchtubeHeaders: Record<string, string> | undefined
16
+ public relayerUrl: string | undefined
19
17
  public mercuryProjectName: string | undefined
20
18
  public mercuryUrl: string | undefined
21
19
 
22
20
  constructor(options: {
23
21
  rpcUrl?: string,
24
- launchtubeUrl?: string,
25
- launchtubeJwt?: string,
26
- launchtubeHeaders?: Record<string, string>
22
+ relayerUrl?: string,
23
+ relayerApiKey?: string,
27
24
  mercuryProjectName?: string,
28
25
  mercuryUrl?: string,
29
26
  mercuryJwt?: string,
@@ -31,9 +28,8 @@ export class PasskeyServer extends PasskeyBase {
31
28
  }) {
32
29
  const {
33
30
  rpcUrl,
34
- launchtubeUrl,
35
- launchtubeJwt,
36
- launchtubeHeaders,
31
+ relayerUrl,
32
+ relayerApiKey,
37
33
  mercuryProjectName,
38
34
  mercuryUrl,
39
35
  mercuryJwt,
@@ -42,14 +38,18 @@ export class PasskeyServer extends PasskeyBase {
42
38
 
43
39
  super(rpcUrl)
44
40
 
45
- if (launchtubeUrl)
46
- this.launchtubeUrl = launchtubeUrl
41
+ if (relayerUrl)
42
+ this.relayerUrl = relayerUrl
47
43
 
48
- if (launchtubeJwt)
49
- this.launchtubeJwt = launchtubeJwt
44
+ if (relayerApiKey)
45
+ this.relayerApiKey = relayerApiKey
50
46
 
51
- if (launchtubeHeaders)
52
- this.launchtubeHeaders = launchtubeHeaders
47
+ if (relayerUrl && relayerApiKey) {
48
+ this.channelsClient = new ChannelsClient({
49
+ baseUrl: relayerUrl,
50
+ apiKey: relayerApiKey,
51
+ })
52
+ }
53
53
 
54
54
  if (mercuryProjectName)
55
55
  this.mercuryProjectName = mercuryProjectName
@@ -158,42 +158,22 @@ export class PasskeyServer extends PasskeyBase {
158
158
  - Add a method for getting a paginated or filtered list of all a wallet's events
159
159
  */
160
160
 
161
- public async send<T>(
162
- txn: AssembledTransaction<T> | Tx | string,
163
- fee?: number,
164
- ) {
165
- if (!this.launchtubeUrl)
166
- throw new Error('Launchtube service not configured')
161
+ public async send<T>(txn: AssembledTransaction<T> | Tx | string) {
162
+ if (!this.channelsClient)
163
+ throw new Error('Relayer service not configured')
167
164
 
168
- const data = new FormData();
165
+ let txnXdr: string
169
166
 
170
167
  if (txn instanceof AssembledTransaction) {
171
- txn = txn.built!.toXDR()
168
+ txnXdr = txn.built!.toXDR()
172
169
  } else if (typeof txn !== 'string') {
173
- txn = txn.toXDR()
170
+ txnXdr = txn.toXDR()
171
+ } else {
172
+ txnXdr = txn
174
173
  }
175
174
 
176
- data.set('xdr', txn);
177
-
178
- if (fee)
179
- data.set('fee', fee.toString());
180
-
181
- let lt_headers = Object.assign({
182
- 'X-Client-Name': 'passkey-kit',
183
- 'X-Client-Version': version,
184
- }, this.launchtubeHeaders)
185
-
186
- if (this.launchtubeJwt)
187
- lt_headers.authorization = `Bearer ${this.launchtubeJwt}`
188
-
189
- return fetch(this.launchtubeUrl, {
190
- method: 'POST',
191
- headers: lt_headers,
192
- body: data
193
- }).then(async (res) => {
194
- if (res.ok)
195
- return res.json()
196
- else throw await res.json()
175
+ return this.channelsClient.submitTransaction({
176
+ xdr: txnXdr,
197
177
  })
198
178
  }
199
- }
179
+ }
package/types/base.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { Server } from "@stellar/stellar-sdk/minimal/rpc";
1
+ import { Server } from "@stellar/stellar-sdk/rpc";
2
2
  export declare class PasskeyBase {
3
3
  rpcUrl: string | undefined;
4
4
  rpc: Server | undefined;
package/types/kit.d.ts CHANGED
@@ -1,11 +1,16 @@
1
1
  import { Client as PasskeyClient } from 'passkey-kit-sdk';
2
- import { xdr, Keypair } from '@stellar/stellar-sdk/minimal';
2
+ import * as StellarSdk from '@stellar/stellar-sdk';
3
+ import { xdr, Keypair } from '@stellar/stellar-sdk';
3
4
  import { startRegistration, startAuthentication, type AuthenticationResponseJSON, type AuthenticatorSelectionCriteria } from "@simplewebauthn/browser";
4
5
  import { Buffer } from 'buffer';
5
6
  import type { SignerKey, SignerLimits, SignerStore } from './types';
6
7
  import { PasskeyBase } from './base';
7
- import { AssembledTransaction, type Tx } from '@stellar/stellar-sdk/minimal/contract';
8
- import type { Server } from '@stellar/stellar-sdk/minimal/rpc';
8
+ import { AssembledTransaction, type Tx } from '@stellar/stellar-sdk/contract';
9
+ import type { Server } from '@stellar/stellar-sdk/rpc';
10
+ export declare function getAddressCredentials(credentials: xdr.SorobanCredentials): xdr.SorobanAddressCredentials;
11
+ export declare function usesAddressBoundPayload(credentials: xdr.SorobanCredentials): boolean;
12
+ export declare function assertSignatureExpirationLedger(expiration: number): void;
13
+ export declare function buildSignaturePayload(networkPassphrase: string, entry: xdr.SorobanAuthorizationEntry, expiration: number): Buffer;
9
14
  export declare class PasskeyKit extends PasskeyBase {
10
15
  rpc: Server;
11
16
  rpcUrl: string;
@@ -17,6 +22,7 @@ export declare class PasskeyKit extends PasskeyBase {
17
22
  keyId: string | undefined;
18
23
  networkPassphrase: string;
19
24
  wallet: PasskeyClient | undefined;
25
+ private get walletSpec();
20
26
  constructor(options: {
21
27
  rpcUrl: string;
22
28
  networkPassphrase: string;
@@ -35,7 +41,7 @@ export declare class PasskeyKit extends PasskeyBase {
35
41
  keyId: Buffer<ArrayBufferLike>;
36
42
  keyIdBase64: string;
37
43
  contractId: string;
38
- signedTx: Tx;
44
+ signedTx: StellarSdk.Transaction;
39
45
  }>;
40
46
  createKey(app: string, user: string, settings?: {
41
47
  rpId?: string;
@@ -70,14 +76,14 @@ export declare class PasskeyKit extends PasskeyBase {
70
76
  keypair?: Keypair;
71
77
  policy?: string;
72
78
  expiration?: number;
73
- }): Promise<AssembledTransaction<T>>;
74
- addSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
75
- addEd25519(publicKey: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
76
- addPolicy(policy: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
77
- updateSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
78
- updateEd25519(publicKey: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
79
- updatePolicy(policy: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<AssembledTransaction<null>>;
80
- remove(signer: SignerKey): Promise<AssembledTransaction<null>>;
79
+ }): Promise<StellarSdk.contract.AssembledTransaction<T>>;
80
+ addSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<StellarSdk.contract.AssembledTransaction<null>>;
81
+ addEd25519(publicKey: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<StellarSdk.contract.AssembledTransaction<null>>;
82
+ addPolicy(policy: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<StellarSdk.contract.AssembledTransaction<null>>;
83
+ updateSecp256r1(keyId: string | Uint8Array, publicKey: string | Uint8Array, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<StellarSdk.contract.AssembledTransaction<null>>;
84
+ updateEd25519(publicKey: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<StellarSdk.contract.AssembledTransaction<null>>;
85
+ updatePolicy(policy: string, limits: SignerLimits, store: SignerStore, expiration?: number): Promise<StellarSdk.contract.AssembledTransaction<null>>;
86
+ remove(signer: SignerKey): Promise<StellarSdk.contract.AssembledTransaction<null>>;
81
87
  private secp256r1;
82
88
  private ed25519;
83
89
  private policy;
package/types/sac.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  import { Client as SacClient } from 'sac-sdk';
2
2
  import { PasskeyBase } from "./base";
3
- import type { Server } from '@stellar/stellar-sdk/minimal/rpc';
3
+ import type { Server } from '@stellar/stellar-sdk/rpc';
4
4
  export declare class SACClient extends PasskeyBase {
5
5
  rpc: Server;
6
6
  rpcUrl: string;
package/types/server.d.ts CHANGED
@@ -1,20 +1,19 @@
1
1
  import { PasskeyBase } from "./base";
2
- import type { Tx } from "@stellar/stellar-sdk/minimal/contract";
2
+ import type { Tx } from "@stellar/stellar-sdk/contract";
3
3
  import type { Signer } from "./types";
4
- import { AssembledTransaction } from "@stellar/stellar-sdk/minimal/contract";
4
+ import { AssembledTransaction } from "@stellar/stellar-sdk/contract";
5
5
  export declare class PasskeyServer extends PasskeyBase {
6
- private launchtubeJwt;
6
+ private relayerApiKey;
7
7
  private mercuryJwt;
8
8
  private mercuryKey;
9
- launchtubeUrl: string | undefined;
10
- launchtubeHeaders: Record<string, string> | undefined;
9
+ private channelsClient;
10
+ relayerUrl: string | undefined;
11
11
  mercuryProjectName: string | undefined;
12
12
  mercuryUrl: string | undefined;
13
13
  constructor(options: {
14
14
  rpcUrl?: string;
15
- launchtubeUrl?: string;
16
- launchtubeJwt?: string;
17
- launchtubeHeaders?: Record<string, string>;
15
+ relayerUrl?: string;
16
+ relayerApiKey?: string;
18
17
  mercuryProjectName?: string;
19
18
  mercuryUrl?: string;
20
19
  mercuryJwt?: string;
@@ -26,5 +25,5 @@ export declare class PasskeyServer extends PasskeyBase {
26
25
  publicKey?: string;
27
26
  policy?: string;
28
27
  }, index?: number): Promise<string>;
29
- send<T>(txn: AssembledTransaction<T> | Tx | string, fee?: number): Promise<any>;
28
+ send<T>(txn: AssembledTransaction<T> | Tx | string): Promise<import("@openzeppelin/relayer-plugin-channels").ChannelsTransactionResponse>;
30
29
  }