@silencelaboratories/walletprovider-sdk 0.0.0 → 0.0.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/README.md +34 -0
- package/dist/authentication.d.ts +25 -0
- package/dist/authentication.d.ts.map +1 -0
- package/dist/encoding.d.ts +5 -0
- package/dist/encoding.d.ts.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +18425 -1
- package/dist/networkSigner.d.ts +42 -0
- package/dist/networkSigner.d.ts.map +1 -0
- package/dist/sdkEOAauthentication.d.ts +19 -0
- package/dist/sdkEOAauthentication.d.ts.map +1 -0
- package/dist/viemSigner.d.ts +12 -0
- package/dist/viemSigner.d.ts.map +1 -0
- package/dist/walletProviderServiceClient.d.ts +14 -0
- package/dist/walletProviderServiceClient.d.ts.map +1 -0
- package/package.json +6 -1
- package/dist/hex.d.ts +0 -3
- package/dist/hex.d.ts.map +0 -1
package/README.md
CHANGED
|
@@ -1 +1,35 @@
|
|
|
1
1
|
# walletprovider-sdk
|
|
2
|
+
|
|
3
|
+
## Bun runtime is required
|
|
4
|
+
|
|
5
|
+
Install bun from https://bun.sh
|
|
6
|
+
|
|
7
|
+
## Install dependencies
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
bun install
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Build
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
bun run build
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The output will be in the `dist` folder.
|
|
20
|
+
|
|
21
|
+
## Test
|
|
22
|
+
|
|
23
|
+
Create `*.test.ts` files and run tests with:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
bun run test
|
|
27
|
+
# or watch test
|
|
28
|
+
bun run test:watch
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Format the code
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx prettier . --write
|
|
35
|
+
```
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { KeygenSetupOpts, SignSetupOpts } from './networkSigner';
|
|
2
|
+
import { IBrowserWallet } from './sdkEOAauthentication';
|
|
3
|
+
import { IWalletProviderServiceClient } from './walletProviderServiceClient';
|
|
4
|
+
export declare enum AuthMethod {
|
|
5
|
+
EOA = 0,
|
|
6
|
+
NONE = 1
|
|
7
|
+
}
|
|
8
|
+
export type ECDSASignature = string;
|
|
9
|
+
export type UserSignature = ECDSASignature;
|
|
10
|
+
export type UserAuthentication = {
|
|
11
|
+
instance: string;
|
|
12
|
+
challenge: string;
|
|
13
|
+
user_sig: UserSignature;
|
|
14
|
+
};
|
|
15
|
+
export interface AuthModule {
|
|
16
|
+
authenticate(payload: KeygenSetupOpts | SignSetupOpts, wp_client: IWalletProviderServiceClient): Promise<UserAuthentication>;
|
|
17
|
+
}
|
|
18
|
+
export declare class EOAAuth implements AuthModule {
|
|
19
|
+
userId: string;
|
|
20
|
+
browserWallet: IBrowserWallet;
|
|
21
|
+
wpClient: IWalletProviderServiceClient;
|
|
22
|
+
constructor(userId: string, browserWallet: IBrowserWallet, wpClient: IWalletProviderServiceClient);
|
|
23
|
+
authenticate(payload: KeygenSetupOpts | SignSetupOpts): Promise<UserAuthentication>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=authentication.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"authentication.d.ts","sourceRoot":"","sources":["../src/authentication.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAwB,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAE7E,oBAAY,UAAU;IACpB,GAAG,IAAA;IACH,IAAI,IAAA;CACL;AAGD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC;AACpC,MAAM,MAAM,aAAa,GAAG,cAAc,CAAC;AAE3C,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,aAAa,CAAC;CACzB,CAAC;AAEF,MAAM,WAAW,UAAU;IACzB,YAAY,CACV,OAAO,EAAE,eAAe,GAAG,aAAa,EACxC,SAAS,EAAE,4BAA4B,GACtC,OAAO,CAAC,kBAAkB,CAAC,CAAC;CAChC;AAED,qBAAa,OAAQ,YAAW,UAAU;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,cAAc,CAAC;IAC9B,QAAQ,EAAE,4BAA4B,CAAC;gBAC3B,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,cAAc,EAAE,QAAQ,EAAE,4BAA4B;IAM3F,YAAY,CAAC,OAAO,EAAE,eAAe,GAAG,aAAa,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAG1F"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export declare const decodeHex: (s: string) => Uint8Array;
|
|
2
|
+
export declare const encodeHex: (a: Uint8Array) => string;
|
|
3
|
+
export declare const decodeBase64: (b64: string) => Uint8Array;
|
|
4
|
+
export declare const encodeBase64: (b: Uint8Array) => string;
|
|
5
|
+
//# sourceMappingURL=encoding.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../src/encoding.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,SAAS,MAAO,MAAM,KAAG,UAMrC,CAAC;AAEF,eAAO,MAAM,SAAS,MAAO,UAAU,KAAG,MAAqE,CAAC;AAEhH,eAAO,MAAM,YAAY,QAAS,MAAM,eAAuD,CAAC;AAEhG,eAAO,MAAM,YAAY,MAAO,UAAU,WAA0D,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { HashAlgo, NetworkSigner } from './networkSigner.ts';
|
|
2
|
+
export { createViemAccount } from './viemSigner.ts';
|
|
3
|
+
export { AuthMethod, EOAAuth } from './authentication.ts';
|
|
4
|
+
export type { AggregatedChallenge, IWalletProviderServiceClient } from './walletProviderServiceClient.ts';
|
|
2
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAE1D,YAAY,EAAE,mBAAmB,EAAE,4BAA4B,EAAE,MAAM,kCAAkC,CAAC"}
|