@explorins/pers-sdk-react-native 1.5.5 → 1.5.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTransactionSigner.d.ts","sourceRoot":"","sources":["../../src/hooks/useTransactionSigner.ts"],"names":[],"mappings":"AA6EA,UAAU,wBAAwB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,oBAAoB;
|
|
1
|
+
{"version":3,"file":"useTransactionSigner.d.ts","sourceRoot":"","sources":["../../src/hooks/useTransactionSigner.ts"],"names":[],"mappings":"AA6EA,UAAU,wBAAwB;IAChC,OAAO,EAAE,OAAO,CAAC;IACjB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAKD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AACH,eAAO,MAAM,oBAAoB;IAuL7B;;OAEG;2BAxE2C,MAAM,KAAG,QAAQ,wBAAwB,CAAC;IA2ExF;;OAEG;gCAlJgD;QACnD,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,iBAAiB,CAAC,EAAE,MAAM,CAAC;KAC5B;IAiJC;;OAEG;;IAGH;;OAEG;;CAGN,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,UAAU,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAE5E;;GAEG;AACH,YAAY,EAAE,wBAAwB,EAAE,CAAC"}
|
|
@@ -80,7 +80,9 @@ export const useTransactionSigner = () => {
|
|
|
80
80
|
console.log('[useTransactionSigner] Auto-initializing PERS transaction signer...');
|
|
81
81
|
// Get configuration from the PERS SDK
|
|
82
82
|
const sdkConfig = sdk.config || {};
|
|
83
|
+
console.log('[useTransactionSigner] SDK config:', sdkConfig);
|
|
83
84
|
const apiProjectKey = sdkConfig.apiProjectKey || 'demo-project-key';
|
|
85
|
+
console.log('[useTransactionSigner] Extracted API project key:', apiProjectKey);
|
|
84
86
|
const tenantId = sdkConfig.tenantId || 'vq-demo';
|
|
85
87
|
initializeSigner({
|
|
86
88
|
tenantId: tenantId,
|
|
@@ -117,12 +119,21 @@ export const useTransactionSigner = () => {
|
|
|
117
119
|
// Configure the PERS service with the project key before creating SDK
|
|
118
120
|
if (config?.projectKey) {
|
|
119
121
|
console.log('[useTransactionSigner] Configuring PERS service with project key:', config.projectKey);
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
122
|
+
try {
|
|
123
|
+
// Import and configure the PERS service
|
|
124
|
+
const { PersService } = await import('@explorins/pers-signer/react-native');
|
|
125
|
+
console.log('[useTransactionSigner] PersService imported successfully');
|
|
126
|
+
PersService.configure({
|
|
127
|
+
projectKey: config.projectKey
|
|
128
|
+
});
|
|
129
|
+
console.log('[useTransactionSigner] PERS service configured with project key');
|
|
130
|
+
// Verify configuration
|
|
131
|
+
const persConfig = PersService.getConfig();
|
|
132
|
+
console.log('[useTransactionSigner] PERS service config after configuration:', persConfig);
|
|
133
|
+
}
|
|
134
|
+
catch (configError) {
|
|
135
|
+
console.error('[useTransactionSigner] Failed to configure PERS service:', configError);
|
|
136
|
+
}
|
|
126
137
|
}
|
|
127
138
|
const signerSDK = await createPersSignerSDK({
|
|
128
139
|
tenantId: config?.tenantId,
|
|
@@ -185,7 +196,9 @@ export const useTransactionSigner = () => {
|
|
|
185
196
|
};
|
|
186
197
|
// Get PERS access token from the main SDK
|
|
187
198
|
const authProvider = sdk.authProvider || sdk._authProvider;
|
|
199
|
+
console.log('[useTransactionSigner] Auth provider found:', !!authProvider);
|
|
188
200
|
const persAccessToken = authProvider ? await authProvider.getToken() : '';
|
|
201
|
+
console.log('[useTransactionSigner] PERS access token extracted:', persAccessToken ? 'Token found' : 'No token');
|
|
189
202
|
// Authenticate user with blockchain signer and pass PERS token
|
|
190
203
|
console.log('[useTransactionSigner] Authenticating user with signer:', signerUserInfo.identifier);
|
|
191
204
|
const signerUser = await signerSDKRef.current.authenticateUser({
|
package/dist/index.js
CHANGED
|
@@ -30322,7 +30322,9 @@ const useTransactionSigner = () => {
|
|
|
30322
30322
|
console.log('[useTransactionSigner] Auto-initializing PERS transaction signer...');
|
|
30323
30323
|
// Get configuration from the PERS SDK
|
|
30324
30324
|
const sdkConfig = sdk.config || {};
|
|
30325
|
+
console.log('[useTransactionSigner] SDK config:', sdkConfig);
|
|
30325
30326
|
const apiProjectKey = sdkConfig.apiProjectKey || 'demo-project-key';
|
|
30327
|
+
console.log('[useTransactionSigner] Extracted API project key:', apiProjectKey);
|
|
30326
30328
|
const tenantId = sdkConfig.tenantId || 'vq-demo';
|
|
30327
30329
|
initializeSigner({
|
|
30328
30330
|
tenantId: tenantId,
|
|
@@ -30359,12 +30361,21 @@ const useTransactionSigner = () => {
|
|
|
30359
30361
|
// Configure the PERS service with the project key before creating SDK
|
|
30360
30362
|
if (config?.projectKey) {
|
|
30361
30363
|
console.log('[useTransactionSigner] Configuring PERS service with project key:', config.projectKey);
|
|
30362
|
-
|
|
30363
|
-
|
|
30364
|
-
|
|
30365
|
-
|
|
30366
|
-
|
|
30367
|
-
|
|
30364
|
+
try {
|
|
30365
|
+
// Import and configure the PERS service
|
|
30366
|
+
const { PersService } = await Promise.resolve().then(function () { return require('./react-native.esm-BtyCg4n1.js'); });
|
|
30367
|
+
console.log('[useTransactionSigner] PersService imported successfully');
|
|
30368
|
+
PersService.configure({
|
|
30369
|
+
projectKey: config.projectKey
|
|
30370
|
+
});
|
|
30371
|
+
console.log('[useTransactionSigner] PERS service configured with project key');
|
|
30372
|
+
// Verify configuration
|
|
30373
|
+
const persConfig = PersService.getConfig();
|
|
30374
|
+
console.log('[useTransactionSigner] PERS service config after configuration:', persConfig);
|
|
30375
|
+
}
|
|
30376
|
+
catch (configError) {
|
|
30377
|
+
console.error('[useTransactionSigner] Failed to configure PERS service:', configError);
|
|
30378
|
+
}
|
|
30368
30379
|
}
|
|
30369
30380
|
const signerSDK = await createPersSignerSDK({
|
|
30370
30381
|
tenantId: config?.tenantId,
|
|
@@ -30427,7 +30438,9 @@ const useTransactionSigner = () => {
|
|
|
30427
30438
|
};
|
|
30428
30439
|
// Get PERS access token from the main SDK
|
|
30429
30440
|
const authProvider = sdk.authProvider || sdk._authProvider;
|
|
30441
|
+
console.log('[useTransactionSigner] Auth provider found:', !!authProvider);
|
|
30430
30442
|
const persAccessToken = authProvider ? await authProvider.getToken() : '';
|
|
30443
|
+
console.log('[useTransactionSigner] PERS access token extracted:', persAccessToken ? 'Token found' : 'No token');
|
|
30431
30444
|
// Authenticate user with blockchain signer and pass PERS token
|
|
30432
30445
|
console.log('[useTransactionSigner] Authenticating user with signer:', signerUserInfo.identifier);
|
|
30433
30446
|
const signerUser = await signerSDKRef.current.authenticateUser({
|