Skip to content

Commit

Permalink
feat: due to issues during webpack bundling, so removing the Core Log…
Browse files Browse the repository at this point in the history
…icDefinitionDecorator
  • Loading branch information
chouandy committed Dec 18, 2023
1 parent f1d78d2 commit 2185e54
Show file tree
Hide file tree
Showing 43 changed files with 89 additions and 41 deletions.
5 changes: 5 additions & 0 deletions .changeset/good-snails-beg.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@protocolink/logics': patch
---

Due to issues during webpack bundling, so removing the Core LogicDefinitionDecorator
3 changes: 2 additions & 1 deletion src/logics/aave-v2/logic.borrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export type BorrowLogicFields = core.TokenOutFields<{ interestRateMode: Interest

export type BorrowLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class BorrowLogic extends core.Logic implements core.LogicTokenListInterface, core.LogicBuilderInterface {
static id = 'borrow';
static protocolId = 'aave-v2';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/aave-v2/logic.deposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export type DepositLogicFields = core.TokenToTokenExactInFields<{ referralCode?:

export type DepositLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class DepositLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'deposit';
static protocolId = 'aave-v2';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/aave-v2/logic.flash-loan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export type FlashLoanLogicQuotation = core.FlashLoanQuotation;

export type FlashLoanLogicFields = core.FlashLoanFields<{ referralCode?: number }>;

@core.LogicDefinitionDecorator()
export class FlashLoanLogic extends core.Logic implements core.LogicTokenListInterface, core.LogicBuilderInterface {
static id = 'flash-loan';
static protocolId = 'aave-v2';
static readonly supportedChainIds = supportedChainIds;

get callbackAddress() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/aave-v2/logic.repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ export type RepayLogicParams = core.RepayParams<{ interestRateMode: InterestRate

export type RepayLogicFields = core.RepayFields<{ interestRateMode: InterestRateMode }>;

@core.LogicDefinitionDecorator()
export class RepayLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'repay';
static protocolId = 'aave-v2';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/aave-v2/logic.withdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export type WithdrawLogicFields = core.TokenToTokenExactInFields;

export type WithdrawLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class WithdrawLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'withdraw';
static protocolId = 'aave-v2';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/aave-v3/logic.borrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export type BorrowLogicFields = core.TokenOutFields<{ interestRateMode: Interest

export type BorrowLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class BorrowLogic extends core.Logic implements core.LogicTokenListInterface, core.LogicBuilderInterface {
static id = 'borrow';
static protocolId = 'aave-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/aave-v3/logic.flash-loan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ export type FlashLoanLogicQuotation = core.FlashLoanQuotation;

export type FlashLoanLogicFields = core.FlashLoanFields<{ referralCode?: number }>;

@core.LogicDefinitionDecorator()
export class FlashLoanLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'flash-loan';
static protocolId = 'aave-v3';
static readonly supportedChainIds = supportedChainIds;

get callbackAddress() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/aave-v3/logic.repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ export type RepayLogicParams = core.RepayParams<{ interestRateMode: InterestRate

export type RepayLogicFields = core.RepayFields<{ interestRateMode: InterestRateMode }>;

@core.LogicDefinitionDecorator()
export class RepayLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'repay';
static protocolId = 'aave-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/aave-v3/logic.supply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export type SupplyLogicFields = core.TokenToTokenExactInFields<{ referralCode?:

export type SupplyLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class SupplyLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'supply';
static protocolId = 'aave-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/aave-v3/logic.withdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export type WithdrawLogicFields = core.TokenToTokenExactInFields;

export type WithdrawLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class WithdrawLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'withdraw';
static protocolId = 'aave-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/balancer-v2/logic.flash-loan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export type FlashLoanLogicQuotation = core.FlashLoanQuotation;

export type FlashLoanLogicFields = core.FlashLoanFields;

@core.LogicDefinitionDecorator()
export class FlashLoanLogic extends core.Logic implements core.LogicTokenListInterface, core.LogicBuilderInterface {
static id = 'flash-loan';
static protocolId = 'balancer-v2';
static readonly supportedChainIds = supportedChainIds;

get callbackAddress() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v2/logic.claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,12 @@ export type ClaimLogicParams = core.ClaimParams;

export type ClaimLogicFields = core.ClaimFields;

@core.LogicDefinitionDecorator()
export class ClaimLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'claim';
static protocolId = 'compound-v2';
static readonly supportedChainIds = supportedChainIds;

getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v2/logic.repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ export type RepayLogicParams = core.RepayParams;

export type RepayLogicFields = core.RepayFields;

@core.LogicDefinitionDecorator()
export class RepayLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'repay';
static protocolId = 'compound-v2';
static readonly supportedChainIds = supportedChainIds;

getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v2/logic.supply.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ export type SupplyLogicParams = core.TokenToTokenExactInParams;

export type SupplyLogicFields = core.TokenToTokenExactInFields;

@core.LogicDefinitionDecorator()
export class SupplyLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'supply';
static protocolId = 'compound-v2';
static readonly supportedChainIds = supportedChainIds;

getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v2/logic.withdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ export type WithdrawLogicParams = core.TokenToTokenExactInParams;

export type WithdrawLogicFields = core.TokenToTokenExactInFields;

@core.LogicDefinitionDecorator()
export class WithdrawLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'withdraw';
static protocolId = 'compound-v2';
static readonly supportedChainIds = supportedChainIds;

getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v3/logic.borrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ export type BorrowLogicFields = core.TokenOutFields<{ marketId: string }>;

export type BorrowLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class BorrowLogic extends core.Logic implements core.LogicTokenListInterface, core.LogicBuilderInterface {
static id = 'borrow';
static protocolId = 'compound-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v3/logic.claim.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export type ClaimLogicFields = core.ClaimFields<{ marketId: string }>;

export type ClaimLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class ClaimLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'claim';
static protocolId = 'compound-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v3/logic.repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export type RepayLogicParams = core.RepayParams<{ marketId: string }>;

export type RepayLogicFields = core.RepayFields<{ marketId: string }>;

@core.LogicDefinitionDecorator()
export class RepayLogic extends core.Logic implements core.LogicTokenListInterface, core.LogicBuilderInterface {
static id = 'repay';
static protocolId = 'compound-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v3/logic.supply-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ export type SupplyBaseLogicParams = core.TokenToTokenExactInParams<{ marketId: s

export type SupplyBaseLogicFields = core.TokenToTokenExactInFields<{ marketId: string }>;

@core.LogicDefinitionDecorator()
export class SupplyBaseLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'supply-base';
static protocolId = 'compound-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v3/logic.supply-collateral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ export type SupplyCollateralLogicFields = core.TokenInFields<{ marketId: string

export type SupplyCollateralLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class SupplyCollateralLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicBuilderInterface
{
static id = 'supply-collateral';
static protocolId = 'compound-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v3/logic.withdraw-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export type WithdrawBaseLogicFields = core.TokenToTokenExactInFields<{ marketId:

export type WithdrawBaseLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class WithdrawBaseLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'withdraw-base';
static protocolId = 'compound-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/compound-v3/logic.withdraw-collateral.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ export type WithdrawCollateralLogicFields = core.TokenOutFields<{ marketId: stri

export type WithdrawCollateralLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class WithdrawCollateralLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicBuilderInterface
{
static id = 'withdraw-collateral';
static protocolId = 'compound-v3';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/openocean-v2/logic.swap-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,12 @@ export type SwapTokenLogicFields = core.TokenToTokenExactInFields<{

export type SwapTokenLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class SwapTokenLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'swap-token';
static protocolId = 'openocean-v2';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/paraswap-v5/logic.swap-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ export type SwapTokenLogicFields = core.TokenToTokenExactInFields<

export type SwapTokenLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class SwapTokenLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'swap-token';
static protocolId = 'paraswap-v5';
static readonly supportedChainIds = supportedChainIds;

get sdk() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/permit2/logic.pull-token.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@ export type PullTokenLogicFields = core.TokenInFields;

export type PullTokenLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class PullTokenLogic extends core.Logic implements core.LogicBuilderInterface {
static id = 'pull-token';
static protocolId = 'permit2';
static readonly supportedChainIds = supportedChainIds;

async getTokenList(): Promise<PullTokenLogicTokenList> {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/radiant-v2/logic.borrow.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ export type BorrowLogicFields = core.TokenOutFields<{ interestRateMode: Interest

export type BorrowLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class BorrowLogic extends core.Logic implements core.LogicTokenListInterface, core.LogicBuilderInterface {
static id = 'borrow';
static protocolId = 'radiant-v2';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/radiant-v2/logic.deposit.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export type DepositLogicFields = core.TokenToTokenExactInFields<{ referralCode?:

export type DepositLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class DepositLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'deposit';
static protocolId = 'radiant-v2';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/radiant-v2/logic.flash-loan.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ export type FlashLoanLogicQuotation = core.FlashLoanQuotation;

export type FlashLoanLogicFields = core.FlashLoanFields<{ referralCode?: number }>;

@core.LogicDefinitionDecorator()
export class FlashLoanLogic extends core.Logic implements core.LogicTokenListInterface, core.LogicBuilderInterface {
static id = 'flash-loan';
static protocolId = 'radiant-v2';
static readonly supportedChainIds = supportedChainIds;

get callbackAddress() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/radiant-v2/logic.repay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,12 @@ export type RepayLogicParams = core.RepayParams<{ interestRateMode: InterestRate

export type RepayLogicFields = core.RepayFields<{ interestRateMode: InterestRateMode }>;

@core.LogicDefinitionDecorator()
export class RepayLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'repay';
static protocolId = 'radiant-v2';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
3 changes: 2 additions & 1 deletion src/logics/radiant-v2/logic.withdraw.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,12 @@ export type WithdrawLogicFields = core.TokenToTokenExactInFields;

export type WithdrawLogicOptions = Pick<core.GlobalOptions, 'account'>;

@core.LogicDefinitionDecorator()
export class WithdrawLogic
extends core.Logic
implements core.LogicTokenListInterface, core.LogicOracleInterface, core.LogicBuilderInterface
{
static id = 'withdraw';
static protocolId = 'radiant-v2';
static readonly supportedChainIds = supportedChainIds;

async getTokenList() {
Expand Down
Loading

0 comments on commit 2185e54

Please sign in to comment.