Skip to content

Commit

Permalink
fix the relay type instead of admin type
Browse files Browse the repository at this point in the history
  • Loading branch information
tirumerla committed May 23, 2024
1 parent d59da13 commit 31453b3
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 26 deletions.
6 changes: 5 additions & 1 deletion examples/list-networks/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,11 @@ require('dotenv').config();
const { SentinelClient } = require('@openzeppelin/defender-sentinel-client');

async function main() {
const creds = { apiKey: process.env.ADMIN_API_KEY, apiSecret: process.env.ADMIN_API_SECRET };
const creds = {
apiKey: process.env.ADMIN_API_KEY,
apiSecret: process.env.ADMIN_API_SECRET,
useCredentialsCaching: true,
};
const client = new SentinelClient(creds);
const networks = await client.listNetworks({ networkType: 'production' });
console.log(networks);
Expand Down
2 changes: 1 addition & 1 deletion examples/list-networks/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "node index.js"
},
"dependencies": {
"@openzeppelin/defender-sentinel-client": "1.47.0",
"@openzeppelin/defender-sentinel-client": "1.54.5",
"dotenv": "^8.2.0"
}
}
2 changes: 1 addition & 1 deletion examples/relayer-actions/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require('dotenv').config();

const { Relayer, VERSION } = require('@openzeppelin/defender-relay-client');

const params = { apiKey: process.env.API_KEY, apiSecret: process.env.API_SECRET };
const params = { apiKey: process.env.API_KEY, apiSecret: process.env.API_SECRET, useCredentialsCaching: true };
const relayer = new Relayer(params);

async function get() {
Expand Down
2 changes: 1 addition & 1 deletion packages/base/src/api/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export abstract class BaseApiClient {
const accessToken = this.authConfig.useCredentialsCaching
? await this.getAccessTokenV2()
: await this.getAccessToken();
this.api = createAuthenticatedApi(this.apiKey, accessToken, this.getApiUrl(v, 'admin'), this.httpsAgent);
this.api = createAuthenticatedApi(this.apiKey, accessToken, this.getApiUrl(v, 'relay'), this.httpsAgent);
this.version = v;
}
return this.api;
Expand Down
22 changes: 0 additions & 22 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1840,17 +1840,6 @@
lodash "^4.17.19"
node-fetch "^2.6.0"

"@openzeppelin/[email protected]":
version "1.47.0"
resolved "https://registry.yarnpkg.com/@openzeppelin/defender-base-client/-/defender-base-client-1.47.0.tgz#f9d47f4cf0a75b4e4e5139dec780a3f26f5e2019"
integrity sha512-y9dDm+gX0MHHEn17W7f7oO3X083JAVMk3YcuXHavSE7kjiCLoFOaZ23joYqoHeaccL10nGt7KOOzZ0sh9iJHTQ==
dependencies:
amazon-cognito-identity-js "^6.0.1"
async-retry "^1.3.3"
axios "^1.4.0"
lodash "^4.17.19"
node-fetch "^2.6.0"

"@openzeppelin/[email protected]":
version "1.48.0"
resolved "https://registry.yarnpkg.com/@openzeppelin/defender-base-client/-/defender-base-client-1.48.0.tgz#9103b1b036db0451b52d7899a277bf24db4c4b06"
Expand Down Expand Up @@ -1895,17 +1884,6 @@
lodash "^4.17.19"
node-fetch "^2.6.0"

"@openzeppelin/[email protected]":
version "1.47.0"
resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.47.0.tgz#eaed39153729c66aa6bb69277cbdeaafc4003dcd"
integrity sha512-PCk25UYKosQWJTKJBGDTRC/MrLuz0GKFn4VEXa12RSUpdVdMoEcGwC5eFkbw8UkYnG1sh7xT3T1V2MuVsh4ULg==
dependencies:
"@ethersproject/abi" "^5.6.3"
"@openzeppelin/defender-base-client" "1.47.0"
axios "^1.4.0"
lodash "^4.17.19"
node-fetch "^2.6.0"

"@openzeppelin/[email protected]":
version "1.48.0"
resolved "https://registry.yarnpkg.com/@openzeppelin/defender-sentinel-client/-/defender-sentinel-client-1.48.0.tgz#293e91d80314f4ba18ad811daea72c1abbc5860a"
Expand Down

0 comments on commit 31453b3

Please sign in to comment.