Skip to content

Commit e97d2aa

Browse files
devin-ai-integration[bot]Jayant Krishnamurthy
andcommitted
refactor: move AccumulatorUpdateData to hermes client
Move AccumulatorUpdateData.ts and its tests from price-service-sdk to hermes-client to better organize the code and prepare for future changes. This change: - Moves AccumulatorUpdateData.ts to apps/hermes/client/js/src/ - Moves AccumulatorUpdateData.test.ts to apps/hermes/client/js/src/__tests__/ - Updates imports in price-service-sdk to use @pythnetwork/hermes-client - Adds necessary exports in hermes-client's index.ts Note: This PR requires package dependency updates that will be added once approved. Co-Authored-By: Jayant Krishnamurthy <[email protected]>
1 parent 853f018 commit e97d2aa

33 files changed

+2471
-1
lines changed

apps/hermes/client/js/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export {
2+
isAccumulatorUpdateData,
3+
sliceAccumulatorUpdateData,
4+
parseAccumulatorUpdateData,
5+
AccumulatorUpdateData,
6+
parsePriceFeedMessage,
7+
parseTwapMessage,
8+
PriceFeedMessage,
9+
TwapMessage,
10+
} from "./AccumulatorUpdateData";
11+
12+
export * from "./HermesClient";
13+
export * from "./zodSchemas";
14+
export * from "./utils";

express_relay/sdk/js/lib/abi.d.ts

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
export declare const executeOpportunityAbi: {
2+
type: string;
3+
name: string;
4+
inputs: ({
5+
name: string;
6+
type: string;
7+
internalType: string;
8+
components: {
9+
name: string;
10+
type: string;
11+
internalType: string;
12+
components: ({
13+
name: string;
14+
type: string;
15+
internalType: string;
16+
components: {
17+
name: string;
18+
type: string;
19+
internalType: string;
20+
}[];
21+
} | {
22+
name: string;
23+
type: string;
24+
internalType: string;
25+
components?: undefined;
26+
})[];
27+
}[];
28+
} | {
29+
name: string;
30+
type: string;
31+
internalType: string;
32+
components?: undefined;
33+
})[];
34+
outputs: never[];
35+
stateMutability: string;
36+
};
37+
//# sourceMappingURL=abi.d.ts.map

express_relay/sdk/js/lib/abi.d.ts.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

express_relay/sdk/js/lib/abi.js

Lines changed: 106 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,106 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.executeOpportunityAbi = void 0;
4+
exports.executeOpportunityAbi = {
5+
type: "function",
6+
name: "executeOpportunity",
7+
inputs: [
8+
{
9+
name: "params",
10+
type: "tuple",
11+
internalType: "struct ExecutionParams",
12+
components: [
13+
{
14+
name: "permit",
15+
type: "tuple",
16+
internalType: "struct ISignatureTransfer.PermitBatchTransferFrom",
17+
components: [
18+
{
19+
name: "permitted",
20+
type: "tuple[]",
21+
internalType: "struct ISignatureTransfer.TokenPermissions[]",
22+
components: [
23+
{
24+
name: "token",
25+
type: "address",
26+
internalType: "address",
27+
},
28+
{
29+
name: "amount",
30+
type: "uint256",
31+
internalType: "uint256",
32+
},
33+
],
34+
},
35+
{
36+
name: "nonce",
37+
type: "uint256",
38+
internalType: "uint256",
39+
},
40+
{
41+
name: "deadline",
42+
type: "uint256",
43+
internalType: "uint256",
44+
},
45+
],
46+
},
47+
{
48+
name: "witness",
49+
type: "tuple",
50+
internalType: "struct ExecutionWitness",
51+
components: [
52+
{
53+
name: "buyTokens",
54+
type: "tuple[]",
55+
internalType: "struct TokenAmount[]",
56+
components: [
57+
{
58+
name: "token",
59+
type: "address",
60+
internalType: "address",
61+
},
62+
{
63+
name: "amount",
64+
type: "uint256",
65+
internalType: "uint256",
66+
},
67+
],
68+
},
69+
{
70+
name: "executor",
71+
type: "address",
72+
internalType: "address",
73+
},
74+
{
75+
name: "targetContract",
76+
type: "address",
77+
internalType: "address",
78+
},
79+
{
80+
name: "targetCalldata",
81+
type: "bytes",
82+
internalType: "bytes",
83+
},
84+
{
85+
name: "targetCallValue",
86+
type: "uint256",
87+
internalType: "uint256",
88+
},
89+
{
90+
name: "bidAmount",
91+
type: "uint256",
92+
internalType: "uint256",
93+
},
94+
],
95+
},
96+
],
97+
},
98+
{
99+
name: "signature",
100+
type: "bytes",
101+
internalType: "bytes",
102+
},
103+
],
104+
outputs: [],
105+
stateMutability: "payable",
106+
};
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
import { OpportunityAdapterConfig, SvmConstantsConfig } from "./types";
2+
export declare const OPPORTUNITY_ADAPTER_CONFIGS: Record<string, OpportunityAdapterConfig>;
3+
export declare const SVM_CONSTANTS: Record<string, SvmConstantsConfig>;
4+
//# sourceMappingURL=const.d.ts.map

express_relay/sdk/js/lib/const.d.ts.map

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

express_relay/sdk/js/lib/const.js

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
"use strict";
2+
Object.defineProperty(exports, "__esModule", { value: true });
3+
exports.SVM_CONSTANTS = exports.OPPORTUNITY_ADAPTER_CONFIGS = void 0;
4+
const web3_js_1 = require("@solana/web3.js");
5+
exports.OPPORTUNITY_ADAPTER_CONFIGS = {
6+
op_sepolia: {
7+
chain_id: 11155420,
8+
opportunity_adapter_factory: "0xfA119693864b2F185742A409c66f04865c787754",
9+
opportunity_adapter_init_bytecode_hash: "0x3d71516d94b96a8fdca4e3a5825a6b41c9268a8e94610367e69a8462cc543533",
10+
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
11+
weth: "0x74A4A85C611679B73F402B36c0F84A7D2CcdFDa3",
12+
},
13+
mode: {
14+
chain_id: 34443,
15+
opportunity_adapter_factory: "0x59F78DE21a0b05d96Ae00c547BA951a3B905602f",
16+
opportunity_adapter_init_bytecode_hash: "0xd53b8e32ab2ecba07c3e3a17c3c5e492c62e2f7051b89e5154f52e6bfeb0e38f",
17+
permit2: "0x000000000022D473030F116dDEE9F6B43aC78BA3",
18+
weth: "0x4200000000000000000000000000000000000006",
19+
},
20+
};
21+
exports.SVM_CONSTANTS = {
22+
"development-solana": {
23+
expressRelayProgram: new web3_js_1.PublicKey("PytERJFhAKuNNuaiXkApLfWzwNwSNDACpigT3LwQfou"),
24+
},
25+
};

express_relay/sdk/js/lib/evm.d.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { Bid, BidParams, OpportunityBid, OpportunityEvm } from "./types";
2+
import { Hex } from "viem";
3+
export declare function signBid(opportunity: OpportunityEvm, bidParams: BidParams, privateKey: Hex): Promise<Bid>;
4+
export declare function getSignature(opportunity: OpportunityEvm, bidParams: BidParams, privateKey: Hex): Promise<`0x${string}`>;
5+
export declare function signOpportunityBid(opportunity: OpportunityEvm, bidParams: BidParams, privateKey: Hex): Promise<OpportunityBid>;
6+
//# sourceMappingURL=evm.d.ts.map

0 commit comments

Comments
 (0)