Skip to content

Commit

Permalink
Ensure proper graphql endpoint is used
Browse files Browse the repository at this point in the history
  • Loading branch information
adairrr committed Nov 1, 2024
1 parent 6a2a194 commit 5968660
Show file tree
Hide file tree
Showing 17 changed files with 331 additions and 150 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,6 @@ schema/
!/frontend/**

build/

.next
# frontend/.next
2 changes: 1 addition & 1 deletion frontend/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1 @@
ABSTRACT_API_URL=https://api.abstract.money/graphql
ABSTRACT_API_URL=https://api-hackmos-2024.up.railway.app/
9 changes: 5 additions & 4 deletions frontend/app/_components/codegen-contract.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ export const CodegenContract: React.FC = () => {
const { data: accountsMetadata } = useAccountsMetadataGraphQLQuery({ accountIds: accounts })
const { data: balance, isLoading } = cw20Base.queries.useBalance({
contractAddress,
args: { address: accountsMetadata?.[0]?.proxy ?? "" },
options: { enabled: !!accountsMetadata?.[0]?.proxy && !!contractAddress },
chainName: appChain.chainName,
args: { address: accountsMetadata?.[0]?.address ?? "" },
options: { enabled: !!accountsMetadata?.[0]?.address && !!contractAddress },
})

return (
Expand All @@ -40,7 +41,7 @@ export const CodegenContract: React.FC = () => {
<p>Loading balance...</p>
) : balance ? (
<div className="bg-gray-100 p-3 rounded-md">
<h3 className="font-semibold mb-2">Balance for address: {accountsMetadata?.[0]?.proxy ?? ""}</h3>
<h3 className="font-semibold mb-2">Balance for address: {accountsMetadata?.[0]?.address ?? ""}</h3>
<p>
<strong>Balance:</strong> {balance.balance}
</p>
Expand All @@ -57,4 +58,4 @@ export const CodegenContract: React.FC = () => {
</CardContent>
</Card>
)
}
}
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* This file was automatically generated by @abstract-money/ts-codegen@0.35.8.
* This file was automatically generated by @abstract-money/ts-codegen@0.37.0-beta-3.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run the @abstract-money/ts-codegen generate command to regenerate this file.
*/
Expand Down Expand Up @@ -172,12 +172,12 @@ export interface Cw20BaseInterface extends Cw20BaseReadOnlyInterface {
}: {
amount: Uint128;
recipient: string;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
burn: ({
amount
}: {
amount: Uint128;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
send: ({
amount,
contract,
Expand All @@ -186,7 +186,7 @@ export interface Cw20BaseInterface extends Cw20BaseReadOnlyInterface {
amount: Uint128;
contract: string;
msg: Binary;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
increaseAllowance: ({
amount,
expires,
Expand All @@ -195,7 +195,7 @@ export interface Cw20BaseInterface extends Cw20BaseReadOnlyInterface {
amount: Uint128;
expires?: Expiration;
spender: string;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
decreaseAllowance: ({
amount,
expires,
Expand All @@ -204,7 +204,7 @@ export interface Cw20BaseInterface extends Cw20BaseReadOnlyInterface {
amount: Uint128;
expires?: Expiration;
spender: string;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
transferFrom: ({
amount,
owner,
Expand All @@ -213,7 +213,7 @@ export interface Cw20BaseInterface extends Cw20BaseReadOnlyInterface {
amount: Uint128;
owner: string;
recipient: string;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
sendFrom: ({
amount,
contract,
Expand All @@ -224,26 +224,26 @@ export interface Cw20BaseInterface extends Cw20BaseReadOnlyInterface {
contract: string;
msg: Binary;
owner: string;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
burnFrom: ({
amount,
owner
}: {
amount: Uint128;
owner: string;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
mint: ({
amount,
recipient
}: {
amount: Uint128;
recipient: string;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
updateMinter: ({
newMinter
}: {
newMinter?: string;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
updateMarketing: ({
description,
marketing,
Expand All @@ -252,8 +252,8 @@ export interface Cw20BaseInterface extends Cw20BaseReadOnlyInterface {
description?: string;
marketing?: string;
project?: string;
}, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
uploadLogo: (logo: Logo, fee?: number | StdFee | "auto", memo?: string, _funds?: Coin[]) => Promise<ExecuteResult>;
}, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
uploadLogo: (logo: Logo, fee_?: number | StdFee | "auto", memo_?: string, funds_?: Coin[]) => Promise<ExecuteResult>;
}
export class Cw20BaseClient extends Cw20BaseQueryClient implements Cw20BaseInterface {
client: SigningCosmWasmClient;
Expand Down Expand Up @@ -285,24 +285,24 @@ export class Cw20BaseClient extends Cw20BaseQueryClient implements Cw20BaseInter
}: {
amount: Uint128;
recipient: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
transfer: {
amount,
recipient
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
burn = async ({
amount
}: {
amount: Uint128;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
burn: {
amount
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
send = async ({
amount,
Expand All @@ -312,14 +312,14 @@ export class Cw20BaseClient extends Cw20BaseQueryClient implements Cw20BaseInter
amount: Uint128;
contract: string;
msg: Binary;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
send: {
amount,
contract,
msg
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
increaseAllowance = async ({
amount,
Expand All @@ -329,14 +329,14 @@ export class Cw20BaseClient extends Cw20BaseQueryClient implements Cw20BaseInter
amount: Uint128;
expires?: Expiration;
spender: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
increase_allowance: {
amount,
expires,
spender
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
decreaseAllowance = async ({
amount,
Expand All @@ -346,14 +346,14 @@ export class Cw20BaseClient extends Cw20BaseQueryClient implements Cw20BaseInter
amount: Uint128;
expires?: Expiration;
spender: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
decrease_allowance: {
amount,
expires,
spender
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
transferFrom = async ({
amount,
Expand All @@ -363,14 +363,14 @@ export class Cw20BaseClient extends Cw20BaseQueryClient implements Cw20BaseInter
amount: Uint128;
owner: string;
recipient: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
transfer_from: {
amount,
owner,
recipient
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
sendFrom = async ({
amount,
Expand All @@ -382,54 +382,54 @@ export class Cw20BaseClient extends Cw20BaseQueryClient implements Cw20BaseInter
contract: string;
msg: Binary;
owner: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
send_from: {
amount,
contract,
msg,
owner
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
burnFrom = async ({
amount,
owner
}: {
amount: Uint128;
owner: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
burn_from: {
amount,
owner
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
mint = async ({
amount,
recipient
}: {
amount: Uint128;
recipient: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
mint: {
amount,
recipient
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
updateMinter = async ({
newMinter
}: {
newMinter?: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
update_minter: {
new_minter: newMinter
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
updateMarketing = async ({
description,
Expand All @@ -439,18 +439,18 @@ export class Cw20BaseClient extends Cw20BaseQueryClient implements Cw20BaseInter
description?: string;
marketing?: string;
project?: string;
}, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
}, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
update_marketing: {
description,
marketing,
project
}
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
uploadLogo = async (logo: Logo, fee: number | StdFee | "auto" = "auto", memo?: string, _funds?: Coin[]): Promise<ExecuteResult> => {
uploadLogo = async (logo: Logo, fee_: number | StdFee | "auto" = "auto", memo_?: string, funds_?: Coin[]): Promise<ExecuteResult> => {
return await this.client.execute(this.sender, this.contractAddress, {
upload_logo: logo
}, fee, memo, _funds);
}, fee_, memo_, funds_);
};
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// @ts-nocheck
/**
* This file was automatically generated by @abstract-money/ts-codegen@0.35.8.
* This file was automatically generated by @abstract-money/ts-codegen@0.37.0-beta-3.
* DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
* and run the @abstract-money/ts-codegen generate command to regenerate this file.
*/
Expand Down
Loading

0 comments on commit 5968660

Please sign in to comment.