@shuttle.technology/authorization 0.0.0-stage → 0.2.0
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/CHANGELOG.md +191 -0
- package/README.md +1124 -2
- package/dist/accountLists.d.ts +28 -0
- package/dist/accountLists.js +27 -0
- package/dist/aesGcmSiv.d.ts +14 -0
- package/dist/aesGcmSiv.js +160 -0
- package/dist/auth.d.ts +68 -0
- package/dist/auth.js +189 -0
- package/dist/balances.d.ts +31 -0
- package/dist/balances.js +44 -0
- package/dist/canonicalize.d.ts +19 -0
- package/dist/canonicalize.js +107 -0
- package/dist/client.d.ts +152 -0
- package/dist/client.js +781 -0
- package/dist/clientTypes.d.ts +56 -0
- package/dist/clientTypes.js +5 -0
- package/dist/configuration.d.ts +48 -0
- package/dist/configuration.js +72 -0
- package/dist/consentDebit.d.ts +36 -0
- package/dist/consentDebit.js +95 -0
- package/dist/credentials.d.ts +116 -0
- package/dist/credentials.js +315 -0
- package/dist/debitPermissionWire.d.ts +90 -0
- package/dist/debitPermissionWire.js +118 -0
- package/dist/debitPermissions.d.ts +39 -0
- package/dist/debitPermissions.js +117 -0
- package/dist/deviceKey.d.ts +13 -0
- package/dist/deviceKey.js +28 -0
- package/dist/deviceRecovery.d.ts +40 -0
- package/dist/deviceRecovery.js +143 -0
- package/dist/deviceShare.d.ts +9 -0
- package/dist/deviceShare.js +24 -0
- package/dist/deviceShareEnvelope.d.ts +13 -0
- package/dist/deviceShareEnvelope.js +139 -0
- package/dist/deviceShares.d.ts +91 -0
- package/dist/deviceShares.js +204 -0
- package/dist/errors.d.ts +280 -0
- package/dist/errors.js +85 -0
- package/dist/linkedChecks.d.ts +17 -0
- package/dist/linkedChecks.js +31 -0
- package/dist/linkedRecovery.d.ts +40 -0
- package/dist/linkedRecovery.js +49 -0
- package/dist/linkedRegistrations.d.ts +11 -0
- package/dist/linkedRegistrations.js +109 -0
- package/dist/linkedSendDisplay.d.ts +73 -0
- package/dist/linkedSendDisplay.js +84 -0
- package/dist/linkedWalletSignals.d.ts +22 -0
- package/dist/linkedWalletSignals.js +101 -0
- package/dist/linkedWallets.d.ts +401 -0
- package/dist/linkedWallets.js +436 -0
- package/dist/me.d.ts +27 -0
- package/dist/me.js +30 -0
- package/dist/mediatedOperation.d.ts +27 -0
- package/dist/mediatedOperation.js +68 -0
- package/dist/mobile.d.ts +64 -0
- package/dist/mobile.js +69 -0
- package/dist/modeC.d.ts +131 -0
- package/dist/modeC.js +248 -0
- package/dist/modeCLinked.d.ts +207 -0
- package/dist/modeCLinked.js +270 -0
- package/dist/pages.d.ts +22 -0
- package/dist/pages.js +45 -0
- package/dist/poll.d.ts +15 -0
- package/dist/poll.js +76 -0
- package/dist/redirects.d.ts +45 -0
- package/dist/redirects.js +108 -0
- package/dist/requestGrant.d.ts +169 -0
- package/dist/requestGrant.js +243 -0
- package/dist/sends.d.ts +89 -0
- package/dist/sends.js +127 -0
- package/dist/serviceGrants.d.ts +52 -0
- package/dist/serviceGrants.js +46 -0
- package/dist/slice4.d.ts +187 -0
- package/dist/slice4.js +299 -0
- package/dist/streams.d.ts +212 -0
- package/dist/streams.js +282 -0
- package/dist/trackedWallets.d.ts +53 -0
- package/dist/trackedWallets.js +104 -0
- package/dist/transferStatus.d.ts +45 -0
- package/dist/transferStatus.js +43 -0
- package/dist/walletCreateGrant.d.ts +62 -0
- package/dist/walletCreateGrant.js +89 -0
- package/dist/walletDisplayParts.d.ts +17 -0
- package/dist/walletDisplayParts.js +47 -0
- package/dist/walletEvents.d.ts +43 -0
- package/dist/walletEvents.js +97 -0
- package/dist/walletLimits.d.ts +65 -0
- package/dist/walletLimits.js +102 -0
- package/dist/walletOperations.d.ts +209 -0
- package/dist/walletOperations.js +317 -0
- package/dist/webRenewal.d.ts +92 -0
- package/dist/webRenewal.js +179 -0
- package/package.json +65 -3
|
@@ -0,0 +1,401 @@
|
|
|
1
|
+
import { type NextAction } from './auth.ts';
|
|
2
|
+
import { type WalletEventPage } from './streams.ts';
|
|
3
|
+
export { resumeCursor } from './streams.ts';
|
|
4
|
+
import { type LocalOperation, type ResultRecipient } from './slice4.ts';
|
|
5
|
+
export { linkedEventsPath, linkedRegistrationsPath, parseLinkedRegistrationOperation, parseLinkedRegistrationOperationEnvelope, parseLinkedRegistrationResult, parseLinkedStreamsRegistrationList, validateLinkedRegistrationCreate } from './linkedRegistrations.ts';
|
|
6
|
+
import { type LinkedWalletSignalEnd, type LinkedWalletSignalHandlers } from './linkedWalletSignals.ts';
|
|
7
|
+
export { linkedSignalsPath, readLinkedWalletSignals, MaxSignalWallets, type LinkedWalletSignalEnd, type LinkedWalletSignalHandlers } from './linkedWalletSignals.ts';
|
|
8
|
+
import { type TransferStatus } from './transferStatus.ts';
|
|
9
|
+
import { type LinkedWalletBalances } from './balances.ts';
|
|
10
|
+
export { parseLinkedWalletBalances, type AssetBalance, type LinkedWalletBalances, type NetworkBalanceStatus, type NetworkBalances } from './balances.ts';
|
|
11
|
+
import { type SendPage } from './sends.ts';
|
|
12
|
+
export { eventOfTransaction, parseSendPage, sendEvents, sendsPath, type ListedSend, type SendPage, type TransferOutcome } from './sends.ts';
|
|
13
|
+
export type { LinkedSendDisplay, ReplaceAction } from './walletOperations.ts';
|
|
14
|
+
import type { PageOptions } from './pages.ts';
|
|
15
|
+
export { parseTransferStatus, transferFinal, transferStatusPath, TransferStates, type TransferState, type TransferStatus } from './transferStatus.ts';
|
|
16
|
+
import { type WalletLimits, type WalletLimitsInput } from './walletLimits.ts';
|
|
17
|
+
export { WalletLimitRefusals, isWalletLimitRefusal, MaxLimitCeilings, MaxLimitRecipients, type LimitAsset, type WalletCeiling, type WalletLimitRefusal, type WalletLimits, type WalletLimitsDisplay, type WalletLimitsInput } from './walletLimits.ts';
|
|
18
|
+
import { DebitPermissions } from './debitPermissions.ts';
|
|
19
|
+
export { DebitPermissions, MaxDebitAssets, MaxDebitRecipients, type DebitAsset, type DebitAssetBound, type DebitPermission, type DebitPermissionDisplay, type DebitPermissionInput, type DebitPermissionList, type DebitPermissionRevokeDisplay, type DebitPermissionState, type DebitShareKeys } from './debitPermissions.ts';
|
|
20
|
+
import type { DeviceRecoveryOptions, LinkedDeviceShares } from './deviceShares.ts';
|
|
21
|
+
import { type LinkedSendAsset, type ReplaceAction, type DeviceSharePackage, type UserWalletOperation, type UserWalletState, type UserWalletEffectState, type UserWalletAuthorizationBasis } from './walletOperations.ts';
|
|
22
|
+
/** session_authorized: the account's session registered its own linked wallet; no confirmation exists. */
|
|
23
|
+
export type LinkedRegistrationAuthorizationBasis = UserWalletAuthorizationBasis;
|
|
24
|
+
export interface WalletConnection {
|
|
25
|
+
requestId: string;
|
|
26
|
+
id: string;
|
|
27
|
+
connectorId: string;
|
|
28
|
+
state: 'connected' | 'revoked' | 'reauth_required';
|
|
29
|
+
createdAt: string;
|
|
30
|
+
lastSyncedAt: string;
|
|
31
|
+
revokedAt?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface LinkedWallet {
|
|
34
|
+
id: string;
|
|
35
|
+
connectionId: string;
|
|
36
|
+
externalWalletId: string;
|
|
37
|
+
externalKeyId: string;
|
|
38
|
+
network: string;
|
|
39
|
+
address: string;
|
|
40
|
+
algorithm: 'secp256k1' | 'ed25519';
|
|
41
|
+
publicKey: string;
|
|
42
|
+
bindingRevision: string;
|
|
43
|
+
status: 'active' | 'inactive';
|
|
44
|
+
observedAt: string;
|
|
45
|
+
}
|
|
46
|
+
export interface WalletLinkChallenge {
|
|
47
|
+
requestId: string;
|
|
48
|
+
challengeId: string;
|
|
49
|
+
expiresAt: string;
|
|
50
|
+
publicKey: {
|
|
51
|
+
challenge: string;
|
|
52
|
+
rpId: string;
|
|
53
|
+
timeoutMs: number;
|
|
54
|
+
userVerification: 'required';
|
|
55
|
+
allowCredentials: [{
|
|
56
|
+
type: 'public-key';
|
|
57
|
+
id: string;
|
|
58
|
+
}];
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
/** Assertion JSON from a credential ceremony on its server-approved RP/origin. */
|
|
62
|
+
export interface WalletLinkAssertion {
|
|
63
|
+
id: string;
|
|
64
|
+
rawId: string;
|
|
65
|
+
type: 'public-key';
|
|
66
|
+
response: {
|
|
67
|
+
clientDataJSON: string;
|
|
68
|
+
authenticatorData: string;
|
|
69
|
+
signature: string;
|
|
70
|
+
userHandle: string;
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
export interface LinkedRegistrationCreate {
|
|
74
|
+
kind: 'streams.register';
|
|
75
|
+
owner_type: 'account';
|
|
76
|
+
owner_id: string;
|
|
77
|
+
linked_wallet_id: string;
|
|
78
|
+
payload: {
|
|
79
|
+
network: string;
|
|
80
|
+
assets?: string[];
|
|
81
|
+
activity_types?: string[];
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export interface LinkedRegistrationDisplay {
|
|
85
|
+
kind: 'streams.register';
|
|
86
|
+
ownerId: string;
|
|
87
|
+
requesterId: string;
|
|
88
|
+
resultRecipient: ResultRecipient;
|
|
89
|
+
bindingSource: 'linked_wallet';
|
|
90
|
+
connectionId: string;
|
|
91
|
+
linkedWalletId: string;
|
|
92
|
+
bindingRevision: string;
|
|
93
|
+
assets: readonly string[];
|
|
94
|
+
network: string;
|
|
95
|
+
address: string;
|
|
96
|
+
streamsMappingId: string;
|
|
97
|
+
streamsMappingVersion: string;
|
|
98
|
+
targetCustomerId: string;
|
|
99
|
+
targetProjectId: string;
|
|
100
|
+
targetEnvironmentId: string;
|
|
101
|
+
}
|
|
102
|
+
export interface LinkedRegistrationPurgedDisplay {
|
|
103
|
+
kind: 'streams.register';
|
|
104
|
+
materialPurged: true;
|
|
105
|
+
ownerId: string;
|
|
106
|
+
requesterId: string;
|
|
107
|
+
resultRecipient: ResultRecipient;
|
|
108
|
+
}
|
|
109
|
+
export interface LinkedRegistrationOperation {
|
|
110
|
+
id: string;
|
|
111
|
+
version: string;
|
|
112
|
+
kind: 'streams.register';
|
|
113
|
+
state: UserWalletState;
|
|
114
|
+
effectState: UserWalletEffectState;
|
|
115
|
+
authorizationBasis: LinkedRegistrationAuthorizationBasis;
|
|
116
|
+
ownerType: 'account';
|
|
117
|
+
ownerId: string;
|
|
118
|
+
requesterId: string;
|
|
119
|
+
bindingSource: 'linked_wallet';
|
|
120
|
+
connectionId: string;
|
|
121
|
+
linkedWalletId: string;
|
|
122
|
+
bindingRevision: string;
|
|
123
|
+
requestFingerprint: string;
|
|
124
|
+
operationFingerprint: string;
|
|
125
|
+
display: LinkedRegistrationDisplay | LinkedRegistrationPurgedDisplay;
|
|
126
|
+
createdAt: string;
|
|
127
|
+
expiresAt: string;
|
|
128
|
+
nextAction: NextAction;
|
|
129
|
+
confirmationLocation?: string;
|
|
130
|
+
}
|
|
131
|
+
export interface LinkedRegistrationResult {
|
|
132
|
+
requestId: string;
|
|
133
|
+
result: {
|
|
134
|
+
kind: 'streams_registration';
|
|
135
|
+
operationId: string;
|
|
136
|
+
bindingSource: 'linked_wallet';
|
|
137
|
+
connectionId: string;
|
|
138
|
+
linkedWalletId: string;
|
|
139
|
+
bindingRevision: string;
|
|
140
|
+
sourceRegistrationId: string;
|
|
141
|
+
registrationDigest: string;
|
|
142
|
+
receiptId: string;
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* A send from a linked wallet. asset is the network's own coin ("native") or a
|
|
147
|
+
* token the own-wallet system sends on that network; amountRaw is in that
|
|
148
|
+
* asset's minimal units, and a token's decimals differ by network. comment
|
|
149
|
+
* is a text the transfer carries to its recipient, on a TON network only:
|
|
150
|
+
* the comment an exchange credits a deposit by (transferComment() is its
|
|
151
|
+
* rule). It is sent exactly as given.
|
|
152
|
+
*/
|
|
153
|
+
export interface LinkedSendInput {
|
|
154
|
+
linkedWalletId: string;
|
|
155
|
+
network: string;
|
|
156
|
+
asset: LinkedSendAsset;
|
|
157
|
+
recipient: string;
|
|
158
|
+
amountRaw: string;
|
|
159
|
+
comment?: string;
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* The replacement of a send the network has not included. operationId is the
|
|
163
|
+
* account's own send from the same wallet; what the replacement moves is
|
|
164
|
+
* that send's own and is not given here.
|
|
165
|
+
*/
|
|
166
|
+
export interface LinkedReplaceInput {
|
|
167
|
+
linkedWalletId: string;
|
|
168
|
+
operationId: string;
|
|
169
|
+
action: ReplaceAction;
|
|
170
|
+
}
|
|
171
|
+
/** The own-wallet system's transport key, as that system publishes it. It carries no proof of where the key lives. */
|
|
172
|
+
export interface LinkedTransportKey {
|
|
173
|
+
requestId: string;
|
|
174
|
+
publicKey: string;
|
|
175
|
+
encryptionAlgorithm: string;
|
|
176
|
+
}
|
|
177
|
+
/** Metadata position is an Auth registration ID, never a deposit cursor. */
|
|
178
|
+
export interface LinkedRegistrationListOptions {
|
|
179
|
+
afterRegistrationId?: string;
|
|
180
|
+
limit?: number;
|
|
181
|
+
signal?: AbortSignal;
|
|
182
|
+
}
|
|
183
|
+
/** eventTypes is the kinds of wallet event wanted: deposit, withdrawal, activity in any combination, or activity:<type>; left out, every kind. */
|
|
184
|
+
export interface LinkedEventsOptions {
|
|
185
|
+
registrationId?: string;
|
|
186
|
+
cursor?: string;
|
|
187
|
+
limit?: number;
|
|
188
|
+
eventTypes?: readonly string[];
|
|
189
|
+
signal?: AbortSignal;
|
|
190
|
+
}
|
|
191
|
+
export interface LinkedStreamsRegistration {
|
|
192
|
+
readonly registrationId: string;
|
|
193
|
+
readonly bindingSource: 'linked_wallet';
|
|
194
|
+
readonly connectionId: string;
|
|
195
|
+
readonly linkedWalletId: string;
|
|
196
|
+
readonly bindingRevision: string;
|
|
197
|
+
readonly sourceRegistrationId: string;
|
|
198
|
+
readonly network: string;
|
|
199
|
+
readonly address: string;
|
|
200
|
+
readonly assets: readonly string[];
|
|
201
|
+
readonly status: 'pending' | 'active';
|
|
202
|
+
readonly effectiveFrom: string;
|
|
203
|
+
readonly revision: number;
|
|
204
|
+
readonly sourceVersion: string;
|
|
205
|
+
}
|
|
206
|
+
export interface LinkedStreamsRegistrationList {
|
|
207
|
+
readonly items: readonly LinkedStreamsRegistration[];
|
|
208
|
+
readonly hasMore: boolean;
|
|
209
|
+
readonly nextAfterRegistrationId?: string;
|
|
210
|
+
}
|
|
211
|
+
/** Consumer-owned ports reuse AuthorizationClient's existing session transport. */
|
|
212
|
+
export interface LinkedWalletTransport {
|
|
213
|
+
get(path: string, signal?: AbortSignal): Promise<unknown>;
|
|
214
|
+
/** Opens a long-lived answer and returns it as it arrives. */
|
|
215
|
+
stream(path: string, signal?: AbortSignal): Promise<ReadableStream<Uint8Array>>;
|
|
216
|
+
write(path: string, method: 'POST' | 'DELETE', body: unknown | undefined, signal?: AbortSignal, idempotencyKey?: string, version?: string): Promise<{
|
|
217
|
+
payload: unknown;
|
|
218
|
+
accountId: string;
|
|
219
|
+
}>;
|
|
220
|
+
accountId(): string;
|
|
221
|
+
now(): number;
|
|
222
|
+
/** The device shares the client keeps (deviceShares.ts); absent, every call that asks the SDK for a share refuses with device_share_unavailable. */
|
|
223
|
+
devices?: LinkedDeviceShares;
|
|
224
|
+
}
|
|
225
|
+
export declare class LinkedWallets {
|
|
226
|
+
#private;
|
|
227
|
+
constructor(transport: LinkedWalletTransport);
|
|
228
|
+
challenge(cognitoAccessToken: string, credentialId: string, signal?: AbortSignal): Promise<WalletLinkChallenge>;
|
|
229
|
+
connect(challengeId: string, cognitoAccessToken: string, assertion: WalletLinkAssertion, signal?: AbortSignal): Promise<WalletConnection>;
|
|
230
|
+
connection(connectionId: string, signal?: AbortSignal): Promise<WalletConnection>;
|
|
231
|
+
sync(connectionId: string, cognitoAccessToken: string, signal?: AbortSignal): Promise<WalletConnection>;
|
|
232
|
+
/**
|
|
233
|
+
* refresh binds the account to the Wallet identity the provider owns for it
|
|
234
|
+
* and synchronizes its public wallet inventory. It carries no Wallet token
|
|
235
|
+
* and no body; repeating it converges on the same connection. Call it after
|
|
236
|
+
* a wallet was created so the wallet appears in list().
|
|
237
|
+
*/
|
|
238
|
+
refresh(signal?: AbortSignal): Promise<WalletConnection>;
|
|
239
|
+
disconnect(connectionId: string, signal?: AbortSignal): Promise<WalletConnection>;
|
|
240
|
+
list(signal?: AbortSignal): Promise<{
|
|
241
|
+
requestId: string;
|
|
242
|
+
items: readonly LinkedWallet[];
|
|
243
|
+
}>;
|
|
244
|
+
wallet(linkedWalletId: string, signal?: AbortSignal): Promise<{
|
|
245
|
+
requestId: string;
|
|
246
|
+
wallet: LinkedWallet;
|
|
247
|
+
}>;
|
|
248
|
+
/** Every metadata page is fresh; restart at the beginning to discover earlier insertions. */
|
|
249
|
+
registrations(linkedWalletId: string, options?: LinkedRegistrationListOptions): Promise<LinkedStreamsRegistrationList>;
|
|
250
|
+
/**
|
|
251
|
+
* One page of the linked wallet's retained events as wallet events 3.0:
|
|
252
|
+
* what came in, what went out and what else happened, each with kind,
|
|
253
|
+
* status and revision, those of the kinds eventTypes names. Continuations
|
|
254
|
+
* are sealed opaque cursors.
|
|
255
|
+
*/
|
|
256
|
+
events(linkedWalletId: string, options?: LinkedEventsOptions): Promise<WalletEventPage>;
|
|
257
|
+
/**
|
|
258
|
+
* Opens one signal stream for these linked wallets and reads it to its end.
|
|
259
|
+
* onOpen says the stream is live: read every wallet once then. onWallets
|
|
260
|
+
* names wallets with new events: read them with events(). The promise
|
|
261
|
+
* resolves with the reason the stream ended; a stream lives no longer than
|
|
262
|
+
* an access token, so the caller opens the next one. It rejects with the
|
|
263
|
+
* server's refusal, with the abort reason, or when the connection fails;
|
|
264
|
+
* keep an ordinary timed read for those times.
|
|
265
|
+
*/
|
|
266
|
+
signals(linkedWalletIds: readonly string[], handlers: LinkedWalletSignalHandlers): Promise<LinkedWalletSignalEnd>;
|
|
267
|
+
createRegistration(create: LinkedRegistrationCreate, idempotencyKey: string, signal?: AbortSignal): Promise<LinkedRegistrationOperation>;
|
|
268
|
+
/**
|
|
269
|
+
* Starts tracking a linked wallet on one network. An EVM wallet has one
|
|
270
|
+
* address on every EVM network, so it is registered on each of them with its
|
|
271
|
+
* own call. activityTypes names the kinds of activity events asked for beside
|
|
272
|
+
* deposits; omitted or empty means deposits only, and Streams refuses a kind
|
|
273
|
+
* the network does not have. The operation comes back authorized;
|
|
274
|
+
* executeRegistration() with its version dispatches it.
|
|
275
|
+
*/
|
|
276
|
+
register(input: {
|
|
277
|
+
linkedWalletId: string;
|
|
278
|
+
network: string;
|
|
279
|
+
assets?: string[];
|
|
280
|
+
activityTypes?: string[];
|
|
281
|
+
}, idempotencyKey: string, signal?: AbortSignal): Promise<LinkedRegistrationOperation>;
|
|
282
|
+
operation(operationId: string, signal?: AbortSignal): Promise<LinkedRegistrationOperation>;
|
|
283
|
+
executeRegistration(operationId: string, version: string, idempotencyKey: string, signal?: AbortSignal): Promise<LinkedRegistrationOperation>;
|
|
284
|
+
registrationResult(operationId: string, signal?: AbortSignal): Promise<LinkedRegistrationResult>;
|
|
285
|
+
/**
|
|
286
|
+
* Starts a send from a linked wallet. The account's session authorizes it:
|
|
287
|
+
* the operation comes back authorized (authorizationBasis
|
|
288
|
+
* session_authorized), with no passkey and no confirmation window. Then
|
|
289
|
+
* prepare() has the own-wallet system prepare the transfer and name its
|
|
290
|
+
* fee; show the owner what was prepared and, on their confirm,
|
|
291
|
+
* executeSend() with the device share.
|
|
292
|
+
*/
|
|
293
|
+
send(input: LinkedSendInput, idempotencyKey: string, signal?: AbortSignal): Promise<UserWalletOperation>;
|
|
294
|
+
/**
|
|
295
|
+
* Replaces a send the own-wallet system broadcast on an EVM network and the
|
|
296
|
+
* network has not included: "speed_up" sends the same transfer again with a
|
|
297
|
+
* higher fee, "cancel" sends nothing to the wallet's own address in its
|
|
298
|
+
* place. The answer is a send of its own, authorized by the session like
|
|
299
|
+
* send(): prepare() has the own-wallet system prepare the replacement (it
|
|
300
|
+
* may answer that the transfer no longer waits), show it with its new fee,
|
|
301
|
+
* and on the owner's confirm executeSend(). Whichever of the two
|
|
302
|
+
* transactions the network includes, the other fails; read
|
|
303
|
+
* transferStatus() of both.
|
|
304
|
+
*/
|
|
305
|
+
replaceSend(input: LinkedReplaceInput, idempotencyKey: string, signal?: AbortSignal): Promise<UserWalletOperation>;
|
|
306
|
+
/**
|
|
307
|
+
* What the wallet holds on each of its networks: the coin and the tokens
|
|
308
|
+
* the stand names there, in minimal units with their decimals. The provider
|
|
309
|
+
* reads its own stand's nodes. A network whose node gave no amount is in
|
|
310
|
+
* the answer with its status and without amounts; it fails nothing.
|
|
311
|
+
*/
|
|
312
|
+
balances(linkedWalletId: string, signal?: AbortSignal): Promise<LinkedWalletBalances>;
|
|
313
|
+
/**
|
|
314
|
+
* Has the own-wallet system prepare the transfer of a send or replacement
|
|
315
|
+
* the session authorized, and returns the send with what was prepared:
|
|
316
|
+
* display.preparedSummary, the sending address and the fee estimate. Show
|
|
317
|
+
* them to the owner; executeSend() sends exactly that transfer. The
|
|
318
|
+
* transfer is prepared once: calling again returns the same prepared send
|
|
319
|
+
* and asks the own-wallet system nothing. A prepared send expires within
|
|
320
|
+
* 150 seconds; one that expired is sent again from send(). The request
|
|
321
|
+
* carries no body, idempotency key or version.
|
|
322
|
+
*/
|
|
323
|
+
prepare(operationId: string, signal?: AbortSignal): Promise<UserWalletOperation>;
|
|
324
|
+
/** The key the device seals its share to, read right before executeSend(). */
|
|
325
|
+
transportKey(linkedWalletId: string, signal?: AbortSignal): Promise<LinkedTransportKey>;
|
|
326
|
+
/**
|
|
327
|
+
* Executes a prepared send, on the owner's confirm, with the device share
|
|
328
|
+
* resealed for the own-wallet system. Without deviceShare the SDK supplies
|
|
329
|
+
* the share it keeps (deviceShareFor()), recovered first with one passkey
|
|
330
|
+
* confirmation when this browser holds none; an app that keeps its own share
|
|
331
|
+
* passes it resealed (resealDeviceShare). The provider cannot open the share.
|
|
332
|
+
* A send never prepared is refused with VERSION_CONFLICT, an expired one
|
|
333
|
+
* with OPERATION_EXPIRED.
|
|
334
|
+
*/
|
|
335
|
+
executeSend(operationId: string, version: string, idempotencyKey: string, deviceShare?: DeviceSharePackage, signal?: AbortSignal): Promise<UserWalletOperation>;
|
|
336
|
+
/**
|
|
337
|
+
* The device share the SDK keeps for this wallet, resealed to the
|
|
338
|
+
* own-wallet system's transport key read right before: what executeSend()
|
|
339
|
+
* sends and what a Mode C request is signed with (signLinkedMediatedRequest).
|
|
340
|
+
* A browser that holds no share of the wallet (another domain, cleared site
|
|
341
|
+
* data, another browser or device) recovers it first: the person confirms
|
|
342
|
+
* once with the passkey on the provider's page, and the share the wallet had
|
|
343
|
+
* elsewhere stops working. Two tabs never recover the same wallet at once.
|
|
344
|
+
*/
|
|
345
|
+
deviceShareFor(linkedWalletId: string, signal?: AbortSignal): Promise<DeviceSharePackage>;
|
|
346
|
+
/**
|
|
347
|
+
* The device key of the wallet's latest creation or recovery the provider
|
|
348
|
+
* made, as 33-byte compressed hex; absent when it knows none. A share kept
|
|
349
|
+
* here that is sealed to another key was replaced by a recovery elsewhere.
|
|
350
|
+
*/
|
|
351
|
+
deviceKey(linkedWalletId: string, signal?: AbortSignal): Promise<{
|
|
352
|
+
requestId: string;
|
|
353
|
+
devicePublicKey?: string;
|
|
354
|
+
}>;
|
|
355
|
+
/** Whether this browser holds a current device share of the wallet; without one the next send recovers it with the passkey. */
|
|
356
|
+
hasDeviceShare(linkedWalletId: string, signal?: AbortSignal): Promise<boolean>;
|
|
357
|
+
/**
|
|
358
|
+
* Recovers the wallet's device share onto this browser when it holds no
|
|
359
|
+
* current one, as deviceShareFor() would, for an app that does it ahead of a
|
|
360
|
+
* transfer; force recovers even then. credentialId names the passkey that
|
|
361
|
+
* confirms it, by default the account's newest. Answers whether a recovery
|
|
362
|
+
* ran. Optional: sends recover by themselves.
|
|
363
|
+
*/
|
|
364
|
+
recoverDevice(linkedWalletId: string, options?: DeviceRecoveryOptions & {
|
|
365
|
+
force?: boolean;
|
|
366
|
+
}): Promise<boolean>;
|
|
367
|
+
/**
|
|
368
|
+
* What became of the transfer a send prepared: on its way, confirmed by the
|
|
369
|
+
* network, or failed and why. The send's operation succeeds when the
|
|
370
|
+
* own-wallet system accepted the transfer; this is what the network did
|
|
371
|
+
* with it. Read it until final is true. Before the send was prepared
|
|
372
|
+
* there is no transfer and the read is refused with NOT_FOUND.
|
|
373
|
+
*/
|
|
374
|
+
transferStatus(operationId: string, signal?: AbortSignal): Promise<TransferStatus>;
|
|
375
|
+
/**
|
|
376
|
+
* One page of the account's send history, newest first: every wallet.send
|
|
377
|
+
* the account can read, with its transaction hash and the recorded final
|
|
378
|
+
* fate of its transfer. A send with a hash and no transfer has not been
|
|
379
|
+
* reported final yet: read transferStatus() for it, which records the fate.
|
|
380
|
+
* The cursor carries the first page's limit.
|
|
381
|
+
*/
|
|
382
|
+
sends(options?: PageOptions): Promise<SendPage>;
|
|
383
|
+
/** The limits every send from the wallet obeys, read with the session (walletLimits.ts). Revision "0": never set. */
|
|
384
|
+
limits(linkedWalletId: string, signal?: AbortSignal): Promise<WalletLimits>;
|
|
385
|
+
/**
|
|
386
|
+
* Asks to replace the wallet's limits as a whole; empty ceilings and recipients remove them all. The operation
|
|
387
|
+
* awaits the owner's passkey: the client's challengeOperation(), completeOperationConfirmation() and
|
|
388
|
+
* executeOperation() apply it. A send the limits refuse answers one of WalletLimitRefusals.
|
|
389
|
+
*/
|
|
390
|
+
setLimits(linkedWalletId: string, limits: WalletLimitsInput, idempotencyKey: string, signal?: AbortSignal): Promise<LocalOperation>;
|
|
391
|
+
/** The permissions the account lets services debit its linked wallets by, without the device (debitPermissions.ts). */
|
|
392
|
+
debitPermissions(): DebitPermissions;
|
|
393
|
+
}
|
|
394
|
+
export declare function parseWalletConnection(payload: unknown): WalletConnection;
|
|
395
|
+
export declare function parseLinkedWallet(payload: unknown): LinkedWallet;
|
|
396
|
+
export declare function parseLinkedWalletList(payload: unknown): {
|
|
397
|
+
requestId: string;
|
|
398
|
+
items: readonly LinkedWallet[];
|
|
399
|
+
};
|
|
400
|
+
export declare function parseWalletLinkChallenge(payload: unknown, now: number): WalletLinkChallenge;
|
|
401
|
+
export declare function validateWalletLinkAssertion(value: WalletLinkAssertion): WalletLinkAssertion;
|