@alien_org/react 0.1.0 → 0.1.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.d.cts +59 -15
- package/dist/index.d.mts +59 -15
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -72,7 +72,7 @@ interface Events {
|
|
|
72
72
|
* For instant fulfillment, your backend should fulfill on webhook receipt
|
|
73
73
|
* using the `invoice` from the request.
|
|
74
74
|
*
|
|
75
|
-
* @since 0.
|
|
75
|
+
* @since 0.1.1
|
|
76
76
|
* @schema
|
|
77
77
|
*/
|
|
78
78
|
'payment:response': CreateEventPayload<WithReqId<{
|
|
@@ -81,13 +81,13 @@ interface Events {
|
|
|
81
81
|
* - `paid`: Success
|
|
82
82
|
* - `cancelled`: User rejected
|
|
83
83
|
* - `failed`: Error (check `errorCode`)
|
|
84
|
-
* @since 0.
|
|
84
|
+
* @since 0.1.1
|
|
85
85
|
* @schema
|
|
86
86
|
*/
|
|
87
87
|
status: 'paid' | 'cancelled' | 'failed';
|
|
88
88
|
/**
|
|
89
89
|
* Transaction hash (present when status is 'paid').
|
|
90
|
-
* @since 0.
|
|
90
|
+
* @since 0.1.1
|
|
91
91
|
* @schema
|
|
92
92
|
*/
|
|
93
93
|
txHash?: string;
|
|
@@ -98,11 +98,36 @@ interface Events {
|
|
|
98
98
|
* - `pre_checkout_rejected`: Backend rejected the payment in pre-checkout
|
|
99
99
|
* - `pre_checkout_timeout`: Backend didn't respond to pre-checkout in time
|
|
100
100
|
* - `unknown`: Unexpected error
|
|
101
|
-
* @since 0.
|
|
101
|
+
* @since 0.1.1
|
|
102
102
|
* @schema
|
|
103
103
|
*/
|
|
104
104
|
errorCode?: 'insufficient_balance' | 'network_error' | 'pre_checkout_rejected' | 'pre_checkout_timeout' | 'unknown';
|
|
105
105
|
}>>;
|
|
106
|
+
/**
|
|
107
|
+
* Clipboard read response.
|
|
108
|
+
*
|
|
109
|
+
* On success: `text` contains the clipboard content (may be empty string).
|
|
110
|
+
* On failure: `text` is null and `errorCode` indicates the reason.
|
|
111
|
+
*
|
|
112
|
+
* @since 0.1.1
|
|
113
|
+
* @schema
|
|
114
|
+
*/
|
|
115
|
+
'clipboard:response': CreateEventPayload<WithReqId<{
|
|
116
|
+
/**
|
|
117
|
+
* Text from clipboard. Null if read failed.
|
|
118
|
+
* @since 0.1.1
|
|
119
|
+
* @schema
|
|
120
|
+
*/
|
|
121
|
+
text: string | null;
|
|
122
|
+
/**
|
|
123
|
+
* Error code if clipboard read failed.
|
|
124
|
+
* - `permission_denied`: User denied clipboard access
|
|
125
|
+
* - `unavailable`: Clipboard is not available
|
|
126
|
+
* @since 0.1.1
|
|
127
|
+
* @schema
|
|
128
|
+
*/
|
|
129
|
+
errorCode?: 'permission_denied' | 'unavailable';
|
|
130
|
+
}>>;
|
|
106
131
|
}
|
|
107
132
|
//#endregion
|
|
108
133
|
//#region ../contract/src/events/types/event-types.d.ts
|
|
@@ -193,61 +218,61 @@ interface Methods {
|
|
|
193
218
|
* Set `test: true` for test mode - no real payment is made, but webhooks
|
|
194
219
|
* are fired with `test: true` flag. Use for development and testing.
|
|
195
220
|
*
|
|
196
|
-
* @since 0.
|
|
221
|
+
* @since 0.1.1
|
|
197
222
|
* @schema
|
|
198
223
|
*/
|
|
199
224
|
'payment:request': CreateMethodPayload<WithReqId<{
|
|
200
225
|
/**
|
|
201
226
|
* The recipient's wallet address.
|
|
202
|
-
* @since 0.
|
|
227
|
+
* @since 0.1.1
|
|
203
228
|
* @schema
|
|
204
229
|
*/
|
|
205
230
|
recipient: string;
|
|
206
231
|
/**
|
|
207
232
|
* The amount to pay (in token's smallest unit, as string for precision).
|
|
208
|
-
* @since 0.
|
|
233
|
+
* @since 0.1.1
|
|
209
234
|
* @schema
|
|
210
235
|
*/
|
|
211
236
|
amount: string;
|
|
212
237
|
/**
|
|
213
238
|
* The token identifier (e.g., 'SOL', 'ALIEN', or contract address).
|
|
214
|
-
* @since 0.
|
|
239
|
+
* @since 0.1.1
|
|
215
240
|
* @schema
|
|
216
241
|
*/
|
|
217
242
|
token: string;
|
|
218
243
|
/**
|
|
219
244
|
* The network for the payment ('solana' or 'alien').
|
|
220
|
-
* @since 0.
|
|
245
|
+
* @since 0.1.1
|
|
221
246
|
* @schema
|
|
222
247
|
*/
|
|
223
248
|
network: string;
|
|
224
249
|
/**
|
|
225
250
|
* Your order/invoice ID for backend correlation and instant fulfillment.
|
|
226
|
-
* @since 0.
|
|
251
|
+
* @since 0.1.1
|
|
227
252
|
* @schema
|
|
228
253
|
*/
|
|
229
254
|
invoice: string;
|
|
230
255
|
/**
|
|
231
256
|
* Item title shown on the approval screen.
|
|
232
|
-
* @since 0.
|
|
257
|
+
* @since 0.1.1
|
|
233
258
|
* @schema
|
|
234
259
|
*/
|
|
235
260
|
title?: string;
|
|
236
261
|
/**
|
|
237
262
|
* Item description/caption shown on the approval screen.
|
|
238
|
-
* @since 0.
|
|
263
|
+
* @since 0.1.1
|
|
239
264
|
* @schema
|
|
240
265
|
*/
|
|
241
266
|
caption?: string;
|
|
242
267
|
/**
|
|
243
268
|
* Item icon URL shown on the approval screen.
|
|
244
|
-
* @since 0.
|
|
269
|
+
* @since 0.1.1
|
|
245
270
|
* @schema
|
|
246
271
|
*/
|
|
247
272
|
iconUrl?: string;
|
|
248
273
|
/**
|
|
249
274
|
* Quantity of items being purchased.
|
|
250
|
-
* @since 0.
|
|
275
|
+
* @since 0.1.1
|
|
251
276
|
* @schema
|
|
252
277
|
*/
|
|
253
278
|
quantity?: number;
|
|
@@ -255,11 +280,30 @@ interface Methods {
|
|
|
255
280
|
* Test mode flag. When true, no real payment is processed.
|
|
256
281
|
* The approval screen shows a test indicator, and webhooks
|
|
257
282
|
* include `test: true`. Use for development and testing.
|
|
258
|
-
* @since 0.
|
|
283
|
+
* @since 0.1.1
|
|
259
284
|
* @schema
|
|
260
285
|
*/
|
|
261
286
|
test?: boolean;
|
|
262
287
|
}>>;
|
|
288
|
+
/**
|
|
289
|
+
* Write text to the system clipboard.
|
|
290
|
+
* @since 0.1.1
|
|
291
|
+
* @schema
|
|
292
|
+
*/
|
|
293
|
+
'clipboard:write': CreateMethodPayload<{
|
|
294
|
+
/**
|
|
295
|
+
* Text to copy to clipboard.
|
|
296
|
+
* @since 0.1.1
|
|
297
|
+
* @schema
|
|
298
|
+
*/
|
|
299
|
+
text: string;
|
|
300
|
+
}>;
|
|
301
|
+
/**
|
|
302
|
+
* Read text from the system clipboard.
|
|
303
|
+
* @since 0.1.1
|
|
304
|
+
* @schema
|
|
305
|
+
*/
|
|
306
|
+
'clipboard:read': CreateMethodPayload<WithReqId<Empty>>;
|
|
263
307
|
}
|
|
264
308
|
//#endregion
|
|
265
309
|
//#region ../contract/src/methods/types/method-types.d.ts
|
package/dist/index.d.mts
CHANGED
|
@@ -72,7 +72,7 @@ interface Events {
|
|
|
72
72
|
* For instant fulfillment, your backend should fulfill on webhook receipt
|
|
73
73
|
* using the `invoice` from the request.
|
|
74
74
|
*
|
|
75
|
-
* @since 0.
|
|
75
|
+
* @since 0.1.1
|
|
76
76
|
* @schema
|
|
77
77
|
*/
|
|
78
78
|
'payment:response': CreateEventPayload<WithReqId<{
|
|
@@ -81,13 +81,13 @@ interface Events {
|
|
|
81
81
|
* - `paid`: Success
|
|
82
82
|
* - `cancelled`: User rejected
|
|
83
83
|
* - `failed`: Error (check `errorCode`)
|
|
84
|
-
* @since 0.
|
|
84
|
+
* @since 0.1.1
|
|
85
85
|
* @schema
|
|
86
86
|
*/
|
|
87
87
|
status: 'paid' | 'cancelled' | 'failed';
|
|
88
88
|
/**
|
|
89
89
|
* Transaction hash (present when status is 'paid').
|
|
90
|
-
* @since 0.
|
|
90
|
+
* @since 0.1.1
|
|
91
91
|
* @schema
|
|
92
92
|
*/
|
|
93
93
|
txHash?: string;
|
|
@@ -98,11 +98,36 @@ interface Events {
|
|
|
98
98
|
* - `pre_checkout_rejected`: Backend rejected the payment in pre-checkout
|
|
99
99
|
* - `pre_checkout_timeout`: Backend didn't respond to pre-checkout in time
|
|
100
100
|
* - `unknown`: Unexpected error
|
|
101
|
-
* @since 0.
|
|
101
|
+
* @since 0.1.1
|
|
102
102
|
* @schema
|
|
103
103
|
*/
|
|
104
104
|
errorCode?: 'insufficient_balance' | 'network_error' | 'pre_checkout_rejected' | 'pre_checkout_timeout' | 'unknown';
|
|
105
105
|
}>>;
|
|
106
|
+
/**
|
|
107
|
+
* Clipboard read response.
|
|
108
|
+
*
|
|
109
|
+
* On success: `text` contains the clipboard content (may be empty string).
|
|
110
|
+
* On failure: `text` is null and `errorCode` indicates the reason.
|
|
111
|
+
*
|
|
112
|
+
* @since 0.1.1
|
|
113
|
+
* @schema
|
|
114
|
+
*/
|
|
115
|
+
'clipboard:response': CreateEventPayload<WithReqId<{
|
|
116
|
+
/**
|
|
117
|
+
* Text from clipboard. Null if read failed.
|
|
118
|
+
* @since 0.1.1
|
|
119
|
+
* @schema
|
|
120
|
+
*/
|
|
121
|
+
text: string | null;
|
|
122
|
+
/**
|
|
123
|
+
* Error code if clipboard read failed.
|
|
124
|
+
* - `permission_denied`: User denied clipboard access
|
|
125
|
+
* - `unavailable`: Clipboard is not available
|
|
126
|
+
* @since 0.1.1
|
|
127
|
+
* @schema
|
|
128
|
+
*/
|
|
129
|
+
errorCode?: 'permission_denied' | 'unavailable';
|
|
130
|
+
}>>;
|
|
106
131
|
}
|
|
107
132
|
//#endregion
|
|
108
133
|
//#region ../contract/src/events/types/event-types.d.ts
|
|
@@ -193,61 +218,61 @@ interface Methods {
|
|
|
193
218
|
* Set `test: true` for test mode - no real payment is made, but webhooks
|
|
194
219
|
* are fired with `test: true` flag. Use for development and testing.
|
|
195
220
|
*
|
|
196
|
-
* @since 0.
|
|
221
|
+
* @since 0.1.1
|
|
197
222
|
* @schema
|
|
198
223
|
*/
|
|
199
224
|
'payment:request': CreateMethodPayload<WithReqId<{
|
|
200
225
|
/**
|
|
201
226
|
* The recipient's wallet address.
|
|
202
|
-
* @since 0.
|
|
227
|
+
* @since 0.1.1
|
|
203
228
|
* @schema
|
|
204
229
|
*/
|
|
205
230
|
recipient: string;
|
|
206
231
|
/**
|
|
207
232
|
* The amount to pay (in token's smallest unit, as string for precision).
|
|
208
|
-
* @since 0.
|
|
233
|
+
* @since 0.1.1
|
|
209
234
|
* @schema
|
|
210
235
|
*/
|
|
211
236
|
amount: string;
|
|
212
237
|
/**
|
|
213
238
|
* The token identifier (e.g., 'SOL', 'ALIEN', or contract address).
|
|
214
|
-
* @since 0.
|
|
239
|
+
* @since 0.1.1
|
|
215
240
|
* @schema
|
|
216
241
|
*/
|
|
217
242
|
token: string;
|
|
218
243
|
/**
|
|
219
244
|
* The network for the payment ('solana' or 'alien').
|
|
220
|
-
* @since 0.
|
|
245
|
+
* @since 0.1.1
|
|
221
246
|
* @schema
|
|
222
247
|
*/
|
|
223
248
|
network: string;
|
|
224
249
|
/**
|
|
225
250
|
* Your order/invoice ID for backend correlation and instant fulfillment.
|
|
226
|
-
* @since 0.
|
|
251
|
+
* @since 0.1.1
|
|
227
252
|
* @schema
|
|
228
253
|
*/
|
|
229
254
|
invoice: string;
|
|
230
255
|
/**
|
|
231
256
|
* Item title shown on the approval screen.
|
|
232
|
-
* @since 0.
|
|
257
|
+
* @since 0.1.1
|
|
233
258
|
* @schema
|
|
234
259
|
*/
|
|
235
260
|
title?: string;
|
|
236
261
|
/**
|
|
237
262
|
* Item description/caption shown on the approval screen.
|
|
238
|
-
* @since 0.
|
|
263
|
+
* @since 0.1.1
|
|
239
264
|
* @schema
|
|
240
265
|
*/
|
|
241
266
|
caption?: string;
|
|
242
267
|
/**
|
|
243
268
|
* Item icon URL shown on the approval screen.
|
|
244
|
-
* @since 0.
|
|
269
|
+
* @since 0.1.1
|
|
245
270
|
* @schema
|
|
246
271
|
*/
|
|
247
272
|
iconUrl?: string;
|
|
248
273
|
/**
|
|
249
274
|
* Quantity of items being purchased.
|
|
250
|
-
* @since 0.
|
|
275
|
+
* @since 0.1.1
|
|
251
276
|
* @schema
|
|
252
277
|
*/
|
|
253
278
|
quantity?: number;
|
|
@@ -255,11 +280,30 @@ interface Methods {
|
|
|
255
280
|
* Test mode flag. When true, no real payment is processed.
|
|
256
281
|
* The approval screen shows a test indicator, and webhooks
|
|
257
282
|
* include `test: true`. Use for development and testing.
|
|
258
|
-
* @since 0.
|
|
283
|
+
* @since 0.1.1
|
|
259
284
|
* @schema
|
|
260
285
|
*/
|
|
261
286
|
test?: boolean;
|
|
262
287
|
}>>;
|
|
288
|
+
/**
|
|
289
|
+
* Write text to the system clipboard.
|
|
290
|
+
* @since 0.1.1
|
|
291
|
+
* @schema
|
|
292
|
+
*/
|
|
293
|
+
'clipboard:write': CreateMethodPayload<{
|
|
294
|
+
/**
|
|
295
|
+
* Text to copy to clipboard.
|
|
296
|
+
* @since 0.1.1
|
|
297
|
+
* @schema
|
|
298
|
+
*/
|
|
299
|
+
text: string;
|
|
300
|
+
}>;
|
|
301
|
+
/**
|
|
302
|
+
* Read text from the system clipboard.
|
|
303
|
+
* @since 0.1.1
|
|
304
|
+
* @schema
|
|
305
|
+
*/
|
|
306
|
+
'clipboard:read': CreateMethodPayload<WithReqId<Empty>>;
|
|
263
307
|
}
|
|
264
308
|
//#endregion
|
|
265
309
|
//#region ../contract/src/methods/types/method-types.d.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alien_org/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -34,8 +34,8 @@
|
|
|
34
34
|
"prepublishOnly": "bun run build"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@alien_org/bridge": "
|
|
38
|
-
"@alien_org/contract": "
|
|
37
|
+
"@alien_org/bridge": "0.1.1",
|
|
38
|
+
"@alien_org/contract": "0.1.1"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"react": "^18 || ^19",
|