passkey-kit 0.18.1 → 0.18.2
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/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +28 -19
- package/dist/base.d.ts +0 -7
- package/dist/base.d.ts.map +0 -1
- package/dist/base.js +0 -16
- package/dist/base.js.map +0 -1
- package/dist/indexer/stellar-indexer.d.ts +0 -115
- package/dist/indexer/stellar-indexer.d.ts.map +0 -1
- package/dist/indexer/stellar-indexer.js +0 -279
- package/dist/indexer/stellar-indexer.js.map +0 -1
package/dist/version.d.ts
CHANGED
package/dist/version.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "passkey-kit",
|
|
3
|
-
"version": "0.18.
|
|
3
|
+
"version": "0.18.2",
|
|
4
4
|
"description": "A helper library for creating and using smart wallet accounts on the Stellar blockchain.",
|
|
5
5
|
"author": "Tyler van der Hoeven <tyler@stellar.org>",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,13 +29,28 @@
|
|
|
29
29
|
"LICENCE",
|
|
30
30
|
"SECURITY.md"
|
|
31
31
|
],
|
|
32
|
+
"scripts": {
|
|
33
|
+
"sync-version": "node scripts/sync-version.js",
|
|
34
|
+
"prebuild": "node scripts/clean-dist.mjs && node scripts/sync-version.js",
|
|
35
|
+
"build:bindings": "pnpm --filter sac-sdk run build && pnpm --filter passkey-kit-sdk run build",
|
|
36
|
+
"bindings:regen": "bash scripts/bindings/build.sh",
|
|
37
|
+
"verify:bindings": "bash scripts/bindings/verify.sh",
|
|
38
|
+
"build": "pnpm run build:bindings && tsc && node scripts/verify-esm.mjs",
|
|
39
|
+
"verify:esm": "node scripts/verify-esm.mjs",
|
|
40
|
+
"test": "vitest",
|
|
41
|
+
"clean": "rm -rf dist packages/passkey-kit-sdk/dist packages/sac-sdk/dist",
|
|
42
|
+
"build:demo": "cd demo && pnpm --ignore-workspace install --frozen-lockfile && pnpm run build",
|
|
43
|
+
"deploy:demo": "npx wrangler pages deploy",
|
|
44
|
+
"deploy:demo:prod": "npx wrangler pages deploy --branch main",
|
|
45
|
+
"prepublishOnly": "pnpm run verify:bindings && pnpm run build"
|
|
46
|
+
},
|
|
32
47
|
"dependencies": {
|
|
33
48
|
"@simplewebauthn/browser": "^13.3.0",
|
|
34
49
|
"@stellar/stellar-sdk": "^16.3.0",
|
|
35
50
|
"base64url": "^3.0.1",
|
|
36
51
|
"buffer": "^6.0.3",
|
|
37
|
-
"passkey-kit-sdk": "
|
|
38
|
-
"sac-sdk": "
|
|
52
|
+
"passkey-kit-sdk": "workspace:*",
|
|
53
|
+
"sac-sdk": "workspace:*"
|
|
39
54
|
},
|
|
40
55
|
"devDependencies": {
|
|
41
56
|
"@types/node": "^24.13.3",
|
|
@@ -46,6 +61,14 @@
|
|
|
46
61
|
"peerDependencies": {
|
|
47
62
|
"@stellar/stellar-sdk": "^16.3.0"
|
|
48
63
|
},
|
|
64
|
+
"pnpm": {
|
|
65
|
+
"overrides": {
|
|
66
|
+
"@stellar/stellar-sdk": "$@stellar/stellar-sdk"
|
|
67
|
+
},
|
|
68
|
+
"onlyBuiltDependencies": [
|
|
69
|
+
"esbuild"
|
|
70
|
+
]
|
|
71
|
+
},
|
|
49
72
|
"engines": {
|
|
50
73
|
"node": ">=22.0.0"
|
|
51
74
|
},
|
|
@@ -69,19 +92,5 @@
|
|
|
69
92
|
"bugs": {
|
|
70
93
|
"url": "https://github.com/stellar/passkey-kit/issues"
|
|
71
94
|
},
|
|
72
|
-
"homepage": "https://github.com/stellar/passkey-kit/blob/main/README.md"
|
|
73
|
-
|
|
74
|
-
"sync-version": "node scripts/sync-version.js",
|
|
75
|
-
"prebuild": "node scripts/sync-version.js",
|
|
76
|
-
"build:bindings": "pnpm --filter sac-sdk run build && pnpm --filter passkey-kit-sdk run build",
|
|
77
|
-
"bindings:regen": "bash scripts/bindings/build.sh",
|
|
78
|
-
"verify:bindings": "bash scripts/bindings/verify.sh",
|
|
79
|
-
"build": "pnpm run build:bindings && tsc && node scripts/verify-esm.mjs",
|
|
80
|
-
"verify:esm": "node scripts/verify-esm.mjs",
|
|
81
|
-
"test": "vitest",
|
|
82
|
-
"clean": "rm -rf dist packages/passkey-kit-sdk/dist packages/sac-sdk/dist",
|
|
83
|
-
"build:demo": "cd demo && pnpm --ignore-workspace install --frozen-lockfile && pnpm run build",
|
|
84
|
-
"deploy:demo": "npx wrangler pages deploy",
|
|
85
|
-
"deploy:demo:prod": "npx wrangler pages deploy --branch main"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
95
|
+
"homepage": "https://github.com/stellar/passkey-kit/blob/main/README.md"
|
|
96
|
+
}
|
package/dist/base.d.ts
DELETED
package/dist/base.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAOjD,qBAAa,WAAW;IACb,MAAM,EAAE,MAAM,GAAG,SAAS,CAAA;IAC1B,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;gBAElB,MAAM,CAAC,EAAE,MAAM;CAM9B"}
|
package/dist/base.js
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { Server } from "@stellar/stellar-sdk/rpc";
|
|
2
|
-
// TODO consider adding support for a signAuthEntry method that conforms to the ed25519 signature scheme of this passkey interface
|
|
3
|
-
// once we do that we can clean the code a little with the `xdr.HashIdPreimage.envelopeTypeSorobanAuthorization` stuff
|
|
4
|
-
// ... note I've re-read the above and I've currently got no clue what this is asking for. Maybe check git-blame for when it was added to try and find some context
|
|
5
|
-
// actually this is just talking about adding support for signing transactions with an ed25519 key as well as a passkey. Simple enough
|
|
6
|
-
export class PasskeyBase {
|
|
7
|
-
rpcUrl;
|
|
8
|
-
rpc;
|
|
9
|
-
constructor(rpcUrl) {
|
|
10
|
-
if (rpcUrl) {
|
|
11
|
-
this.rpcUrl = rpcUrl;
|
|
12
|
-
this.rpc = new Server(rpcUrl);
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
//# sourceMappingURL=base.js.map
|
package/dist/base.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,0BAA0B,CAAA;AAEjD,kIAAkI;AAClI,sHAAsH;AACtH,mKAAmK;AACnK,sIAAsI;AAEtI,MAAM,OAAO,WAAW;IACb,MAAM,CAAoB;IAC1B,GAAG,CAAoB;IAE9B,YAAY,MAAe;QACvB,IAAI,MAAM,EAAE,CAAC;YACT,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;YACpB,IAAI,CAAC,GAAG,GAAG,IAAI,MAAM,CAAC,MAAM,CAAC,CAAA;QACjC,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stellar Indexer backend (Creit Tech), over `POST /v1/contract-data/`.
|
|
3
|
-
*
|
|
4
|
-
* The wallet stores one top-level contract-data entry per signer
|
|
5
|
-
* (`key = SignerKey ScVal`, `val = SignerVal`), so signer enumeration is a
|
|
6
|
-
* contract-scoped query and reverse lookup is derive-then-confirm: derive the
|
|
7
|
-
* wallet address from the keyId, then confirm the signer entry exists there.
|
|
8
|
-
* Removed signers appear as tombstoned (`deleted_at`) entries.
|
|
9
|
-
*
|
|
10
|
-
* WIRE FORMAT (F2-confirmed, todo 959 c2502 / todo 967):
|
|
11
|
-
* - The live API returns each entry's `key`/`val` as **JSON ScVal**, e.g.
|
|
12
|
-
* `{"vec":[{"symbol":"Secp256r1"},{"bytes":"<hex>"}]}` — NOT base64 XDR. We
|
|
13
|
-
* convert JSON ScVal -> `xdr.ScVal` ({@link jsonScValToXdr}) and reuse the
|
|
14
|
-
* contract-spec decoders (`scValToSignerKey`/`decodeSignerVal`). The JSON
|
|
15
|
-
* convention is the standard Stellar one: `symbol`, `bytes` (hex), `address`
|
|
16
|
-
* (strkey), `vec` (array), `map` (`[{key,val}]`), `u64`/`i64` (string),
|
|
17
|
-
* `u32`/`i32` (number), `bool`, `string`, `void` (None).
|
|
18
|
-
* - Entry fields: `id, contract_id, durability, key, val,
|
|
19
|
-
* last_modified_ledger_seq, tx_meta_version, timestamp, created_at,
|
|
20
|
-
* updated_at, deleted_at`.
|
|
21
|
-
*
|
|
22
|
-
* NETWORK: **the Stellar Indexer indexes MAINNET only** — a testnet contract
|
|
23
|
-
* returns HTTP 200 with zero entries (F2). To keep "unsupported network" from
|
|
24
|
-
* masquerading as "wallet has no signers", the backend is network-aware: use
|
|
25
|
-
* {@link StellarIndexerBackend.forNetwork} (returns `null` off mainnet), and a
|
|
26
|
-
* config pinned to a non-mainnet passphrase throws at construction rather than
|
|
27
|
-
* silently returning `[]`. Live validation therefore needs a mainnet v1 wallet
|
|
28
|
-
* (endgame-gated); until then this is unit-tested against the documented shape.
|
|
29
|
-
*
|
|
30
|
-
* @packageDocumentation
|
|
31
|
-
*/
|
|
32
|
-
import { Networks, xdr } from "@stellar/stellar-sdk";
|
|
33
|
-
import { SignerKey } from "../types.js";
|
|
34
|
-
import type { FindWalletsHardeningDeps, IndexerHealth, SignerIndexer, WalletSigner } from "./types.js";
|
|
35
|
-
/** Max contract ids per contract-data request (API cap). */
|
|
36
|
-
export declare const MAX_CONTRACTS_PER_QUERY = 25;
|
|
37
|
-
/** The only network the Stellar Indexer indexes (mainnet). */
|
|
38
|
-
export declare const STELLAR_INDEXER_NETWORK = Networks.PUBLIC;
|
|
39
|
-
/**
|
|
40
|
-
* A raw contract-data entry (F2-confirmed live shape). `key`/`val` are JSON
|
|
41
|
-
* ScVal objects (see {@link jsonScValToXdr}), not base64-XDR strings; the extra
|
|
42
|
-
* fields are carried through untyped since only these four drive decoding.
|
|
43
|
-
*/
|
|
44
|
-
export interface StellarIndexerEntry {
|
|
45
|
-
/** JSON ScVal of the SignerKey. */
|
|
46
|
-
key: unknown;
|
|
47
|
-
/** JSON ScVal of the SignerVal. */
|
|
48
|
-
val: unknown;
|
|
49
|
-
durability: "persistent" | "temporary";
|
|
50
|
-
deleted_at: string | null;
|
|
51
|
-
id?: string;
|
|
52
|
-
contract_id?: string;
|
|
53
|
-
last_modified_ledger_seq?: number;
|
|
54
|
-
tx_meta_version?: string | number;
|
|
55
|
-
timestamp?: string;
|
|
56
|
-
created_at?: string;
|
|
57
|
-
updated_at?: string;
|
|
58
|
-
}
|
|
59
|
-
export interface StellarIndexerConfig {
|
|
60
|
-
/** Base URL, e.g. https://api.stellarindexer.com */
|
|
61
|
-
url: string;
|
|
62
|
-
/** Bearer access token (server-side secret). */
|
|
63
|
-
accessToken: string;
|
|
64
|
-
/**
|
|
65
|
-
* Network passphrase this backend serves. The Stellar Indexer indexes mainnet
|
|
66
|
-
* only; a non-mainnet passphrase throws at construction (prefer
|
|
67
|
-
* {@link StellarIndexerBackend.forNetwork} to get a `null` off mainnet). When
|
|
68
|
-
* omitted, mainnet is assumed.
|
|
69
|
-
*/
|
|
70
|
-
networkPassphrase?: string;
|
|
71
|
-
/** Deps enabling derive-then-confirm reverse lookup. */
|
|
72
|
-
hardening?: FindWalletsHardeningDeps;
|
|
73
|
-
/** Clock source (seconds); injectable for tests. */
|
|
74
|
-
now?: () => number;
|
|
75
|
-
}
|
|
76
|
-
export declare class StellarIndexerBackend implements SignerIndexer {
|
|
77
|
-
private readonly config;
|
|
78
|
-
constructor(config: StellarIndexerConfig);
|
|
79
|
-
/**
|
|
80
|
-
* Network-aware factory: the backend for mainnet, or `null` for any other
|
|
81
|
-
* network (the Stellar Indexer doesn't index testnet, so "discovery disabled"
|
|
82
|
-
* is the honest answer — callers treat `null` as no-indexer rather than an
|
|
83
|
-
* empty signer set).
|
|
84
|
-
*/
|
|
85
|
-
static forNetwork(config: Omit<StellarIndexerConfig, "networkPassphrase">, networkPassphrase: string): StellarIndexerBackend | null;
|
|
86
|
-
private nowSeconds;
|
|
87
|
-
private query;
|
|
88
|
-
getSigners(wallet: string): Promise<WalletSigner[]>;
|
|
89
|
-
/**
|
|
90
|
-
* Group entries by signer key and resolve status. A key with any live entry
|
|
91
|
-
* is live/expired; a key whose every entry is tombstoned (no live counterpart
|
|
92
|
-
* in either durability) is `removed`.
|
|
93
|
-
*/
|
|
94
|
-
entriesToSigners(entries: StellarIndexerEntry[]): WalletSigner[];
|
|
95
|
-
/**
|
|
96
|
-
* Reverse lookup via derive-then-confirm. Only Secp256r1 keyIds are
|
|
97
|
-
* derivable; Ed25519/Policy signers are not discoverable through this backend
|
|
98
|
-
* (use Mercury's event-driven index for those).
|
|
99
|
-
*/
|
|
100
|
-
findWallets(key: SignerKey): Promise<string[]>;
|
|
101
|
-
health(): Promise<IndexerHealth>;
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Convert a Stellar JSON-ScVal object into an `xdr.ScVal`.
|
|
105
|
-
*
|
|
106
|
-
* The Stellar Indexer serializes ledger-entry `key`/`val` as JSON ScVal — a
|
|
107
|
-
* single-key object per value (`{"vec":[...]}`, `{"symbol":"…"}`, …). This is
|
|
108
|
-
* the inverse of that serialization for the variants a smart-wallet
|
|
109
|
-
* SignerKey/SignerVal can contain, letting the contract-spec decoders take over.
|
|
110
|
-
*
|
|
111
|
-
* Unknown variant keys THROW (never silently misdecode): an unexpected wire
|
|
112
|
-
* shape must surface as an error, not a wrong signer.
|
|
113
|
-
*/
|
|
114
|
-
export declare function jsonScValToXdr(json: unknown): xdr.ScVal;
|
|
115
|
-
//# sourceMappingURL=stellar-indexer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"stellar-indexer.d.ts","sourceRoot":"","sources":["../../src/indexer/stellar-indexer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8B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CACf,MAAM,EAAE,IAAI,CAAC,oBAAoB,EAAE,mBAAmB,CAAC,EACvD,iBAAiB,EAAE,MAAM,GACxB,qBAAqB,GAAG,IAAI;IAK/B,OAAO,CAAC,UAAU;YAIJ,KAAK;IA2Cb,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAKzD;;;;OAIG;IACH,gBAAgB,CAAC,OAAO,EAAE,mBAAmB,EAAE,GAAG,YAAY,EAAE;IA6BhE;;;;OAIG;IACG,WAAW,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC;IA2B9C,MAAM,IAAI,OAAO,CAAC,aAAa,CAAC;CAcvC;AAyBD;;;;;;;;;;GAUG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,GAAG,GAAG,CAAC,KAAK,CAwEvD"}
|
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Stellar Indexer backend (Creit Tech), over `POST /v1/contract-data/`.
|
|
3
|
-
*
|
|
4
|
-
* The wallet stores one top-level contract-data entry per signer
|
|
5
|
-
* (`key = SignerKey ScVal`, `val = SignerVal`), so signer enumeration is a
|
|
6
|
-
* contract-scoped query and reverse lookup is derive-then-confirm: derive the
|
|
7
|
-
* wallet address from the keyId, then confirm the signer entry exists there.
|
|
8
|
-
* Removed signers appear as tombstoned (`deleted_at`) entries.
|
|
9
|
-
*
|
|
10
|
-
* WIRE FORMAT (F2-confirmed, todo 959 c2502 / todo 967):
|
|
11
|
-
* - The live API returns each entry's `key`/`val` as **JSON ScVal**, e.g.
|
|
12
|
-
* `{"vec":[{"symbol":"Secp256r1"},{"bytes":"<hex>"}]}` — NOT base64 XDR. We
|
|
13
|
-
* convert JSON ScVal -> `xdr.ScVal` ({@link jsonScValToXdr}) and reuse the
|
|
14
|
-
* contract-spec decoders (`scValToSignerKey`/`decodeSignerVal`). The JSON
|
|
15
|
-
* convention is the standard Stellar one: `symbol`, `bytes` (hex), `address`
|
|
16
|
-
* (strkey), `vec` (array), `map` (`[{key,val}]`), `u64`/`i64` (string),
|
|
17
|
-
* `u32`/`i32` (number), `bool`, `string`, `void` (None).
|
|
18
|
-
* - Entry fields: `id, contract_id, durability, key, val,
|
|
19
|
-
* last_modified_ledger_seq, tx_meta_version, timestamp, created_at,
|
|
20
|
-
* updated_at, deleted_at`.
|
|
21
|
-
*
|
|
22
|
-
* NETWORK: **the Stellar Indexer indexes MAINNET only** — a testnet contract
|
|
23
|
-
* returns HTTP 200 with zero entries (F2). To keep "unsupported network" from
|
|
24
|
-
* masquerading as "wallet has no signers", the backend is network-aware: use
|
|
25
|
-
* {@link StellarIndexerBackend.forNetwork} (returns `null` off mainnet), and a
|
|
26
|
-
* config pinned to a non-mainnet passphrase throws at construction rather than
|
|
27
|
-
* silently returning `[]`. Live validation therefore needs a mainnet v1 wallet
|
|
28
|
-
* (endgame-gated); until then this is unit-tested against the documented shape.
|
|
29
|
-
*
|
|
30
|
-
* @packageDocumentation
|
|
31
|
-
*/
|
|
32
|
-
import { Address, Networks, nativeToScVal, xdr } from "@stellar/stellar-sdk";
|
|
33
|
-
import { IndexerError, PasskeyKitErrorCode } from "../errors.js";
|
|
34
|
-
import { DEFAULT_INDEXER_TIMEOUT_MS } from "../constants.js";
|
|
35
|
-
import { deriveContractAddress } from "../utils.js";
|
|
36
|
-
import { buildWalletSigner, decodeSignerVal, deriveStatus, scValToSignerKey, signerKeyToIndexerJson, } from "./codec.js";
|
|
37
|
-
/** Max contract ids per contract-data request (API cap). */
|
|
38
|
-
export const MAX_CONTRACTS_PER_QUERY = 25;
|
|
39
|
-
/** The only network the Stellar Indexer indexes (mainnet). */
|
|
40
|
-
export const STELLAR_INDEXER_NETWORK = Networks.PUBLIC;
|
|
41
|
-
export class StellarIndexerBackend {
|
|
42
|
-
config;
|
|
43
|
-
constructor(config) {
|
|
44
|
-
this.config = config;
|
|
45
|
-
if (!config.url || !config.accessToken) {
|
|
46
|
-
throw new IndexerError("StellarIndexerBackend requires url and accessToken", PasskeyKitErrorCode.INDEXER_NOT_CONFIGURED);
|
|
47
|
-
}
|
|
48
|
-
if (config.networkPassphrase &&
|
|
49
|
-
config.networkPassphrase !== STELLAR_INDEXER_NETWORK) {
|
|
50
|
-
throw new IndexerError(`Stellar Indexer indexes mainnet only; refusing a backend pinned to "${config.networkPassphrase}". ` +
|
|
51
|
-
`Use StellarIndexerBackend.forNetwork(...) to get null off mainnet.`, PasskeyKitErrorCode.INDEXER_NOT_CONFIGURED);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Network-aware factory: the backend for mainnet, or `null` for any other
|
|
56
|
-
* network (the Stellar Indexer doesn't index testnet, so "discovery disabled"
|
|
57
|
-
* is the honest answer — callers treat `null` as no-indexer rather than an
|
|
58
|
-
* empty signer set).
|
|
59
|
-
*/
|
|
60
|
-
static forNetwork(config, networkPassphrase) {
|
|
61
|
-
if (networkPassphrase !== STELLAR_INDEXER_NETWORK)
|
|
62
|
-
return null;
|
|
63
|
-
return new StellarIndexerBackend({ ...config, networkPassphrase });
|
|
64
|
-
}
|
|
65
|
-
nowSeconds() {
|
|
66
|
-
return this.config.now ? this.config.now() : Math.floor(Date.now() / 1000);
|
|
67
|
-
}
|
|
68
|
-
async query(body) {
|
|
69
|
-
const controller = new AbortController();
|
|
70
|
-
const timeout = setTimeout(() => controller.abort(), DEFAULT_INDEXER_TIMEOUT_MS);
|
|
71
|
-
try {
|
|
72
|
-
const response = await fetch(`${this.config.url}/v1/contract-data/`, {
|
|
73
|
-
method: "POST",
|
|
74
|
-
headers: {
|
|
75
|
-
"Content-Type": "application/json",
|
|
76
|
-
Authorization: `Bearer ${this.config.accessToken}`,
|
|
77
|
-
},
|
|
78
|
-
body: JSON.stringify(body),
|
|
79
|
-
signal: controller.signal,
|
|
80
|
-
});
|
|
81
|
-
if (!response.ok) {
|
|
82
|
-
const text = await response.text().catch(() => "");
|
|
83
|
-
throw new IndexerError(`Stellar Indexer request failed (${response.status}): ${text.slice(0, 200)}`, PasskeyKitErrorCode.INDEXER_REQUEST_FAILED, { status: response.status });
|
|
84
|
-
}
|
|
85
|
-
const json = (await response.json());
|
|
86
|
-
return extractEntries(json);
|
|
87
|
-
}
|
|
88
|
-
catch (err) {
|
|
89
|
-
if (err instanceof IndexerError)
|
|
90
|
-
throw err;
|
|
91
|
-
const aborted = err instanceof Error && err.name === "AbortError";
|
|
92
|
-
throw new IndexerError(aborted ? "Stellar Indexer request timed out" : String(err), PasskeyKitErrorCode.INDEXER_REQUEST_FAILED, undefined, err instanceof Error ? err : undefined);
|
|
93
|
-
}
|
|
94
|
-
finally {
|
|
95
|
-
clearTimeout(timeout);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
async getSigners(wallet) {
|
|
99
|
-
const entries = await this.query({ contracts: [wallet] });
|
|
100
|
-
return this.entriesToSigners(entries);
|
|
101
|
-
}
|
|
102
|
-
/**
|
|
103
|
-
* Group entries by signer key and resolve status. A key with any live entry
|
|
104
|
-
* is live/expired; a key whose every entry is tombstoned (no live counterpart
|
|
105
|
-
* in either durability) is `removed`.
|
|
106
|
-
*/
|
|
107
|
-
entriesToSigners(entries) {
|
|
108
|
-
const groups = new Map();
|
|
109
|
-
for (const entry of entries) {
|
|
110
|
-
// Group on the raw JSON ScVal of the key (identical signer keys serialize
|
|
111
|
-
// identically); decode once per group below.
|
|
112
|
-
const groupKey = JSON.stringify(entry.key);
|
|
113
|
-
const list = groups.get(groupKey) ?? [];
|
|
114
|
-
list.push(entry);
|
|
115
|
-
groups.set(groupKey, list);
|
|
116
|
-
}
|
|
117
|
-
const signers = [];
|
|
118
|
-
for (const [, group] of groups) {
|
|
119
|
-
const live = group.find((e) => e.deleted_at == null);
|
|
120
|
-
const chosen = live ?? group[0];
|
|
121
|
-
const key = scValToSignerKey(jsonScValToXdr(chosen.key));
|
|
122
|
-
const decoded = decodeSignerVal(jsonScValToXdr(chosen.val));
|
|
123
|
-
const storage = chosen.durability;
|
|
124
|
-
const status = live
|
|
125
|
-
? deriveStatus({
|
|
126
|
-
expiration: decoded.expiration,
|
|
127
|
-
nowSeconds: this.nowSeconds(),
|
|
128
|
-
})
|
|
129
|
-
: "removed";
|
|
130
|
-
signers.push(buildWalletSigner(key, decoded, storage, status));
|
|
131
|
-
}
|
|
132
|
-
return signers;
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Reverse lookup via derive-then-confirm. Only Secp256r1 keyIds are
|
|
136
|
-
* derivable; Ed25519/Policy signers are not discoverable through this backend
|
|
137
|
-
* (use Mercury's event-driven index for those).
|
|
138
|
-
*/
|
|
139
|
-
async findWallets(key) {
|
|
140
|
-
if (key.key !== "Secp256r1") {
|
|
141
|
-
return [];
|
|
142
|
-
}
|
|
143
|
-
if (!this.config.hardening) {
|
|
144
|
-
throw new IndexerError("findWallets requires hardening deps (networkPassphrase + deployerPublicKey) to derive candidates", PasskeyKitErrorCode.INDEXER_NOT_CONFIGURED);
|
|
145
|
-
}
|
|
146
|
-
const candidate = deriveContractAddress(Buffer.from(key.value, "base64url"), this.config.hardening.deployerPublicKey, this.config.hardening.networkPassphrase);
|
|
147
|
-
const entries = await this.query({
|
|
148
|
-
contracts: [candidate],
|
|
149
|
-
key: signerKeyToIndexerJson(key),
|
|
150
|
-
});
|
|
151
|
-
// Confirmed only if the derived wallet holds a live entry for this key.
|
|
152
|
-
const live = entries.some((e) => e.deleted_at == null);
|
|
153
|
-
return live ? [candidate] : [];
|
|
154
|
-
}
|
|
155
|
-
async health() {
|
|
156
|
-
try {
|
|
157
|
-
await this.query({
|
|
158
|
-
contracts: ["CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAWHF"],
|
|
159
|
-
});
|
|
160
|
-
return { ok: true, backend: "stellar-indexer" };
|
|
161
|
-
}
|
|
162
|
-
catch (err) {
|
|
163
|
-
return {
|
|
164
|
-
ok: false,
|
|
165
|
-
backend: "stellar-indexer",
|
|
166
|
-
detail: err instanceof Error ? err.message : String(err),
|
|
167
|
-
};
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
}
|
|
171
|
-
/**
|
|
172
|
-
* Pull the entries array out of a few known response shapes.
|
|
173
|
-
*
|
|
174
|
-
* A genuinely empty response (`null`/`undefined` or `{}`) yields `[]`, but an
|
|
175
|
-
* UNRECOGNIZED non-empty envelope throws rather than silently degrading to `[]`:
|
|
176
|
-
* conflating "shape changed" with "wallet has no signers" would burn the whole
|
|
177
|
-
* retry budget and then report a valid wallet as signer-less (audit LOW).
|
|
178
|
-
*/
|
|
179
|
-
function extractEntries(json) {
|
|
180
|
-
if (Array.isArray(json))
|
|
181
|
-
return json;
|
|
182
|
-
if (json == null)
|
|
183
|
-
return [];
|
|
184
|
-
if (typeof json === "object") {
|
|
185
|
-
const obj = json;
|
|
186
|
-
if (Array.isArray(obj.entries))
|
|
187
|
-
return obj.entries;
|
|
188
|
-
if (Array.isArray(obj.data))
|
|
189
|
-
return obj.data;
|
|
190
|
-
if (Object.keys(obj).length === 0)
|
|
191
|
-
return []; // genuinely-empty object
|
|
192
|
-
}
|
|
193
|
-
throw new IndexerError("Unrecognized Stellar Indexer response shape (expected an array or { entries | data: [...] })", PasskeyKitErrorCode.INDEXER_REQUEST_FAILED);
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Convert a Stellar JSON-ScVal object into an `xdr.ScVal`.
|
|
197
|
-
*
|
|
198
|
-
* The Stellar Indexer serializes ledger-entry `key`/`val` as JSON ScVal — a
|
|
199
|
-
* single-key object per value (`{"vec":[...]}`, `{"symbol":"…"}`, …). This is
|
|
200
|
-
* the inverse of that serialization for the variants a smart-wallet
|
|
201
|
-
* SignerKey/SignerVal can contain, letting the contract-spec decoders take over.
|
|
202
|
-
*
|
|
203
|
-
* Unknown variant keys THROW (never silently misdecode): an unexpected wire
|
|
204
|
-
* shape must surface as an error, not a wrong signer.
|
|
205
|
-
*/
|
|
206
|
-
export function jsonScValToXdr(json) {
|
|
207
|
-
// Some encoders represent `void`/None as a bare null.
|
|
208
|
-
if (json === null || json === undefined)
|
|
209
|
-
return xdr.ScVal.scvVoid();
|
|
210
|
-
if (typeof json !== "object") {
|
|
211
|
-
throw new IndexerError(`Unrecognized JSON ScVal (not an object): ${JSON.stringify(json)}`, PasskeyKitErrorCode.INDEXER_REQUEST_FAILED);
|
|
212
|
-
}
|
|
213
|
-
const obj = json;
|
|
214
|
-
const keys = Object.keys(obj);
|
|
215
|
-
if (keys.length !== 1) {
|
|
216
|
-
throw new IndexerError(`Unrecognized JSON ScVal (expected exactly one type key): ${JSON.stringify(keys)}`, PasskeyKitErrorCode.INDEXER_REQUEST_FAILED);
|
|
217
|
-
}
|
|
218
|
-
const tag = keys[0];
|
|
219
|
-
const v = obj[tag];
|
|
220
|
-
switch (tag) {
|
|
221
|
-
case "void":
|
|
222
|
-
return xdr.ScVal.scvVoid();
|
|
223
|
-
case "bool":
|
|
224
|
-
return xdr.ScVal.scvBool(Boolean(v));
|
|
225
|
-
case "u32":
|
|
226
|
-
return xdr.ScVal.scvU32(Number(v));
|
|
227
|
-
case "i32":
|
|
228
|
-
return xdr.ScVal.scvI32(Number(v));
|
|
229
|
-
case "u64":
|
|
230
|
-
return nativeToScVal(BigInt(v), { type: "u64" });
|
|
231
|
-
case "i64":
|
|
232
|
-
return nativeToScVal(BigInt(v), { type: "i64" });
|
|
233
|
-
case "timepoint":
|
|
234
|
-
return nativeToScVal(BigInt(v), { type: "timepoint" });
|
|
235
|
-
case "duration":
|
|
236
|
-
return nativeToScVal(BigInt(v), { type: "duration" });
|
|
237
|
-
case "u128":
|
|
238
|
-
return nativeToScVal(bigIntOfParts(v), { type: "u128" });
|
|
239
|
-
case "i128":
|
|
240
|
-
return nativeToScVal(bigIntOfParts(v), { type: "i128" });
|
|
241
|
-
case "u256":
|
|
242
|
-
return nativeToScVal(bigIntOfParts(v), { type: "u256" });
|
|
243
|
-
case "i256":
|
|
244
|
-
return nativeToScVal(bigIntOfParts(v), { type: "i256" });
|
|
245
|
-
case "bytes":
|
|
246
|
-
return xdr.ScVal.scvBytes(Buffer.from(String(v), "hex"));
|
|
247
|
-
case "string":
|
|
248
|
-
return xdr.ScVal.scvString(String(v));
|
|
249
|
-
case "symbol":
|
|
250
|
-
return xdr.ScVal.scvSymbol(String(v));
|
|
251
|
-
case "address":
|
|
252
|
-
return Address.fromString(String(v)).toScVal();
|
|
253
|
-
case "vec":
|
|
254
|
-
return xdr.ScVal.scvVec(v.map(jsonScValToXdr));
|
|
255
|
-
case "map":
|
|
256
|
-
return xdr.ScVal.scvMap(v.map((e) => new xdr.ScMapEntry({
|
|
257
|
-
key: jsonScValToXdr(e.key),
|
|
258
|
-
val: jsonScValToXdr(e.val),
|
|
259
|
-
})));
|
|
260
|
-
default:
|
|
261
|
-
throw new IndexerError(`Unsupported JSON ScVal type "${tag}"`, PasskeyKitErrorCode.INDEXER_REQUEST_FAILED);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
/**
|
|
265
|
-
* Coerce a large-integer JSON ScVal value to a bigint, accepting either a
|
|
266
|
-
* decimal string/number or a `{ hi, lo }` multi-part object (the exact 128/256
|
|
267
|
-
* wire shape is undocumented and unused by SignerVal — u64 covers expiration —
|
|
268
|
-
* so this stays tolerant).
|
|
269
|
-
*/
|
|
270
|
-
function bigIntOfParts(v) {
|
|
271
|
-
if (typeof v === "string" || typeof v === "number")
|
|
272
|
-
return BigInt(v);
|
|
273
|
-
if (v && typeof v === "object" && "hi" in v && "lo" in v) {
|
|
274
|
-
const { hi, lo } = v;
|
|
275
|
-
return (BigInt(hi) << 64n) | BigInt(lo);
|
|
276
|
-
}
|
|
277
|
-
throw new IndexerError(`Unrecognized large-integer JSON ScVal value: ${JSON.stringify(v)}`, PasskeyKitErrorCode.INDEXER_REQUEST_FAILED);
|
|
278
|
-
}
|
|
279
|
-
//# sourceMappingURL=stellar-indexer.js.map
|
|
@@ -1 +0,0 @@
|
|
|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