unwallet-client-sdk 0.1.0 → 0.2.0
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 +4 -6
- package/dist/configs.js +3 -3
- package/dist/unwallet.d.ts.map +1 -1
- package/dist/unwallet.js +3 -0
- package/package.json +2 -2
- package/src/configs.ts +3 -3
- package/src/unwallet.ts +3 -0
package/README.md
CHANGED
|
@@ -1,13 +1,11 @@
|
|
|
1
|
-
#
|
|
1
|
+
# unWallet client-side SDK
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
:warning: unwallet-client-sdk-js works fine only on browsers
|
|
3
|
+
:warning: Works fine only on browsers
|
|
6
4
|
|
|
7
5
|
## Installation
|
|
8
6
|
|
|
9
7
|
```sh
|
|
10
|
-
$ npm
|
|
8
|
+
$ npm install unwallet-client-sdk
|
|
11
9
|
```
|
|
12
10
|
|
|
13
11
|
## Example
|
|
@@ -51,4 +49,4 @@ const metaTx = await unWallet.signTokenTransfer({
|
|
|
51
49
|
});
|
|
52
50
|
```
|
|
53
51
|
|
|
54
|
-
To execute the transaction, call [POST /metaTransactions of unWallet API](https://developers.
|
|
52
|
+
To execute the transaction, call [POST /metaTransactions of unWallet Enterprise API](https://developers.ent.unwallet.world/ja/latest/unwallet-ent-api.html#post-metatransactions).
|
package/dist/configs.js
CHANGED
|
@@ -5,16 +5,16 @@ exports.unWalletConfigs = {
|
|
|
5
5
|
prod: {
|
|
6
6
|
baseURL: "https://id.unwallet.world",
|
|
7
7
|
authURL: "https://id.unwallet.world/authorize",
|
|
8
|
-
wsAPIURL: "wss://ws-api.
|
|
8
|
+
wsAPIURL: "wss://in-ws-api.id.unwallet.world",
|
|
9
9
|
},
|
|
10
10
|
dev: {
|
|
11
11
|
baseURL: "https://id.unwallet.dev",
|
|
12
12
|
authURL: "https://id.unwallet.dev/authorize",
|
|
13
|
-
wsAPIURL: "wss://ws-api.
|
|
13
|
+
wsAPIURL: "wss://in-ws-api.id.unwallet.dev",
|
|
14
14
|
},
|
|
15
15
|
local: {
|
|
16
16
|
baseURL: "http://localhost:4200",
|
|
17
17
|
authURL: "http://localhost:4200/authorize",
|
|
18
|
-
wsAPIURL: "wss://ws-api.
|
|
18
|
+
wsAPIURL: "wss://in-ws-api.id.unwallet.dev",
|
|
19
19
|
},
|
|
20
20
|
};
|
package/dist/unwallet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unwallet.d.ts","sourceRoot":"","sources":["../src/unwallet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAElE,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,cAAc,CAAiB;IAEvC,OAAO,CAAC,EAAE,CAAY;IACtB,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,MAAM,CAAwC;gBAE1C,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,EAAE,EAAE,SAAS;IAUzE,OAAO,CAAC,eAAe;WAKT,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiC9C,SAAS,CAAC,IAAI,EAAE;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI;IAgBD,IAAI,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"unwallet.d.ts","sourceRoot":"","sources":["../src/unwallet.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAElE,qBAAa,QAAQ;IACnB,OAAO,CAAC,MAAM,CAAS;IACvB,OAAO,CAAC,cAAc,CAAiB;IAEvC,OAAO,CAAC,EAAE,CAAY;IACtB,OAAO,CAAC,YAAY,CAAS;IAE7B,OAAO,CAAC,OAAO,CAAwC;IACvD,OAAO,CAAC,MAAM,CAAwC;gBAE1C,MAAM,EAAE,MAAM,EAAE,cAAc,EAAE,cAAc,EAAE,EAAE,EAAE,SAAS;IAUzE,OAAO,CAAC,eAAe;WAKT,IAAI,CAAC,MAAM,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC;IAiC9C,SAAS,CAAC,IAAI,EAAE;QACrB,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,WAAW,EAAE,MAAM,CAAC;QACpB,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI;IAgBD,IAAI,CAAC,IAAI,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,OAAO,CAAC,MAAM,CAAC;IAahD,iBAAiB,CAAC,IAAI,EAAE;QAC7B,EAAE,EAAE,MAAM,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,MAAM,EAAE,MAAM,CAAC;KAChB,GAAG,OAAO,CAAC,eAAe,CAAC;IAerB,kBAAkB,CAAC,IAAI,EAAE;QAC9B,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,GAAG,OAAO,CAAC,MAAM,CAAC;IAgBnB,OAAO,CAAC,eAAe;IAMvB,OAAO,CAAC,aAAa;IAIrB,OAAO,CAAC,eAAe;IAevB,OAAO,CAAC,UAAU;CAYnB"}
|
package/dist/unwallet.js
CHANGED
|
@@ -64,6 +64,7 @@ class UnWallet {
|
|
|
64
64
|
this.reject = reject;
|
|
65
65
|
const url = new URL(`${this.unWalletConfig.baseURL}/x/sign`);
|
|
66
66
|
url.searchParams.set("connectionID", this.connectionID);
|
|
67
|
+
url.searchParams.set("clientID", this.config.clientID);
|
|
67
68
|
url.searchParams.set("message", args.message);
|
|
68
69
|
this.openWindow(url);
|
|
69
70
|
});
|
|
@@ -74,6 +75,7 @@ class UnWallet {
|
|
|
74
75
|
this.reject = reject;
|
|
75
76
|
const url = new URL(`${this.unWalletConfig.baseURL}/x/signTokenTransfer`);
|
|
76
77
|
url.searchParams.set("connectionID", this.connectionID);
|
|
78
|
+
url.searchParams.set("clientID", this.config.clientID);
|
|
77
79
|
url.searchParams.set("id", args.id.toString());
|
|
78
80
|
url.searchParams.set("to", args.to);
|
|
79
81
|
url.searchParams.set("amount", args.amount.toString());
|
|
@@ -86,6 +88,7 @@ class UnWallet {
|
|
|
86
88
|
this.reject = reject;
|
|
87
89
|
const url = new URL(`${this.unWalletConfig.baseURL}/x/createPresentation`);
|
|
88
90
|
url.searchParams.set("connectionID", this.connectionID);
|
|
91
|
+
url.searchParams.set("clientID", this.config.clientID);
|
|
89
92
|
url.searchParams.set("credential", args.credential);
|
|
90
93
|
url.searchParams.set("challenge", args.challenge);
|
|
91
94
|
this.openWindow(url);
|
package/package.json
CHANGED
package/src/configs.ts
CHANGED
|
@@ -4,16 +4,16 @@ export const unWalletConfigs: { [env: string]: UnWalletConfig } = {
|
|
|
4
4
|
prod: {
|
|
5
5
|
baseURL: "https://id.unwallet.world",
|
|
6
6
|
authURL: "https://id.unwallet.world/authorize",
|
|
7
|
-
wsAPIURL: "wss://ws-api.
|
|
7
|
+
wsAPIURL: "wss://in-ws-api.id.unwallet.world",
|
|
8
8
|
},
|
|
9
9
|
dev: {
|
|
10
10
|
baseURL: "https://id.unwallet.dev",
|
|
11
11
|
authURL: "https://id.unwallet.dev/authorize",
|
|
12
|
-
wsAPIURL: "wss://ws-api.
|
|
12
|
+
wsAPIURL: "wss://in-ws-api.id.unwallet.dev",
|
|
13
13
|
},
|
|
14
14
|
local: {
|
|
15
15
|
baseURL: "http://localhost:4200",
|
|
16
16
|
authURL: "http://localhost:4200/authorize",
|
|
17
|
-
wsAPIURL: "wss://ws-api.
|
|
17
|
+
wsAPIURL: "wss://in-ws-api.id.unwallet.dev",
|
|
18
18
|
},
|
|
19
19
|
};
|
package/src/unwallet.ts
CHANGED
|
@@ -86,6 +86,7 @@ export class UnWallet {
|
|
|
86
86
|
|
|
87
87
|
const url = new URL(`${this.unWalletConfig.baseURL}/x/sign`);
|
|
88
88
|
url.searchParams.set("connectionID", this.connectionID);
|
|
89
|
+
url.searchParams.set("clientID", this.config.clientID);
|
|
89
90
|
url.searchParams.set("message", args.message);
|
|
90
91
|
this.openWindow(url);
|
|
91
92
|
});
|
|
@@ -102,6 +103,7 @@ export class UnWallet {
|
|
|
102
103
|
|
|
103
104
|
const url = new URL(`${this.unWalletConfig.baseURL}/x/signTokenTransfer`);
|
|
104
105
|
url.searchParams.set("connectionID", this.connectionID);
|
|
106
|
+
url.searchParams.set("clientID", this.config.clientID);
|
|
105
107
|
url.searchParams.set("id", args.id.toString());
|
|
106
108
|
url.searchParams.set("to", args.to);
|
|
107
109
|
url.searchParams.set("amount", args.amount.toString());
|
|
@@ -121,6 +123,7 @@ export class UnWallet {
|
|
|
121
123
|
`${this.unWalletConfig.baseURL}/x/createPresentation`
|
|
122
124
|
);
|
|
123
125
|
url.searchParams.set("connectionID", this.connectionID);
|
|
126
|
+
url.searchParams.set("clientID", this.config.clientID);
|
|
124
127
|
url.searchParams.set("credential", args.credential);
|
|
125
128
|
url.searchParams.set("challenge", args.challenge);
|
|
126
129
|
this.openWindow(url);
|