Skip to content

Commit

Permalink
update sdk
Browse files Browse the repository at this point in the history
  • Loading branch information
H34D committed Mar 23, 2023
1 parent 71adfbf commit 3568be2
Show file tree
Hide file tree
Showing 8 changed files with 30 additions and 24 deletions.
2 changes: 1 addition & 1 deletion package.json
Expand Up @@ -29,7 +29,7 @@
"author": "hide-on-bush",
"dependencies": {
"@babel/preset-typescript": "^7.21.0",
"@masa-finance/masa-sdk": "^1.10.5",
"@masa-finance/masa-sdk": "^1.10.6",
"@metamask/providers": "^10.2.1",
"babel-loader": "^9.1.2",
"babel-plugin-import": "^1.13.6",
Expand Down
2 changes: 1 addition & 1 deletion src/helpers/masa.ts
Expand Up @@ -54,7 +54,7 @@ export const createNewMasa = ({
return new Masa({
wallet: newSigner,
apiUrl: environment.apiUrl,
defaultNetwork: networkName,
networkName,
environment: environment.environment,
arweave: {
host: arweaveConfig?.host || 'arweave.net',
Expand Down
8 changes: 4 additions & 4 deletions src/provider/modules/credit-scores/credit-scores.ts
@@ -1,7 +1,7 @@
import { useCallback, useMemo } from 'react';
import { useQuery } from 'react-query';
import { queryClient } from '../../masa-query-client';
import { ICreditScore, Masa } from '@masa-finance/masa-sdk';
import { ICreditScore, Masa, NetworkName } from '@masa-finance/masa-sdk';
import { BigNumber } from 'ethers';

export const useCreditScores = (
Expand All @@ -24,8 +24,8 @@ export const useCreditScores = (
reloadCreditScores: () => void;
error: unknown;
} => {
const queryKey: (string | undefined)[] = useMemo(() => {
return ['credit-scores', walletAddress, masa?.config.network];
const queryKey: (string | NetworkName | undefined)[] = useMemo(() => {
return ['credit-scores', walletAddress, masa?.config.networkName];
}, [walletAddress, masa]);

const {
Expand Down Expand Up @@ -53,7 +53,7 @@ export const useCreditScores = (
}[]
) => {
if (masa?.config.verbose) {
console.info({ creditScores, network: masa?.config.network });
console.info({ creditScores, network: masa?.config.networkName });
}
},
});
Expand Down
7 changes: 4 additions & 3 deletions src/provider/modules/green/green.ts
Expand Up @@ -5,6 +5,7 @@ import {
GenerateGreenResult,
IGreen,
Masa,
NetworkName,
VerifyGreenResult,
} from '@masa-finance/masa-sdk';
import { BigNumber } from 'ethers';
Expand Down Expand Up @@ -32,8 +33,8 @@ export const useGreen = (
reloadGreens: () => void;
error: unknown;
} => {
const queryKey: (string | undefined)[] = useMemo(() => {
return ['green', walletAddress, masa?.config.network];
const queryKey: (string | NetworkName | undefined)[] = useMemo(() => {
return ['green', walletAddress, masa?.config.networkName];
}, [masa, walletAddress]);

const {
Expand Down Expand Up @@ -61,7 +62,7 @@ export const useGreen = (
}[]
) => {
if (masa?.config.verbose) {
console.info({ greens, network: masa?.config.network });
console.info({ greens, network: masa?.config.networkName });
}
},
});
Expand Down
8 changes: 4 additions & 4 deletions src/provider/modules/identity/identity.ts
@@ -1,7 +1,7 @@
import { useCallback, useMemo } from 'react';
import { useQuery } from 'react-query';
import { queryClient } from '../../masa-query-client';
import { Masa, PaymentMethod } from '@masa-finance/masa-sdk';
import { Masa, NetworkName, PaymentMethod } from '@masa-finance/masa-sdk';
import { BigNumber } from 'ethers';

export const useIdentity = (
Expand All @@ -23,8 +23,8 @@ export const useIdentity = (
reloadIdentity: () => void;
error: unknown;
} => {
const queryKey: (string | undefined)[] = useMemo(() => {
return ['identity', walletAddress, masa?.config.network];
const queryKey: (string | NetworkName | undefined)[] = useMemo(() => {
return ['identity', walletAddress, masa?.config.networkName];
}, [walletAddress, masa]);

const {
Expand All @@ -42,7 +42,7 @@ export const useIdentity = (
retry: false,
onSuccess: (identity?: { identityId?: BigNumber; address?: string }) => {
if (masa?.config.verbose) {
console.info({ identity, network: masa?.config.network });
console.info({ identity, network: masa?.config.networkName });
}
},
}
Expand Down
13 changes: 9 additions & 4 deletions src/provider/modules/soulnames/soulnames.ts
@@ -1,5 +1,10 @@
import { useQuery } from 'react-query';
import { Masa, PaymentMethod, SoulNameDetails } from '@masa-finance/masa-sdk';
import {
Masa,
NetworkName,
PaymentMethod,
SoulNameDetails,
} from '@masa-finance/masa-sdk';
import { useCallback, useMemo } from 'react';
import { queryClient } from '../../masa-query-client';

Expand All @@ -18,8 +23,8 @@ export const useSoulnames = (
) => Promise<boolean>;
error: unknown;
} => {
const queryKey: (string | undefined)[] = useMemo(() => {
return ['soulnames', walletAddress, masa?.config.network];
const queryKey: (string | NetworkName | undefined)[] = useMemo(() => {
return ['soulnames', walletAddress, masa?.config.networkName];
}, [walletAddress, masa]);

const {
Expand All @@ -37,7 +42,7 @@ export const useSoulnames = (
retry: false,
onSuccess: (soulNames?: SoulNameDetails[]) => {
if (masa?.config.verbose) {
console.info({ soulNames, network: masa?.config.network });
console.info({ soulNames, network: masa?.config.networkName });
}
},
}
Expand Down
6 changes: 3 additions & 3 deletions src/provider/modules/wallet/wallet.ts
@@ -1,5 +1,5 @@
import { useQuery } from 'react-query';
import { Masa } from '@masa-finance/masa-sdk';
import { Masa, NetworkName } from '@masa-finance/masa-sdk';
import { Signer, Wallet } from 'ethers';
import { useMemo } from 'react';

Expand All @@ -13,8 +13,8 @@ export const useWallet = (
status: string;
error: unknown;
} => {
const queryKey: (string | undefined)[] = useMemo(() => {
return ['wallet', masa?.config.network];
const queryKey: (string | NetworkName | undefined)[] = useMemo(() => {
return ['wallet', masa?.config.networkName];
}, [masa]);

const {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Expand Up @@ -2015,10 +2015,10 @@
dependencies:
ethers "~5.7.2"

"@masa-finance/masa-sdk@^1.10.5":
version "1.10.5"
resolved "https://registry.yarnpkg.com/@masa-finance/masa-sdk/-/masa-sdk-1.10.5.tgz#1f076fea54fc49ddb15347206038c50a02831727"
integrity sha512-vZrS/GNrqZB9OjQCH8HfwXc+kWT8BqFJLByuN5gEMkU8KivMyWUHwefm1iO5VXc6dL61GFaVMyl7SJ4hrBdZLA==
"@masa-finance/masa-sdk@^1.10.6":
version "1.10.6"
resolved "https://registry.yarnpkg.com/@masa-finance/masa-sdk/-/masa-sdk-1.10.6.tgz#a76dd03c65385af5ff6d05ea50dcb7d72304ae53"
integrity sha512-F1Lfa3K7bQ3U1SByTyJvI2WmpUYneKXVoSMZCdk6CHyDB9MsdrgsksoHg8hnk3yafcZK5he+HVSzcJC9xYEBDw==
dependencies:
"@masa-finance/masa-contracts-identity" "^1.4.0"
"@masa-finance/masa-token" "^1.0.0"
Expand Down

0 comments on commit 3568be2

Please sign in to comment.