Skip to content

Instantly share code, notes, and snippets.

@pyramation
Created May 4, 2022 03:23
Show Gist options
  • Save pyramation/f50869d1ecdb6d6ced2bc0a44c6ff492 to your computer and use it in GitHub Desktop.
Save pyramation/f50869d1ecdb6d6ced2bc0a44c6ff492 to your computer and use it in GitHub Desktop.
/**
* This file was automatically generated by cosmwasm-typescript-gen.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run the cosmwasm-typescript-gen generate command to regenerate this file.
*/
import { MsgExecuteContractEncodeObject } from "cosmwasm";
import { MsgExecuteContract } from "cosmjs-types/cosmwasm/wasm/v1/tx";
import { toUtf8 } from "@cosmjs/encoding";
import { Timestamp, Uint64, Uint128, ConfigResponse, Coin, Addr, Config, Decimal, InstantiateMsg, InstantiateMsg1, CollectionInfoFor_RoyaltyInfoResponse, RoyaltyInfoResponse } from "./MinterContract.ts";
export interface MinterMessage {
contractAddress: string;
sender: string;
mint: (funds?: readonly Coin[]) => MsgExecuteContractEncodeObject;
setWhitelist: ({
whitelist
}: {
whitelist: string;
}, funds?: readonly Coin[]) => MsgExecuteContractEncodeObject;
updateStartTime: (funds?: readonly Coin[]) => MsgExecuteContractEncodeObject;
updatePerAddressLimit: ({
perAddressLimit
}: {
perAddressLimit: number;
}, funds?: readonly Coin[]) => MsgExecuteContractEncodeObject;
mintTo: ({
recipient
}: {
recipient: string;
}, funds?: readonly Coin[]) => MsgExecuteContractEncodeObject;
mintFor: ({
recipient,
tokenId
}: {
recipient: string;
tokenId: number;
}, funds?: readonly Coin[]) => MsgExecuteContractEncodeObject;
withdraw: (funds?: readonly Coin[]) => MsgExecuteContractEncodeObject;
}
export class MinterMessageComposer implements MinterMessage {
sender: string;
contractAddress: string;
constructor(sender: string, contractAddress: string) {
this.sender = sender;
this.contractAddress = contractAddress;
this.mint = this.mint.bind(this);
this.setWhitelist = this.setWhitelist.bind(this);
this.updateStartTime = this.updateStartTime.bind(this);
this.updatePerAddressLimit = this.updatePerAddressLimit.bind(this);
this.mintTo = this.mintTo.bind(this);
this.mintFor = this.mintFor.bind(this);
this.withdraw = this.withdraw.bind(this);
}
mint = (funds?: readonly Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: MsgExecuteContract.fromPartial({
sender: this.sender,
contract: this.contractAddress,
msg: toUtf8(JSON.stringify({
mint: {}
})),
funds
})
};
};
setWhitelist = ({
whitelist
}: {
whitelist: string;
}, funds?: readonly Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: MsgExecuteContract.fromPartial({
sender: this.sender,
contract: this.contractAddress,
msg: toUtf8(JSON.stringify({
set_whitelist: {
whitelist
}
})),
funds
})
};
};
updateStartTime = (funds?: readonly Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: MsgExecuteContract.fromPartial({
sender: this.sender,
contract: this.contractAddress,
msg: toUtf8(JSON.stringify({
update_start_time: {}
})),
funds
})
};
};
updatePerAddressLimit = ({
perAddressLimit
}: {
perAddressLimit: number;
}, funds?: readonly Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: MsgExecuteContract.fromPartial({
sender: this.sender,
contract: this.contractAddress,
msg: toUtf8(JSON.stringify({
update_per_address_limit: {
per_address_limit: perAddressLimit
}
})),
funds
})
};
};
mintTo = ({
recipient
}: {
recipient: string;
}, funds?: readonly Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: MsgExecuteContract.fromPartial({
sender: this.sender,
contract: this.contractAddress,
msg: toUtf8(JSON.stringify({
mint_to: {
recipient
}
})),
funds
})
};
};
mintFor = ({
recipient,
tokenId
}: {
recipient: string;
tokenId: number;
}, funds?: readonly Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: MsgExecuteContract.fromPartial({
sender: this.sender,
contract: this.contractAddress,
msg: toUtf8(JSON.stringify({
mint_for: {
recipient,
token_id: tokenId
}
})),
funds
})
};
};
withdraw = (funds?: readonly Coin[]): MsgExecuteContractEncodeObject => {
return {
typeUrl: "/cosmwasm.wasm.v1.MsgExecuteContract",
value: MsgExecuteContract.fromPartial({
sender: this.sender,
contract: this.contractAddress,
msg: toUtf8(JSON.stringify({
withdraw: {}
})),
funds
})
};
};
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment