Skip to content

Commit

Permalink
Merge pull request #40 from etherspot/PRO-2161
Browse files Browse the repository at this point in the history
Removed graphqlEndpoints and projectKey parameters
  • Loading branch information
Jineshdarjee authored Mar 21, 2024
2 parents 2ff00bb + 6c8d8f3 commit 0809dc8
Show file tree
Hide file tree
Showing 24 changed files with 100 additions and 84 deletions.
4 changes: 1 addition & 3 deletions test/specs/mainnet/getAddresses/arbitrum.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.arbitrum_chainid),
projectKey: process.env.PROJECT_KEY,
factoryWallet: Factory.ZERO_DEV, bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY)
},
);
Expand Down Expand Up @@ -81,7 +80,6 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.arbitrum_chainid),
projectKey: process.env.PROJECT_KEY,
factoryWallet: Factory.SIMPLE_ACCOUNT, bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY)
},
);
Expand Down Expand Up @@ -139,7 +137,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.arbitrum_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down
4 changes: 1 addition & 3 deletions test/specs/mainnet/getAddresses/matic.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.matic_chainid),
projectKey: process.env.PROJECT_KEY,
factoryWallet: Factory.ZERO_DEV, bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY)
},
);
Expand Down Expand Up @@ -81,7 +80,6 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.matic_chainid),
projectKey: process.env.PROJECT_KEY,
factoryWallet: Factory.SIMPLE_ACCOUNT, bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY)
},
);
Expand Down Expand Up @@ -139,7 +137,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.matic_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down
4 changes: 1 addition & 3 deletions test/specs/mainnet/getAddresses/optimism.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.optimism_chainid),
projectKey: process.env.PROJECT_KEY,
factoryWallet: Factory.ZERO_DEV, bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY)
},
);
Expand Down Expand Up @@ -81,7 +80,6 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.optimism_chainid),
projectKey: process.env.PROJECT_KEY,
factoryWallet: Factory.SIMPLE_ACCOUNT, bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY)
},
);
Expand Down Expand Up @@ -139,7 +137,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.optimism_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down
4 changes: 1 addition & 3 deletions test/specs/mainnet/getAddresses/xdai.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.xdai_chainid),
projectKey: process.env.PROJECT_KEY,
factoryWallet: Factory.ZERO_DEV, bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY)
},
);
Expand Down Expand Up @@ -81,7 +80,6 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.xdai_chainid),
projectKey: process.env.PROJECT_KEY,
factoryWallet: Factory.SIMPLE_ACCOUNT, bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY)
},
);
Expand Down Expand Up @@ -139,7 +137,7 @@ describe('The PrimeSDK, when get the ZeroDev address and SimpleAccount address d
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.xdai_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down
26 changes: 16 additions & 10 deletions test/specs/mainnet/listAndRates/arbitrum.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from 'dotenv';
dotenv.config(); // init dotenv
import { PrimeSdk, DataUtils, graphqlEndpoints, EtherspotBundler } from '@etherspot/prime-sdk';
import { PrimeSdk, DataUtils, EtherspotBundler } from '@etherspot/prime-sdk';
import { utils } from 'ethers';
import { assert } from 'chai';
import addContext from 'mochawesome/addContext.js';
Expand All @@ -24,7 +24,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.arbitrum_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down Expand Up @@ -999,7 +999,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
if (runTest) {
await customRetryAsync(async function () {
let TOKEN_LIST;
let rates;
let requestPayload;

try {
Expand All @@ -1010,15 +1009,22 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
chainId: Number(data.invalid_arbitrum_chainid),
};

rates = await arbitrumDataService.fetchExchangeRates(requestPayload);
await arbitrumDataService.fetchExchangeRates(requestPayload);

} catch (e) {
console.error(e);
const eString = e.toString();
addContext(test, eString);
assert.fail(
'The respective validate is displayed with invalid ChainID while fetching the exchange rates.',
);
let errorMessage = e.message;
if (errorMessage.includes('Cannot set properties of undefined')) {
console.log(
'The correct validation is displayed invalid ChainID while fetching the exchange rates.',
);
} else {
console.error(e);
const eString = e.toString();
addContext(test, eString);
assert.fail(
'The respective validate is not displayed invalid ChainID while fetching the exchange rates.',
);
}
}
}, data.retry); // Retry this async test up to 5 times
} else {
Expand Down
26 changes: 16 additions & 10 deletions test/specs/mainnet/listAndRates/matic.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from 'dotenv';
dotenv.config(); // init dotenv
import { PrimeSdk, DataUtils, graphqlEndpoints, EtherspotBundler } from '@etherspot/prime-sdk';
import { PrimeSdk, DataUtils, EtherspotBundler } from '@etherspot/prime-sdk';
import { utils } from 'ethers';
import { assert } from 'chai';
import addContext from 'mochawesome/addContext.js';
Expand All @@ -24,7 +24,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.matic_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down Expand Up @@ -999,7 +999,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
if (runTest) {
await customRetryAsync(async function () {
let TOKEN_LIST;
let rates;
let requestPayload;

try {
Expand All @@ -1010,15 +1009,22 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
chainId: Number(data.invalid_matic_chainid),
};

rates = await maticDataService.fetchExchangeRates(requestPayload);
await maticDataService.fetchExchangeRates(requestPayload);

} catch (e) {
console.error(e);
const eString = e.toString();
addContext(test, eString);
assert.fail(
'The respective validate is displayed with invalid ChainID while fetching the exchange rates.',
);
let errorMessage = e.message;
if (errorMessage.includes('Cannot set properties of undefined')) {
console.log(
'The correct validation is displayed invalid ChainID while fetching the exchange rates.',
);
} else {
console.error(e);
const eString = e.toString();
addContext(test, eString);
assert.fail(
'The respective validate is not displayed invalid ChainID while fetching the exchange rates.',
);
}
}
}, data.retry); // Retry this async test up to 5 times
} else {
Expand Down
26 changes: 16 additions & 10 deletions test/specs/mainnet/listAndRates/optimism.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from 'dotenv';
dotenv.config(); // init dotenv
import { PrimeSdk, DataUtils, graphqlEndpoints, EtherspotBundler } from '@etherspot/prime-sdk';
import { PrimeSdk, DataUtils, EtherspotBundler } from '@etherspot/prime-sdk';
import { utils } from 'ethers';
import { assert } from 'chai';
import addContext from 'mochawesome/addContext.js';
Expand All @@ -24,7 +24,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.optimism_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down Expand Up @@ -999,7 +999,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
if (runTest) {
await customRetryAsync(async function () {
let TOKEN_LIST;
let rates;
let requestPayload;

try {
Expand All @@ -1010,15 +1009,22 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
chainId: Number(data.invalid_optimism_chainid),
};

rates = await optimismDataService.fetchExchangeRates(requestPayload);
await optimismDataService.fetchExchangeRates(requestPayload);

} catch (e) {
console.error(e);
const eString = e.toString();
addContext(test, eString);
assert.fail(
'The respective validate is displayed with invalid ChainID while fetching the exchange rates.',
);
let errorMessage = e.message;
if (errorMessage.includes('Cannot set properties of undefined')) {
console.log(
'The correct validation is displayed invalid ChainID while fetching the exchange rates.',
);
} else {
console.error(e);
const eString = e.toString();
addContext(test, eString);
assert.fail(
'The respective validate is not displayed invalid ChainID while fetching the exchange rates.',
);
}
}
}, data.retry); // Retry this async test up to 5 times
} else {
Expand Down
26 changes: 16 additions & 10 deletions test/specs/mainnet/listAndRates/xdai.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from 'dotenv';
dotenv.config(); // init dotenv
import { PrimeSdk, DataUtils, graphqlEndpoints, EtherspotBundler } from '@etherspot/prime-sdk';
import { PrimeSdk, DataUtils, EtherspotBundler } from '@etherspot/prime-sdk';
import { utils } from 'ethers';
import { assert } from 'chai';
import addContext from 'mochawesome/addContext.js';
Expand All @@ -24,7 +24,7 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.xdai_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down Expand Up @@ -999,7 +999,6 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
if (runTest) {
await customRetryAsync(async function () {
let TOKEN_LIST;
let rates;
let requestPayload;

try {
Expand All @@ -1010,15 +1009,22 @@ describe('The PrimeSDK, when get the NFT List, Token List and Exchange Rates det
chainId: Number(data.invalid_xdai_chainid),
};

rates = await xdaiDataService.fetchExchangeRates(requestPayload);
await xdaiDataService.fetchExchangeRates(requestPayload);

} catch (e) {
console.error(e);
const eString = e.toString();
addContext(test, eString);
assert.fail(
'The respective validate is displayed with invalid ChainID while fetching the exchange rates.',
);
let errorMessage = e.message;
if (errorMessage.includes('Cannot set properties of undefined')) {
console.log(
'The correct validation is displayed invalid ChainID while fetching the exchange rates.',
);
} else {
console.error(e);
const eString = e.toString();
addContext(test, eString);
assert.fail(
'The respective validate is not displayed invalid ChainID while fetching the exchange rates.',
);
}
}
}, data.retry); // Retry this async test up to 5 times
} else {
Expand Down
4 changes: 2 additions & 2 deletions test/specs/mainnet/paymaster/arbitrum.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from 'dotenv';
dotenv.config(); // init dotenv
import { PrimeSdk, DataUtils, graphqlEndpoints, EtherspotBundler } from '@etherspot/prime-sdk';
import { PrimeSdk, DataUtils, EtherspotBundler } from '@etherspot/prime-sdk';
import { ethers, utils } from 'ethers';
import { assert } from 'chai';
import { ERC20_ABI } from '@etherspot/prime-sdk/dist/sdk/helpers/abi/ERC20_ABI.js';
Expand All @@ -25,7 +25,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with a
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.arbitrum_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.arbitrum_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down
4 changes: 2 additions & 2 deletions test/specs/mainnet/paymaster/matic.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from 'dotenv';
dotenv.config(); // init dotenv
import { PrimeSdk, DataUtils, graphqlEndpoints, EtherspotBundler } from '@etherspot/prime-sdk';
import { PrimeSdk, DataUtils, EtherspotBundler } from '@etherspot/prime-sdk';
import { ethers, utils } from 'ethers';
import { assert } from 'chai';
import { ERC20_ABI } from '@etherspot/prime-sdk/dist/sdk/helpers/abi/ERC20_ABI.js';
Expand All @@ -25,7 +25,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with m
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.matic_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.matic_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down
4 changes: 2 additions & 2 deletions test/specs/mainnet/paymaster/optimism.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from 'dotenv';
dotenv.config(); // init dotenv
import { PrimeSdk, DataUtils, graphqlEndpoints, EtherspotBundler } from '@etherspot/prime-sdk';
import { PrimeSdk, DataUtils, EtherspotBundler } from '@etherspot/prime-sdk';
import { ethers, utils } from 'ethers';
import { assert } from 'chai';
import { ERC20_ABI } from '@etherspot/prime-sdk/dist/sdk/helpers/abi/ERC20_ABI.js';
Expand All @@ -25,7 +25,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with o
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.optimism_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.optimism_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down
4 changes: 2 additions & 2 deletions test/specs/mainnet/paymaster/xdai.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as dotenv from 'dotenv';
dotenv.config(); // init dotenv
import { PrimeSdk, DataUtils, graphqlEndpoints, EtherspotBundler } from '@etherspot/prime-sdk';
import { PrimeSdk, DataUtils, EtherspotBundler } from '@etherspot/prime-sdk';
import { ethers, utils } from 'ethers';
import { assert } from 'chai';
import { ERC20_ABI } from '@etherspot/prime-sdk/dist/sdk/helpers/abi/ERC20_ABI.js';
Expand All @@ -26,7 +26,7 @@ describe('The PrimeSDK, when transaction with arka and pimlico paymasters with x
{ privateKey: process.env.PRIVATE_KEY },
{
chainId: Number(data.xdai_chainid),
projectKey: process.env.PROJECT_KEY, bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY)
bundlerProvider: new EtherspotBundler(Number(data.xdai_chainid), process.env.BUNDLER_API_KEY)
},
);

Expand Down
Loading

0 comments on commit 0809dc8

Please sign in to comment.