Skip to content
Merged
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
103 changes: 0 additions & 103 deletions sdk/js/src/abi.ts

This file was deleted.

24 changes: 1 addition & 23 deletions sdk/js/src/const.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,5 @@
import { PublicKey } from "@solana/web3.js";
import { OpportunityAdapterConfig, SvmConstantsConfig } from "./types";

export const OPPORTUNITY_ADAPTER_CONFIGS: Record<
string,
OpportunityAdapterConfig
> = {
op_sepolia: {
chain_id: 11155420,
opportunity_adapter_factory: "0xfA119693864b2F185742A409c66f04865c787754",
opportunity_adapter_init_bytecode_hash:
"0x3d71516d94b96a8fdca4e3a5825a6b41c9268a8e94610367e69a8462cc543533",
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
weth: "0x74A4A85C611679B73F402B36c0F84A7D2CcdFDa3",
},
mode: {
chain_id: 34443,
opportunity_adapter_factory: "0x59F78DE21a0b05d96Ae00c547BA951a3B905602f",
opportunity_adapter_init_bytecode_hash:
"0xd53b8e32ab2ecba07c3e3a17c3c5e492c62e2f7051b89e5154f52e6bfeb0e38f",
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
weth: "0x4200000000000000000000000000000000000006",
},
};
import { SvmConstantsConfig } from "./types";

export const SVM_CONSTANTS: Record<string, SvmConstantsConfig> = {
"local-solana": {
Expand Down
11 changes: 0 additions & 11 deletions sdk/js/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import {
ExpressRelaySvmConfig,
Opportunity,
OpportunityCreate,
TokenAmount,
SvmChainUpdate,
OpportunityDelete,
ChainType,
Expand Down Expand Up @@ -86,16 +85,6 @@ export function checkAddress(address: string): Address {
throw new ClientError(`Invalid address: ${address}`);
}

export function checkTokenQty(token: {
token: string;
amount: string;
}): TokenAmount {
return {
token: checkAddress(token.token),
amount: BigInt(token.amount),
};
}

export class Client {
public clientOptions: ClientOptions;
public wsOptions: WsOptions;
Expand Down
60 changes: 0 additions & 60 deletions sdk/js/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,9 @@
import { Address, Hex } from "viem";
import type { components } from "./serverTypes";
import { PublicKey, Transaction } from "@solana/web3.js";
import { OrderStateAndAddress } from "@kamino-finance/limo-sdk/dist/utils";
import { VersionedTransaction } from "@solana/web3.js";
import * as anchor from "@coral-xyz/anchor";

/**
* ERC20 token with contract address and amount
*/
export type TokenAmount = {
token: Address;
amount: bigint;
};
/**
* SVM token with contract address and amount
*/
Expand All @@ -20,13 +12,6 @@ export type TokenAmountSvm = {
amount: bigint;
};

/**
* TokenPermissions struct for permit2
*/
export type TokenPermissions = {
token: Address;
amount: bigint;
};
export type BidId = string;
export type ChainId = string;
/**
Expand All @@ -48,28 +33,6 @@ export type BidParams = {
deadline: bigint;
};

export type OpportunityAdapterConfig = {
/**
* The chain id as a u64
*/
chain_id: number;
/**
* The opportunity factory address
*/
opportunity_adapter_factory: Address;
/**
* The hash of the bytecode used to initialize the opportunity adapter
*/
opportunity_adapter_init_bytecode_hash: Hex;
/**
* The permit2 address
*/
permit2: Address;
/**
* The weth address
*/
weth: Address;
};
export type OpportunitySvmMetadata = {
/**
* The chain id where the opportunity will be executed.
Expand Down Expand Up @@ -137,29 +100,6 @@ export type OpportunitySvm = OpportunitySvmLimo | OpportunitySvmSwap;
export type OpportunityCreate = Omit<OpportunitySvmLimo, "opportunityId">;

export type Opportunity = OpportunitySvm;
/**
* Represents a bid for an opportunity
*/
export type OpportunityBid = {
/**
* Opportunity unique identifier in uuid format
*/
opportunityId: string;
/**
* The permission key required for successful execution of the opportunity.
*/
permissionKey: Hex;
/**
* Executor address
*/
executor: Address;
/**
* Signature of the executor
*/
signature: Hex;

bid: BidParams;
};
/**
* All the parameters necessary to represent an opportunity
*/
Expand Down
Loading
Loading