Skip to content

Commit

Permalink
Add updates for end-2-end flow (#74)
Browse files Browse the repository at this point in the history
* Add updates for end-2-end flow

* add query params
  • Loading branch information
Robert-H-Leonard authored Oct 25, 2024
1 parent 66550fc commit 7844643
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 9 deletions.
4 changes: 2 additions & 2 deletions gateway-ui/src/stories/Index.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,14 +34,14 @@ type Story = StoryObj<typeof CollapsableGatewayPortal>;
export const WalletWithToken: Story = {
args: {
userWallet: new Wallet(foundryDefaultPKWithToken, publicRPC),
networkName: "Identity.com KYC Verification"
networkName: "Identity-KYC-Verification"
},
};

export const WalletWithoutToken: Story = {
args: {
userWallet: Wallet.createRandom().connect(publicRPC),
networkName: "Identity.com KYC Verification"
networkName: "Identity-KYC-Verification"
},
};

Expand Down
4 changes: 3 additions & 1 deletion gateway-ui/src/useGatewayPortal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,8 @@ export const useGatewayPortal = (props: GatewayPortalProps) => {
const loadGatekeeperIssuerData = async () => {
// If we need to look up the service endpoint of each gatekeeper
const provider = await userWallet.provider;
const address = userWallet.getAddress();
const chainId = await userWallet.getChainId();

if(portalData && portalData.invalidPassData) {
const didResitry = new DidRegistry(provider, BNB_TESTNET_CONTRACT_ADDRESSES.didRegistry, {chainEnvironment: 'testnet'});
Expand All @@ -163,7 +165,7 @@ export const useGatewayPortal = (props: GatewayPortalProps) => {
return {
issuerAlias: resolvedConfig.displayName,
issuanceFee: issuer.issuanceFee,
passRequestLink: resolvedConfig.gatewayIssuerEndpoint
passRequestLink: `${resolvedConfig.gatewayIssuerEndpoint}?chain_id=${chainId}&wallet_address=${address}`
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
import { sleep, getDeploymentSigner } from "../defender-utils";
import hre , { ethers, upgrades } from "hardhat";
import { Signer } from '@ethersproject/abstract-signer/src.ts'
import { COMPLERE_TESTNET_CONTRACT_ADDRESSES, ZERO_ADDRESS, gatekeeperOneTestnetWallet, gatekeeperTwoTestnetWallet, testNetworkName, testNetworkNameWithErc20Fees, testNetworkNameWithNativeFees, trustSwiftlyTestnetGatekeeperWallet } from "../utils";
import { BNB_TESTNET_CONTRACT_ADDRESSES, COMPLERE_TESTNET_CONTRACT_ADDRESSES, ZERO_ADDRESS, gatekeeperOneTestnetWallet, gatekeeperTwoTestnetWallet, testNetworkName, testNetworkNameWithErc20Fees, testNetworkNameWithNativeFees, trustSwiftlyTestnetGatekeeperWallet } from "../utils";
import { GatewayNetwork, GatewayToken, IGatewayNetwork } from "../../typechain-types";

async function main() {
let signer: Signer;
signer = await getDeploymentSigner();

const gatewayNetworkContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.gatewayNetwork;
const gatewayNetworkContractAddress = BNB_TESTNET_CONTRACT_ADDRESSES.gatewayNetwork;

const NetworkContractFactory = await ethers.getContractFactory("GatewayNetwork", signer!);
const networkContract = NetworkContractFactory.attach(gatewayNetworkContractAddress) as GatewayNetwork;


await networkContract.connect(signer!).addGatekeeper(await signer.getAddress(), testNetworkName);
const tx = await networkContract.connect(signer!).addGatekeeper("0xBae36244AdaDe42247dd31e8cFaECb0a1F0e4570", testNetworkName);

console.log(JSON.stringify(tx))
}


Expand Down
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import { sleep, getDeploymentSigner } from "../defender-utils";
import hre , { ethers, upgrades } from "hardhat";
import { Signer } from '@ethersproject/abstract-signer/src.ts'
import { COMPLERE_TESTNET_CONTRACT_ADDRESSES, ZERO_ADDRESS, gatekeeperOneTestnetWallet, gatekeeperTwoTestnetWallet, testNetworkName, testNetworkNameWithErc20Fees, testNetworkNameWithNativeFees } from "../utils";
import { BNB_TESTNET_CONTRACT_ADDRESSES, COMPLERE_TESTNET_CONTRACT_ADDRESSES, ZERO_ADDRESS, gatekeeperOneTestnetWallet, gatekeeperTwoTestnetWallet, testNetworkName, testNetworkNameWithErc20Fees, testNetworkNameWithNativeFees } from "../utils";
import { GatewayNetwork, IGatewayNetwork } from "../../typechain-types";
import { utils } from "ethers";

async function main() {
let signer: Signer;
signer = await getDeploymentSigner();

const gatewayNetworkContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.gatewayNetwork;
const dummyERC20ContractAddress = COMPLERE_TESTNET_CONTRACT_ADDRESSES.erc20;
const gatewayNetworkContractAddress = BNB_TESTNET_CONTRACT_ADDRESSES.gatewayNetwork;
const dummyERC20ContractAddress = BNB_TESTNET_CONTRACT_ADDRESSES.erc20;

const provider = new ethers.providers.JsonRpcProvider(process.env.BNB_TESTNET_RPC_URL!);

Expand Down

0 comments on commit 7844643

Please sign in to comment.