Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
"dist"
],
"dependencies": {
"@dappio-wonderland/gateway-idls": "^0.2.6",
"@dappio-wonderland/navigator": "^0.2.11",
"@dappio-wonderland/gateway-idls": "^0.2.7-test.3",
"@dappio-wonderland/navigator": "^0.2.14-test.13",
"@jup-ag/core": "1.0.0-beta.26",
"@project-serum/anchor": "^0.24.2",
"@project-serum/borsh": "^0.2.5",
Expand Down Expand Up @@ -45,6 +45,7 @@
"testAdapterNftFinance": "ANCHOR_WALLET=~/.config/solana/gateway.json ts-mocha -p ./tsconfig.json -t 1000000 tests/testAdapterNftFinance.ts",
"testAdapterFrancium": "ANCHOR_WALLET=~/.config/solana/gateway.json ts-mocha -p ./tsconfig.json -t 1000000 tests/testAdapterFrancium.ts",
"testAdapterKatana": "ANCHOR_WALLET=~/.config/solana/gateway.json ts-mocha -p ./tsconfig.json -t 1000000 tests/testAdapterKatana.ts",
"testAdapterFriktion": "ANCHOR_WALLET=~/.config/solana/gateway.json ts-mocha -p ./tsconfig.json -t 1000000 tests/testAdapterFriktion.ts"
"testAdapterFriktion": "ANCHOR_WALLET=~/.config/solana/gateway.json ts-mocha -p ./tsconfig.json -t 1000000 tests/testAdapterFriktion.ts",
"testAdapterGenopets": "ANCHOR_WALLET=~/.config/solana/gateway.json ts-mocha -p ./tsconfig.json -t 1000000 tests/testAdapterGenopets.ts"
}
}
46 changes: 46 additions & 0 deletions src/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import {
nftFinance,
katana,
friktion,
genopets,
} from "@dappio-wonderland/navigator";
import {
ActionType,
Expand Down Expand Up @@ -63,6 +64,7 @@ import { ProtocolFrancium } from "./protocols/francium";
import { ProtocolKatana } from "./protocols/katana";
import { ProtocolTulip } from "./protocols/tulip";
import { ProtocolFriktion } from "./protocols/friktion";
import { ProtocolGenopets } from "./protocols/genopets";

export class GatewayBuilder {
public params: GatewayParams;
Expand Down Expand Up @@ -109,6 +111,8 @@ export class GatewayBuilder {
// Extra Metadata
poolDirection: PoolDirection.Obverse,
swapMinOutAmount: new anchor.BN(0),
lockDuration: 0,
harvestType: 0,
};

this._metadata = {
Expand Down Expand Up @@ -437,6 +441,20 @@ export class GatewayBuilder {
this.params
);

break;
case SupportedProtocols.Genopets:
this._metadata.farm = await genopets.infos.getFarm(
this._provider.connection,
stakeParams.farmId
);

protocol = new ProtocolGenopets(
this._provider.connection,
this._program,
await this.getGatewayStateKey(),
this.params
);

break;
default:
throw new Error("Unsupported Protocol");
Expand Down Expand Up @@ -539,6 +557,20 @@ export class GatewayBuilder {
this.params
);

break;
case SupportedProtocols.Genopets:
this._metadata.farm = await genopets.infos.getFarm(
this._provider.connection,
unstakeParams.farmId
);

protocol = new ProtocolGenopets(
this._provider.connection,
this._program,
await this.getGatewayStateKey(),
this.params
);

break;
default:
throw new Error("Unsupported Protocol");
Expand Down Expand Up @@ -627,6 +659,20 @@ export class GatewayBuilder {
await this.getGatewayStateKey(),
this.params
);
break;
case SupportedProtocols.Genopets:
this._metadata.farm = await genopets.infos.getFarm(
this._provider.connection,
harvestParams.farmId
);

protocol = new ProtocolGenopets(
this._provider.connection,
this._program,
await this.getGatewayStateKey(),
this.params
);

break;
default:
throw new Error("Unsupported Protocol");
Expand Down
6 changes: 5 additions & 1 deletion src/ids.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { PublicKey } from "@solana/web3.js";
// Program IDs

export const GATEWAY_PROGRAM_ID = new PublicKey(
"GATEp6AEtXtwHABNWHKH9qeh3uJDZtZJ7YBNYzHsX3FS"
"9dwUanLrLHoaUEw7YYZG4VkqWWvMpxjmNYmTB71Gzwnu"
);

export const RAYDIUM_ADAPTER_PROGRAM_ID = new PublicKey(
Expand All @@ -26,6 +26,10 @@ export const NFT_FINANCE_ADAPTER_PROGRAM_ID = new PublicKey(
"ADPTyBr92sBCE1hdYBRvXbMpF4hKs17xyDjFPxopcsrh"
);

export const GENOPETS_ADAPTER_PROGRAM_ID = new PublicKey(
"ADPTR3wPKDCZ8HNBBpY3GGXB8hu6DZDqyPJMimyHjKNk"
);

export const SERUM_PROGRAM_ID = new PublicKey(
"9xQeWvG816bUx9EPjHmaT23yvVM2ZWbrrpZb9PusVFin"
);
Expand Down
Loading