@civic/common-gateway-react
Advanced tools
Comparing version
@@ -177,2 +177,3 @@ /// <reference types="react" /> | ||
instanceId: string; | ||
signedTx?: string; | ||
}; | ||
@@ -179,0 +180,0 @@ export type CivicPassState = { |
@@ -47,3 +47,3 @@ "use strict"; | ||
const getCivicPassSrcUrl = (state, status, errorCode) => { | ||
const { redirectUrl, gatekeeperNetworkAddress, stage, walletAddress, civicPass, chainType, chainNetwork, ownerSigns, partnerAppId, instanceId, gatewayTokenTransaction, } = state; | ||
const { redirectUrl, gatekeeperNetworkAddress, stage, walletAddress, civicPass, chainType, chainNetwork, ownerSigns, partnerAppId, instanceId, signedTx, } = state; | ||
logDebug('getCivicPassSrcUrl state', state); | ||
@@ -57,3 +57,3 @@ if (!gatekeeperNetworkAddress || !walletAddress) { | ||
const action = gatewayStatusToCivicPassAction[status]; | ||
const searchParams = new URLSearchParams(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, civicPass.requestPayload), { redirectUrl, networkAddress: gatekeeperNetworkAddress, action, wallet: walletAddress }), (chainType ? { chain: chainType } : {})), (chainNetwork ? { chainNetwork } : {})), { ownerSigns: ownerSigns ? 'true' : 'false' }), (errorCode ? { errorCode } : {})), (partnerAppId ? { partnerAppId } : {})), { instanceId }), (gatewayTokenTransaction ? { gatewayTokenTransaction } : {}))); | ||
const searchParams = new URLSearchParams(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, civicPass.requestPayload), { redirectUrl, networkAddress: gatekeeperNetworkAddress, action, wallet: walletAddress }), (chainType ? { chain: chainType } : {})), (chainNetwork ? { chainNetwork } : {})), { ownerSigns: ownerSigns ? 'true' : 'false' }), (errorCode ? { errorCode } : {})), (partnerAppId ? { partnerAppId } : {})), { instanceId }), (signedTx ? { signedTx } : {}))); | ||
logDebug('Civic pass query params', { | ||
@@ -60,0 +60,0 @@ searchParams, |
@@ -45,4 +45,4 @@ "use strict"; | ||
try { | ||
await chainImplementation.handleUserSignedTransaction(transaction); | ||
dispatch({ type: 'handleOwnerSendsTransactionComplete' }); | ||
const signedTx = await chainImplementation.handleUserSignedTransaction(transaction); | ||
dispatch({ type: 'handleOwnerSendsTransactionComplete', signedTx }); | ||
} | ||
@@ -49,0 +49,0 @@ catch (error) { |
@@ -50,2 +50,3 @@ import { ChainType, GatewayToken, PendingPayload } from '../types'; | ||
type: 'handleOwnerSendsTransactionComplete'; | ||
signedTx: string; | ||
}; |
@@ -28,5 +28,6 @@ "use strict"; | ||
logDebug('tokenCreationInProgress', { tokenCreationInProgress }); | ||
const { signedTx } = action; | ||
return Object.assign(Object.assign({}, updatedState), { tokenIssuanceState: types_1.TokenIssuanceState.PENDING_ONCHAIN_CONFIRMATION, | ||
// only move to IN_REVIEW if it's during the initial token creation flow | ||
gatewayStatus: tokenCreationInProgress ? types_1.GatewayStatus.IN_REVIEW : updatedState.gatewayStatus, walletPowoInProgress: false, firstTokenCheck: false }); | ||
gatewayStatus: tokenCreationInProgress ? types_1.GatewayStatus.IN_REVIEW : updatedState.gatewayStatus, walletPowoInProgress: false, firstTokenCheck: false, signedTx }); | ||
} | ||
@@ -33,0 +34,0 @@ case 'walletPowoIncomplete': { |
@@ -177,2 +177,3 @@ /// <reference types="react" /> | ||
instanceId: string; | ||
signedTx?: string; | ||
}; | ||
@@ -179,0 +180,0 @@ export type CivicPassState = { |
@@ -44,3 +44,3 @@ import { useEffect } from 'react'; | ||
export const getCivicPassSrcUrl = (state, status, errorCode) => { | ||
const { redirectUrl, gatekeeperNetworkAddress, stage, walletAddress, civicPass, chainType, chainNetwork, ownerSigns, partnerAppId, instanceId, gatewayTokenTransaction, } = state; | ||
const { redirectUrl, gatekeeperNetworkAddress, stage, walletAddress, civicPass, chainType, chainNetwork, ownerSigns, partnerAppId, instanceId, signedTx, } = state; | ||
logDebug('getCivicPassSrcUrl state', state); | ||
@@ -54,3 +54,3 @@ if (!gatekeeperNetworkAddress || !walletAddress) { | ||
const action = gatewayStatusToCivicPassAction[status]; | ||
const searchParams = new URLSearchParams(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, civicPass.requestPayload), { redirectUrl, networkAddress: gatekeeperNetworkAddress, action, wallet: walletAddress }), (chainType ? { chain: chainType } : {})), (chainNetwork ? { chainNetwork } : {})), { ownerSigns: ownerSigns ? 'true' : 'false' }), (errorCode ? { errorCode } : {})), (partnerAppId ? { partnerAppId } : {})), { instanceId }), (gatewayTokenTransaction ? { gatewayTokenTransaction } : {}))); | ||
const searchParams = new URLSearchParams(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({}, civicPass.requestPayload), { redirectUrl, networkAddress: gatekeeperNetworkAddress, action, wallet: walletAddress }), (chainType ? { chain: chainType } : {})), (chainNetwork ? { chainNetwork } : {})), { ownerSigns: ownerSigns ? 'true' : 'false' }), (errorCode ? { errorCode } : {})), (partnerAppId ? { partnerAppId } : {})), { instanceId }), (signedTx ? { signedTx } : {}))); | ||
logDebug('Civic pass query params', { | ||
@@ -57,0 +57,0 @@ searchParams, |
@@ -43,4 +43,4 @@ import { useCallback } from 'react'; | ||
try { | ||
await chainImplementation.handleUserSignedTransaction(transaction); | ||
dispatch({ type: 'handleOwnerSendsTransactionComplete' }); | ||
const signedTx = await chainImplementation.handleUserSignedTransaction(transaction); | ||
dispatch({ type: 'handleOwnerSendsTransactionComplete', signedTx }); | ||
} | ||
@@ -47,0 +47,0 @@ catch (error) { |
@@ -50,2 +50,3 @@ import { ChainType, GatewayToken, PendingPayload } from '../types'; | ||
type: 'handleOwnerSendsTransactionComplete'; | ||
signedTx: string; | ||
}; |
@@ -24,5 +24,6 @@ import { prefixLogger } from '../logger'; | ||
logDebug('tokenCreationInProgress', { tokenCreationInProgress }); | ||
const { signedTx } = action; | ||
return Object.assign(Object.assign({}, updatedState), { tokenIssuanceState: TokenIssuanceState.PENDING_ONCHAIN_CONFIRMATION, | ||
// only move to IN_REVIEW if it's during the initial token creation flow | ||
gatewayStatus: tokenCreationInProgress ? GatewayStatus.IN_REVIEW : updatedState.gatewayStatus, walletPowoInProgress: false, firstTokenCheck: false }); | ||
gatewayStatus: tokenCreationInProgress ? GatewayStatus.IN_REVIEW : updatedState.gatewayStatus, walletPowoInProgress: false, firstTokenCheck: false, signedTx }); | ||
} | ||
@@ -29,0 +30,0 @@ case 'walletPowoIncomplete': { |
{ | ||
"name": "@civic/common-gateway-react", | ||
"version": "0.11.0-beta.2", | ||
"version": "0.11.0-beta.3", | ||
"main": "./dist/cjs/index.js", | ||
@@ -5,0 +5,0 @@ "module": "./dist/esm/index.js", |
449825
0.03%8748
0.05%