@merkl/api 0.10.230 → 0.10.232
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/database/api/.generated/edge.js +6 -12
- package/dist/database/api/.generated/index-browser.js +3 -8
- package/dist/database/api/.generated/index.d.ts +156 -124
- package/dist/database/api/.generated/index.js +6 -12
- package/dist/database/api/.generated/package.json +1 -1
- package/dist/database/api/.generated/schema.prisma +3 -10
- package/dist/database/api/.generated/wasm.js +3 -8
- package/dist/database/engine/.generated/edge.js +2 -3
- package/dist/database/engine/.generated/index.js +2 -3
- package/dist/database/engine/.generated/package.json +1 -1
- package/dist/database/engine/.generated/schema.prisma +1 -1
- package/dist/src/eden/index.d.ts +142 -155
- package/dist/src/index.d.ts +52 -55
- package/dist/src/modules/v4/enso/enso.service.d.ts +1 -1
- package/dist/src/modules/v4/interaction/interaction.controller.d.ts +2 -42
- package/dist/src/modules/v4/interaction/interaction.controller.js +2 -20
- package/dist/src/modules/v4/interaction/interaction.model.d.ts +1 -0
- package/dist/src/modules/v4/interaction/interaction.model.js +1 -0
- package/dist/src/modules/v4/interaction/interaction.service.d.ts +1 -1
- package/dist/src/modules/v4/interaction/interaction.service.js +2 -2
- package/dist/src/modules/v4/kyberzap/kyberzap.model.d.ts +1 -0
- package/dist/src/modules/v4/kyberzap/kyberzap.model.js +1 -0
- package/dist/src/modules/v4/kyberzap/kyberzap.service.d.ts +1 -1
- package/dist/src/modules/v4/kyberzap/kyberzap.service.js +6 -2
- package/dist/src/modules/v4/opportunity/opportunity.controller.d.ts +5 -3
- package/dist/src/modules/v4/opportunity/opportunity.controller.js +1 -2
- package/dist/src/modules/v4/opportunity/opportunity.model.d.ts +2 -14
- package/dist/src/modules/v4/opportunity/opportunity.repository.d.ts +18 -8
- package/dist/src/modules/v4/opportunity/opportunity.service.d.ts +9 -4
- package/dist/src/modules/v4/programPayload/programPayload.repository.d.ts +4 -0
- package/dist/src/modules/v4/programPayload/programPayload.repository.js +113 -46
- package/dist/src/modules/v4/protocol/protocol.controller.d.ts +6 -6
- package/dist/src/modules/v4/protocol/protocol.model.d.ts +3 -15
- package/dist/src/modules/v4/protocol/protocol.model.js +3 -4
- package/dist/src/modules/v4/protocol/protocol.repository.d.ts +5 -5
- package/dist/src/modules/v4/protocol/protocol.service.d.ts +2 -2
- package/dist/src/modules/v4/reward/reward.repository.d.ts +3 -2
- package/dist/src/modules/v4/reward/reward.service.d.ts +18 -12
- package/dist/src/modules/v4/router.d.ts +52 -55
- package/dist/src/modules/v4/token/token.controller.d.ts +33 -0
- package/dist/src/modules/v4/token/token.controller.js +14 -1
- package/dist/src/modules/v4/token/token.model.d.ts +8 -0
- package/dist/src/modules/v4/token/token.model.js +7 -0
- package/dist/src/modules/v4/token/token.service.d.ts +19 -1
- package/dist/src/modules/v4/token/token.service.js +10 -0
- package/dist/src/modules/v4/user/user.controller.d.ts +6 -4
- package/dist/tsconfig.package.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/dist/src/modules/v4/zyfi/zyfi.model.d.ts +0 -45
- package/dist/src/modules/v4/zyfi/zyfi.model.js +0 -1
- package/dist/src/modules/v4/zyfi/zyfi.service.d.ts +0 -30
- package/dist/src/modules/v4/zyfi/zyfi.service.js +0 -35
package/package.json
CHANGED
@@ -1,45 +0,0 @@
|
|
1
|
-
export type ZyfiApi = {
|
2
|
-
"erc20_sponsored_paymaster/v1": {
|
3
|
-
payload: {
|
4
|
-
/**
|
5
|
-
* Defaults to ZKsync Era
|
6
|
-
*/
|
7
|
-
chainId?: number;
|
8
|
-
feeTokenAddress?: string;
|
9
|
-
/**
|
10
|
-
* [0-100] how much of the tx to sponsor
|
11
|
-
*/
|
12
|
-
sponsorshipRatio: number;
|
13
|
-
/**
|
14
|
-
* Defaults to 5, how many time can the user replay the tx
|
15
|
-
*/
|
16
|
-
replayLimit?: string;
|
17
|
-
txData: {
|
18
|
-
from: string;
|
19
|
-
to: string;
|
20
|
-
data: string;
|
21
|
-
};
|
22
|
-
};
|
23
|
-
response: {
|
24
|
-
expirationTime: string;
|
25
|
-
expiresIn: string;
|
26
|
-
feeTokenAmount: string;
|
27
|
-
feeTokendecimals: string;
|
28
|
-
feeUSD: string;
|
29
|
-
gasLimit: string;
|
30
|
-
gasPrice: string;
|
31
|
-
markup: string;
|
32
|
-
maxNonce: string;
|
33
|
-
protocolAddress: string;
|
34
|
-
sponsorshipRatio: string;
|
35
|
-
tokenAddress: string;
|
36
|
-
tokenPrice: string;
|
37
|
-
txData: {
|
38
|
-
from: string;
|
39
|
-
to: string;
|
40
|
-
data: string;
|
41
|
-
};
|
42
|
-
warnings: string[];
|
43
|
-
};
|
44
|
-
};
|
45
|
-
};
|
@@ -1 +0,0 @@
|
|
1
|
-
export {};
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import type { ZyfiApi } from "./zyfi.model";
|
2
|
-
export declare abstract class ZyfiService {
|
3
|
-
#private;
|
4
|
-
/**
|
5
|
-
* Get sponsored tx from raw payload
|
6
|
-
* @param transaction to wrap
|
7
|
-
* @returns query
|
8
|
-
*/
|
9
|
-
static wrapTx(transaction: ZyfiApi["erc20_sponsored_paymaster/v1"]["payload"]["txData"]): Promise<{
|
10
|
-
expirationTime: string;
|
11
|
-
expiresIn: string;
|
12
|
-
feeTokenAmount: string;
|
13
|
-
feeTokendecimals: string;
|
14
|
-
feeUSD: string;
|
15
|
-
gasLimit: string;
|
16
|
-
gasPrice: string;
|
17
|
-
markup: string;
|
18
|
-
maxNonce: string;
|
19
|
-
protocolAddress: string;
|
20
|
-
sponsorshipRatio: string;
|
21
|
-
tokenAddress: string;
|
22
|
-
tokenPrice: string;
|
23
|
-
txData: {
|
24
|
-
from: string;
|
25
|
-
to: string;
|
26
|
-
data: string;
|
27
|
-
};
|
28
|
-
warnings: string[];
|
29
|
-
}>;
|
30
|
-
}
|
@@ -1,35 +0,0 @@
|
|
1
|
-
export class ZyfiService {
|
2
|
-
static async #fetch(call, resource = "Paymaster") {
|
3
|
-
const { data, status } = await call();
|
4
|
-
if (status === 404)
|
5
|
-
throw new Response(`${resource} not found`, { status });
|
6
|
-
if (status === 500)
|
7
|
-
throw new Response(`${resource} unavailable`, { status });
|
8
|
-
if (data == null)
|
9
|
-
throw new Response(`${resource} unavailable`, { status });
|
10
|
-
return data;
|
11
|
-
}
|
12
|
-
static async #post(route, payload) {
|
13
|
-
const response = await fetch(`https://api.zyfi.org/api/${route}`, {
|
14
|
-
method: "POST",
|
15
|
-
headers: {
|
16
|
-
"Content-Type": "application/json",
|
17
|
-
"X-API-Key": process.env.ZYFI_API_KEY ?? "",
|
18
|
-
},
|
19
|
-
body: JSON.stringify(payload),
|
20
|
-
});
|
21
|
-
return (await response.json());
|
22
|
-
}
|
23
|
-
/**
|
24
|
-
* Get sponsored tx from raw payload
|
25
|
-
* @param transaction to wrap
|
26
|
-
* @returns query
|
27
|
-
*/
|
28
|
-
static async wrapTx(transaction) {
|
29
|
-
const res = await ZyfiService.#post("erc20_sponsored_paymaster/v1", {
|
30
|
-
txData: transaction,
|
31
|
-
sponsorshipRatio: 100,
|
32
|
-
});
|
33
|
-
return res;
|
34
|
-
}
|
35
|
-
}
|