passkey-kit 0.12.0 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +399 -227
- package/{types → dist}/base.d.ts +2 -1
- package/dist/base.d.ts.map +1 -0
- package/{src/base.ts → dist/base.js} +8 -10
- package/dist/base.js.map +1 -0
- package/dist/base64url.d.ts +18 -0
- package/dist/base64url.d.ts.map +1 -0
- package/dist/base64url.js +18 -0
- package/dist/base64url.js.map +1 -0
- package/dist/constants.d.ts +87 -0
- package/dist/constants.d.ts.map +1 -0
- package/dist/constants.js +111 -0
- package/dist/constants.js.map +1 -0
- package/dist/contract-errors.d.ts +69 -0
- package/dist/contract-errors.d.ts.map +1 -0
- package/dist/contract-errors.js +129 -0
- package/dist/contract-errors.js.map +1 -0
- package/dist/errors.d.ts +163 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +244 -0
- package/dist/errors.js.map +1 -0
- package/dist/events.d.ts +94 -0
- package/dist/events.d.ts.map +1 -0
- package/dist/events.js +92 -0
- package/dist/events.js.map +1 -0
- package/dist/index.d.ts +22 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +36 -0
- package/dist/index.js.map +1 -0
- package/dist/indexer/codec.d.ts +18 -0
- package/dist/indexer/codec.d.ts.map +1 -0
- package/dist/indexer/codec.js +32 -0
- package/dist/indexer/codec.js.map +1 -0
- package/dist/indexer/index.d.ts +25 -0
- package/dist/indexer/index.d.ts.map +1 -0
- package/dist/indexer/index.js +34 -0
- package/dist/indexer/index.js.map +1 -0
- package/dist/indexer/mercury.d.ts +88 -0
- package/dist/indexer/mercury.d.ts.map +1 -0
- package/dist/indexer/mercury.js +237 -0
- package/dist/indexer/mercury.js.map +1 -0
- package/dist/indexer/stellar-indexer.d.ts +115 -0
- package/dist/indexer/stellar-indexer.d.ts.map +1 -0
- package/dist/indexer/stellar-indexer.js +279 -0
- package/dist/indexer/stellar-indexer.js.map +1 -0
- package/dist/indexer/types.d.ts +73 -0
- package/dist/indexer/types.d.ts.map +1 -0
- package/dist/indexer/types.js +9 -0
- package/dist/indexer/types.js.map +1 -0
- package/dist/kit/auth-payload.d.ts +89 -0
- package/dist/kit/auth-payload.d.ts.map +1 -0
- package/dist/kit/auth-payload.js +203 -0
- package/dist/kit/auth-payload.js.map +1 -0
- package/dist/kit/deploy-ops.d.ts +45 -0
- package/dist/kit/deploy-ops.d.ts.map +1 -0
- package/dist/kit/deploy-ops.js +69 -0
- package/dist/kit/deploy-ops.js.map +1 -0
- package/dist/kit/tx-ops.d.ts +92 -0
- package/dist/kit/tx-ops.d.ts.map +1 -0
- package/dist/kit/tx-ops.js +113 -0
- package/dist/kit/tx-ops.js.map +1 -0
- package/dist/kit/wallet-ops.d.ts +59 -0
- package/dist/kit/wallet-ops.d.ts.map +1 -0
- package/dist/kit/wallet-ops.js +122 -0
- package/dist/kit/wallet-ops.js.map +1 -0
- package/dist/kit/webauthn-ops.d.ts +55 -0
- package/dist/kit/webauthn-ops.d.ts.map +1 -0
- package/dist/kit/webauthn-ops.js +79 -0
- package/dist/kit/webauthn-ops.js.map +1 -0
- package/dist/kit.d.ts +128 -0
- package/dist/kit.d.ts.map +1 -0
- package/dist/kit.js +276 -0
- package/dist/kit.js.map +1 -0
- package/dist/managers/credential-manager.d.ts +39 -0
- package/dist/managers/credential-manager.d.ts.map +1 -0
- package/dist/managers/credential-manager.js +47 -0
- package/dist/managers/credential-manager.js.map +1 -0
- package/dist/managers/index.d.ts +7 -0
- package/dist/managers/index.d.ts.map +1 -0
- package/dist/managers/index.js +7 -0
- package/dist/managers/index.js.map +1 -0
- package/dist/managers/signer-manager.d.ts +51 -0
- package/dist/managers/signer-manager.d.ts.map +1 -0
- package/dist/managers/signer-manager.js +92 -0
- package/dist/managers/signer-manager.js.map +1 -0
- package/dist/managers/submission-manager.d.ts +52 -0
- package/dist/managers/submission-manager.d.ts.map +1 -0
- package/dist/managers/submission-manager.js +77 -0
- package/dist/managers/submission-manager.js.map +1 -0
- package/dist/relayer.d.ts +61 -0
- package/dist/relayer.d.ts.map +1 -0
- package/dist/relayer.js +119 -0
- package/dist/relayer.js.map +1 -0
- package/dist/rpc-data.d.ts +35 -0
- package/dist/rpc-data.d.ts.map +1 -0
- package/dist/rpc-data.js +49 -0
- package/dist/rpc-data.js.map +1 -0
- package/dist/sac.d.ts +31 -0
- package/dist/sac.d.ts.map +1 -0
- package/dist/sac.js +47 -0
- package/dist/sac.js.map +1 -0
- package/dist/server.d.ts +79 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +152 -0
- package/dist/server.js.map +1 -0
- package/dist/signers.d.ts +83 -0
- package/dist/signers.d.ts.map +1 -0
- package/dist/signers.js +124 -0
- package/dist/signers.js.map +1 -0
- package/dist/storage/index.d.ts +13 -0
- package/dist/storage/index.d.ts.map +1 -0
- package/dist/storage/index.js +12 -0
- package/dist/storage/index.js.map +1 -0
- package/dist/storage/indexeddb.d.ts +26 -0
- package/dist/storage/indexeddb.d.ts.map +1 -0
- package/dist/storage/indexeddb.js +100 -0
- package/dist/storage/indexeddb.js.map +1 -0
- package/dist/storage/localStorage.d.ts +22 -0
- package/dist/storage/localStorage.d.ts.map +1 -0
- package/dist/storage/localStorage.js +86 -0
- package/dist/storage/localStorage.js.map +1 -0
- package/dist/storage/memory.d.ts +18 -0
- package/dist/storage/memory.d.ts.map +1 -0
- package/dist/storage/memory.js +41 -0
- package/dist/storage/memory.js.map +1 -0
- package/dist/types.d.ts +136 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +39 -0
- package/dist/types.js.map +1 -0
- package/dist/utils.d.ts +52 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +153 -0
- package/dist/utils.js.map +1 -0
- package/dist/validation.d.ts +40 -0
- package/dist/validation.d.ts.map +1 -0
- package/dist/validation.js +73 -0
- package/dist/validation.js.map +1 -0
- package/dist/version.d.ts +7 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +9 -0
- package/dist/version.js.map +1 -0
- package/package.json +48 -20
- package/.claude/settings.local.json +0 -20
- package/.cursorrules +0 -170
- package/.gitattributes +0 -2
- package/.github/workflows/release.yml +0 -21
- package/.vscode/settings.json +0 -6
- package/PROPOSAL.md +0 -397
- package/cheatsheet.txt +0 -18
- package/clone-js-sdk.sh +0 -21
- package/packages/passkey-kit-sdk/README.md +0 -54
- package/packages/passkey-kit-sdk/package.json +0 -18
- package/packages/passkey-kit-sdk/src/index.ts +0 -171
- package/packages/passkey-kit-sdk/tsconfig.json +0 -98
- package/packages/passkey-kit-sdk/types/index.d.ts +0 -190
- package/packages/sac-sdk/README.md +0 -54
- package/packages/sac-sdk/package.json +0 -18
- package/packages/sac-sdk/src/index.ts +0 -586
- package/packages/sac-sdk/tsconfig.json +0 -98
- package/packages/sac-sdk/types/index.d.ts +0 -532
- package/pnpm-workspace.yaml +0 -2
- package/src/index.ts +0 -5
- package/src/kit.ts +0 -698
- package/src/sac.ts +0 -29
- package/src/server.ts +0 -179
- package/src/types.ts +0 -32
- package/tsconfig.json +0 -28
- package/types/index.d.ts +0 -5
- package/types/kit.d.ts +0 -89
- package/types/sac.d.ts +0 -13
- package/types/server.d.ts +0 -29
- package/types/types.d.ts +0 -22
package/src/sac.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { Client as SacClient } from 'sac-sdk'
|
|
2
|
-
import { PasskeyBase } from "./base"
|
|
3
|
-
import type { Server } from '@stellar/stellar-sdk/minimal/rpc'
|
|
4
|
-
|
|
5
|
-
export class SACClient extends PasskeyBase {
|
|
6
|
-
declare rpc: Server
|
|
7
|
-
declare rpcUrl: string
|
|
8
|
-
|
|
9
|
-
public networkPassphrase: string
|
|
10
|
-
|
|
11
|
-
constructor(options: {
|
|
12
|
-
networkPassphrase: string,
|
|
13
|
-
rpcUrl: string
|
|
14
|
-
}) {
|
|
15
|
-
const { networkPassphrase, rpcUrl } = options
|
|
16
|
-
|
|
17
|
-
super(rpcUrl)
|
|
18
|
-
|
|
19
|
-
this.networkPassphrase = networkPassphrase
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
public getSACClient(SACContractId: string) {
|
|
23
|
-
return new SacClient({
|
|
24
|
-
contractId: SACContractId,
|
|
25
|
-
networkPassphrase: this.networkPassphrase,
|
|
26
|
-
rpcUrl: this.rpcUrl,
|
|
27
|
-
})
|
|
28
|
-
}
|
|
29
|
-
}
|
package/src/server.ts
DELETED
|
@@ -1,179 +0,0 @@
|
|
|
1
|
-
import { xdr } from "@stellar/stellar-sdk/minimal"
|
|
2
|
-
import { PasskeyBase } from "./base"
|
|
3
|
-
import base64url from "base64url"
|
|
4
|
-
import type { Tx } from "@stellar/stellar-sdk/minimal/contract"
|
|
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 { ChannelsClient } from "@openzeppelin/relayer-plugin-channels"
|
|
9
|
-
|
|
10
|
-
export class PasskeyServer extends PasskeyBase {
|
|
11
|
-
private relayerApiKey: string | undefined
|
|
12
|
-
private mercuryJwt: string | undefined
|
|
13
|
-
private mercuryKey: string | undefined
|
|
14
|
-
private channelsClient: ChannelsClient | undefined
|
|
15
|
-
|
|
16
|
-
public relayerUrl: string | undefined
|
|
17
|
-
public mercuryProjectName: string | undefined
|
|
18
|
-
public mercuryUrl: string | undefined
|
|
19
|
-
|
|
20
|
-
constructor(options: {
|
|
21
|
-
rpcUrl?: string,
|
|
22
|
-
relayerUrl?: string,
|
|
23
|
-
relayerApiKey?: string,
|
|
24
|
-
mercuryProjectName?: string,
|
|
25
|
-
mercuryUrl?: string,
|
|
26
|
-
mercuryJwt?: string,
|
|
27
|
-
mercuryKey?: string,
|
|
28
|
-
}) {
|
|
29
|
-
const {
|
|
30
|
-
rpcUrl,
|
|
31
|
-
relayerUrl,
|
|
32
|
-
relayerApiKey,
|
|
33
|
-
mercuryProjectName,
|
|
34
|
-
mercuryUrl,
|
|
35
|
-
mercuryJwt,
|
|
36
|
-
mercuryKey,
|
|
37
|
-
} = options
|
|
38
|
-
|
|
39
|
-
super(rpcUrl)
|
|
40
|
-
|
|
41
|
-
if (relayerUrl)
|
|
42
|
-
this.relayerUrl = relayerUrl
|
|
43
|
-
|
|
44
|
-
if (relayerApiKey)
|
|
45
|
-
this.relayerApiKey = relayerApiKey
|
|
46
|
-
|
|
47
|
-
if (relayerUrl && relayerApiKey) {
|
|
48
|
-
this.channelsClient = new ChannelsClient({
|
|
49
|
-
baseUrl: relayerUrl,
|
|
50
|
-
apiKey: relayerApiKey,
|
|
51
|
-
})
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
if (mercuryProjectName)
|
|
55
|
-
this.mercuryProjectName = mercuryProjectName
|
|
56
|
-
|
|
57
|
-
if (mercuryUrl)
|
|
58
|
-
this.mercuryUrl = mercuryUrl
|
|
59
|
-
|
|
60
|
-
if (mercuryJwt)
|
|
61
|
-
this.mercuryJwt = mercuryJwt
|
|
62
|
-
|
|
63
|
-
if (mercuryKey)
|
|
64
|
-
this.mercuryKey = mercuryKey
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
public async getSigners(contractId: string) {
|
|
68
|
-
if (!this.rpc || !this.mercuryProjectName || !this.mercuryUrl || (!this.mercuryJwt && !this.mercuryKey))
|
|
69
|
-
throw new Error('Mercury service not configured')
|
|
70
|
-
|
|
71
|
-
const signers = await fetch(`${this.mercuryUrl}/zephyr/execute`, {
|
|
72
|
-
method: 'POST',
|
|
73
|
-
headers: {
|
|
74
|
-
'Content-Type': 'application/json',
|
|
75
|
-
Authorization: this.mercuryJwt ? `Bearer ${this.mercuryJwt}` : this.mercuryKey!
|
|
76
|
-
},
|
|
77
|
-
body: JSON.stringify({
|
|
78
|
-
project_name: this.mercuryProjectName,
|
|
79
|
-
mode: {
|
|
80
|
-
Function: {
|
|
81
|
-
fname: "get_signers_by_address",
|
|
82
|
-
arguments: JSON.stringify({
|
|
83
|
-
address: contractId
|
|
84
|
-
})
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
})
|
|
88
|
-
})
|
|
89
|
-
.then(async (res) => {
|
|
90
|
-
if (res.ok)
|
|
91
|
-
return res.json()
|
|
92
|
-
|
|
93
|
-
throw await res.json()
|
|
94
|
-
})
|
|
95
|
-
|
|
96
|
-
for (const signer of signers) {
|
|
97
|
-
if (signer.storage === 'Temporary') {
|
|
98
|
-
try {
|
|
99
|
-
await this.rpc.getContractData(contractId, xdr.ScVal.scvBytes(base64url.toBuffer(signer.key)), Durability.Temporary)
|
|
100
|
-
} catch {
|
|
101
|
-
signer.evicted = true
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
return signers as Signer[]
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
public async getContractId(options: {
|
|
110
|
-
keyId?: string,
|
|
111
|
-
publicKey?: string,
|
|
112
|
-
policy?: string,
|
|
113
|
-
}, index = 0) {
|
|
114
|
-
if (!this.mercuryProjectName || !this.mercuryUrl || (!this.mercuryJwt && !this.mercuryKey))
|
|
115
|
-
throw new Error('Mercury service not configured')
|
|
116
|
-
|
|
117
|
-
let { keyId, publicKey, policy } = options || {}
|
|
118
|
-
|
|
119
|
-
if ([keyId, publicKey, policy].filter((arg) => !!arg).length > 1)
|
|
120
|
-
throw new Error('Exactly one of `options.keyId`, `options.publicKey`, or `options.policy` must be provided.');
|
|
121
|
-
|
|
122
|
-
let args: { key: string, kind: 'Secp256r1' | 'Ed25519' | 'Policy' }
|
|
123
|
-
|
|
124
|
-
if (keyId)
|
|
125
|
-
args = { key: keyId, kind: 'Secp256r1' }
|
|
126
|
-
else if (publicKey)
|
|
127
|
-
args = { key: publicKey, kind: 'Ed25519' }
|
|
128
|
-
else if (policy)
|
|
129
|
-
args = { key: policy, kind: 'Policy' }
|
|
130
|
-
|
|
131
|
-
const res = await fetch(`${this.mercuryUrl}/zephyr/execute`, {
|
|
132
|
-
method: 'POST',
|
|
133
|
-
headers: {
|
|
134
|
-
'Content-Type': 'application/json',
|
|
135
|
-
Authorization: this.mercuryJwt ? `Bearer ${this.mercuryJwt}` : this.mercuryKey!
|
|
136
|
-
},
|
|
137
|
-
body: JSON.stringify({
|
|
138
|
-
project_name: this.mercuryProjectName,
|
|
139
|
-
mode: {
|
|
140
|
-
Function: {
|
|
141
|
-
fname: "get_addresses_by_signer",
|
|
142
|
-
arguments: JSON.stringify(args!)
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
})
|
|
146
|
-
})
|
|
147
|
-
.then(async (res) => {
|
|
148
|
-
if (res.ok)
|
|
149
|
-
return await res.json() as string[]
|
|
150
|
-
|
|
151
|
-
throw await res.json()
|
|
152
|
-
})
|
|
153
|
-
|
|
154
|
-
return res[index]
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
/* LATER
|
|
158
|
-
- Add a method for getting a paginated or filtered list of all a wallet's events
|
|
159
|
-
*/
|
|
160
|
-
|
|
161
|
-
public async send<T>(txn: AssembledTransaction<T> | Tx | string) {
|
|
162
|
-
if (!this.channelsClient)
|
|
163
|
-
throw new Error('Relayer service not configured')
|
|
164
|
-
|
|
165
|
-
let txnXdr: string
|
|
166
|
-
|
|
167
|
-
if (txn instanceof AssembledTransaction) {
|
|
168
|
-
txnXdr = txn.built!.toXDR()
|
|
169
|
-
} else if (typeof txn !== 'string') {
|
|
170
|
-
txnXdr = txn.toXDR()
|
|
171
|
-
} else {
|
|
172
|
-
txnXdr = txn
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
return this.channelsClient.submitTransaction({
|
|
176
|
-
xdr: txnXdr,
|
|
177
|
-
})
|
|
178
|
-
}
|
|
179
|
-
}
|
package/src/types.ts
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
export type Signer = {
|
|
2
|
-
kind: string
|
|
3
|
-
key: string
|
|
4
|
-
val: string
|
|
5
|
-
expiration: number | null
|
|
6
|
-
storage: "Persistent" | "Temporary"
|
|
7
|
-
limits: string
|
|
8
|
-
evicted?: boolean
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
export class SignerKey {
|
|
12
|
-
private constructor(public key: "Policy" | "Ed25519" | "Secp256r1", public value: string) { }
|
|
13
|
-
|
|
14
|
-
static Policy(policy: string): SignerKey {
|
|
15
|
-
return new SignerKey("Policy", policy);
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static Ed25519(publicKey: string): SignerKey {
|
|
19
|
-
return new SignerKey("Ed25519", publicKey);
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
static Secp256r1(id: string): SignerKey {
|
|
23
|
-
return new SignerKey("Secp256r1", id);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
export type SignerLimits = Map<string, SignerKey[] | undefined> | undefined
|
|
28
|
-
|
|
29
|
-
export enum SignerStore {
|
|
30
|
-
Persistent = 'Persistent',
|
|
31
|
-
Temporary = 'Temporary',
|
|
32
|
-
}
|
package/tsconfig.json
DELETED
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"outDir": "./types",
|
|
4
|
-
"rootDir": "./src",
|
|
5
|
-
// Enable latest features
|
|
6
|
-
"target": "ESNext",
|
|
7
|
-
"module": "ESNext",
|
|
8
|
-
"moduleDetection": "force",
|
|
9
|
-
// Bundler mode
|
|
10
|
-
"moduleResolution": "Bundler",
|
|
11
|
-
"allowImportingTsExtensions": true,
|
|
12
|
-
"verbatimModuleSyntax": true,
|
|
13
|
-
"declaration": true,
|
|
14
|
-
"emitDeclarationOnly": true,
|
|
15
|
-
// Best practices
|
|
16
|
-
"strict": true,
|
|
17
|
-
"skipLibCheck": true,
|
|
18
|
-
"noFallthroughCasesInSwitch": true,
|
|
19
|
-
// Some stricter flags (disabled by default)
|
|
20
|
-
"noUnusedLocals": false,
|
|
21
|
-
"noUnusedParameters": false,
|
|
22
|
-
"noPropertyAccessFromIndexSignature": false,
|
|
23
|
-
"strictNullChecks": true,
|
|
24
|
-
},
|
|
25
|
-
"include": [
|
|
26
|
-
"src",
|
|
27
|
-
],
|
|
28
|
-
}
|
package/types/index.d.ts
DELETED
package/types/kit.d.ts
DELETED
|
@@ -1,89 +0,0 @@
|
|
|
1
|
-
import { Client as PasskeyClient } from 'passkey-kit-sdk';
|
|
2
|
-
import { xdr, Keypair } from '@stellar/stellar-sdk/minimal';
|
|
3
|
-
import { startRegistration, startAuthentication, type AuthenticationResponseJSON, type AuthenticatorSelectionCriteria } from "@simplewebauthn/browser";
|
|
4
|
-
import { Buffer } from 'buffer';
|
|
5
|
-
import type { SignerKey, SignerLimits, SignerStore } from './types';
|
|
6
|
-
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';
|
|
9
|
-
export declare class PasskeyKit extends PasskeyBase {
|
|
10
|
-
rpc: Server;
|
|
11
|
-
rpcUrl: string;
|
|
12
|
-
private walletKeypair;
|
|
13
|
-
private walletPublicKey;
|
|
14
|
-
private walletWasmHash;
|
|
15
|
-
private timeoutInSeconds;
|
|
16
|
-
private WebAuthn;
|
|
17
|
-
keyId: string | undefined;
|
|
18
|
-
networkPassphrase: string;
|
|
19
|
-
wallet: PasskeyClient | undefined;
|
|
20
|
-
constructor(options: {
|
|
21
|
-
rpcUrl: string;
|
|
22
|
-
networkPassphrase: string;
|
|
23
|
-
walletWasmHash: string;
|
|
24
|
-
timeoutInSeconds?: number;
|
|
25
|
-
WebAuthn?: {
|
|
26
|
-
startRegistration: typeof startRegistration;
|
|
27
|
-
startAuthentication: typeof startAuthentication;
|
|
28
|
-
};
|
|
29
|
-
});
|
|
30
|
-
createWallet(app: string, user: string, settings?: {
|
|
31
|
-
rpId?: string;
|
|
32
|
-
authenticatorSelection?: AuthenticatorSelectionCriteria;
|
|
33
|
-
}): Promise<{
|
|
34
|
-
rawResponse: import("@simplewebauthn/browser").RegistrationResponseJSON;
|
|
35
|
-
keyId: Buffer<ArrayBufferLike>;
|
|
36
|
-
keyIdBase64: string;
|
|
37
|
-
contractId: string;
|
|
38
|
-
signedTx: Tx;
|
|
39
|
-
}>;
|
|
40
|
-
createKey(app: string, user: string, settings?: {
|
|
41
|
-
rpId?: string;
|
|
42
|
-
authenticatorSelection?: AuthenticatorSelectionCriteria;
|
|
43
|
-
}): Promise<{
|
|
44
|
-
rawResponse: import("@simplewebauthn/browser").RegistrationResponseJSON;
|
|
45
|
-
keyId: Buffer<ArrayBufferLike>;
|
|
46
|
-
keyIdBase64: string;
|
|
47
|
-
publicKey: Buffer<ArrayBufferLike>;
|
|
48
|
-
}>;
|
|
49
|
-
connectWallet(opts?: {
|
|
50
|
-
rpId?: string;
|
|
51
|
-
keyId?: string | Uint8Array;
|
|
52
|
-
getContractId?: (keyId: string) => Promise<string | undefined>;
|
|
53
|
-
walletPublicKey?: string;
|
|
54
|
-
}): Promise<{
|
|
55
|
-
rawResponse: AuthenticationResponseJSON | undefined;
|
|
56
|
-
keyId: Buffer<ArrayBufferLike>;
|
|
57
|
-
keyIdBase64: string;
|
|
58
|
-
contractId: string;
|
|
59
|
-
}>;
|
|
60
|
-
signAuthEntry(entry: xdr.SorobanAuthorizationEntry, options?: {
|
|
61
|
-
rpId?: string;
|
|
62
|
-
keyId?: 'any' | string | Uint8Array;
|
|
63
|
-
keypair?: Keypair;
|
|
64
|
-
policy?: string;
|
|
65
|
-
expiration?: number;
|
|
66
|
-
}): Promise<xdr.SorobanAuthorizationEntry>;
|
|
67
|
-
sign<T>(txn: AssembledTransaction<T> | Tx | string, options?: {
|
|
68
|
-
rpId?: string;
|
|
69
|
-
keyId?: 'any' | string | Uint8Array;
|
|
70
|
-
keypair?: Keypair;
|
|
71
|
-
policy?: string;
|
|
72
|
-
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>>;
|
|
81
|
-
private secp256r1;
|
|
82
|
-
private ed25519;
|
|
83
|
-
private policy;
|
|
84
|
-
private getSignerLimits;
|
|
85
|
-
private getSignerKey;
|
|
86
|
-
private encodeContract;
|
|
87
|
-
private getPublicKey;
|
|
88
|
-
private compactSignature;
|
|
89
|
-
}
|
package/types/sac.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { Client as SacClient } from 'sac-sdk';
|
|
2
|
-
import { PasskeyBase } from "./base";
|
|
3
|
-
import type { Server } from '@stellar/stellar-sdk/minimal/rpc';
|
|
4
|
-
export declare class SACClient extends PasskeyBase {
|
|
5
|
-
rpc: Server;
|
|
6
|
-
rpcUrl: string;
|
|
7
|
-
networkPassphrase: string;
|
|
8
|
-
constructor(options: {
|
|
9
|
-
networkPassphrase: string;
|
|
10
|
-
rpcUrl: string;
|
|
11
|
-
});
|
|
12
|
-
getSACClient(SACContractId: string): SacClient;
|
|
13
|
-
}
|
package/types/server.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { PasskeyBase } from "./base";
|
|
2
|
-
import type { Tx } from "@stellar/stellar-sdk/minimal/contract";
|
|
3
|
-
import type { Signer } from "./types";
|
|
4
|
-
import { AssembledTransaction } from "@stellar/stellar-sdk/minimal/contract";
|
|
5
|
-
export declare class PasskeyServer extends PasskeyBase {
|
|
6
|
-
private relayerApiKey;
|
|
7
|
-
private mercuryJwt;
|
|
8
|
-
private mercuryKey;
|
|
9
|
-
private channelsClient;
|
|
10
|
-
relayerUrl: string | undefined;
|
|
11
|
-
mercuryProjectName: string | undefined;
|
|
12
|
-
mercuryUrl: string | undefined;
|
|
13
|
-
constructor(options: {
|
|
14
|
-
rpcUrl?: string;
|
|
15
|
-
relayerUrl?: string;
|
|
16
|
-
relayerApiKey?: string;
|
|
17
|
-
mercuryProjectName?: string;
|
|
18
|
-
mercuryUrl?: string;
|
|
19
|
-
mercuryJwt?: string;
|
|
20
|
-
mercuryKey?: string;
|
|
21
|
-
});
|
|
22
|
-
getSigners(contractId: string): Promise<Signer[]>;
|
|
23
|
-
getContractId(options: {
|
|
24
|
-
keyId?: string;
|
|
25
|
-
publicKey?: string;
|
|
26
|
-
policy?: string;
|
|
27
|
-
}, index?: number): Promise<string>;
|
|
28
|
-
send<T>(txn: AssembledTransaction<T> | Tx | string): Promise<import("@openzeppelin/relayer-plugin-channels").ChannelsTransactionResponse>;
|
|
29
|
-
}
|
package/types/types.d.ts
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
export type Signer = {
|
|
2
|
-
kind: string;
|
|
3
|
-
key: string;
|
|
4
|
-
val: string;
|
|
5
|
-
expiration: number | null;
|
|
6
|
-
storage: "Persistent" | "Temporary";
|
|
7
|
-
limits: string;
|
|
8
|
-
evicted?: boolean;
|
|
9
|
-
};
|
|
10
|
-
export declare class SignerKey {
|
|
11
|
-
key: "Policy" | "Ed25519" | "Secp256r1";
|
|
12
|
-
value: string;
|
|
13
|
-
private constructor();
|
|
14
|
-
static Policy(policy: string): SignerKey;
|
|
15
|
-
static Ed25519(publicKey: string): SignerKey;
|
|
16
|
-
static Secp256r1(id: string): SignerKey;
|
|
17
|
-
}
|
|
18
|
-
export type SignerLimits = Map<string, SignerKey[] | undefined> | undefined;
|
|
19
|
-
export declare enum SignerStore {
|
|
20
|
-
Persistent = "Persistent",
|
|
21
|
-
Temporary = "Temporary"
|
|
22
|
-
}
|