passkey-kit 0.10.16 → 0.10.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/package.json +4 -4
- package/packages/passkey-kit-sdk/package.json +2 -2
- package/packages/sac-sdk/package.json +2 -2
- package/src/kit.ts +3 -1
- package/src/server.ts +25 -7
- package/types/{server.d.ts → src/server.d.ts} +2 -0
- /package/types/{base.d.ts → src/base.d.ts} +0 -0
- /package/types/{index.d.ts → src/index.d.ts} +0 -0
- /package/types/{kit.d.ts → src/kit.d.ts} +0 -0
- /package/types/{sac.d.ts → src/sac.d.ts} +0 -0
- /package/types/{types.d.ts → src/types.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "passkey-kit",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.18",
|
|
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",
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
"@stellar/stellar-sdk": "^13.1.0",
|
|
13
13
|
"base64url": "^3.0.1",
|
|
14
14
|
"buffer": "^6.0.3",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
15
|
+
"passkey-kit-sdk": "0.6.6",
|
|
16
|
+
"sac-sdk": "0.3.6"
|
|
17
17
|
},
|
|
18
18
|
"devDependencies": {
|
|
19
19
|
"@simplewebauthn/types": "^12.0.0",
|
|
20
|
-
"@types/node": "^22.13.
|
|
20
|
+
"@types/node": "^22.13.10",
|
|
21
21
|
"typescript": "^5.8.2"
|
|
22
22
|
},
|
|
23
23
|
"workspaces": [
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.6.
|
|
2
|
+
"version": "0.6.6",
|
|
3
3
|
"name": "passkey-kit-sdk",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"@stellar/stellar-sdk": "13.1.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"typescript": "5.
|
|
16
|
+
"typescript": "5.8.2"
|
|
17
17
|
}
|
|
18
18
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"version": "0.3.
|
|
2
|
+
"version": "0.3.6",
|
|
3
3
|
"name": "sac-sdk",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "src/index.ts",
|
|
@@ -13,6 +13,6 @@
|
|
|
13
13
|
"@stellar/stellar-sdk": "13.1.0"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"typescript": "5.
|
|
16
|
+
"typescript": "5.8.2"
|
|
17
17
|
}
|
|
18
18
|
}
|
package/src/kit.ts
CHANGED
|
@@ -136,7 +136,9 @@ export class PasskeyKit extends PasskeyBase {
|
|
|
136
136
|
rpId?: string,
|
|
137
137
|
keyId?: string | Uint8Array,
|
|
138
138
|
getContractId?: (keyId: string) => Promise<string | undefined>,
|
|
139
|
-
|
|
139
|
+
// TEMP for backwards compatibility for when we seeded wallets from a factory address
|
|
140
|
+
// Consider putting this somewhere else??
|
|
141
|
+
walletPublicKey?: string
|
|
140
142
|
}) {
|
|
141
143
|
let { keyId, rpId, getContractId, walletPublicKey } = opts || {}
|
|
142
144
|
let keyIdBuffer: Buffer
|
package/src/server.ts
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { xdr } from "@stellar/stellar-sdk/minimal"
|
|
2
2
|
import { PasskeyBase } from "./base"
|
|
3
3
|
import base64url from "base64url"
|
|
4
4
|
import type { Tx } from "@stellar/stellar-sdk/minimal/contract"
|
|
5
5
|
import type { Signer } from "./types"
|
|
6
6
|
import { AssembledTransaction } from "@stellar/stellar-sdk/minimal/contract"
|
|
7
7
|
import { Durability } from "@stellar/stellar-sdk/minimal/rpc"
|
|
8
|
+
import { version } from '../package.json'
|
|
9
|
+
|
|
10
|
+
// TODO set default headers in constructor
|
|
8
11
|
|
|
9
12
|
export class PasskeyServer extends PasskeyBase {
|
|
10
13
|
private launchtubeJwt: string | undefined
|
|
@@ -12,6 +15,7 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
12
15
|
private mercuryKey: string | undefined
|
|
13
16
|
|
|
14
17
|
public launchtubeUrl: string | undefined
|
|
18
|
+
public launchtubeHeaders: Record<string, string> | undefined
|
|
15
19
|
public mercuryProjectName: string | undefined
|
|
16
20
|
public mercuryUrl: string | undefined
|
|
17
21
|
|
|
@@ -19,6 +23,7 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
19
23
|
rpcUrl?: string,
|
|
20
24
|
launchtubeUrl?: string,
|
|
21
25
|
launchtubeJwt?: string,
|
|
26
|
+
launchtubeHeaders?: Record<string, string>
|
|
22
27
|
mercuryProjectName?: string,
|
|
23
28
|
mercuryUrl?: string,
|
|
24
29
|
mercuryJwt?: string,
|
|
@@ -28,6 +33,7 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
28
33
|
rpcUrl,
|
|
29
34
|
launchtubeUrl,
|
|
30
35
|
launchtubeJwt,
|
|
36
|
+
launchtubeHeaders,
|
|
31
37
|
mercuryProjectName,
|
|
32
38
|
mercuryUrl,
|
|
33
39
|
mercuryJwt,
|
|
@@ -42,6 +48,9 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
42
48
|
if (launchtubeJwt)
|
|
43
49
|
this.launchtubeJwt = launchtubeJwt
|
|
44
50
|
|
|
51
|
+
if (launchtubeHeaders)
|
|
52
|
+
this.launchtubeHeaders = launchtubeHeaders
|
|
53
|
+
|
|
45
54
|
if (mercuryProjectName)
|
|
46
55
|
this.mercuryProjectName = mercuryProjectName
|
|
47
56
|
|
|
@@ -149,8 +158,11 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
149
158
|
- Add a method for getting a paginated or filtered list of all a wallet's events
|
|
150
159
|
*/
|
|
151
160
|
|
|
152
|
-
public async send<T>(
|
|
153
|
-
|
|
161
|
+
public async send<T>(
|
|
162
|
+
txn: AssembledTransaction<T> | Tx | string,
|
|
163
|
+
fee?: number,
|
|
164
|
+
) {
|
|
165
|
+
if (!this.launchtubeUrl)
|
|
154
166
|
throw new Error('Launchtube service not configured')
|
|
155
167
|
|
|
156
168
|
const data = new FormData();
|
|
@@ -166,15 +178,21 @@ export class PasskeyServer extends PasskeyBase {
|
|
|
166
178
|
if (fee)
|
|
167
179
|
data.set('fee', fee.toString());
|
|
168
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
|
+
|
|
169
189
|
return fetch(this.launchtubeUrl, {
|
|
170
190
|
method: 'POST',
|
|
171
|
-
headers:
|
|
172
|
-
authorization: `Bearer ${this.launchtubeJwt}`,
|
|
173
|
-
},
|
|
191
|
+
headers: lt_headers,
|
|
174
192
|
body: data
|
|
175
193
|
}).then(async (res) => {
|
|
176
194
|
if (res.ok)
|
|
177
|
-
|
|
195
|
+
return res.json()
|
|
178
196
|
else throw await res.json()
|
|
179
197
|
})
|
|
180
198
|
}
|
|
@@ -7,12 +7,14 @@ export declare class PasskeyServer extends PasskeyBase {
|
|
|
7
7
|
private mercuryJwt;
|
|
8
8
|
private mercuryKey;
|
|
9
9
|
launchtubeUrl: string | undefined;
|
|
10
|
+
launchtubeHeaders: Record<string, string> | undefined;
|
|
10
11
|
mercuryProjectName: string | undefined;
|
|
11
12
|
mercuryUrl: string | undefined;
|
|
12
13
|
constructor(options: {
|
|
13
14
|
rpcUrl?: string;
|
|
14
15
|
launchtubeUrl?: string;
|
|
15
16
|
launchtubeJwt?: string;
|
|
17
|
+
launchtubeHeaders?: Record<string, string>;
|
|
16
18
|
mercuryProjectName?: string;
|
|
17
19
|
mercuryUrl?: string;
|
|
18
20
|
mercuryJwt?: string;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|