@1sat/connect 0.0.5 → 0.0.6
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.ts +10 -10
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +70 -70
- package/dist/popup.d.ts +1 -1
- package/dist/popup.d.ts.map +1 -1
- package/dist/provider.d.ts +2 -2
- package/dist/provider.d.ts.map +1 -1
- package/dist/types.d.ts +33 -16
- package/dist/types.d.ts.map +1 -1
- package/package.json +34 -25
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import type { OneSatConfig, OneSatProvider } from
|
|
2
|
-
export
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
7
|
-
export {
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
1
|
+
import type { OneSatConfig, OneSatProvider } from "./types";
|
|
2
|
+
export { AuthorizationTimeoutError, CodeReplayError, type ErrorCode, ErrorCodes, FallbackRequiredError, fromErrorResponse, InsufficientFundsError, OneSatError, PopupBlockedError, PopupClosedError, StateMismatchError, TimeoutError, TransportUnavailableError, UserRejectedError, WalletLockedError, WalletNotConnectedError, } from "./errors";
|
|
3
|
+
export { type BaseMessage, createErrorResponse, createRequest, createResponse, isResponse, isValidMessage, type MessageType, MessageTypes, PROTOCOL_VERSION, type ProtocolMessage, type RequestMessage, type ResponseMessage, } from "./messages";
|
|
4
|
+
export { type PendingRequest, type PopupConfig, PopupManager } from "./popup";
|
|
5
|
+
export { OneSatBrowserProvider } from "./provider";
|
|
6
|
+
export { clearConnection, hasStoredConnection, loadConnection, type StoredConnection, saveConnection, } from "./storage";
|
|
7
|
+
export { AutoTransport, createAutoTransport, createEmbedTransport, createRedirectTransport, EmbedTransport, RedirectTransport, } from "./transport";
|
|
8
|
+
export type { BalanceResult, CancelListingRequest, ConnectParams, ConnectResult, CreateListingRequest, CWIHandshakeReason, CWIRequestMessage, CWIResponseMessage, CWIState, CWIStateMessage, CWITransport, CWITransportConfig, CWITransportEvent, CWITransportEventHandler, CWITransportName, CWIWalletStatus, EventHandler, InscribeRequest, InscribeResult, ListingResult, ListOptions, MobileFallbackMode, OneSatConfig, OneSatEvent, OneSatProvider, OrdinalOutput, PurchaseListingRequest, RpcMethod, SendOrdinalsRequest, SendResult, SignMessageResult, SignTransactionRequest, SignTransactionResult, TokenOutput, TransferTokenRequest, TransportMode, Utxo, } from "./types";
|
|
9
|
+
export { RpcMethods } from "./types";
|
|
10
|
+
export { closePopup, getPopupContext, isPopupContext, type PopupParams, parsePopupParams, rejectRequest, sendErrorResponse, sendResponse, walletLockedError, walletNotConnectedError, } from "./wallet";
|
|
11
11
|
/**
|
|
12
12
|
* Check if the OneSat provider is injected by browser extension
|
|
13
13
|
* Extensions inject window.onesat with isOneSat: true
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AAG5D,OAAO,EACN,yBAAyB,EACzB,eAAe,EACf,KAAK,SAAS,EACd,UAAU,EACV,qBAAqB,EACrB,iBAAiB,EACjB,sBAAsB,EACtB,WAAW,EACX,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,YAAY,EACZ,yBAAyB,EACzB,iBAAiB,EACjB,iBAAiB,EACjB,uBAAuB,GACvB,MAAM,UAAU,CAAC;AAElB,OAAO,EACN,KAAK,WAAW,EAChB,mBAAmB,EACnB,aAAa,EACb,cAAc,EACd,UAAU,EACV,cAAc,EACd,KAAK,WAAW,EAChB,YAAY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H,wBAAgB,iBAAiB,IAAI,cAAc,GAAG,SAAS,CAK9D;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,YAAY,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,cAAc,CAgBlE;AAED;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,CAAC,EAAE,YAAY,GAAG,cAAc,CAE/D;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,OAAO,CAE3C;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,OAAO,SAAO,GAAG,OAAO,CAAC,cAAc,CAAC,CAuBrE"}
|
package/dist/index.js
CHANGED
|
@@ -415,7 +415,7 @@ function isResponse(msg) {
|
|
|
415
415
|
}
|
|
416
416
|
|
|
417
417
|
// src/popup.ts
|
|
418
|
-
var DEFAULT_POPUP_URL = "https://
|
|
418
|
+
var DEFAULT_POPUP_URL = "https://www.1satwallet.com";
|
|
419
419
|
var DEFAULT_TIMEOUT = 300000;
|
|
420
420
|
var POPUP_CHECK_INTERVAL = 500;
|
|
421
421
|
|
|
@@ -556,7 +556,7 @@ var RpcMethods = {
|
|
|
556
556
|
};
|
|
557
557
|
|
|
558
558
|
// src/provider.ts
|
|
559
|
-
var DEFAULT_POPUP_URL2 = "https://
|
|
559
|
+
var DEFAULT_POPUP_URL2 = "https://www.1satwallet.com";
|
|
560
560
|
var DEFAULT_TIMEOUT2 = 300000;
|
|
561
561
|
|
|
562
562
|
class OneSatBrowserProvider {
|
|
@@ -601,8 +601,8 @@ class OneSatBrowserProvider {
|
|
|
601
601
|
const requestId = this.generateRequestId();
|
|
602
602
|
return this.popupManager.openPopup(method, requestId, params);
|
|
603
603
|
}
|
|
604
|
-
async connect() {
|
|
605
|
-
const result = await this.sendRequest(RpcMethods.CONNECT);
|
|
604
|
+
async connect(params) {
|
|
605
|
+
const result = await this.sendRequest(RpcMethods.CONNECT, params?.challenge ? { challenge: params.challenge } : undefined);
|
|
606
606
|
this.connection = {
|
|
607
607
|
...result,
|
|
608
608
|
connectedAt: Date.now()
|
|
@@ -700,72 +700,6 @@ class OneSatBrowserProvider {
|
|
|
700
700
|
this.events.removeAllListeners();
|
|
701
701
|
}
|
|
702
702
|
}
|
|
703
|
-
// src/wallet.ts
|
|
704
|
-
function parsePopupParams(searchParams) {
|
|
705
|
-
const requestId = searchParams.get("requestId");
|
|
706
|
-
const origin = searchParams.get("origin");
|
|
707
|
-
const method = searchParams.get("method");
|
|
708
|
-
const appName = searchParams.get("appName");
|
|
709
|
-
const paramsStr = searchParams.get("params");
|
|
710
|
-
let params = undefined;
|
|
711
|
-
if (paramsStr) {
|
|
712
|
-
try {
|
|
713
|
-
params = JSON.parse(decodeURIComponent(paramsStr));
|
|
714
|
-
} catch {}
|
|
715
|
-
}
|
|
716
|
-
return { requestId, origin, method, appName, params };
|
|
717
|
-
}
|
|
718
|
-
function sendResponse(requestId, result, origin) {
|
|
719
|
-
if (typeof window === "undefined")
|
|
720
|
-
return;
|
|
721
|
-
if (!window.opener) {
|
|
722
|
-
console.error("[onesat] No opener window found");
|
|
723
|
-
return;
|
|
724
|
-
}
|
|
725
|
-
const response = createResponse(requestId, result, origin);
|
|
726
|
-
window.opener.postMessage(response, origin);
|
|
727
|
-
window.close();
|
|
728
|
-
}
|
|
729
|
-
function sendErrorResponse(requestId, code, message, origin, data) {
|
|
730
|
-
if (typeof window === "undefined")
|
|
731
|
-
return;
|
|
732
|
-
if (!window.opener) {
|
|
733
|
-
console.error("[onesat] No opener window found");
|
|
734
|
-
return;
|
|
735
|
-
}
|
|
736
|
-
const response = createErrorResponse(requestId, code, message, origin, data);
|
|
737
|
-
window.opener.postMessage(response, origin);
|
|
738
|
-
window.close();
|
|
739
|
-
}
|
|
740
|
-
function rejectRequest(requestId, origin, reason = "User rejected the request") {
|
|
741
|
-
sendErrorResponse(requestId, ErrorCodes.USER_REJECTED, reason, origin);
|
|
742
|
-
}
|
|
743
|
-
function walletLockedError(requestId, origin) {
|
|
744
|
-
sendErrorResponse(requestId, ErrorCodes.WALLET_LOCKED, "Wallet is locked. Please unlock your wallet.", origin);
|
|
745
|
-
}
|
|
746
|
-
function walletNotConnectedError(requestId, origin) {
|
|
747
|
-
sendErrorResponse(requestId, ErrorCodes.WALLET_NOT_CONNECTED, "Wallet is not connected", origin);
|
|
748
|
-
}
|
|
749
|
-
function closePopup() {
|
|
750
|
-
if (typeof window !== "undefined") {
|
|
751
|
-
window.close();
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
function isPopupContext() {
|
|
755
|
-
if (typeof window === "undefined")
|
|
756
|
-
return false;
|
|
757
|
-
return window.opener !== null;
|
|
758
|
-
}
|
|
759
|
-
function getPopupContext(searchParams) {
|
|
760
|
-
const { requestId, origin, method, appName, params } = parsePopupParams(searchParams);
|
|
761
|
-
if (!requestId) {
|
|
762
|
-
throw new Error("Missing requestId in popup parameters");
|
|
763
|
-
}
|
|
764
|
-
if (!origin) {
|
|
765
|
-
throw new Error("Missing origin in popup parameters");
|
|
766
|
-
}
|
|
767
|
-
return { requestId, origin, method, appName, params };
|
|
768
|
-
}
|
|
769
703
|
// src/transport.ts
|
|
770
704
|
var DEFAULT_WALLET_URL = "https://1sat.market";
|
|
771
705
|
var DEFAULT_IFRAME_PATH = "/wallet/cwi";
|
|
@@ -1435,6 +1369,72 @@ class AutoTransport {
|
|
|
1435
1369
|
var createEmbedTransport = (config) => new EmbedTransport(config);
|
|
1436
1370
|
var createRedirectTransport = (config) => new RedirectTransport(config);
|
|
1437
1371
|
var createAutoTransport = (config) => new AutoTransport(config);
|
|
1372
|
+
// src/wallet.ts
|
|
1373
|
+
function parsePopupParams(searchParams) {
|
|
1374
|
+
const requestId = searchParams.get("requestId");
|
|
1375
|
+
const origin = searchParams.get("origin");
|
|
1376
|
+
const method = searchParams.get("method");
|
|
1377
|
+
const appName = searchParams.get("appName");
|
|
1378
|
+
const paramsStr = searchParams.get("params");
|
|
1379
|
+
let params = undefined;
|
|
1380
|
+
if (paramsStr) {
|
|
1381
|
+
try {
|
|
1382
|
+
params = JSON.parse(decodeURIComponent(paramsStr));
|
|
1383
|
+
} catch {}
|
|
1384
|
+
}
|
|
1385
|
+
return { requestId, origin, method, appName, params };
|
|
1386
|
+
}
|
|
1387
|
+
function sendResponse(requestId, result, origin) {
|
|
1388
|
+
if (typeof window === "undefined")
|
|
1389
|
+
return;
|
|
1390
|
+
if (!window.opener) {
|
|
1391
|
+
console.error("[onesat] No opener window found");
|
|
1392
|
+
return;
|
|
1393
|
+
}
|
|
1394
|
+
const response = createResponse(requestId, result, origin);
|
|
1395
|
+
window.opener.postMessage(response, origin);
|
|
1396
|
+
window.close();
|
|
1397
|
+
}
|
|
1398
|
+
function sendErrorResponse(requestId, code, message, origin, data) {
|
|
1399
|
+
if (typeof window === "undefined")
|
|
1400
|
+
return;
|
|
1401
|
+
if (!window.opener) {
|
|
1402
|
+
console.error("[onesat] No opener window found");
|
|
1403
|
+
return;
|
|
1404
|
+
}
|
|
1405
|
+
const response = createErrorResponse(requestId, code, message, origin, data);
|
|
1406
|
+
window.opener.postMessage(response, origin);
|
|
1407
|
+
window.close();
|
|
1408
|
+
}
|
|
1409
|
+
function rejectRequest(requestId, origin, reason = "User rejected the request") {
|
|
1410
|
+
sendErrorResponse(requestId, ErrorCodes.USER_REJECTED, reason, origin);
|
|
1411
|
+
}
|
|
1412
|
+
function walletLockedError(requestId, origin) {
|
|
1413
|
+
sendErrorResponse(requestId, ErrorCodes.WALLET_LOCKED, "Wallet is locked. Please unlock your wallet.", origin);
|
|
1414
|
+
}
|
|
1415
|
+
function walletNotConnectedError(requestId, origin) {
|
|
1416
|
+
sendErrorResponse(requestId, ErrorCodes.WALLET_NOT_CONNECTED, "Wallet is not connected", origin);
|
|
1417
|
+
}
|
|
1418
|
+
function closePopup() {
|
|
1419
|
+
if (typeof window !== "undefined") {
|
|
1420
|
+
window.close();
|
|
1421
|
+
}
|
|
1422
|
+
}
|
|
1423
|
+
function isPopupContext() {
|
|
1424
|
+
if (typeof window === "undefined")
|
|
1425
|
+
return false;
|
|
1426
|
+
return window.opener !== null;
|
|
1427
|
+
}
|
|
1428
|
+
function getPopupContext(searchParams) {
|
|
1429
|
+
const { requestId, origin, method, appName, params } = parsePopupParams(searchParams);
|
|
1430
|
+
if (!requestId) {
|
|
1431
|
+
throw new Error("Missing requestId in popup parameters");
|
|
1432
|
+
}
|
|
1433
|
+
if (!origin) {
|
|
1434
|
+
throw new Error("Missing origin in popup parameters");
|
|
1435
|
+
}
|
|
1436
|
+
return { requestId, origin, method, appName, params };
|
|
1437
|
+
}
|
|
1438
1438
|
|
|
1439
1439
|
// src/index.ts
|
|
1440
1440
|
function isOneSatInjected() {
|
package/dist/popup.d.ts
CHANGED
package/dist/popup.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"popup.d.ts","sourceRoot":"","sources":["../src/popup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"popup.d.ts","sourceRoot":"","sources":["../src/popup.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAMzC,MAAM,WAAW,WAAW;IAC3B,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,cAAc,CAAC,CAAC;IAChC,OAAO,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,CAAC;IAC5B,MAAM,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAC;IAC/B,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,SAAS,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,CAAC;IACzC,eAAe,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAC;CAChD;AAED;;GAEG;AACH,qBAAa,YAAY;IACxB,OAAO,CAAC,MAAM,CAAc;IAC5B,OAAO,CAAC,eAAe,CAA8C;gBAEzD,MAAM,CAAC,EAAE,OAAO,CAAC,WAAW,CAAC;IAQzC;;OAEG;IACH,SAAS,CAAC,CAAC,EACV,MAAM,EAAE,SAAS,EACjB,SAAS,EAAE,MAAM,EACjB,MAAM,CAAC,EAAE,OAAO,GACd,OAAO,CAAC,CAAC,CAAC;IA8Db;;OAEG;IACH,cAAc,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,GAAG,OAAO;IAS3D;;OAEG;IACH,aAAa,CAAC,SAAS,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAG,OAAO;IASvD;;OAEG;IACH,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO;IAI7C;;OAEG;IACH,OAAO,CAAC,OAAO;IAcf;;OAEG;IACH,OAAO,IAAI,IAAI;CAKf"}
|
package/dist/provider.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type BalanceResult, type CancelListingRequest, type ConnectResult, type CreateListingRequest, type EventHandler, type InscribeRequest, type InscribeResult, type
|
|
1
|
+
import { type BalanceResult, type CancelListingRequest, type ConnectParams, type ConnectResult, type CreateListingRequest, type EventHandler, type InscribeRequest, type InscribeResult, type ListingResult, type ListOptions, type OneSatConfig, type OneSatEvent, type OneSatProvider, type OrdinalOutput, type PurchaseListingRequest, type SendOrdinalsRequest, type SendResult, type SignMessageResult, type SignTransactionRequest, type SignTransactionResult, type TokenOutput, type TransferTokenRequest, type Utxo } from "./types";
|
|
2
2
|
/**
|
|
3
3
|
* Browser implementation of the OneSat wallet provider
|
|
4
4
|
* Uses popup-based communication with the wallet
|
|
@@ -23,7 +23,7 @@ export declare class OneSatBrowserProvider implements OneSatProvider {
|
|
|
23
23
|
* Send a request that requires popup approval
|
|
24
24
|
*/
|
|
25
25
|
private sendRequest;
|
|
26
|
-
connect(): Promise<ConnectResult>;
|
|
26
|
+
connect(params?: ConnectParams): Promise<ConnectResult>;
|
|
27
27
|
disconnect(): Promise<void>;
|
|
28
28
|
isConnected(): boolean;
|
|
29
29
|
/**
|
package/dist/provider.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAUA,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,
|
|
1
|
+
{"version":3,"file":"provider.d.ts","sourceRoot":"","sources":["../src/provider.ts"],"names":[],"mappings":"AAUA,OAAO,EACN,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAG3B,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAC1B,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,IAAI,EACT,MAAM,SAAS,CAAC;AAKjB;;;GAGG;AACH,qBAAa,qBAAsB,YAAW,cAAc;IAC3D,sFAAsF;IACtF,QAAQ,CAAC,QAAQ,EAAG,IAAI,CAAU;IAElC,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,UAAU,CAAiC;IACnD,OAAO,CAAC,MAAM,CAAsB;IACpC,OAAO,CAAC,WAAW,CAAS;gBAEhB,MAAM,CAAC,EAAE,YAAY;IAqBjC;;OAEG;IACH,OAAO,CAAC,aAAa,CAoBnB;IAEF;;OAEG;IACH,OAA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AAY,IAAI;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAQzE,iBAAiB,IAAI,MAAM,GAAG,IAAI;IAIlC;;OAEG;IACH,OAAO,IAAI,IAAI;CAOf"}
|
package/dist/types.d.ts
CHANGED
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Optional parameters for connect()
|
|
3
|
+
*/
|
|
4
|
+
export interface ConnectParams {
|
|
5
|
+
/**
|
|
6
|
+
* An optional challenge message to sign during connection.
|
|
7
|
+
* When provided, the wallet signs the challenge with BSM in the same popup,
|
|
8
|
+
* avoiding a second popup for signMessage().
|
|
9
|
+
* The result is returned in ConnectResult.signedMessage.
|
|
10
|
+
*/
|
|
11
|
+
challenge?: string;
|
|
12
|
+
}
|
|
1
13
|
/**
|
|
2
14
|
* Connection result returned after successful wallet connection
|
|
3
15
|
*/
|
|
@@ -5,6 +17,11 @@ export interface ConnectResult {
|
|
|
5
17
|
paymentAddress: string;
|
|
6
18
|
ordinalAddress: string;
|
|
7
19
|
identityPubKey: string;
|
|
20
|
+
/**
|
|
21
|
+
* If a challenge was provided to connect(), this contains the BSM signature.
|
|
22
|
+
* Only present when connect() was called with a challenge parameter.
|
|
23
|
+
*/
|
|
24
|
+
signedMessage?: SignMessageResult;
|
|
8
25
|
}
|
|
9
26
|
/**
|
|
10
27
|
* Provider configuration options
|
|
@@ -17,12 +34,12 @@ export interface OneSatConfig {
|
|
|
17
34
|
/** Request timeout in milliseconds (default: 300000 = 5 minutes) */
|
|
18
35
|
timeout?: number;
|
|
19
36
|
/** Network to use (default: main) */
|
|
20
|
-
network?:
|
|
37
|
+
network?: "main" | "test";
|
|
21
38
|
}
|
|
22
39
|
/** Transport mode for CWI requests */
|
|
23
|
-
export type TransportMode =
|
|
40
|
+
export type TransportMode = "popup" | "embed" | "redirect" | "auto";
|
|
24
41
|
/** Mobile fallback strategy for CWI transport negotiation */
|
|
25
|
-
export type MobileFallbackMode =
|
|
42
|
+
export type MobileFallbackMode = "auto" | "redirect" | "embed-only";
|
|
26
43
|
/**
|
|
27
44
|
* Configuration options for CWI transport implementations
|
|
28
45
|
*/
|
|
@@ -47,8 +64,8 @@ export interface CWITransportConfig {
|
|
|
47
64
|
mobileFallback?: MobileFallbackMode;
|
|
48
65
|
}
|
|
49
66
|
/** CWI handshake reason codes from the wallet iframe */
|
|
50
|
-
export type CWIHandshakeReason =
|
|
51
|
-
export type CWIWalletStatus =
|
|
67
|
+
export type CWIHandshakeReason = "channel_unavailable" | "wallet_tab_unreachable" | "wallet_locked";
|
|
68
|
+
export type CWIWalletStatus = "checking" | "locked" | "unlocked" | "no-wallet";
|
|
52
69
|
/**
|
|
53
70
|
* RPC method names for wallet communication
|
|
54
71
|
*/
|
|
@@ -69,18 +86,18 @@ export declare const RpcMethods: {
|
|
|
69
86
|
readonly GET_UTXOS: "getUtxos";
|
|
70
87
|
};
|
|
71
88
|
export type RpcMethod = (typeof RpcMethods)[keyof typeof RpcMethods];
|
|
72
|
-
export type CWITransportName =
|
|
89
|
+
export type CWITransportName = "embed" | "redirect";
|
|
73
90
|
/** State signal posted by wallet CWI iframe */
|
|
74
91
|
export interface CWIState {
|
|
75
92
|
status?: CWIWalletStatus;
|
|
76
93
|
hasPermission?: boolean;
|
|
77
|
-
transport?:
|
|
94
|
+
transport?: "embed";
|
|
78
95
|
fallbackRecommended?: boolean;
|
|
79
96
|
reason?: CWIHandshakeReason;
|
|
80
97
|
}
|
|
81
98
|
/** CWI invocation request sent from dApp to iframe */
|
|
82
99
|
export interface CWIRequestMessage {
|
|
83
|
-
type:
|
|
100
|
+
type: "CWI";
|
|
84
101
|
isInvocation: true;
|
|
85
102
|
id: string;
|
|
86
103
|
call: string;
|
|
@@ -88,22 +105,22 @@ export interface CWIRequestMessage {
|
|
|
88
105
|
}
|
|
89
106
|
/** CWI invocation response sent from iframe to dApp */
|
|
90
107
|
export interface CWIResponseMessage {
|
|
91
|
-
type:
|
|
108
|
+
type: "CWI";
|
|
92
109
|
isInvocation: false;
|
|
93
110
|
id: string;
|
|
94
111
|
result?: unknown;
|
|
95
|
-
status?:
|
|
112
|
+
status?: "error";
|
|
96
113
|
description?: string;
|
|
97
114
|
code?: number;
|
|
98
115
|
}
|
|
99
116
|
/** CWI state updates posted by wallet iframe */
|
|
100
117
|
export interface CWIStateMessage {
|
|
101
|
-
type:
|
|
118
|
+
type: "CWI";
|
|
102
119
|
cwiState: CWIState;
|
|
103
120
|
}
|
|
104
121
|
/** Transport events for telemetry and UX signaling */
|
|
105
122
|
export interface CWITransportEvent {
|
|
106
|
-
type:
|
|
123
|
+
type: "selected" | "fallback";
|
|
107
124
|
transport: CWITransportName;
|
|
108
125
|
previousTransport?: CWITransportName;
|
|
109
126
|
reason?: string;
|
|
@@ -119,8 +136,8 @@ export interface CWITransport {
|
|
|
119
136
|
readonly mode: TransportMode;
|
|
120
137
|
invoke<TResult = unknown>(call: string, args?: unknown): Promise<TResult>;
|
|
121
138
|
resume<TResult = unknown>(searchParams?: URLSearchParams | string): Promise<TResult | null>;
|
|
122
|
-
on(event:
|
|
123
|
-
off(event:
|
|
139
|
+
on(event: "transport", handler: CWITransportEventHandler): void;
|
|
140
|
+
off(event: "transport", handler: CWITransportEventHandler): void;
|
|
124
141
|
destroy(): void;
|
|
125
142
|
}
|
|
126
143
|
/**
|
|
@@ -253,7 +270,7 @@ export interface ListOptions {
|
|
|
253
270
|
/**
|
|
254
271
|
* Event types emitted by the provider
|
|
255
272
|
*/
|
|
256
|
-
export type OneSatEvent =
|
|
273
|
+
export type OneSatEvent = "connect" | "disconnect" | "accountChange";
|
|
257
274
|
/**
|
|
258
275
|
* Event handler function type
|
|
259
276
|
*/
|
|
@@ -274,7 +291,7 @@ declare global {
|
|
|
274
291
|
export interface OneSatProvider {
|
|
275
292
|
/** Identifies this as the OneSat provider (for detection) */
|
|
276
293
|
readonly isOneSat: true;
|
|
277
|
-
connect(): Promise<ConnectResult>;
|
|
294
|
+
connect(params?: ConnectParams): Promise<ConnectResult>;
|
|
278
295
|
disconnect(): Promise<void>;
|
|
279
296
|
isConnected(): boolean;
|
|
280
297
|
signTransaction(request: SignTransactionRequest): Promise<SignTransactionResult>;
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,cAAc,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;CACnB;AAED;;GAEG;AACH,MAAM,WAAW,aAAa;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB,cAAc,EAAE,MAAM,CAAC;IACvB;;;OAGG;IACH,aAAa,CAAC,EAAE,iBAAiB,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,YAAY;IAC5B,iDAAiD;IACjD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mEAAmE;IACnE,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,oEAAoE;IACpE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,qCAAqC;IACrC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;CAC1B;AAED,sCAAsC;AACtC,MAAM,MAAM,aAAa,GAAG,OAAO,GAAG,OAAO,GAAG,UAAU,GAAG,MAAM,CAAC;AAEpE,6DAA6D;AAC7D,MAAM,MAAM,kBAAkB,GAAG,MAAM,GAAG,UAAU,GAAG,YAAY,CAAC;AAEpE;;GAEG;AACH,MAAM,WAAW,kBAAkB;IAClC,8DAA8D;IAC9D,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+CAA+C;IAC/C,UAAU,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,IAAI;QAAE,cAAc,EAAE,MAAM,CAAC;QAAC,cAAc,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAC1E,iBAAiB,IAAI,MAAM,GAAG,IAAI,CAAC;CACnC"}
|
package/package.json
CHANGED
|
@@ -1,27 +1,36 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
2
|
+
"name": "@1sat/connect",
|
|
3
|
+
"version": "0.0.6",
|
|
4
|
+
"description": "Connection layer for 1Sat wallet - popup flow, events, session management",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./dist/index.d.ts",
|
|
11
|
+
"import": "./dist/index.js"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "bun build ./src/index.ts --outdir ./dist --target browser && tsc --emitDeclarationOnly",
|
|
19
|
+
"dev": "tsc --watch"
|
|
20
|
+
},
|
|
21
|
+
"keywords": [
|
|
22
|
+
"1sat",
|
|
23
|
+
"bsv",
|
|
24
|
+
"ordinals",
|
|
25
|
+
"wallet",
|
|
26
|
+
"sdk",
|
|
27
|
+
"connect"
|
|
28
|
+
],
|
|
29
|
+
"license": "MIT",
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"eventemitter3": "^5.0.1"
|
|
32
|
+
},
|
|
33
|
+
"devDependencies": {
|
|
34
|
+
"typescript": "^5.9.3"
|
|
35
|
+
}
|
|
27
36
|
}
|