Skip to content

Commit

Permalink
Tractor types
Browse files Browse the repository at this point in the history
  • Loading branch information
funderbrker committed Mar 1, 2024
1 parent cc0580c commit af51388
Showing 1 changed file with 26 additions and 18 deletions.
44 changes: 26 additions & 18 deletions projects/sdk/src/lib/tractor/types.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,34 @@
import { ethers } from "ethers";

export type Bytes = string;
export type Bytes32 = string;
export type uint80 = string;
export type uint80 = number;

export type Blueprint = {
publisher: string;
data: Bytes;
operatorPasteInstrs: Bytes32[];
maxNonce: number;
startTime: number;
endTime: number;
}

publisher: string;
data: ethers.Bytes;
operatorPasteInstrs?: ethers.Bytes;
maxNonce: ethers.BigNumber;
startTime: ethers.BigNumber;
endTime: ethers.BigNumber;
};

export type Requisition = {
blueprint: Blueprint;
blueprintHash: Bytes32;
signature: Bytes;
}
blueprint: Blueprint;
blueprintHash: ethers.Bytes;
signature: ethers.Bytes;
};

export type Draft = {
advFarmCalls: AdvancedFarmCall[];
operatorPasteInstrs: OperatorPasteInstr[];
};

export type AdvancedFarmCall = {
callData: ethers.Bytes;
clipboard: ethers.Bytes;
};

function toBytes32(data: number) {
return ethers.utils.hexlify(ethers.utils.zeroPad(data.toString(), 32));
}
export type OperatorPasteInstr = {
copyByteIndex: uint80;
pasteCallIndex: uint80;
pasteByteIndex: uint80;
};

0 comments on commit af51388

Please sign in to comment.