-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add TS interface & types for whitelist-updatable-flatrate
- Loading branch information
1 parent
44a5172
commit 0079ca9
Showing
2 changed files
with
287 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,217 @@ | ||
/** | ||
* This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | ||
* and run the @cosmwasm/ts-codegen generate command to regenerate this file. | ||
*/ | ||
|
||
import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from "@cosmjs/cosmwasm-stargate"; | ||
import { Coin, StdFee } from "@cosmjs/amino"; | ||
import { InstantiateMsg, ExecuteMsg, QueryMsg, Uint64, AdminResponse, Addr, Config, Boolean, Nullableuint64 } from "./WhitelistUpdatableFlatrate.types"; | ||
export interface WhitelistUpdatableFlatrateReadOnlyInterface { | ||
contractAddress: string; | ||
config: () => Promise<Config>; | ||
includesAddress: ({ | ||
address | ||
}: { | ||
address: string; | ||
}) => Promise<Boolean>; | ||
mintCount: ({ | ||
address | ||
}: { | ||
address: string; | ||
}) => Promise<Uint64>; | ||
isProcessable: ({ | ||
address | ||
}: { | ||
address: string; | ||
}) => Promise<Boolean>; | ||
admins: () => Promise<AdminResponse>; | ||
addressCount: () => Promise<Uint64>; | ||
perAddressLimit: () => Promise<Uint64>; | ||
mintDiscountAmount: () => Promise<NullableUint64>; | ||
} | ||
export class WhitelistUpdatableFlatrateQueryClient implements WhitelistUpdatableFlatrateReadOnlyInterface { | ||
client: CosmWasmClient; | ||
contractAddress: string; | ||
|
||
constructor(client: CosmWasmClient, contractAddress: string) { | ||
this.client = client; | ||
this.contractAddress = contractAddress; | ||
this.config = this.config.bind(this); | ||
this.includesAddress = this.includesAddress.bind(this); | ||
this.mintCount = this.mintCount.bind(this); | ||
this.isProcessable = this.isProcessable.bind(this); | ||
this.admins = this.admins.bind(this); | ||
this.addressCount = this.addressCount.bind(this); | ||
this.perAddressLimit = this.perAddressLimit.bind(this); | ||
this.mintDiscountAmount = this.mintDiscountAmount.bind(this); | ||
} | ||
|
||
config = async (): Promise<Config> => { | ||
return this.client.queryContractSmart(this.contractAddress, { | ||
config: {} | ||
}); | ||
}; | ||
includesAddress = async ({ | ||
address | ||
}: { | ||
address: string; | ||
}): Promise<Boolean> => { | ||
return this.client.queryContractSmart(this.contractAddress, { | ||
includes_address: { | ||
address | ||
} | ||
}); | ||
}; | ||
mintCount = async ({ | ||
address | ||
}: { | ||
address: string; | ||
}): Promise<Uint64> => { | ||
return this.client.queryContractSmart(this.contractAddress, { | ||
mint_count: { | ||
address | ||
} | ||
}); | ||
}; | ||
isProcessable = async ({ | ||
address | ||
}: { | ||
address: string; | ||
}): Promise<Boolean> => { | ||
return this.client.queryContractSmart(this.contractAddress, { | ||
is_processable: { | ||
address | ||
} | ||
}); | ||
}; | ||
admins = async (): Promise<AdminResponse> => { | ||
return this.client.queryContractSmart(this.contractAddress, { | ||
admins: {} | ||
}); | ||
}; | ||
addressCount = async (): Promise<Uint64> => { | ||
return this.client.queryContractSmart(this.contractAddress, { | ||
address_count: {} | ||
}); | ||
}; | ||
perAddressLimit = async (): Promise<Uint64> => { | ||
return this.client.queryContractSmart(this.contractAddress, { | ||
per_address_limit: {} | ||
}); | ||
}; | ||
mintDiscountAmount = async (): Promise<NullableUint64> => { | ||
return this.client.queryContractSmart(this.contractAddress, { | ||
mint_discount_amount: {} | ||
}); | ||
}; | ||
} | ||
export interface WhitelistUpdatableFlatrateInterface extends WhitelistUpdatableFlatrateReadOnlyInterface { | ||
contractAddress: string; | ||
sender: string; | ||
updateAdmins: ({ | ||
newAdminList | ||
}: { | ||
newAdminList: string[]; | ||
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>; | ||
addAddresses: ({ | ||
addresses | ||
}: { | ||
addresses: string[]; | ||
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>; | ||
removeAddresses: ({ | ||
addresses | ||
}: { | ||
addresses: string[]; | ||
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>; | ||
processAddress: ({ | ||
address | ||
}: { | ||
address: string; | ||
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>; | ||
updatePerAddressLimit: ({ | ||
limit | ||
}: { | ||
limit: number; | ||
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>; | ||
purge: (fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>; | ||
} | ||
export class WhitelistUpdatableFlatrateClient extends WhitelistUpdatableFlatrateQueryClient implements WhitelistUpdatableFlatrateInterface { | ||
client: SigningCosmWasmClient; | ||
sender: string; | ||
contractAddress: string; | ||
|
||
constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { | ||
super(client, contractAddress); | ||
this.client = client; | ||
this.sender = sender; | ||
this.contractAddress = contractAddress; | ||
this.updateAdmins = this.updateAdmins.bind(this); | ||
this.addAddresses = this.addAddresses.bind(this); | ||
this.removeAddresses = this.removeAddresses.bind(this); | ||
this.processAddress = this.processAddress.bind(this); | ||
this.updatePerAddressLimit = this.updatePerAddressLimit.bind(this); | ||
this.purge = this.purge.bind(this); | ||
} | ||
|
||
updateAdmins = async ({ | ||
newAdminList | ||
}: { | ||
newAdminList: string[]; | ||
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => { | ||
return await this.client.execute(this.sender, this.contractAddress, { | ||
update_admins: { | ||
new_admin_list: newAdminList | ||
} | ||
}, fee, memo, _funds); | ||
}; | ||
addAddresses = async ({ | ||
addresses | ||
}: { | ||
addresses: string[]; | ||
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => { | ||
return await this.client.execute(this.sender, this.contractAddress, { | ||
add_addresses: { | ||
addresses | ||
} | ||
}, fee, memo, _funds); | ||
}; | ||
removeAddresses = async ({ | ||
addresses | ||
}: { | ||
addresses: string[]; | ||
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => { | ||
return await this.client.execute(this.sender, this.contractAddress, { | ||
remove_addresses: { | ||
addresses | ||
} | ||
}, fee, memo, _funds); | ||
}; | ||
processAddress = async ({ | ||
address | ||
}: { | ||
address: string; | ||
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => { | ||
return await this.client.execute(this.sender, this.contractAddress, { | ||
process_address: { | ||
address | ||
} | ||
}, fee, memo, _funds); | ||
}; | ||
updatePerAddressLimit = async ({ | ||
limit | ||
}: { | ||
limit: number; | ||
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => { | ||
return await this.client.execute(this.sender, this.contractAddress, { | ||
update_per_address_limit: { | ||
limit | ||
} | ||
}, fee, memo, _funds); | ||
}; | ||
purge = async (fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => { | ||
return await this.client.execute(this.sender, this.contractAddress, { | ||
purge: {} | ||
}, fee, memo, _funds); | ||
}; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
/** | ||
* This file was automatically generated by @cosmwasm/ts-codegen@0.35.3. | ||
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, | ||
* and run the @cosmwasm/ts-codegen generate command to regenerate this file. | ||
*/ | ||
|
||
export interface InstantiateMsg { | ||
addresses: string[]; | ||
admin_list?: string[] | null; | ||
mint_discount_amount?: number | null; | ||
per_address_limit: number; | ||
} | ||
export type ExecuteMsg = { | ||
update_admins: { | ||
new_admin_list: string[]; | ||
}; | ||
} | { | ||
add_addresses: { | ||
addresses: string[]; | ||
}; | ||
} | { | ||
remove_addresses: { | ||
addresses: string[]; | ||
}; | ||
} | { | ||
process_address: { | ||
address: string; | ||
}; | ||
} | { | ||
update_per_address_limit: { | ||
limit: number; | ||
}; | ||
} | { | ||
purge: {}; | ||
}; | ||
export type QueryMsg = { | ||
config: {}; | ||
} | { | ||
includes_address: { | ||
address: string; | ||
}; | ||
} | { | ||
mint_count: { | ||
address: string; | ||
}; | ||
} | { | ||
is_processable: { | ||
address: string; | ||
}; | ||
} | { | ||
admins: {}; | ||
} | { | ||
address_count: {}; | ||
} | { | ||
per_address_limit: {}; | ||
} | { | ||
mint_discount_amount: {}; | ||
}; | ||
export type Uint64 = number; | ||
export interface AdminResponse { | ||
admin?: string | null; | ||
} | ||
export type Addr = string; | ||
export interface Config { | ||
admins: Addr[]; | ||
mint_discount_amount?: number | null; | ||
per_address_limit: number; | ||
} | ||
export type Boolean = boolean; | ||
export type Nullableuint64 = number | null; |