@revibase/lite 0.5.1 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +5 -5
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +22 -105
- package/dist/index.d.ts +22 -105
- package/dist/index.js +5 -5
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { StartMessageRequest, StartTransactionRequest, CompleteMessageRequest, UserInfo, CompleteTransactionRequest } from '@revibase/core';
|
|
2
2
|
export { CompleteMessageRequest, CompleteTransactionRequest, StartMessageRequest, StartTransactionRequest, UserInfo } from '@revibase/core';
|
|
3
|
-
import * as _simplewebauthn_browser from '@simplewebauthn/browser';
|
|
4
3
|
import { Instruction, TransactionSigner, AddressesByLookupTableAddress } from 'gill';
|
|
5
4
|
|
|
6
5
|
declare class RevibaseError extends Error {
|
|
@@ -50,6 +49,20 @@ type ClientAuthorizationCallback = {
|
|
|
50
49
|
}>;
|
|
51
50
|
(request: CompleteTransactionRequest): Promise<CompleteTransactionRequest>;
|
|
52
51
|
};
|
|
52
|
+
type OnConnectedCallback = (rid: string, clientOrigin: string) => Promise<{
|
|
53
|
+
request: StartMessageRequest | StartTransactionRequest;
|
|
54
|
+
signature: string;
|
|
55
|
+
}>;
|
|
56
|
+
type SuccessMap = {
|
|
57
|
+
message: {
|
|
58
|
+
user: UserInfo;
|
|
59
|
+
};
|
|
60
|
+
transaction: {
|
|
61
|
+
txSig: string;
|
|
62
|
+
user: UserInfo;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
type OnSuccessCallback = ((req: CompleteMessageRequest) => Promise<SuccessMap["message"]>) | ((req: CompleteTransactionRequest) => Promise<SuccessMap["transaction"]>);
|
|
53
66
|
type StartPayload = Omit<StartMessageRequest, "validTill"> | Omit<StartTransactionRequest, "validTill">;
|
|
54
67
|
type SignInAuthorizationFlowOptions = {
|
|
55
68
|
signal?: AbortSignal;
|
|
@@ -69,117 +82,21 @@ type RevibaseProviderOptions = {
|
|
|
69
82
|
};
|
|
70
83
|
|
|
71
84
|
declare class RevibaseProvider {
|
|
72
|
-
private readonly pending;
|
|
73
85
|
onClientAuthorizationCallback: ClientAuthorizationCallback;
|
|
74
86
|
onSendJitoBundleCallback: (request: string[]) => Promise<string>;
|
|
75
87
|
onEstimateJitoTipsCallback: () => Promise<number>;
|
|
76
88
|
private providerOrigin;
|
|
77
|
-
private
|
|
89
|
+
private popUp;
|
|
78
90
|
constructor(options: RevibaseProviderOptions);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
request: StartMessageRequest | StartTransactionRequest;
|
|
83
|
-
signature: string;
|
|
84
|
-
}>;
|
|
91
|
+
sendRequestToPopupProvider({ onConnectedCallback, onSuccessCallback, signal, }: {
|
|
92
|
+
onConnectedCallback: OnConnectedCallback;
|
|
93
|
+
onSuccessCallback: OnSuccessCallback;
|
|
85
94
|
signal?: AbortSignal;
|
|
86
95
|
}): Promise<{
|
|
87
|
-
|
|
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
|
-
};
|
|
96
|
+
user: UserInfo;
|
|
137
97
|
} | {
|
|
138
|
-
|
|
139
|
-
|
|
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
|
+
txSig: string;
|
|
99
|
+
user: UserInfo;
|
|
183
100
|
}>;
|
|
184
101
|
private attachTransport;
|
|
185
102
|
}
|
|
@@ -234,4 +151,4 @@ declare function processEstimateJitoTipsCallback(priority?: string, url?: string
|
|
|
234
151
|
|
|
235
152
|
declare function processSendJitoBundleCallback(serializedTransactions: string[], jitoUUID?: string, url?: string): Promise<string>;
|
|
236
153
|
|
|
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 };
|
|
154
|
+
export { type ClientAuthorizationCallback, type OnConnectedCallback, type OnSuccessCallback, 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,6 +1,5 @@
|
|
|
1
1
|
import { StartMessageRequest, StartTransactionRequest, CompleteMessageRequest, UserInfo, CompleteTransactionRequest } from '@revibase/core';
|
|
2
2
|
export { CompleteMessageRequest, CompleteTransactionRequest, StartMessageRequest, StartTransactionRequest, UserInfo } from '@revibase/core';
|
|
3
|
-
import * as _simplewebauthn_browser from '@simplewebauthn/browser';
|
|
4
3
|
import { Instruction, TransactionSigner, AddressesByLookupTableAddress } from 'gill';
|
|
5
4
|
|
|
6
5
|
declare class RevibaseError extends Error {
|
|
@@ -50,6 +49,20 @@ type ClientAuthorizationCallback = {
|
|
|
50
49
|
}>;
|
|
51
50
|
(request: CompleteTransactionRequest): Promise<CompleteTransactionRequest>;
|
|
52
51
|
};
|
|
52
|
+
type OnConnectedCallback = (rid: string, clientOrigin: string) => Promise<{
|
|
53
|
+
request: StartMessageRequest | StartTransactionRequest;
|
|
54
|
+
signature: string;
|
|
55
|
+
}>;
|
|
56
|
+
type SuccessMap = {
|
|
57
|
+
message: {
|
|
58
|
+
user: UserInfo;
|
|
59
|
+
};
|
|
60
|
+
transaction: {
|
|
61
|
+
txSig: string;
|
|
62
|
+
user: UserInfo;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
type OnSuccessCallback = ((req: CompleteMessageRequest) => Promise<SuccessMap["message"]>) | ((req: CompleteTransactionRequest) => Promise<SuccessMap["transaction"]>);
|
|
53
66
|
type StartPayload = Omit<StartMessageRequest, "validTill"> | Omit<StartTransactionRequest, "validTill">;
|
|
54
67
|
type SignInAuthorizationFlowOptions = {
|
|
55
68
|
signal?: AbortSignal;
|
|
@@ -69,117 +82,21 @@ type RevibaseProviderOptions = {
|
|
|
69
82
|
};
|
|
70
83
|
|
|
71
84
|
declare class RevibaseProvider {
|
|
72
|
-
private readonly pending;
|
|
73
85
|
onClientAuthorizationCallback: ClientAuthorizationCallback;
|
|
74
86
|
onSendJitoBundleCallback: (request: string[]) => Promise<string>;
|
|
75
87
|
onEstimateJitoTipsCallback: () => Promise<number>;
|
|
76
88
|
private providerOrigin;
|
|
77
|
-
private
|
|
89
|
+
private popUp;
|
|
78
90
|
constructor(options: RevibaseProviderOptions);
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
request: StartMessageRequest | StartTransactionRequest;
|
|
83
|
-
signature: string;
|
|
84
|
-
}>;
|
|
91
|
+
sendRequestToPopupProvider({ onConnectedCallback, onSuccessCallback, signal, }: {
|
|
92
|
+
onConnectedCallback: OnConnectedCallback;
|
|
93
|
+
onSuccessCallback: OnSuccessCallback;
|
|
85
94
|
signal?: AbortSignal;
|
|
86
95
|
}): Promise<{
|
|
87
|
-
|
|
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
|
-
};
|
|
96
|
+
user: UserInfo;
|
|
137
97
|
} | {
|
|
138
|
-
|
|
139
|
-
|
|
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
|
+
txSig: string;
|
|
99
|
+
user: UserInfo;
|
|
183
100
|
}>;
|
|
184
101
|
private attachTransport;
|
|
185
102
|
}
|
|
@@ -234,4 +151,4 @@ declare function processEstimateJitoTipsCallback(priority?: string, url?: string
|
|
|
234
151
|
|
|
235
152
|
declare function processSendJitoBundleCallback(serializedTransactions: string[], jitoUUID?: string, url?: string): Promise<string>;
|
|
236
153
|
|
|
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 };
|
|
154
|
+
export { type ClientAuthorizationCallback, type OnConnectedCallback, type OnSuccessCallback, RevibaseAbortedError, RevibaseApiError, RevibaseAuthError, RevibaseEnvironmentError, RevibaseError, RevibaseFlowInProgressError, RevibasePopupBlockedError, RevibasePopupClosedError, RevibasePopupNotOpenError, RevibaseProvider, RevibaseTimeoutError, type SignInAuthorizationFlowOptions, type StartPayload, type TransactionAuthorizationFlowOptions, executeTransaction, processClientAuthCallback, processEstimateJitoTipsCallback, processSendJitoBundleCallback, signIn, transferTokens };
|