@revibase/lite 0.4.6 → 0.5.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/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,178 @@ 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;
24
47
  }>;
25
- (request: StartTransactionRequest, signal?: AbortSignal, device?: DeviceSignature, channelId?: string): Promise<{
26
- txSig?: string;
48
+ (request: CompleteMessageRequest): Promise<{
27
49
  user: UserInfo;
28
50
  }>;
29
- (request: StartChannelRequest, signal?: AbortSignal, device?: DeviceSignature, channelId?: string): Promise<{
30
- ok: true;
31
- }>;
51
+ (request: CompleteTransactionRequest): Promise<CompleteTransactionRequest>;
32
52
  };
53
+ type StartPayload = Omit<StartMessageRequest, "validTill"> | Omit<StartTransactionRequest, "validTill">;
33
54
  type SignInAuthorizationFlowOptions = {
34
- trustedDeviceCheck?: boolean;
35
55
  signal?: AbortSignal;
36
- channelId?: string;
37
56
  };
38
57
  type TransactionAuthorizationFlowOptions = {
58
+ confirmTransaction?: boolean;
59
+ pendingApprovalsCallback?: PendingApprovalsCallbacks;
39
60
  signal?: AbortSignal;
40
- channelId?: string;
41
61
  };
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
62
 
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
63
  type RevibaseProviderOptions = {
64
+ rpcEndpoint: string;
77
65
  providerOrigin?: string;
78
66
  onClientAuthorizationCallback?: ClientAuthorizationCallback;
79
- rpcEndpoint?: string;
80
- logger?: Pick<Console, "info" | "warn" | "error">;
67
+ onEstimateJitoTipsCallback?: () => Promise<number>;
68
+ onSendJitoBundleCallback?: (request: string[]) => Promise<string>;
81
69
  };
70
+
82
71
  declare class RevibaseProvider {
72
+ private readonly pending;
83
73
  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;
74
+ onSendJitoBundleCallback: (request: string[]) => Promise<string>;
75
+ onEstimateJitoTipsCallback: () => Promise<number>;
76
+ private providerOrigin;
77
+ private popUpConfig;
78
+ constructor(options: RevibaseProviderOptions);
79
+ startRequest(): Promise<void>;
80
+ sendRequestToPopupProvidr({ onConnectedCallback, signal, }: {
81
+ onConnectedCallback: (rid: string, clientOrigin: string) => Promise<{
82
+ request: StartMessageRequest | StartTransactionRequest;
83
+ signature: string;
84
+ }>;
85
+ signal?: AbortSignal;
86
+ }): Promise<{
87
+ phase: "complete";
88
+ data: {
89
+ type: "transaction";
90
+ payload: {
91
+ signer: string;
92
+ startRequest: {
93
+ phase: "start";
94
+ clientOrigin: string;
95
+ rid: string;
96
+ validTill: number;
97
+ data: {
98
+ type: "message";
99
+ payload: string;
100
+ };
101
+ signer?: string | undefined;
102
+ } | {
103
+ phase: "start";
104
+ clientOrigin: string;
105
+ rid: string;
106
+ validTill: number;
107
+ data: {
108
+ type: "transaction";
109
+ payload: {
110
+ transactionActionType: "create" | "create_with_preauthorized_execution" | "execute" | "vote" | "sync" | "close" | "decompress" | "transfer_intent" | "change_delegate" | "change_config";
111
+ transactionAddress: string;
112
+ transactionMessageBytes: string;
113
+ };
114
+ };
115
+ signer?: string | undefined;
116
+ };
117
+ authResponse: _simplewebauthn_browser.AuthenticationResponseJSON;
118
+ client: {
119
+ clientOrigin: string;
120
+ jws: string;
121
+ };
122
+ device: {
123
+ jwk: string;
124
+ jws: string;
125
+ };
126
+ slotHash: string;
127
+ slotNumber: string;
128
+ estimatedSlotHashExpiry: number;
129
+ originIndex: number;
130
+ crossOrigin: boolean;
131
+ userAddressTreeIndex?: number | undefined;
132
+ additionalInfo?: {
133
+ [x: string]: unknown;
134
+ } | undefined;
135
+ };
136
+ };
137
+ } | {
138
+ phase: "complete";
139
+ data: {
140
+ type: "message";
141
+ payload: {
142
+ signer: string;
143
+ startRequest: {
144
+ phase: "start";
145
+ clientOrigin: string;
146
+ rid: string;
147
+ validTill: number;
148
+ data: {
149
+ type: "message";
150
+ payload: string;
151
+ };
152
+ signer?: string | undefined;
153
+ } | {
154
+ phase: "start";
155
+ clientOrigin: string;
156
+ rid: string;
157
+ validTill: number;
158
+ data: {
159
+ type: "transaction";
160
+ payload: {
161
+ transactionActionType: "create" | "create_with_preauthorized_execution" | "execute" | "vote" | "sync" | "close" | "decompress" | "transfer_intent" | "change_delegate" | "change_config";
162
+ transactionAddress: string;
163
+ transactionMessageBytes: string;
164
+ };
165
+ };
166
+ signer?: string | undefined;
167
+ };
168
+ authResponse: _simplewebauthn_browser.AuthenticationResponseJSON;
169
+ client: {
170
+ clientOrigin: string;
171
+ jws: string;
172
+ };
173
+ device: {
174
+ jwk: string;
175
+ jws: string;
176
+ };
177
+ userAddressTreeIndex?: number | undefined;
178
+ additionalInfo?: {
179
+ [x: string]: unknown;
180
+ } | undefined;
181
+ };
182
+ };
98
183
  }>;
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
- };
184
+ private attachTransport;
114
185
  }
115
186
 
116
187
  declare function signIn(provider: RevibaseProvider, options?: SignInAuthorizationFlowOptions): Promise<{
@@ -120,11 +191,12 @@ declare function signIn(provider: RevibaseProvider, options?: SignInAuthorizatio
120
191
  declare function executeTransaction(provider: RevibaseProvider, args: {
121
192
  instructions: Instruction[];
122
193
  signer: UserInfo;
194
+ payer?: TransactionSigner;
123
195
  settingsIndexWithAddress?: {
124
196
  index: number | bigint;
125
197
  settingsAddressTreeIndex: number;
126
198
  };
127
- additionalSigners?: AdditionalSignersParam;
199
+ additionalSigners?: TransactionSigner[];
128
200
  addressesByLookupTableAddress?: AddressesByLookupTableAddress;
129
201
  }, options?: TransactionAuthorizationFlowOptions): Promise<{
130
202
  txSig?: string;
@@ -137,23 +209,29 @@ declare function transferTokens(provider: RevibaseProvider, args: {
137
209
  signer?: UserInfo;
138
210
  mint?: string;
139
211
  tokenProgram?: string;
212
+ payer?: TransactionSigner;
213
+ addressesByLookupTableAddress?: AddressesByLookupTableAddress;
140
214
  }, options?: TransactionAuthorizationFlowOptions): Promise<{
141
215
  txSig?: string;
142
216
  user: UserInfo;
143
217
  }>;
144
218
 
145
- declare function processClientAuthCallback({ request, privateKey, providerOrigin, rpId, signal, device, channelId, }: {
146
- request: StartTransactionRequest | StartMessageRequest | StartChannelRequest;
147
- signal?: AbortSignal;
219
+ declare function processClientAuthCallback({ request, publicKey, allowedClientOrigins, privateKey, providerOrigin, rpId, }: {
220
+ request: Omit<StartMessageRequest, "validTill"> | Omit<StartTransactionRequest, "validTill"> | CompleteMessageRequest | CompleteTransactionRequest;
221
+ allowedClientOrigins: string[];
222
+ publicKey: string;
148
223
  privateKey: string;
149
- channelId?: string;
150
- device?: DeviceSignature;
151
224
  providerOrigin?: string;
152
225
  rpId?: string;
153
226
  }): Promise<{
154
- txSig?: string;
155
- user?: UserInfo;
156
- ok?: boolean;
157
- }>;
227
+ signature: string;
228
+ validTill: number;
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,178 @@ 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;
24
47
  }>;
25
- (request: StartTransactionRequest, signal?: AbortSignal, device?: DeviceSignature, channelId?: string): Promise<{
26
- txSig?: string;
48
+ (request: CompleteMessageRequest): Promise<{
27
49
  user: UserInfo;
28
50
  }>;
29
- (request: StartChannelRequest, signal?: AbortSignal, device?: DeviceSignature, channelId?: string): Promise<{
30
- ok: true;
31
- }>;
51
+ (request: CompleteTransactionRequest): Promise<CompleteTransactionRequest>;
32
52
  };
53
+ type StartPayload = Omit<StartMessageRequest, "validTill"> | Omit<StartTransactionRequest, "validTill">;
33
54
  type SignInAuthorizationFlowOptions = {
34
- trustedDeviceCheck?: boolean;
35
55
  signal?: AbortSignal;
36
- channelId?: string;
37
56
  };
38
57
  type TransactionAuthorizationFlowOptions = {
58
+ confirmTransaction?: boolean;
59
+ pendingApprovalsCallback?: PendingApprovalsCallbacks;
39
60
  signal?: AbortSignal;
40
- channelId?: string;
41
61
  };
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
62
 
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
63
  type RevibaseProviderOptions = {
64
+ rpcEndpoint: string;
77
65
  providerOrigin?: string;
78
66
  onClientAuthorizationCallback?: ClientAuthorizationCallback;
79
- rpcEndpoint?: string;
80
- logger?: Pick<Console, "info" | "warn" | "error">;
67
+ onEstimateJitoTipsCallback?: () => Promise<number>;
68
+ onSendJitoBundleCallback?: (request: string[]) => Promise<string>;
81
69
  };
70
+
82
71
  declare class RevibaseProvider {
72
+ private readonly pending;
83
73
  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;
74
+ onSendJitoBundleCallback: (request: string[]) => Promise<string>;
75
+ onEstimateJitoTipsCallback: () => Promise<number>;
76
+ private providerOrigin;
77
+ private popUpConfig;
78
+ constructor(options: RevibaseProviderOptions);
79
+ startRequest(): Promise<void>;
80
+ sendRequestToPopupProvidr({ onConnectedCallback, signal, }: {
81
+ onConnectedCallback: (rid: string, clientOrigin: string) => Promise<{
82
+ request: StartMessageRequest | StartTransactionRequest;
83
+ signature: string;
84
+ }>;
85
+ signal?: AbortSignal;
86
+ }): Promise<{
87
+ phase: "complete";
88
+ data: {
89
+ type: "transaction";
90
+ payload: {
91
+ signer: string;
92
+ startRequest: {
93
+ phase: "start";
94
+ clientOrigin: string;
95
+ rid: string;
96
+ validTill: number;
97
+ data: {
98
+ type: "message";
99
+ payload: string;
100
+ };
101
+ signer?: string | undefined;
102
+ } | {
103
+ phase: "start";
104
+ clientOrigin: string;
105
+ rid: string;
106
+ validTill: number;
107
+ data: {
108
+ type: "transaction";
109
+ payload: {
110
+ transactionActionType: "create" | "create_with_preauthorized_execution" | "execute" | "vote" | "sync" | "close" | "decompress" | "transfer_intent" | "change_delegate" | "change_config";
111
+ transactionAddress: string;
112
+ transactionMessageBytes: string;
113
+ };
114
+ };
115
+ signer?: string | undefined;
116
+ };
117
+ authResponse: _simplewebauthn_browser.AuthenticationResponseJSON;
118
+ client: {
119
+ clientOrigin: string;
120
+ jws: string;
121
+ };
122
+ device: {
123
+ jwk: string;
124
+ jws: string;
125
+ };
126
+ slotHash: string;
127
+ slotNumber: string;
128
+ estimatedSlotHashExpiry: number;
129
+ originIndex: number;
130
+ crossOrigin: boolean;
131
+ userAddressTreeIndex?: number | undefined;
132
+ additionalInfo?: {
133
+ [x: string]: unknown;
134
+ } | undefined;
135
+ };
136
+ };
137
+ } | {
138
+ phase: "complete";
139
+ data: {
140
+ type: "message";
141
+ payload: {
142
+ signer: string;
143
+ startRequest: {
144
+ phase: "start";
145
+ clientOrigin: string;
146
+ rid: string;
147
+ validTill: number;
148
+ data: {
149
+ type: "message";
150
+ payload: string;
151
+ };
152
+ signer?: string | undefined;
153
+ } | {
154
+ phase: "start";
155
+ clientOrigin: string;
156
+ rid: string;
157
+ validTill: number;
158
+ data: {
159
+ type: "transaction";
160
+ payload: {
161
+ transactionActionType: "create" | "create_with_preauthorized_execution" | "execute" | "vote" | "sync" | "close" | "decompress" | "transfer_intent" | "change_delegate" | "change_config";
162
+ transactionAddress: string;
163
+ transactionMessageBytes: string;
164
+ };
165
+ };
166
+ signer?: string | undefined;
167
+ };
168
+ authResponse: _simplewebauthn_browser.AuthenticationResponseJSON;
169
+ client: {
170
+ clientOrigin: string;
171
+ jws: string;
172
+ };
173
+ device: {
174
+ jwk: string;
175
+ jws: string;
176
+ };
177
+ userAddressTreeIndex?: number | undefined;
178
+ additionalInfo?: {
179
+ [x: string]: unknown;
180
+ } | undefined;
181
+ };
182
+ };
98
183
  }>;
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
- };
184
+ private attachTransport;
114
185
  }
115
186
 
116
187
  declare function signIn(provider: RevibaseProvider, options?: SignInAuthorizationFlowOptions): Promise<{
@@ -120,11 +191,12 @@ declare function signIn(provider: RevibaseProvider, options?: SignInAuthorizatio
120
191
  declare function executeTransaction(provider: RevibaseProvider, args: {
121
192
  instructions: Instruction[];
122
193
  signer: UserInfo;
194
+ payer?: TransactionSigner;
123
195
  settingsIndexWithAddress?: {
124
196
  index: number | bigint;
125
197
  settingsAddressTreeIndex: number;
126
198
  };
127
- additionalSigners?: AdditionalSignersParam;
199
+ additionalSigners?: TransactionSigner[];
128
200
  addressesByLookupTableAddress?: AddressesByLookupTableAddress;
129
201
  }, options?: TransactionAuthorizationFlowOptions): Promise<{
130
202
  txSig?: string;
@@ -137,23 +209,29 @@ declare function transferTokens(provider: RevibaseProvider, args: {
137
209
  signer?: UserInfo;
138
210
  mint?: string;
139
211
  tokenProgram?: string;
212
+ payer?: TransactionSigner;
213
+ addressesByLookupTableAddress?: AddressesByLookupTableAddress;
140
214
  }, options?: TransactionAuthorizationFlowOptions): Promise<{
141
215
  txSig?: string;
142
216
  user: UserInfo;
143
217
  }>;
144
218
 
145
- declare function processClientAuthCallback({ request, privateKey, providerOrigin, rpId, signal, device, channelId, }: {
146
- request: StartTransactionRequest | StartMessageRequest | StartChannelRequest;
147
- signal?: AbortSignal;
219
+ declare function processClientAuthCallback({ request, publicKey, allowedClientOrigins, privateKey, providerOrigin, rpId, }: {
220
+ request: Omit<StartMessageRequest, "validTill"> | Omit<StartTransactionRequest, "validTill"> | CompleteMessageRequest | CompleteTransactionRequest;
221
+ allowedClientOrigins: string[];
222
+ publicKey: string;
148
223
  privateKey: string;
149
- channelId?: string;
150
- device?: DeviceSignature;
151
224
  providerOrigin?: string;
152
225
  rpId?: string;
153
226
  }): Promise<{
154
- txSig?: string;
155
- user?: UserInfo;
156
- ok?: boolean;
157
- }>;
227
+ signature: string;
228
+ validTill: number;
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 };