Skip to content

Commit

Permalink
Merge branch 'main' into env
Browse files Browse the repository at this point in the history
  • Loading branch information
secondl1ght authored Jul 4, 2024
2 parents f77a1a7 + 6aebbc7 commit 39932e0
Show file tree
Hide file tree
Showing 5 changed files with 335 additions and 75 deletions.
61 changes: 61 additions & 0 deletions src/graphql/mutations/__generated__/wallet.generated.tsx

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

8 changes: 8 additions & 0 deletions src/graphql/mutations/wallet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,11 @@ export const CreateWallet = gql`
}
}
`;

export const ChangeWalletName = gql`
mutation ChangeWalletName($id: String!, $name: String!) {
wallets {
change_name(id: $id, name: $name)
}
}
`;
86 changes: 86 additions & 0 deletions src/graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ export type PayMutations = {
lightning_invoice: CreateLiquidTransaction;
liquid_address: CreateLiquidTransaction;
money_address: CreateLiquidTransaction;
network_swap: CreateLiquidTransaction;
};

export type PayMutationsLightning_InvoiceArgs = {
Expand All @@ -267,6 +268,24 @@ export type PayMutationsMoney_AddressArgs = {
input: PayLnAddressInput;
};

export type PayMutationsNetwork_SwapArgs = {
input: PayNetworkSwapInput;
};

export type PayNetworkSwapInput = {
quote_id: Scalars['String']['input'];
settle_address: Scalars['String']['input'];
};

export type PayQueries = {
__typename?: 'PayQueries';
network_swap_quote: SwapQuote;
};

export type PayQueriesNetwork_Swap_QuoteArgs = {
input: SwapQuoteInput;
};

export enum PaymentOptionCode {
Btc = 'BTC',
Lightning = 'LIGHTNING',
Expand All @@ -281,10 +300,27 @@ export enum PaymentOptionNetwork {
export type Query = {
__typename?: 'Query';
hello: Scalars['String']['output'];
pay: PayQueries;
user: User;
wallets: WalletQueries;
};

export type ReceiveSwap = {
__typename?: 'ReceiveSwap';
coin: SwapCoin;
id: Scalars['String']['output'];
max: Scalars['String']['output'];
min: Scalars['String']['output'];
network: SwapNetwork;
receive_address: Scalars['String']['output'];
};

export type ReceiveSwapInput = {
deposit_coin: SwapCoin;
deposit_network: SwapNetwork;
wallet_account_id: Scalars['String']['input'];
};

export type RefreshToken = {
__typename?: 'RefreshToken';
access_token: Scalars['String']['output'];
Expand Down Expand Up @@ -355,11 +391,50 @@ export type SimpleWalletContact = {
money_address: Scalars['String']['output'];
};

export enum SwapCoin {
Btc = 'BTC',
Usdt = 'USDT',
}

export enum SwapNetwork {
Bitcoin = 'bitcoin',
Ethereum = 'ethereum',
Liquid = 'liquid',
Tron = 'tron',
}

export type SwapQuote = {
__typename?: 'SwapQuote';
created_at: Scalars['String']['output'];
deposit_amount: Scalars['String']['output'];
deposit_coin: Scalars['String']['output'];
deposit_network: Scalars['String']['output'];
expires_at: Scalars['String']['output'];
id: Scalars['String']['output'];
rate: Scalars['String']['output'];
settle_amount: Scalars['String']['output'];
settle_coin: Scalars['String']['output'];
settle_network: Scalars['String']['output'];
};

export type SwapQuoteInput = {
settle_amount: Scalars['String']['input'];
settle_coin: SwapCoin;
settle_network: SwapNetwork;
};

export type User = {
__typename?: 'User';
default_wallet_id?: Maybe<Scalars['String']['output']>;
email: Scalars['String']['output'];
id: Scalars['String']['output'];
swap_info: UserSwapInfo;
};

export type UserSwapInfo = {
__typename?: 'UserSwapInfo';
id: Scalars['String']['output'];
shifts_enabled: Scalars['Boolean']['output'];
};

export type Wallet = {
Expand Down Expand Up @@ -417,15 +492,22 @@ export type WalletDetails = {
export type WalletMutations = {
__typename?: 'WalletMutations';
broadcast_liquid_transaction: BroadcastLiquidTransaction;
change_name: Scalars['Boolean']['output'];
create: CreateWallet;
create_onchain_address: CreateOnchainAddress;
create_onchain_address_swap: ReceiveSwap;
refresh_wallet: Scalars['Boolean']['output'];
};

export type WalletMutationsBroadcast_Liquid_TransactionArgs = {
input: BroadcastLiquidTransactionInput;
};

export type WalletMutationsChange_NameArgs = {
id: Scalars['String']['input'];
name: Scalars['String']['input'];
};

export type WalletMutationsCreateArgs = {
input: CreateWalletInput;
};
Expand All @@ -434,6 +516,10 @@ export type WalletMutationsCreate_Onchain_AddressArgs = {
input: CreateOnchainAddressInput;
};

export type WalletMutationsCreate_Onchain_Address_SwapArgs = {
input: ReceiveSwapInput;
};

export type WalletMutationsRefresh_WalletArgs = {
input: RefreshWalletInput;
};
Expand Down
39 changes: 22 additions & 17 deletions src/views/app/Dashboard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -86,23 +86,28 @@ const WalletDetails: FC<{ id: string }> = ({ id }) => {
{addresses.map(a => {
return (
<div key={a.id}>
<div className="text-2xl font-bold">{a.user}</div>
{a.domains.map(d => {
return (
<div className="flex gap-1" key={d}>
<p className="text-xs text-muted-foreground">
{'@' + d}
</p>
<button onClick={() => copy(`${a.user}@${d}`)}>
{copiedText ? (
<CopyCheck className="size-3" color={'green'} />
) : (
<Copy className="size-3" />
)}
</button>
</div>
);
})}
<div className="mb-2 text-2xl font-bold">{a.user}</div>
<div className="flex flex-wrap gap-2">
{a.domains.map(d => {
return (
<div className="flex gap-1" key={d}>
<p className="text-xs text-muted-foreground">
{'@' + d}
</p>
<button onClick={() => copy(`${a.user}@${d}`)}>
{copiedText === `${a.user}@${d}` ? (
<CopyCheck
className="size-3"
color={'green'}
/>
) : (
<Copy className="size-3 hover:text-purple-500" />
)}
</button>
</div>
);
})}
</div>
</div>
);
})}
Expand Down
Loading

0 comments on commit 39932e0

Please sign in to comment.