@bsv/wallet-toolbox 1.6.19 → 1.6.21
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/CHANGELOG.md +4 -0
- package/docs/client.md +93 -27
- package/docs/wallet.md +93 -27
- package/mobile/out/src/index.client.d.ts +1 -0
- package/mobile/out/src/index.client.d.ts.map +1 -1
- package/mobile/out/src/index.client.js +1 -0
- package/mobile/out/src/index.client.js.map +1 -1
- package/mobile/out/src/index.mobile.d.ts +1 -0
- package/mobile/out/src/index.mobile.d.ts.map +1 -1
- package/mobile/out/src/index.mobile.js +1 -0
- package/mobile/out/src/index.mobile.js.map +1 -1
- package/mobile/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.d.ts +29 -0
- package/mobile/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.d.ts.map +1 -0
- package/mobile/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.js +70 -0
- package/mobile/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.js.map +1 -0
- package/mobile/package-lock.json +6 -7
- package/mobile/package.json +2 -2
- package/out/src/index.all.d.ts +1 -0
- package/out/src/index.all.d.ts.map +1 -1
- package/out/src/index.all.js +1 -0
- package/out/src/index.all.js.map +1 -1
- package/out/src/index.client.d.ts +1 -0
- package/out/src/index.client.d.ts.map +1 -1
- package/out/src/index.client.js +1 -0
- package/out/src/index.client.js.map +1 -1
- package/out/src/index.mobile.d.ts +1 -0
- package/out/src/index.mobile.d.ts.map +1 -1
- package/out/src/index.mobile.js +1 -0
- package/out/src/index.mobile.js.map +1 -1
- package/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.d.ts +29 -0
- package/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.d.ts.map +1 -0
- package/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.js +70 -0
- package/out/src/wab-client/auth-method-interactors/DevConsoleInteractor.js.map +1 -0
- package/out/tsconfig.all.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/src/index.all.ts +1 -0
- package/src/index.client.ts +1 -0
- package/src/index.mobile.ts +1 -0
- package/src/wab-client/auth-method-interactors/DevConsoleInteractor.ts +73 -0
package/out/src/index.mobile.js
CHANGED
|
@@ -50,6 +50,7 @@ __exportStar(require("./SimpleWalletManager"), exports);
|
|
|
50
50
|
__exportStar(require("./wab-client/auth-method-interactors/AuthMethodInteractor"), exports);
|
|
51
51
|
__exportStar(require("./wab-client/auth-method-interactors/PersonaIDInteractor"), exports);
|
|
52
52
|
__exportStar(require("./wab-client/auth-method-interactors/TwilioPhoneInteractor"), exports);
|
|
53
|
+
__exportStar(require("./wab-client/auth-method-interactors/DevConsoleInteractor"), exports);
|
|
53
54
|
__exportStar(require("./wab-client/WABClient"), exports);
|
|
54
55
|
__exportStar(require("./Wallet"), exports);
|
|
55
56
|
__exportStar(require("./WalletAuthenticationManager"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mobile.js","sourceRoot":"","sources":["../../src/index.mobile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAkC;AAElC,yDAAsC;AACtC,yDAAsC;AACtC,mFAAgE;AAEhE,0DAAuC;AACvC,oDAAiC;AACjC,6DAA0C;AAC1C,sDAAmC;AACnC,wDAAqC;AACrC,wDAAqC;AACrC,4FAAyE;AACzE,2FAAwE;AACxE,6FAA0E;AAC1E,yDAAsC;AACtC,2CAAwB;AACxB,gEAA6C;AAC7C,6DAA0C"}
|
|
1
|
+
{"version":3,"file":"index.mobile.js","sourceRoot":"","sources":["../../src/index.mobile.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mDAAkC;AAElC,yDAAsC;AACtC,yDAAsC;AACtC,mFAAgE;AAEhE,0DAAuC;AACvC,oDAAiC;AACjC,6DAA0C;AAC1C,sDAAmC;AACnC,wDAAqC;AACrC,wDAAqC;AACrC,4FAAyE;AACzE,2FAAwE;AACxE,6FAA0E;AAC1E,4FAAyE;AACzE,yDAAsC;AACtC,2CAAwB;AACxB,gEAA6C;AAC7C,6DAA0C"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AuthMethodInteractor, AuthPayload, StartAuthResponse, CompleteAuthResponse } from './AuthMethodInteractor';
|
|
2
|
+
/**
|
|
3
|
+
* DevConsoleInteractor
|
|
4
|
+
*
|
|
5
|
+
* A client-side class that knows how to call the WAB server for DevConsole-based authentication.
|
|
6
|
+
* This is a development-only auth method that generates OTP codes and logs them to the console.
|
|
7
|
+
*/
|
|
8
|
+
export declare class DevConsoleInteractor extends AuthMethodInteractor {
|
|
9
|
+
methodType: string;
|
|
10
|
+
/**
|
|
11
|
+
* Start the DevConsole authentication on the server.
|
|
12
|
+
* - The server will generate an OTP code and log it to the console for development use.
|
|
13
|
+
* @param serverUrl - The base URL of the WAB server (e.g. http://localhost:3000)
|
|
14
|
+
* @param presentationKey - The 256-bit key the client is attempting to authenticate with
|
|
15
|
+
* @param payload - { phoneNumber: string } (identifier for the authentication)
|
|
16
|
+
* @returns - { success, message, data }
|
|
17
|
+
*/
|
|
18
|
+
startAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<StartAuthResponse>;
|
|
19
|
+
/**
|
|
20
|
+
* Complete the DevConsole authentication on the server.
|
|
21
|
+
* - The server will verify the OTP code that was generated and logged to the console.
|
|
22
|
+
* @param serverUrl - The base URL of the WAB server
|
|
23
|
+
* @param presentationKey - The 256-bit key
|
|
24
|
+
* @param payload - { phoneNumber: string, otp: string } (the identifier and OTP code from console)
|
|
25
|
+
* @returns - { success, message, presentationKey }
|
|
26
|
+
*/
|
|
27
|
+
completeAuth(serverUrl: string, presentationKey: string, payload: AuthPayload): Promise<CompleteAuthResponse>;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=DevConsoleInteractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevConsoleInteractor.d.ts","sourceRoot":"","sources":["../../../../src/wab-client/auth-method-interactors/DevConsoleInteractor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,iBAAiB,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAA;AAEnH;;;;;GAKG;AACH,qBAAa,oBAAqB,SAAQ,oBAAoB;IACrD,UAAU,SAAe;IAEhC;;;;;;;OAOG;IACU,SAAS,CAAC,SAAS,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,EAAE,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,iBAAiB,CAAC;IAqBpH;;;;;;;OAOG;IACU,YAAY,CACvB,SAAS,EAAE,MAAM,EACjB,eAAe,EAAE,MAAM,EACvB,OAAO,EAAE,WAAW,GACnB,OAAO,CAAC,oBAAoB,CAAC;CAoBjC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DevConsoleInteractor = void 0;
|
|
4
|
+
const AuthMethodInteractor_1 = require("./AuthMethodInteractor");
|
|
5
|
+
/**
|
|
6
|
+
* DevConsoleInteractor
|
|
7
|
+
*
|
|
8
|
+
* A client-side class that knows how to call the WAB server for DevConsole-based authentication.
|
|
9
|
+
* This is a development-only auth method that generates OTP codes and logs them to the console.
|
|
10
|
+
*/
|
|
11
|
+
class DevConsoleInteractor extends AuthMethodInteractor_1.AuthMethodInteractor {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(...arguments);
|
|
14
|
+
this.methodType = 'DevConsole';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Start the DevConsole authentication on the server.
|
|
18
|
+
* - The server will generate an OTP code and log it to the console for development use.
|
|
19
|
+
* @param serverUrl - The base URL of the WAB server (e.g. http://localhost:3000)
|
|
20
|
+
* @param presentationKey - The 256-bit key the client is attempting to authenticate with
|
|
21
|
+
* @param payload - { phoneNumber: string } (identifier for the authentication)
|
|
22
|
+
* @returns - { success, message, data }
|
|
23
|
+
*/
|
|
24
|
+
async startAuth(serverUrl, presentationKey, payload) {
|
|
25
|
+
const res = await fetch(`${serverUrl}/auth/start`, {
|
|
26
|
+
method: 'POST',
|
|
27
|
+
headers: { 'Content-Type': 'application/json' },
|
|
28
|
+
body: JSON.stringify({
|
|
29
|
+
methodType: this.methodType,
|
|
30
|
+
presentationKey,
|
|
31
|
+
payload
|
|
32
|
+
})
|
|
33
|
+
});
|
|
34
|
+
if (!res.ok) {
|
|
35
|
+
return {
|
|
36
|
+
success: false,
|
|
37
|
+
message: `HTTP error ${res.status}`
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
return res.json();
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Complete the DevConsole authentication on the server.
|
|
44
|
+
* - The server will verify the OTP code that was generated and logged to the console.
|
|
45
|
+
* @param serverUrl - The base URL of the WAB server
|
|
46
|
+
* @param presentationKey - The 256-bit key
|
|
47
|
+
* @param payload - { phoneNumber: string, otp: string } (the identifier and OTP code from console)
|
|
48
|
+
* @returns - { success, message, presentationKey }
|
|
49
|
+
*/
|
|
50
|
+
async completeAuth(serverUrl, presentationKey, payload) {
|
|
51
|
+
const res = await fetch(`${serverUrl}/auth/complete`, {
|
|
52
|
+
method: 'POST',
|
|
53
|
+
headers: { 'Content-Type': 'application/json' },
|
|
54
|
+
body: JSON.stringify({
|
|
55
|
+
methodType: this.methodType,
|
|
56
|
+
presentationKey,
|
|
57
|
+
payload
|
|
58
|
+
})
|
|
59
|
+
});
|
|
60
|
+
if (!res.ok) {
|
|
61
|
+
return {
|
|
62
|
+
success: false,
|
|
63
|
+
message: `HTTP error ${res.status}`
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
return res.json();
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.DevConsoleInteractor = DevConsoleInteractor;
|
|
70
|
+
//# sourceMappingURL=DevConsoleInteractor.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DevConsoleInteractor.js","sourceRoot":"","sources":["../../../../src/wab-client/auth-method-interactors/DevConsoleInteractor.ts"],"names":[],"mappings":";;;AAAA,iEAAmH;AAEnH;;;;;GAKG;AACH,MAAa,oBAAqB,SAAQ,2CAAoB;IAA9D;;QACS,eAAU,GAAG,YAAY,CAAA;IA+DlC,CAAC;IA7DC;;;;;;;OAOG;IACI,KAAK,CAAC,SAAS,CAAC,SAAiB,EAAE,eAAuB,EAAE,OAAoB;QACrF,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,SAAS,aAAa,EAAE;YACjD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,eAAe;gBACf,OAAO;aACR,CAAC;SACH,CAAC,CAAA;QAEF,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,cAAc,GAAG,CAAC,MAAM,EAAE;aACpC,CAAA;QACH,CAAC;QAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;IACnB,CAAC;IAED;;;;;;;OAOG;IACI,KAAK,CAAC,YAAY,CACvB,SAAiB,EACjB,eAAuB,EACvB,OAAoB;QAEpB,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,GAAG,SAAS,gBAAgB,EAAE;YACpD,MAAM,EAAE,MAAM;YACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE;YAC/C,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC;gBACnB,UAAU,EAAE,IAAI,CAAC,UAAU;gBAC3B,eAAe;gBACf,OAAO;aACR,CAAC;SACH,CAAC,CAAA;QAEF,IAAI,CAAC,GAAG,CAAC,EAAE,EAAE,CAAC;YACZ,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,OAAO,EAAE,cAAc,GAAG,CAAC,MAAM,EAAE;aACpC,CAAA;QACH,CAAC;QAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAA;IACnB,CAAC;CACF;AAhED,oDAgEC"}
|