wallet-connect-button-vue 1.0.8 → 1.0.10
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.esm.js +22 -4
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +22 -4
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.esm.js
CHANGED
|
@@ -38,7 +38,7 @@ const _hoisted_2 = {
|
|
|
38
38
|
class: "attributes"
|
|
39
39
|
};
|
|
40
40
|
const _hoisted_3 = { class: "verification-card" };
|
|
41
|
-
const _hoisted_4 = ["text", "usecase", "start-url", "lang"];
|
|
41
|
+
const _hoisted_4 = ["text", "usecase", "start-url", "lang", "help-base-url", "same-device-ul", "cross-device-ul"];
|
|
42
42
|
|
|
43
43
|
|
|
44
44
|
const _sfc_main = {
|
|
@@ -49,7 +49,9 @@ const _sfc_main = {
|
|
|
49
49
|
onSuccess: { type: Function, required: true },
|
|
50
50
|
apiKey: { type: String, required: false },
|
|
51
51
|
walletConnectHost: { type: String, required: false },
|
|
52
|
-
lang: { type: String, required: false, default: 'nl' }
|
|
52
|
+
lang: { type: String, required: false, default: 'nl' },
|
|
53
|
+
helpBaseUrl: { type: String, required: false },
|
|
54
|
+
issuance: { type: Boolean, required: false }
|
|
53
55
|
},
|
|
54
56
|
setup(__props) {
|
|
55
57
|
|
|
@@ -66,6 +68,17 @@ const startUrl = computed(() => {
|
|
|
66
68
|
return `${baseUrl}/api/create-session?lang=en&return_url=${encodeURIComponent(returnUrl)}`;
|
|
67
69
|
});
|
|
68
70
|
|
|
71
|
+
const constructURI = (session_type) => {
|
|
72
|
+
const request_uri = `https://issuance.wallet-connect.eu/disclosure/${props.clientId}/request_uri?session_type=${session_type}`;
|
|
73
|
+
const request_uri_method = "post";
|
|
74
|
+
const client_id_uri = `${props.clientId}.example.com`;
|
|
75
|
+
|
|
76
|
+
return `walletdebuginteraction://wallet.edi.rijksoverheid.nl/disclosure_based_issuance?request_uri=${encodeURIComponent(request_uri)}&request_uri_method=${request_uri_method}&client_id=${client_id_uri}`;
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const sameDeviceUl = computed(() => constructURI("same_device"));
|
|
80
|
+
const crossDeviceUl = computed(() => constructURI("cross_device"));
|
|
81
|
+
|
|
69
82
|
const handleSuccess = (e) => {
|
|
70
83
|
const customEvent = e;
|
|
71
84
|
if (customEvent.detail && customEvent.detail.length > 1) {
|
|
@@ -116,11 +129,13 @@ const fetchDisclosedAttributes = async () => {
|
|
|
116
129
|
console.log("Disclosed attributes:", data);
|
|
117
130
|
props.onSuccess(data);
|
|
118
131
|
removeSearchParam('session_token');
|
|
132
|
+
if (nonce) removeSearchParam('nonce');
|
|
119
133
|
loading.value = false;
|
|
120
134
|
} catch (err) {
|
|
121
135
|
console.log(err.message);
|
|
122
136
|
error.value = err.message;
|
|
123
137
|
removeSearchParam('session_token');
|
|
138
|
+
if (nonce) removeSearchParam('nonce');
|
|
124
139
|
loading.value = false;
|
|
125
140
|
}
|
|
126
141
|
};
|
|
@@ -160,9 +175,12 @@ return (_ctx, _cache) => {
|
|
|
160
175
|
ref_key: "buttonRef",
|
|
161
176
|
ref: buttonRef,
|
|
162
177
|
text: props.label,
|
|
163
|
-
usecase: __props.clientId,
|
|
178
|
+
usecase: props.issuance ? '' : __props.clientId,
|
|
164
179
|
"start-url": startUrl.value,
|
|
165
|
-
lang: props.lang
|
|
180
|
+
lang: props.lang,
|
|
181
|
+
"help-base-url": props.helpBaseUrl,
|
|
182
|
+
"same-device-ul": sameDeviceUl.value,
|
|
183
|
+
"cross-device-ul": crossDeviceUl.value
|
|
166
184
|
}, null, 8 /* PROPS */, _hoisted_4))
|
|
167
185
|
}
|
|
168
186
|
}
|