Skip to content

Commit

Permalink
feat: open dist
Browse files Browse the repository at this point in the history
  • Loading branch information
snaildarter committed Mar 31, 2024
1 parent e746af4 commit f313b1f
Show file tree
Hide file tree
Showing 9 changed files with 132 additions and 1 deletion.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ bin-release/
# should NOT be excluded as they contain compiler settings and other important
# information for Eclipse / Flash Builder.
node_modules
dist/

.idea
.vscode
6 changes: 6 additions & 0 deletions dist/__test__/hello.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
interface Person {
firstName: string;
lastName: string;
}
export declare function greeter(person: Person): string;
export {};
Empty file.
Empty file added dist/__test__/util.test.d.ts
Empty file.
1 change: 1 addition & 0 deletions dist/index.cjs.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions dist/index.esm.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

21 changes: 21 additions & 0 deletions dist/src/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { HealthRes, AuthRes, EntryPointRes, StrategyRes, UserOpReq, TryPayUserOpRes } from '@/types/response';
/**
* Change the base url to the production or development url
*
* @param isProdUrl is production url
*/
export declare function init(isProdUrl?: boolean): void;
/**
*
* @returns server is health or not
*/
export declare const health: () => Promise<HealthRes | any>;
/**
*
* @param apiKey
* @returns
*/
export declare const auth: (apiKey: string) => Promise<AuthRes | any>;
export declare const getSupportEntryPointV1: (network?: string) => Promise<EntryPointRes | any>;
export declare const getSupportStrategyV1: (network?: string) => Promise<StrategyRes | any>;
export declare const tryPayUserOperationV1: (data: UserOpReq) => Promise<TryPayUserOpRes | any>;
99 changes: 99 additions & 0 deletions dist/src/types/response.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
interface BaseRes {
code: number;
message: string;
cost: string;
}
export interface HealthRes extends BaseRes {
data: {
environment: string;
hello: string;
time: string;
version: string;
};
}
export interface AuthRes {
code: number;
expire: string;
token: string;
}
export interface EntryPoint {
address: string;
desc: string;
network: string;
strategy_id: string;
}
export interface EntryPointRes extends BaseRes {
data: EntryPoint[];
}
interface ExecuteRestriction {
ban_sender_address: string;
effective_start_time: number;
effective_end_time: number;
global_max_usd: number;
global_max_op_count: number;
}
interface Strategy {
description: string;
enable_4844: boolean;
enable_7560: boolean;
enable_currency: boolean;
enable_eoa: boolean;
enable_erc20: boolean;
entrypoint_address: string;
entrypoint_tag: string;
execute_restriction: ExecuteRestriction[];
id: string;
network: string;
pay_type: string;
paymaster_address: string;
token: string;
}
export interface StrategyRes extends BaseRes {
data: Strategy[];
}
export interface TryPayUserOpRes extends BaseRes {
data: {
strategy_id: string;
entrypoint_address: string;
paymaster_address: string;
paymaster_signature: string;
paymaster_and_data: string;
pay_receipt: {
transaction_hash: string;
sponsor: string;
};
gas_info: {
gas_info: {
max_base_price_wei: number;
max_base_price_gwei: number;
max_base_price_ether: string;
max_priority_price_wei: number;
max_priority_price_gwei: number;
max_priority_price_ether: string;
};
token_cost: string;
network: string;
token: string;
usd_cost: number;
blob_enable: boolean;
max_fee: number;
};
};
}
export interface UserOpReq {
forceStrategyId: string;
userOperation: {
callData: string;
callGasLimit: string;
initCode: string;
maxFeePerGas: string;
maxPriorityFeePerGas: string;
nonce: string;
preVerificationGas: string;
sender: string;
signature: string;
verificationGasLimit: string;
paymasterAndData: string;
};
}
export {};
4 changes: 4 additions & 0 deletions dist/src/utils/path.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
declare const Path: {
[key: string]: string;
};
export default Path;

0 comments on commit f313b1f

Please sign in to comment.