Skip to content

Commit

Permalink
better parsing, more feature support
Browse files Browse the repository at this point in the history
  • Loading branch information
pyramation committed Apr 19, 2024
1 parent ed79c7c commit af26662
Show file tree
Hide file tree
Showing 20 changed files with 1,392 additions and 89 deletions.
2 changes: 1 addition & 1 deletion __fixtures__/output/assetlist.camel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface Asset {
name: string;
display: string;
symbol: string;
traces?: any[];
traces?: (IbcTransition | IbcCw20Transition | NonIbcTransition)[];
ibc?: {
sourceChannel: string;
dstChannel: string;
Expand Down
2 changes: 1 addition & 1 deletion __fixtures__/output/assetlist.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export interface Asset {
name: string;
display: string;
symbol: string;
traces?: any[];
traces?: (IbcTransition | IbcCw20Transition | NonIbcTransition)[];
ibc?: {
source_channel: string;
dst_channel: string;
Expand Down
4 changes: 2 additions & 2 deletions __fixtures__/output/chain.camel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export interface CosmosChain {
prettyName?: string;
website?: string;
updateLink?: string;
status?: any;
networkType?: any;
status?: "live" | "upcoming" | "killed";
networkType?: "mainnet" | "testnet" | "devnet";
bech32Prefix: string;
bech32Config?: {
bech32PrefixAccAddr?: string;
Expand Down
4 changes: 2 additions & 2 deletions __fixtures__/output/chain.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ export interface CosmosChain {
pretty_name?: string;
website?: string;
update_link?: string;
status?: any;
network_type?: any;
status?: "live" | "upcoming" | "killed";
network_type?: "mainnet" | "testnet" | "devnet";
bech32_prefix: string;
bech32_config?: {
bech32PrefixAccAddr?: string;
Expand Down
112 changes: 112 additions & 0 deletions __fixtures__/output/contract.camel.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
export type Addr = string;
export interface Asset {
amount: Uint128;
info: AssetInfo;
}
export type AssetInfo = {
token: {
contractAddr: Addr;
};
} | {
nativeToken: {
denom: string;
};
};
export type Binary = string;
export interface Cw20ReceiveMsg {
amount: Uint128;
msg: Binary;
sender: string;
}
export type Decimal = string;
export interface FeeInfo {
devFeePercent: number;
developerAddr?: Addr | any;
protocolFeePercent: number;
totalFeeBps: number;
}
export interface PoolConfig {
codeId: number;
feeInfo: FeeInfo;
isDisabled: boolean;
isGeneratorDisabled: boolean;
poolType: PoolType;
}
export type PoolType = {
xyk: any;
} | {
stable2Pool: any;
} | {
stable3Pool: any;
} | {
weighted: any;
} | {
custom: string;
};
export interface SingleSwapRequest {
amount: Uint128;
assetIn: AssetInfo;
assetOut: AssetInfo;
beliefPrice?: Decimal | any;
maxSpread?: Decimal | any;
poolId: Uint128;
swapType: SwapType;
}
export type SwapType = {
giveIn: any;
} | {
giveOut: any;
} | {
custom: string;
};
export type Uint128 = string;
export type ExecuteMsg = {
receive: Cw20ReceiveMsg;
} | {
updateConfig: {
feeCollector?: any;
generatorAddress?: any;
lpTokenCodeId?: any;
};
} | {
updatePoolConfig: {
isDisabled?: any;
newFeeInfo?: FeeInfo | any;
poolType: PoolType;
};
} | {
addToRegistery: {
newPoolConfig: PoolConfig;
};
} | {
createPoolInstance: {
assetInfos: AssetInfo[];
initParams?: Binary | any;
lpTokenName?: any;
lpTokenSymbol?: any;
poolType: PoolType;
};
} | {
joinPool: {
assets?: any;
autoStake?: any;
lpToMint?: Uint128 | any;
poolId: Uint128;
recipient?: any;
slippageTolerance?: Decimal | any;
};
} | {
swap: {
recipient?: any;
swapRequest: SingleSwapRequest;
};
} | {
proposeNewOwner: {
expiresIn: number;
owner: string;
};
} | {
dropOwnershipProposal: any;
} | {
claimOwnership: any;
};
112 changes: 112 additions & 0 deletions __fixtures__/output/contract.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,112 @@
export type Addr = string;
export interface Asset {
amount: Uint128;
info: AssetInfo;
}
export type AssetInfo = {
token: {
contract_addr: Addr;
};
} | {
native_token: {
denom: string;
};
};
export type Binary = string;
export interface Cw20ReceiveMsg {
amount: Uint128;
msg: Binary;
sender: string;
}
export type Decimal = string;
export interface FeeInfo {
dev_fee_percent: number;
developer_addr?: Addr | any;
protocol_fee_percent: number;
total_fee_bps: number;
}
export interface PoolConfig {
code_id: number;
fee_info: FeeInfo;
is_disabled: boolean;
is_generator_disabled: boolean;
pool_type: PoolType;
}
export type PoolType = {
xyk: any;
} | {
stable2_pool: any;
} | {
stable3_pool: any;
} | {
weighted: any;
} | {
custom: string;
};
export interface SingleSwapRequest {
amount: Uint128;
asset_in: AssetInfo;
asset_out: AssetInfo;
belief_price?: Decimal | any;
max_spread?: Decimal | any;
pool_id: Uint128;
swap_type: SwapType;
}
export type SwapType = {
give_in: any;
} | {
give_out: any;
} | {
custom: string;
};
export type Uint128 = string;
export type ExecuteMsg = {
receive: Cw20ReceiveMsg;
} | {
update_config: {
fee_collector?: any;
generator_address?: any;
lp_token_code_id?: any;
};
} | {
update_pool_config: {
is_disabled?: any;
new_fee_info?: FeeInfo | any;
pool_type: PoolType;
};
} | {
add_to_registery: {
new_pool_config: PoolConfig;
};
} | {
create_pool_instance: {
asset_infos: AssetInfo[];
init_params?: Binary | any;
lp_token_name?: any;
lp_token_symbol?: any;
pool_type: PoolType;
};
} | {
join_pool: {
assets?: any;
auto_stake?: any;
lp_to_mint?: Uint128 | any;
pool_id: Uint128;
recipient?: any;
slippage_tolerance?: Decimal | any;
};
} | {
swap: {
recipient?: any;
swap_request: SingleSwapRequest;
};
} | {
propose_new_owner: {
expires_in: number;
owner: string;
};
} | {
drop_ownership_proposal: any;
} | {
claim_ownership: any;
};
Loading

0 comments on commit af26662

Please sign in to comment.