Skip to content

Commit

Permalink
Merge pull request #85 from etherspot/feature/etherspot-prime-sdk-pro…
Browse files Browse the repository at this point in the history
…ject-key

added etherspot project key
  • Loading branch information
poocart authored Jan 29, 2024
2 parents f77c475 + 782ee3c commit 10813a2
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## [0.6.12] - 2024-01-26

### Added Changes
- Added Etherspot Prime SDK `projectKey` to `<EtherspotTransactionKit />`, it allows usage of SDK data services

## [0.6.11] - 2023-11-23

### Added Changes
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@etherspot/transaction-kit",
"description": "React Etherspot Transaction Kit",
"version": "0.6.11",
"version": "0.6.12",
"main": "dist/cjs/index.js",
"scripts": {
"rollup:build": "NODE_OPTIONS=--max-old-space-size=8192 rollup -c",
Expand Down
3 changes: 3 additions & 0 deletions src/components/EtherspotTransactionKit.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ interface EtherspotTransactionKitProps extends React.PropsWithChildren {
provider: WalletProviderLike;
chainId?: number;
accountTemplate?: AccountTemplate;
projectKey?: string;
}

const EtherspotTransactionKit = ({
children,
provider,
chainId = 1,
accountTemplate = Factory.ETHERSPOT,
projectKey
}: EtherspotTransactionKitProps) => (
<EtherspotContextProvider
provider={provider}
chainId={chainId}
accountTemplate={accountTemplate}
projectKey={projectKey}
>
<EtherspotTransactionKitContextProvider>
<ProviderWalletContextProvider>
Expand Down
4 changes: 3 additions & 1 deletion src/providers/EtherspotContextProvider.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,13 @@ const EtherspotContextProvider = ({
provider,
chainId,
accountTemplate,
projectKey,
}: {
children: ReactNode;
provider: WalletProviderLike;
chainId: number;
accountTemplate: AccountTemplate;
projectKey?: string;
}) => {
const context = useContext(EtherspotContext);

Expand Down Expand Up @@ -63,7 +65,7 @@ const EtherspotContextProvider = ({

const sdkForChain = new PrimeSdk(mappedProvider ?? provider, {
chainId: sdkChainId,
projectKey: '__ETHERSPOT_PROJECT_KEY__' || undefined,
projectKey: projectKey ?? ('__ETHERSPOT_PROJECT_KEY__' || undefined),
factoryWallet: accountTemplate as Factory,
});

Expand Down

0 comments on commit 10813a2

Please sign in to comment.