@revibase/lite 0.4.6 → 0.5.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/dist/index.d.cts CHANGED
@@ -1,7 +1,7 @@
1
- import { StartMessageRequest, UserInfo, StartTransactionRequest, AdditionalSignersParam } from '@revibase/core';
1
+ import { StartMessageRequest, StartTransactionRequest, CompleteMessageRequest, UserInfo, CompleteTransactionRequest } from '@revibase/core';
2
2
  export { CompleteMessageRequest, CompleteTransactionRequest, StartMessageRequest, StartTransactionRequest, UserInfo } from '@revibase/core';
3
- import z from 'zod';
4
- import { Instruction, AddressesByLookupTableAddress } from 'gill';
3
+ import * as _simplewebauthn_browser from '@simplewebauthn/browser';
4
+ import { Instruction, TransactionSigner, AddressesByLookupTableAddress } from 'gill';
5
5
 
6
6
  declare class RevibaseError extends Error {
7
7
  readonly code: string;
@@ -10,107 +10,177 @@ declare class RevibaseError extends Error {
10
10
  declare class RevibasePopupBlockedError extends RevibaseError {
11
11
  constructor(message?: string);
12
12
  }
13
+ declare class RevibasePopupClosedError extends RevibaseError {
14
+ constructor(message?: string);
15
+ }
16
+ declare class RevibaseTimeoutError extends RevibaseError {
17
+ constructor(message?: string);
18
+ }
19
+ declare class RevibaseFlowInProgressError extends RevibaseError {
20
+ constructor(message?: string);
21
+ }
22
+ declare class RevibaseAbortedError extends RevibaseError {
23
+ constructor(message?: string);
24
+ }
25
+ declare class RevibasePopupNotOpenError extends RevibaseError {
26
+ constructor(message?: string);
27
+ }
13
28
  declare class RevibaseAuthError extends RevibaseError {
14
29
  constructor(message: string);
15
30
  }
31
+ declare class RevibaseApiError extends RevibaseError {
32
+ constructor(message: string);
33
+ }
34
+ declare class RevibaseEnvironmentError extends RevibaseError {
35
+ constructor(message?: string);
36
+ }
16
37
 
17
- type DeviceSignature = {
18
- jwk: string;
19
- jws: string;
38
+ type PendingApprovalsCallbacks = {
39
+ onPendingApprovalsCallback?: (validTill: number) => void;
40
+ onPendingApprovalsSuccess?: () => void;
20
41
  };
42
+
21
43
  type ClientAuthorizationCallback = {
22
- (request: StartMessageRequest, signal?: AbortSignal, device?: DeviceSignature, channelId?: string): Promise<{
23
- user: UserInfo;
44
+ (request: StartPayload): Promise<{
45
+ signature: string;
46
+ validTill: number;
47
+ rid: string;
24
48
  }>;
25
- (request: StartTransactionRequest, signal?: AbortSignal, device?: DeviceSignature, channelId?: string): Promise<{
26
- txSig?: string;
49
+ (request: CompleteMessageRequest): Promise<{
27
50
  user: UserInfo;
28
51
  }>;
29
- (request: StartChannelRequest, signal?: AbortSignal, device?: DeviceSignature, channelId?: string): Promise<{
30
- ok: true;
31
- }>;
52
+ (request: CompleteTransactionRequest): Promise<CompleteTransactionRequest>;
32
53
  };
54
+ type StartPayload = Omit<StartMessageRequest, "rid" | "validTill"> | Omit<StartTransactionRequest, "rid" | "validTill">;
33
55
  type SignInAuthorizationFlowOptions = {
34
- trustedDeviceCheck?: boolean;
35
56
  signal?: AbortSignal;
36
- channelId?: string;
37
57
  };
38
58
  type TransactionAuthorizationFlowOptions = {
59
+ confirmTransaction?: boolean;
60
+ pendingApprovalsCallback?: PendingApprovalsCallbacks;
39
61
  signal?: AbortSignal;
40
- channelId?: string;
41
62
  };
42
- type AuthorizationFlowResult = {
43
- user: UserInfo;
44
- } | {
45
- txSig?: string;
46
- user: UserInfo;
47
- };
48
- declare const StartChannelRequestSchema: z.ZodObject<{
49
- phase: z.ZodLiteral<"start">;
50
- redirectOrigin: z.ZodURL;
51
- data: z.ZodObject<{
52
- type: z.ZodLiteral<"channel">;
53
- device: z.ZodCustom<DeviceSignature, DeviceSignature>;
54
- channelId: z.ZodString;
55
- }, z.core.$strip>;
56
- }, z.core.$strict>;
57
- type StartChannelRequest = z.infer<typeof StartChannelRequestSchema>;
58
63
 
59
- declare enum ChannelStatus {
60
- AUTHENTICATING = 0,
61
- AWAITING_RECIPIENT = 1,
62
- RECIPIENT_CONNECTED = 2,
63
- RECIPIENT_DISCONNECTED = 3,
64
- AUTO_RECONNECTING = 4,
65
- CONNECTION_LOST = 5,
66
- CHANNEL_CLOSED = 6,
67
- ERROR = 7
68
- }
69
- type ChannelStatusEntry = {
70
- status: ChannelStatus;
71
- recipient?: string;
72
- error?: string;
73
- reconnectAttempt?: number;
74
- };
75
- type ChannelStatusListener = (channelId: string, entry: ChannelStatusEntry) => void;
76
64
  type RevibaseProviderOptions = {
65
+ rpcEndpoint: string;
77
66
  providerOrigin?: string;
78
67
  onClientAuthorizationCallback?: ClientAuthorizationCallback;
79
- rpcEndpoint?: string;
80
- logger?: Pick<Console, "info" | "warn" | "error">;
68
+ onEstimateJitoTipsCallback?: () => Promise<number>;
69
+ onSendJitoBundleCallback?: (request: string[]) => Promise<string>;
81
70
  };
71
+
82
72
  declare class RevibaseProvider {
73
+ private readonly pending;
83
74
  onClientAuthorizationCallback: ClientAuthorizationCallback;
84
- private readonly providerOrigin;
85
- private channelWs;
86
- private readonly channelStatusListeners;
87
- private readonly logger;
88
- private static CHANNEL_ID_CHARSET;
89
- private static CHANNEL_ID_LENGTH;
90
- private static DEFAULT_RETRY_ATTEMPTS;
91
- private static DEFAULT_RETRY_BASE_DELAY_MS;
92
- private sleep;
93
- private defaultCallback;
94
- constructor(options?: RevibaseProviderOptions);
95
- getDeviceSignature(message: string): Promise<{
96
- jwk: string;
97
- jws: string;
75
+ onSendJitoBundleCallback: (request: string[]) => Promise<string>;
76
+ onEstimateJitoTipsCallback: () => Promise<number>;
77
+ private providerOrigin;
78
+ private popUp;
79
+ constructor(options: RevibaseProviderOptions);
80
+ startRequest(): void;
81
+ sendPayloadToProviderViaPopup({ request, signature, signal, }: {
82
+ request: StartMessageRequest | StartTransactionRequest;
83
+ signature: string;
84
+ signal?: AbortSignal;
85
+ }): Promise<{
86
+ phase: "complete";
87
+ data: {
88
+ type: "transaction";
89
+ payload: {
90
+ signer: string;
91
+ startRequest: {
92
+ phase: "start";
93
+ clientOrigin: string;
94
+ rid: string;
95
+ validTill: number;
96
+ data: {
97
+ type: "message";
98
+ payload: string;
99
+ };
100
+ signer?: string | undefined;
101
+ } | {
102
+ phase: "start";
103
+ clientOrigin: string;
104
+ rid: string;
105
+ validTill: number;
106
+ data: {
107
+ type: "transaction";
108
+ payload: {
109
+ transactionActionType: "create" | "create_with_preauthorized_execution" | "execute" | "vote" | "sync" | "close" | "decompress" | "transfer_intent" | "change_delegate" | "change_config";
110
+ transactionAddress: string;
111
+ transactionMessageBytes: string;
112
+ };
113
+ };
114
+ signer?: string | undefined;
115
+ };
116
+ authResponse: _simplewebauthn_browser.AuthenticationResponseJSON;
117
+ client: {
118
+ clientOrigin: string;
119
+ jws: string;
120
+ };
121
+ device: {
122
+ jwk: string;
123
+ jws: string;
124
+ };
125
+ slotHash: string;
126
+ slotNumber: string;
127
+ estimatedSlotHashExpiry: number;
128
+ originIndex: number;
129
+ crossOrigin: boolean;
130
+ userAddressTreeIndex?: number | undefined;
131
+ additionalInfo?: {
132
+ [x: string]: unknown;
133
+ } | undefined;
134
+ };
135
+ };
136
+ } | {
137
+ phase: "complete";
138
+ data: {
139
+ type: "message";
140
+ payload: {
141
+ signer: string;
142
+ startRequest: {
143
+ phase: "start";
144
+ clientOrigin: string;
145
+ rid: string;
146
+ validTill: number;
147
+ data: {
148
+ type: "message";
149
+ payload: string;
150
+ };
151
+ signer?: string | undefined;
152
+ } | {
153
+ phase: "start";
154
+ clientOrigin: string;
155
+ rid: string;
156
+ validTill: number;
157
+ data: {
158
+ type: "transaction";
159
+ payload: {
160
+ transactionActionType: "create" | "create_with_preauthorized_execution" | "execute" | "vote" | "sync" | "close" | "decompress" | "transfer_intent" | "change_delegate" | "change_config";
161
+ transactionAddress: string;
162
+ transactionMessageBytes: string;
163
+ };
164
+ };
165
+ signer?: string | undefined;
166
+ };
167
+ authResponse: _simplewebauthn_browser.AuthenticationResponseJSON;
168
+ client: {
169
+ clientOrigin: string;
170
+ jws: string;
171
+ };
172
+ device: {
173
+ jwk: string;
174
+ jws: string;
175
+ };
176
+ userAddressTreeIndex?: number | undefined;
177
+ additionalInfo?: {
178
+ [x: string]: unknown;
179
+ } | undefined;
180
+ };
181
+ };
98
182
  }>;
99
- subscribeToChannelStatus(listener: ChannelStatusListener): () => void;
100
- private setChannelStatus;
101
- private generateChannelId;
102
- createChannel(): Promise<{
103
- channelId: string;
104
- url: string;
105
- }>;
106
- cancelChannelRequest(channelId: string): void;
107
- reconnectChannel(channelId: string): boolean;
108
- closeChannel(channelId: string): void;
109
- closeAllChannels(): void;
110
- startRequest(channelId?: string): {
111
- rid: string;
112
- redirectOrigin: string;
113
- };
183
+ private attachTransport;
114
184
  }
115
185
 
116
186
  declare function signIn(provider: RevibaseProvider, options?: SignInAuthorizationFlowOptions): Promise<{
@@ -120,11 +190,12 @@ declare function signIn(provider: RevibaseProvider, options?: SignInAuthorizatio
120
190
  declare function executeTransaction(provider: RevibaseProvider, args: {
121
191
  instructions: Instruction[];
122
192
  signer: UserInfo;
193
+ payer?: TransactionSigner;
123
194
  settingsIndexWithAddress?: {
124
195
  index: number | bigint;
125
196
  settingsAddressTreeIndex: number;
126
197
  };
127
- additionalSigners?: AdditionalSignersParam;
198
+ additionalSigners?: TransactionSigner[];
128
199
  addressesByLookupTableAddress?: AddressesByLookupTableAddress;
129
200
  }, options?: TransactionAuthorizationFlowOptions): Promise<{
130
201
  txSig?: string;
@@ -137,23 +208,30 @@ declare function transferTokens(provider: RevibaseProvider, args: {
137
208
  signer?: UserInfo;
138
209
  mint?: string;
139
210
  tokenProgram?: string;
211
+ payer?: TransactionSigner;
212
+ addressesByLookupTableAddress?: AddressesByLookupTableAddress;
140
213
  }, options?: TransactionAuthorizationFlowOptions): Promise<{
141
214
  txSig?: string;
142
215
  user: UserInfo;
143
216
  }>;
144
217
 
145
- declare function processClientAuthCallback({ request, privateKey, providerOrigin, rpId, signal, device, channelId, }: {
146
- request: StartTransactionRequest | StartMessageRequest | StartChannelRequest;
147
- signal?: AbortSignal;
218
+ declare function processClientAuthCallback({ request, publicKey, allowedClientOrigins, privateKey, providerOrigin, rpId, }: {
219
+ request: Omit<StartMessageRequest, "rid" | "validTill"> | Omit<StartTransactionRequest, "rid" | "validTill"> | CompleteMessageRequest | CompleteTransactionRequest;
220
+ allowedClientOrigins: string[];
221
+ publicKey: string;
148
222
  privateKey: string;
149
- channelId?: string;
150
- device?: DeviceSignature;
151
223
  providerOrigin?: string;
152
224
  rpId?: string;
153
225
  }): Promise<{
154
- txSig?: string;
155
- user?: UserInfo;
156
- ok?: boolean;
157
- }>;
226
+ signature: string;
227
+ validTill: number;
228
+ rid: string;
229
+ } | {
230
+ user: UserInfo;
231
+ } | CompleteTransactionRequest>;
232
+
233
+ declare function processEstimateJitoTipsCallback(priority?: string, url?: string): Promise<number>;
234
+
235
+ declare function processSendJitoBundleCallback(serializedTransactions: string[], jitoUUID?: string, url?: string): Promise<string>;
158
236
 
159
- export { type AuthorizationFlowResult, ChannelStatus, type ChannelStatusEntry, type ChannelStatusListener, type ClientAuthorizationCallback, type DeviceSignature, RevibaseAuthError, RevibaseError, RevibasePopupBlockedError, RevibaseProvider, type RevibaseProviderOptions, type SignInAuthorizationFlowOptions, type StartChannelRequest, StartChannelRequestSchema, type TransactionAuthorizationFlowOptions, executeTransaction, processClientAuthCallback, signIn, transferTokens };
237
+ export { type ClientAuthorizationCallback, RevibaseAbortedError, RevibaseApiError, RevibaseAuthError, RevibaseEnvironmentError, RevibaseError, RevibaseFlowInProgressError, RevibasePopupBlockedError, RevibasePopupClosedError, RevibasePopupNotOpenError, RevibaseProvider, RevibaseTimeoutError, type SignInAuthorizationFlowOptions, type StartPayload, type TransactionAuthorizationFlowOptions, executeTransaction, processClientAuthCallback, processEstimateJitoTipsCallback, processSendJitoBundleCallback, signIn, transferTokens };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
- import { StartMessageRequest, UserInfo, StartTransactionRequest, AdditionalSignersParam } from '@revibase/core';
1
+ import { StartMessageRequest, StartTransactionRequest, CompleteMessageRequest, UserInfo, CompleteTransactionRequest } from '@revibase/core';
2
2
  export { CompleteMessageRequest, CompleteTransactionRequest, StartMessageRequest, StartTransactionRequest, UserInfo } from '@revibase/core';
3
- import z from 'zod';
4
- import { Instruction, AddressesByLookupTableAddress } from 'gill';
3
+ import * as _simplewebauthn_browser from '@simplewebauthn/browser';
4
+ import { Instruction, TransactionSigner, AddressesByLookupTableAddress } from 'gill';
5
5
 
6
6
  declare class RevibaseError extends Error {
7
7
  readonly code: string;
@@ -10,107 +10,177 @@ declare class RevibaseError extends Error {
10
10
  declare class RevibasePopupBlockedError extends RevibaseError {
11
11
  constructor(message?: string);
12
12
  }
13
+ declare class RevibasePopupClosedError extends RevibaseError {
14
+ constructor(message?: string);
15
+ }
16
+ declare class RevibaseTimeoutError extends RevibaseError {
17
+ constructor(message?: string);
18
+ }
19
+ declare class RevibaseFlowInProgressError extends RevibaseError {
20
+ constructor(message?: string);
21
+ }
22
+ declare class RevibaseAbortedError extends RevibaseError {
23
+ constructor(message?: string);
24
+ }
25
+ declare class RevibasePopupNotOpenError extends RevibaseError {
26
+ constructor(message?: string);
27
+ }
13
28
  declare class RevibaseAuthError extends RevibaseError {
14
29
  constructor(message: string);
15
30
  }
31
+ declare class RevibaseApiError extends RevibaseError {
32
+ constructor(message: string);
33
+ }
34
+ declare class RevibaseEnvironmentError extends RevibaseError {
35
+ constructor(message?: string);
36
+ }
16
37
 
17
- type DeviceSignature = {
18
- jwk: string;
19
- jws: string;
38
+ type PendingApprovalsCallbacks = {
39
+ onPendingApprovalsCallback?: (validTill: number) => void;
40
+ onPendingApprovalsSuccess?: () => void;
20
41
  };
42
+
21
43
  type ClientAuthorizationCallback = {
22
- (request: StartMessageRequest, signal?: AbortSignal, device?: DeviceSignature, channelId?: string): Promise<{
23
- user: UserInfo;
44
+ (request: StartPayload): Promise<{
45
+ signature: string;
46
+ validTill: number;
47
+ rid: string;
24
48
  }>;
25
- (request: StartTransactionRequest, signal?: AbortSignal, device?: DeviceSignature, channelId?: string): Promise<{
26
- txSig?: string;
49
+ (request: CompleteMessageRequest): Promise<{
27
50
  user: UserInfo;
28
51
  }>;
29
- (request: StartChannelRequest, signal?: AbortSignal, device?: DeviceSignature, channelId?: string): Promise<{
30
- ok: true;
31
- }>;
52
+ (request: CompleteTransactionRequest): Promise<CompleteTransactionRequest>;
32
53
  };
54
+ type StartPayload = Omit<StartMessageRequest, "rid" | "validTill"> | Omit<StartTransactionRequest, "rid" | "validTill">;
33
55
  type SignInAuthorizationFlowOptions = {
34
- trustedDeviceCheck?: boolean;
35
56
  signal?: AbortSignal;
36
- channelId?: string;
37
57
  };
38
58
  type TransactionAuthorizationFlowOptions = {
59
+ confirmTransaction?: boolean;
60
+ pendingApprovalsCallback?: PendingApprovalsCallbacks;
39
61
  signal?: AbortSignal;
40
- channelId?: string;
41
62
  };
42
- type AuthorizationFlowResult = {
43
- user: UserInfo;
44
- } | {
45
- txSig?: string;
46
- user: UserInfo;
47
- };
48
- declare const StartChannelRequestSchema: z.ZodObject<{
49
- phase: z.ZodLiteral<"start">;
50
- redirectOrigin: z.ZodURL;
51
- data: z.ZodObject<{
52
- type: z.ZodLiteral<"channel">;
53
- device: z.ZodCustom<DeviceSignature, DeviceSignature>;
54
- channelId: z.ZodString;
55
- }, z.core.$strip>;
56
- }, z.core.$strict>;
57
- type StartChannelRequest = z.infer<typeof StartChannelRequestSchema>;
58
63
 
59
- declare enum ChannelStatus {
60
- AUTHENTICATING = 0,
61
- AWAITING_RECIPIENT = 1,
62
- RECIPIENT_CONNECTED = 2,
63
- RECIPIENT_DISCONNECTED = 3,
64
- AUTO_RECONNECTING = 4,
65
- CONNECTION_LOST = 5,
66
- CHANNEL_CLOSED = 6,
67
- ERROR = 7
68
- }
69
- type ChannelStatusEntry = {
70
- status: ChannelStatus;
71
- recipient?: string;
72
- error?: string;
73
- reconnectAttempt?: number;
74
- };
75
- type ChannelStatusListener = (channelId: string, entry: ChannelStatusEntry) => void;
76
64
  type RevibaseProviderOptions = {
65
+ rpcEndpoint: string;
77
66
  providerOrigin?: string;
78
67
  onClientAuthorizationCallback?: ClientAuthorizationCallback;
79
- rpcEndpoint?: string;
80
- logger?: Pick<Console, "info" | "warn" | "error">;
68
+ onEstimateJitoTipsCallback?: () => Promise<number>;
69
+ onSendJitoBundleCallback?: (request: string[]) => Promise<string>;
81
70
  };
71
+
82
72
  declare class RevibaseProvider {
73
+ private readonly pending;
83
74
  onClientAuthorizationCallback: ClientAuthorizationCallback;
84
- private readonly providerOrigin;
85
- private channelWs;
86
- private readonly channelStatusListeners;
87
- private readonly logger;
88
- private static CHANNEL_ID_CHARSET;
89
- private static CHANNEL_ID_LENGTH;
90
- private static DEFAULT_RETRY_ATTEMPTS;
91
- private static DEFAULT_RETRY_BASE_DELAY_MS;
92
- private sleep;
93
- private defaultCallback;
94
- constructor(options?: RevibaseProviderOptions);
95
- getDeviceSignature(message: string): Promise<{
96
- jwk: string;
97
- jws: string;
75
+ onSendJitoBundleCallback: (request: string[]) => Promise<string>;
76
+ onEstimateJitoTipsCallback: () => Promise<number>;
77
+ private providerOrigin;
78
+ private popUp;
79
+ constructor(options: RevibaseProviderOptions);
80
+ startRequest(): void;
81
+ sendPayloadToProviderViaPopup({ request, signature, signal, }: {
82
+ request: StartMessageRequest | StartTransactionRequest;
83
+ signature: string;
84
+ signal?: AbortSignal;
85
+ }): Promise<{
86
+ phase: "complete";
87
+ data: {
88
+ type: "transaction";
89
+ payload: {
90
+ signer: string;
91
+ startRequest: {
92
+ phase: "start";
93
+ clientOrigin: string;
94
+ rid: string;
95
+ validTill: number;
96
+ data: {
97
+ type: "message";
98
+ payload: string;
99
+ };
100
+ signer?: string | undefined;
101
+ } | {
102
+ phase: "start";
103
+ clientOrigin: string;
104
+ rid: string;
105
+ validTill: number;
106
+ data: {
107
+ type: "transaction";
108
+ payload: {
109
+ transactionActionType: "create" | "create_with_preauthorized_execution" | "execute" | "vote" | "sync" | "close" | "decompress" | "transfer_intent" | "change_delegate" | "change_config";
110
+ transactionAddress: string;
111
+ transactionMessageBytes: string;
112
+ };
113
+ };
114
+ signer?: string | undefined;
115
+ };
116
+ authResponse: _simplewebauthn_browser.AuthenticationResponseJSON;
117
+ client: {
118
+ clientOrigin: string;
119
+ jws: string;
120
+ };
121
+ device: {
122
+ jwk: string;
123
+ jws: string;
124
+ };
125
+ slotHash: string;
126
+ slotNumber: string;
127
+ estimatedSlotHashExpiry: number;
128
+ originIndex: number;
129
+ crossOrigin: boolean;
130
+ userAddressTreeIndex?: number | undefined;
131
+ additionalInfo?: {
132
+ [x: string]: unknown;
133
+ } | undefined;
134
+ };
135
+ };
136
+ } | {
137
+ phase: "complete";
138
+ data: {
139
+ type: "message";
140
+ payload: {
141
+ signer: string;
142
+ startRequest: {
143
+ phase: "start";
144
+ clientOrigin: string;
145
+ rid: string;
146
+ validTill: number;
147
+ data: {
148
+ type: "message";
149
+ payload: string;
150
+ };
151
+ signer?: string | undefined;
152
+ } | {
153
+ phase: "start";
154
+ clientOrigin: string;
155
+ rid: string;
156
+ validTill: number;
157
+ data: {
158
+ type: "transaction";
159
+ payload: {
160
+ transactionActionType: "create" | "create_with_preauthorized_execution" | "execute" | "vote" | "sync" | "close" | "decompress" | "transfer_intent" | "change_delegate" | "change_config";
161
+ transactionAddress: string;
162
+ transactionMessageBytes: string;
163
+ };
164
+ };
165
+ signer?: string | undefined;
166
+ };
167
+ authResponse: _simplewebauthn_browser.AuthenticationResponseJSON;
168
+ client: {
169
+ clientOrigin: string;
170
+ jws: string;
171
+ };
172
+ device: {
173
+ jwk: string;
174
+ jws: string;
175
+ };
176
+ userAddressTreeIndex?: number | undefined;
177
+ additionalInfo?: {
178
+ [x: string]: unknown;
179
+ } | undefined;
180
+ };
181
+ };
98
182
  }>;
99
- subscribeToChannelStatus(listener: ChannelStatusListener): () => void;
100
- private setChannelStatus;
101
- private generateChannelId;
102
- createChannel(): Promise<{
103
- channelId: string;
104
- url: string;
105
- }>;
106
- cancelChannelRequest(channelId: string): void;
107
- reconnectChannel(channelId: string): boolean;
108
- closeChannel(channelId: string): void;
109
- closeAllChannels(): void;
110
- startRequest(channelId?: string): {
111
- rid: string;
112
- redirectOrigin: string;
113
- };
183
+ private attachTransport;
114
184
  }
115
185
 
116
186
  declare function signIn(provider: RevibaseProvider, options?: SignInAuthorizationFlowOptions): Promise<{
@@ -120,11 +190,12 @@ declare function signIn(provider: RevibaseProvider, options?: SignInAuthorizatio
120
190
  declare function executeTransaction(provider: RevibaseProvider, args: {
121
191
  instructions: Instruction[];
122
192
  signer: UserInfo;
193
+ payer?: TransactionSigner;
123
194
  settingsIndexWithAddress?: {
124
195
  index: number | bigint;
125
196
  settingsAddressTreeIndex: number;
126
197
  };
127
- additionalSigners?: AdditionalSignersParam;
198
+ additionalSigners?: TransactionSigner[];
128
199
  addressesByLookupTableAddress?: AddressesByLookupTableAddress;
129
200
  }, options?: TransactionAuthorizationFlowOptions): Promise<{
130
201
  txSig?: string;
@@ -137,23 +208,30 @@ declare function transferTokens(provider: RevibaseProvider, args: {
137
208
  signer?: UserInfo;
138
209
  mint?: string;
139
210
  tokenProgram?: string;
211
+ payer?: TransactionSigner;
212
+ addressesByLookupTableAddress?: AddressesByLookupTableAddress;
140
213
  }, options?: TransactionAuthorizationFlowOptions): Promise<{
141
214
  txSig?: string;
142
215
  user: UserInfo;
143
216
  }>;
144
217
 
145
- declare function processClientAuthCallback({ request, privateKey, providerOrigin, rpId, signal, device, channelId, }: {
146
- request: StartTransactionRequest | StartMessageRequest | StartChannelRequest;
147
- signal?: AbortSignal;
218
+ declare function processClientAuthCallback({ request, publicKey, allowedClientOrigins, privateKey, providerOrigin, rpId, }: {
219
+ request: Omit<StartMessageRequest, "rid" | "validTill"> | Omit<StartTransactionRequest, "rid" | "validTill"> | CompleteMessageRequest | CompleteTransactionRequest;
220
+ allowedClientOrigins: string[];
221
+ publicKey: string;
148
222
  privateKey: string;
149
- channelId?: string;
150
- device?: DeviceSignature;
151
223
  providerOrigin?: string;
152
224
  rpId?: string;
153
225
  }): Promise<{
154
- txSig?: string;
155
- user?: UserInfo;
156
- ok?: boolean;
157
- }>;
226
+ signature: string;
227
+ validTill: number;
228
+ rid: string;
229
+ } | {
230
+ user: UserInfo;
231
+ } | CompleteTransactionRequest>;
232
+
233
+ declare function processEstimateJitoTipsCallback(priority?: string, url?: string): Promise<number>;
234
+
235
+ declare function processSendJitoBundleCallback(serializedTransactions: string[], jitoUUID?: string, url?: string): Promise<string>;
158
236
 
159
- export { type AuthorizationFlowResult, ChannelStatus, type ChannelStatusEntry, type ChannelStatusListener, type ClientAuthorizationCallback, type DeviceSignature, RevibaseAuthError, RevibaseError, RevibasePopupBlockedError, RevibaseProvider, type RevibaseProviderOptions, type SignInAuthorizationFlowOptions, type StartChannelRequest, StartChannelRequestSchema, type TransactionAuthorizationFlowOptions, executeTransaction, processClientAuthCallback, signIn, transferTokens };
237
+ export { type ClientAuthorizationCallback, RevibaseAbortedError, RevibaseApiError, RevibaseAuthError, RevibaseEnvironmentError, RevibaseError, RevibaseFlowInProgressError, RevibasePopupBlockedError, RevibasePopupClosedError, RevibasePopupNotOpenError, RevibaseProvider, RevibaseTimeoutError, type SignInAuthorizationFlowOptions, type StartPayload, type TransactionAuthorizationFlowOptions, executeTransaction, processClientAuthCallback, processEstimateJitoTipsCallback, processSendJitoBundleCallback, signIn, transferTokens };