Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

defender-admin-client

Package Overview
Dependencies
Maintainers
10
Versions
66
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

defender-admin-client - npm Package Compare versions

Comparing version 1.31.0-rc.2 to 1.31.0-rc.3

6

lib/api.d.ts

@@ -38,3 +38,7 @@ import { BaseApiClient } from 'defender-base-client';

createProposal(proposal: CreateProposalRequest): Promise<ProposalResponseWithUrl>;
listProposals(): Promise<ProposalResponseWithUrl[]>;
listProposals(opts?: {
includeArchived?: boolean;
}): Promise<ProposalResponseWithUrl[]>;
archiveProposal(contractId: string, proposalId: string): Promise<ProposalResponseWithUrl>;
unarchiveProposal(contractId: string, proposalId: string): Promise<ProposalResponseWithUrl>;
proposeUpgrade(params: UpgradeParams, contract: CreateProposalRequest['contract']): Promise<ProposalResponseWithUrl>;

@@ -41,0 +45,0 @@ proposePause(params: PauseParams, contract: CreateProposalRequest['contract']): Promise<ProposalResponseWithUrl>;

@@ -38,8 +38,24 @@ "use strict";

}
async listProposals() {
async listProposals(opts = {}) {
return this.apiCall(async (api) => {
const response = (await api.get('/proposals'));
const response = (await api.get('/proposals', { params: opts }));
return response.map((proposal) => ({ ...proposal, url: utils_1.getProposalUrl(proposal) }));
});
}
async archiveProposal(contractId, proposalId) {
return this.apiCall(async (api) => {
const response = (await api.put(`/contracts/${contractId}/proposals/${proposalId}/archived`, {
archived: true,
}));
return { ...response, url: utils_1.getProposalUrl(response) };
});
}
async unarchiveProposal(contractId, proposalId) {
return this.apiCall(async (api) => {
const response = (await api.put(`/contracts/${contractId}/proposals/${proposalId}/archived`, {
archived: false,
}));
return { ...response, url: utils_1.getProposalUrl(response) };
});
}
async proposeUpgrade(params, contract) {

@@ -46,0 +62,0 @@ var _a, _b;

@@ -7,3 +7,4 @@ import { ExternalApiCreateProposalRequest } from './proposal';

isActive: boolean;
isArchived: boolean;
}
//# sourceMappingURL=response.d.ts.map

4

package.json
{
"name": "defender-admin-client",
"version": "1.31.0-rc.2",
"version": "1.31.0-rc.3",
"description": "",

@@ -29,3 +29,3 @@ "main": "./lib/index.js",

},
"gitHead": "e244687a0b14906e390075ac62e670226b837405"
"gitHead": "05e49c07cfdec351d68150ad02196a5cdc7158ea"
}

@@ -113,4 +113,13 @@ # Defender Admin Client

You can filter your active proposals by `isActive` property present on each proposal in the list response.
You can filter your active proposals by `isActive` property present on each proposal in the list response. By default, only unarchived proposals are returned, but you can override this by adding an `includeArchived: true` option in the call.
### Archiving proposals
You can archive or unarchive a proposal given its contract and proposal ids:
```js
await client.archiveProposal(contractId, proposalId);
await client.unarchiveProposal(contractId, proposalId);
```
## Adding Contracts

@@ -117,0 +126,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc