@reflexer-finance/geb-contract-api
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -108,34 +108,1 @@ "use strict"; | ||
}; | ||
// Contract addresses (kovan) NOT instantiated | ||
// "ETH_FROM": "0xFc5C3A40BC9b8AD5D179036f5489c573C9d91c7f", | ||
// "STARTING_BLOCK_NUMBER": "20439312", | ||
// "PROXY_DEPLOYER": "0xC08F184e72dbdFdE07e47C2c267061FC20D8F6a5", | ||
// "COIN_TYPE": "BOND", | ||
// "GOVERNANCE_TYPE": "MULTISIG", | ||
// "MULTICALL": "0x99C7E7AA093F71a4070FD671b9Ab397EFDABA62b", | ||
// "FAUCET": "0x2B976a555851Eb27596721ca4c3f61c838668673", | ||
// "GEB_MULTISIG": "0x8a293e2437a98a45c0e46953d3a7361c40A513C4", | ||
// "GEB_MULTISIG_PROXY": "0xfBc6bcAd323BB4EaF1dF978A9DbB2323D7D7B938", | ||
// "GEB_DEPLOY": "0xE633E01AEB26B8B15cd2324Aa8489703227AEbbb", | ||
// "GEB_PROT": "0x4ABE1B1c4dF244e233A527B8d976907Fa04F3032", | ||
// "PROTOCOL_TOKEN_AUTHORITY": "0x99b5F7dC99BeFD258Bd7263703E5BFc12ebc87be", | ||
// "PRINTING_PERMISSIONS_REGISTRY": "0x6234299f571DccD082aCfc6637fb0cC0e17F2C15", | ||
// "GEB_PAUSE_AUTHORITY": "0x5B20a2c0CB30824E62a7693f7EB6592F7b599C56", | ||
// "GEB_POLLING_EMITTER": "0x1bE20dFaE34a1c27253140A663AF3458a63e623D", | ||
// "GEB_PAUSE": "0xA4Acde4E2cDbE0409Bb7bd80E8Fd9A0e20B70647", | ||
// "GEB_PAUSE_PROXY": "0xF00A0B342A1CeDB67a2318832a808C93254CE904", | ||
// "GEB_GOV_ACTIONS": "0xb00401Ca958cB5DfF5525e0B154c494eFC6839e1", | ||
// "GEB_ESM": "0x6E06607fD1A960849031398de5d0Fb2425C642F2", | ||
// "GEB_ESM_TOKEN_BURNER": "0x4fF23D682584abF302DfBef47a14d1DCc6D17752", | ||
// "PROXY_ACTIONS_GLOBAL_SETTLEMENT": "0x8f953dd087740F1d1EB163DB7b79ae4004120A9e", | ||
// "FSM_GOV_INTERFACE": "0xde4AAf4443c7C663cCf72e5e67b1431391d3dc9c", | ||
// "PROXY_FACTORY": "0x72EB40c627495386F42F156Cf4C88f1388de3EFD", | ||
// "MEDIANIZER_ETH": "0xb0F96Ae14d2Cb4289D0Cb8d856f277DD7Da6c6e9", | ||
// "ORACLE_SECURITY_MODULE_ETH": "0xb0F96Ae14d2Cb4289D0Cb8d856f277DD7Da6c6e9", | ||
// "PROXY_PAUSE_ACTIONS": "0x7E668de7C5e6539300ec2c83EE1c6b2b34aBBdd7", | ||
// "PROXY_DEPLOYER": "0xC08F184e72dbdFdE07e47C2c267061FC20D8F6a5", | ||
// "UNISWAP_FACTORY": "0x5C69bEe701ef814a2B6a3EDD4B1652CB9cc5aA6f", | ||
// "UNISWAP_ROUTER": "0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D", | ||
// "GEB_DS_COMPARE": "0x70ec1F9D4ce7B903cEFD24419821273A50ABB093", | ||
// "GEB_TX_MANAGER": "0xBf9d7Ee4D97fD6db15B9062a7a835e51ACDFa1e7" | ||
// "PROXY_ACTIONS": '0x7b8a0329a24E57Bd97991E03f83F3628207e314369588B0380E', |
import { AccountingEngine, TaxCollector, LiquidationEngine, OracleRelayer, GlobalSettlement, DebtAuctionHouse, PreSettlementSurplusAuctionHouse, PostSettlementSurplusAuctionHouse, SettlementSurplusAuctioneer, Coin, GebSafeManager, GetSafes, BasicCollateralJoin, CoinJoin, GebProxyRegistry, EnglishCollateralAuctionHouse, FixedDiscountCollateralAuctionHouse, Weth, SafeEngine } from '.'; | ||
import { ChainProviderInterface } from '@reflexer-finance/geb-provider'; | ||
import { GebProviderInterface } from '@reflexer-finance/geb-provider'; | ||
export declare type ContractKey = 'ETH_FROM' | 'STARTING_BLOCK_NUMBER' | 'PROXY_DEPLOYER' | 'COIN_TYPE' | 'GOVERNANCE_TYPE' | 'MULTICALL' | 'FAUCET' | 'GEB_MULTISIG' | 'GEB_MULTISIG_PROXY' | 'GEB_DEPLOY' | 'GEB_PROT' | 'PROTOCOL_TOKEN_AUTHORITY' | 'PRINTING_PERMISSIONS_REGISTRY' | 'GEB_PAUSE_AUTHORITY' | 'GEB_POLLING_EMITTER' | 'GEB_SAFE_ENGINE' | 'GEB_TAX_COLLECTOR' | 'GEB_LIQUIDATION_ENGINE' | 'GEB_ACCOUNTING_ENGINE' | 'GEB_COIN_JOIN' | 'GEB_SETTLEMENT_SURPLUS_AUCTIONEER' | 'GEB_PRE_SETTLEMENT_SURPLUS_AUCTION_HOUSE' | 'GEB_POST_SETTLEMENT_SURPLUS_AUCTION_HOUSE' | 'GEB_DEBT_AUCTION_HOUSE' | 'GEB_PAUSE' | 'GEB_PAUSE_PROXY' | 'GEB_GOV_ACTIONS' | 'GEB_COIN' | 'GEB_ORACLE_RELAYER' | 'GEB_GLOBAL_SETTLEMENT' | 'GEB_ESM' | 'GEB_ESM_TOKEN_BURNER' | 'PROXY_ACTIONS' | 'PROXY_ACTIONS_GLOBAL_SETTLEMENT' | 'SAFE_MANAGER' | 'GET_SAFES' | 'FSM_GOV_INTERFACE' | 'PROXY_FACTORY' | 'PROXY_REGISTRY' | 'ETH' | 'MEDIANIZER_ETH' | 'ORACLE_SECURITY_MODULE_ETH' | 'GEB_JOIN_ETH_A' | 'GEB_COLLATERAL_AUCTION_HOUSE_ETH_A' | 'PROXY_PAUSE_ACTIONS' | 'PROXY_DEPLOYER' | 'UNISWAP_FACTORY' | 'UNISWAP_ROUTER' | 'GEB_DS_COMPARE' | 'GEB_TX_MANAGER'; | ||
@@ -9,3 +9,3 @@ export declare type ContractList = { | ||
export declare class ContractApis { | ||
chainProvider: ChainProviderInterface; | ||
chainProvider: GebProviderInterface; | ||
safeEngine: SafeEngine; | ||
@@ -29,3 +29,3 @@ accountingEngine: AccountingEngine; | ||
weth: Weth; | ||
constructor(network: ContractAddresses, chainProvider: ChainProviderInterface); | ||
constructor(network: ContractAddresses, chainProvider: GebProviderInterface); | ||
} |
@@ -24,6 +24,7 @@ import { AccountingEngine } from './generated/AccountingEngine'; | ||
import { Weth } from './generated/WETH'; | ||
import { GebProxyActions } from './generated/GebProxyActions'; | ||
import { GebProxyActionsGlobalSettlement } from './generated/GebProxyActionsGlobalSettlement'; | ||
import { ContractApis, ContractAddresses, ContractList, ContractKey } from './contract-apis'; | ||
import { KOVAN_ADDRESSES, MAINNET_ADDRESSES } from './addresses'; | ||
import { GebProxyActions, GebProxyActionsGlobalSettlement } from './proxy'; | ||
import { ETH_A } from './const'; | ||
export { KOVAN_ADDRESSES, MAINNET_ADDRESSES, ContractApis, AccountingEngine, BasicCollateralJoin, CoinJoin, CoinSavingsAccount, Coin, DebtAuctionHouse, DsProxy, EnglishCollateralAuctionHouse, EthJoin, FixedDiscountCollateralAuctionHouse, GebProxyRegistry, GebSafeManager, GetSafes, GlobalSettlement, LiquidationEngine, OracleRelayer, PostSettlementSurplusAuctionHouse, PreSettlementSurplusAuctionHouse, SafeEngine, SettlementSurplusAuctioneer, StabilityFeeTreasury, TaxCollector, Weth, GebProxyActions, GebProxyActionsGlobalSettlement, ContractAddresses, ContractList, ContractKey, ETH_A, }; |
@@ -50,2 +50,6 @@ "use strict"; | ||
Object.defineProperty(exports, "Weth", { enumerable: true, get: function () { return WETH_1.Weth; } }); | ||
var GebProxyActions_1 = require("./generated/GebProxyActions"); | ||
Object.defineProperty(exports, "GebProxyActions", { enumerable: true, get: function () { return GebProxyActions_1.GebProxyActions; } }); | ||
var GebProxyActionsGlobalSettlement_1 = require("./generated/GebProxyActionsGlobalSettlement"); | ||
Object.defineProperty(exports, "GebProxyActionsGlobalSettlement", { enumerable: true, get: function () { return GebProxyActionsGlobalSettlement_1.GebProxyActionsGlobalSettlement; } }); | ||
var contract_apis_1 = require("./contract-apis"); | ||
@@ -56,6 +60,3 @@ Object.defineProperty(exports, "ContractApis", { enumerable: true, get: function () { return contract_apis_1.ContractApis; } }); | ||
Object.defineProperty(exports, "MAINNET_ADDRESSES", { enumerable: true, get: function () { return addresses_1.MAINNET_ADDRESSES; } }); | ||
var proxy_1 = require("./proxy"); | ||
Object.defineProperty(exports, "GebProxyActions", { enumerable: true, get: function () { return proxy_1.GebProxyActions; } }); | ||
Object.defineProperty(exports, "GebProxyActionsGlobalSettlement", { enumerable: true, get: function () { return proxy_1.GebProxyActionsGlobalSettlement; } }); | ||
var const_1 = require("./const"); | ||
Object.defineProperty(exports, "ETH_A", { enumerable: true, get: function () { return const_1.ETH_A; } }); |
188
lib/proxy.js
@@ -1,117 +0,73 @@ | ||
"use strict"; | ||
var __extends = (this && this.__extends) || (function () { | ||
var extendStatics = function (d, b) { | ||
extendStatics = Object.setPrototypeOf || | ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || | ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; | ||
return extendStatics(d, b); | ||
}; | ||
return function (d, b) { | ||
extendStatics(d, b); | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
})(); | ||
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } | ||
return new (P || (P = Promise))(function (resolve, reject) { | ||
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } | ||
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } | ||
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } | ||
step((generator = generator.apply(thisArg, _arguments || [])).next()); | ||
}); | ||
}; | ||
var __generator = (this && this.__generator) || function (thisArg, body) { | ||
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g; | ||
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g; | ||
function verb(n) { return function (v) { return step([n, v]); }; } | ||
function step(op) { | ||
if (f) throw new TypeError("Generator is already executing."); | ||
while (_) try { | ||
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t; | ||
if (y = 0, t) op = [op[0] & 2, t.value]; | ||
switch (op[0]) { | ||
case 0: case 1: t = op; break; | ||
case 4: _.label++; return { value: op[1], done: false }; | ||
case 5: _.label++; y = op[1]; op = [0]; continue; | ||
case 7: op = _.ops.pop(); _.trys.pop(); continue; | ||
default: | ||
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; } | ||
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; } | ||
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; } | ||
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; } | ||
if (t[2]) _.ops.pop(); | ||
_.trys.pop(); continue; | ||
} | ||
op = body.call(thisArg, _); | ||
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; } | ||
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true }; | ||
} | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.GebProxyActionsGlobalSettlement = exports.GebProxyActions = void 0; | ||
var _1 = require("."); | ||
var GebProxyActions_1 = require("./generated/GebProxyActions"); | ||
var GebProxyActionsGlobalSettlement_1 = require("./generated/GebProxyActionsGlobalSettlement"); | ||
var utils_1 = require("./utils"); | ||
var bignumber_1 = require("@ethersproject/bignumber"); | ||
// Helper class that abstract away the proxy | ||
var GebProxyActions = /** @class */ (function (_super) { | ||
__extends(GebProxyActions, _super); | ||
function GebProxyActions(proxyAddress, network, chainProvider) { | ||
var _this = _super.call(this, utils_1.getAddressList(network).PROXY_ACTIONS, chainProvider) || this; | ||
_this.proxyAddress = proxyAddress; | ||
_this.proxy = new _1.DsProxy(proxyAddress, _this.chainProvider); | ||
_this.proxyActionAddress = utils_1.getAddressList(network).PROXY_ACTIONS; | ||
return _this; | ||
} | ||
// Override ETH send to use proxy | ||
GebProxyActions.prototype.ethSend = function (abiFragment, params, ethValue) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.chainProvider.ethSend(this.proxyActionAddress, abiFragment, params, ethValue)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
if (!ethValue) { | ||
ethValue = bignumber_1.BigNumber.from('0'); | ||
} | ||
return [2 /*return*/, this.proxy.execute(ethValue, this.proxyActionAddress, data)]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return GebProxyActions; | ||
}(GebProxyActions_1.GebProxyActions)); | ||
exports.GebProxyActions = GebProxyActions; | ||
var GebProxyActionsGlobalSettlement = /** @class */ (function (_super) { | ||
__extends(GebProxyActionsGlobalSettlement, _super); | ||
function GebProxyActionsGlobalSettlement(proxyAddress, network, chainProvider) { | ||
var _this = _super.call(this, utils_1.getAddressList(network).PROXY_ACTIONS, chainProvider) || this; | ||
_this.proxyAddress = proxyAddress; | ||
_this.proxy = new _1.DsProxy(proxyAddress, _this.chainProvider); | ||
_this.proxyActionAddress = utils_1.getAddressList(network).PROXY_ACTIONS; | ||
return _this; | ||
} | ||
// Override ETH send to use proxy | ||
GebProxyActionsGlobalSettlement.prototype.ethSend = function (abiFragment, params, ethValue) { | ||
return __awaiter(this, void 0, void 0, function () { | ||
var data; | ||
return __generator(this, function (_a) { | ||
switch (_a.label) { | ||
case 0: return [4 /*yield*/, this.chainProvider.ethSend(this.proxyActionAddress, abiFragment, params, ethValue)]; | ||
case 1: | ||
data = (_a.sent()).data; | ||
return [2 /*return*/, this.proxy.execute(ethValue, this.proxyActionAddress, data)]; | ||
} | ||
}); | ||
}); | ||
}; | ||
return GebProxyActionsGlobalSettlement; | ||
}(GebProxyActionsGlobalSettlement_1.GebProxyActionsGlobalSettlement)); | ||
exports.GebProxyActionsGlobalSettlement = GebProxyActionsGlobalSettlement; | ||
// declare type ret = <T>(...args: T[]) => Promise<TransactionRequest> | ||
// const a: <T extends ret>(calls: T[]) => Promise<TransactionRequest[]> = { | ||
// return [{}] | ||
// import { DsProxy, ContractAddresses } from '.' | ||
// import { | ||
// GebProviderInterface, | ||
// AbiDefinition, | ||
// Inputs, | ||
// TransactionRequest, | ||
// } from '@reflexer-finance/geb-provider' | ||
// import { GebProxyActions as GebProxyActionsGenerated } from './generated/GebProxyActions' | ||
// import { GebProxyActionsGlobalSettlement as GebProxyActionsGlobalSettlementGenerated } from './generated/GebProxyActionsGlobalSettlement' | ||
// import { getAddressList } from './utils' | ||
// import { BigNumber } from '@ethersproject/bignumber' | ||
// // Helper class that abstract away the proxy | ||
// export class GebProxyActions extends GebProxyActionsGenerated { | ||
// public proxy: DsProxy | ||
// private proxyActionAddress: string | ||
// constructor( | ||
// public proxyAddress: string, | ||
// network: ContractAddresses, | ||
// chainProvider: GebProviderInterface | ||
// ) { | ||
// super(getAddressList(network).PROXY_ACTIONS, chainProvider) | ||
// this.proxy = new DsProxy(proxyAddress, this.chainProvider) | ||
// this.proxyActionAddress = getAddressList(network).PROXY_ACTIONS | ||
// } | ||
// // Override ETH send to use proxy | ||
// async ethSend( | ||
// abiFragment: AbiDefinition, | ||
// params: Inputs, | ||
// ethValue?: BigNumber | ||
// ): Promise<TransactionRequest> { | ||
// let { data } = await this.chainProvider.ethSend( | ||
// this.proxyActionAddress, | ||
// abiFragment, | ||
// params, | ||
// ethValue | ||
// ) | ||
// if (!ethValue) { | ||
// ethValue = BigNumber.from('0') | ||
// } | ||
// return this.proxy.execute(ethValue, this.proxyActionAddress, data) | ||
// } | ||
// } | ||
// export class GebProxyActionsGlobalSettlement extends GebProxyActionsGlobalSettlementGenerated { | ||
// public proxy: DsProxy | ||
// private proxyActionAddress: string | ||
// constructor( | ||
// public proxyAddress: string, | ||
// network: ContractAddresses, | ||
// chainProvider: GebProviderInterface | ||
// ) { | ||
// super(getAddressList(network).PROXY_ACTIONS, chainProvider) | ||
// this.proxy = new DsProxy(proxyAddress, this.chainProvider) | ||
// this.proxyActionAddress = getAddressList(network).PROXY_ACTIONS | ||
// } | ||
// // Override ETH send to use proxy | ||
// async ethSend( | ||
// abiFragment: AbiDefinition, | ||
// params: Inputs, | ||
// ethValue?: BigNumber | ||
// ): Promise<TransactionRequest> { | ||
// let { data } = await this.chainProvider.ethSend( | ||
// this.proxyActionAddress, | ||
// abiFragment, | ||
// params, | ||
// ethValue | ||
// ) | ||
// return this.proxy.execute(ethValue, this.proxyActionAddress, data) | ||
// } | ||
// } | ||
// // declare type ret = <T>(...args: T[]) => Promise<TransactionRequest> | ||
// // const a: <T extends ret>(calls: T[]) => Promise<TransactionRequest[]> = { | ||
// // return [{}] | ||
// // } |
{ | ||
"name": "@reflexer-finance/geb-contract-api", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "", | ||
@@ -13,4 +13,3 @@ "main": "./lib/index.js", | ||
"@ethersproject/bignumber": "5.x", | ||
"@ethersproject/bytes": "5.x", | ||
"@reflexer-finance/geb-provider": "^0.0.4" | ||
"@reflexer-finance/geb-provider": "^0.0.5" | ||
}, | ||
@@ -21,3 +20,3 @@ "devDependencies": { | ||
}, | ||
"gitHead": "539871a04c8ff9b83093fc51364006ceef0d8fe3" | ||
"gitHead": "50d87b0bdec03fac369bcfef36ade6b807822674" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
2
358292
6093
+ Added@reflexer-finance/geb-provider@0.0.5(transitive)
- Removed@ethersproject/bytes@5.x
- Removed@reflexer-finance/geb-provider@0.0.4(transitive)