Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/akanoce/getgho
Browse files Browse the repository at this point in the history
  • Loading branch information
davidecarpini committed Jan 21, 2024
2 parents 4176022 + b25bf48 commit 266657e
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
3 changes: 2 additions & 1 deletion apps/web/src/api/turnkey/createSubOrg.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { createActivityPoller } from '@turnkey/http';
import { ETHEREUM_WALLET_DEFAULT_PATH, turnkeyClient } from '../../const';
import { CreateSubOrgWithPrivateKeyRequest } from './types';
import { refineNonNull } from './helpers';
import { config } from '@repo/config';

export async function turnkeyCreateUser(
subOrgRequest: CreateSubOrgWithPrivateKeyRequest
Expand All @@ -17,7 +18,7 @@ export async function turnkeyCreateUser(
const completedActivity = await activityPoller({
type: 'ACTIVITY_TYPE_CREATE_SUB_ORGANIZATION_V4',
timestampMs: String(Date.now()),
organizationId: import.meta.env.VITE_ORGANIZATION_ID!,
organizationId: config.turnkeyOrganizationId,
parameters: {
subOrganizationName: subOrgRequest.subOrgName,
rootQuorumThreshold: 1,
Expand Down
5 changes: 3 additions & 2 deletions apps/web/src/config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { createConfig } from 'wagmi';
import { sepolia } from 'wagmi/chains';
import { getDefaultConfig } from 'connectkit';
import { config as appConfig } from '@repo/config';

declare module 'wagmi' {
interface Register {
Expand All @@ -9,8 +10,8 @@ declare module 'wagmi' {
}

const envConfig = {
alchemyId: import.meta.env.VITE_ALCHEMY_KEY,
walletConnectProjectId: import.meta.env.VITE_WALLET_CONNECT_PROJECT_ID
alchemyId: appConfig.alchemyApiKey,
walletConnectProjectId: appConfig.walletConnectProjectId
};

export const config = createConfig(
Expand Down
9 changes: 5 additions & 4 deletions apps/web/src/const/turnkey.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
import { ApiKeyStamper } from '@turnkey/api-key-stamper';
import { TurnkeyClient } from '@turnkey/http';
import { WebauthnStamper } from '@turnkey/webauthn-stamper';
import { config } from '@repo/config';

const stamper = new WebauthnStamper({
rpId: 'localhost'
});

export const passkeyHttpClient = new TurnkeyClient(
{
baseUrl: import.meta.env.VITE_TURNKEY_API_BASE_URL!
baseUrl: config.turnkeyApiBaseUrl
},
stamper
);

export const turnkeyClient = new TurnkeyClient(
{ baseUrl: import.meta.env.VITE_TURNKEY_API_BASE_URL! },
{ baseUrl: config.turnkeyApiBaseUrl },
new ApiKeyStamper({
apiPublicKey: import.meta.env.VITE_API_PUBLIC_KEY!,
apiPrivateKey: import.meta.env.VITE_API_PRIVATE_KEY!
apiPublicKey: config.turnkeyApiPublicKey,
apiPrivateKey: config.turnkeyApiPrivateKey
})
);

0 comments on commit 266657e

Please sign in to comment.