laconic-wallet/src/utils/wallet-connect/COSMOSData.ts
Adwait Gharpure 83723d4086
Add support for sending cosmos transactions (#116)
* Update readme to contain instructions for creating  file

* Add method for sending transaction to chain

* Rename approve transaction component to approve transfer

* Create component for approving transactions

* Display transaction message in Approve transaction component

* Install registry-sdk

* Display gas limit on receiving transaction request

* Add functionality for sending transaction to chain

* Add memo in simulate gas method

* Remove unnecessary TODO

* Display error in dialog box

* Add support for onboarding transaction

* Pass address of signer in wallet connect request from app
2024-07-04 18:36:20 +05:30

43 lines
954 B
TypeScript

// Taken from https://github.com/WalletConnect/web-examples/blob/main/advanced/wallets/react-wallet-v2/src/data/COSMOSData.ts
/**
* Types
*/
export type TCosmosChain = keyof typeof COSMOS_TESTNET_CHAINS;
/**
* Chains
*/
// Added for pay.laconic.com
export const COSMOS_TESTNET_CHAINS: Record<
string,
{
chainId: string;
name: string;
rpc: string;
namespace: string;
}
> = {
'cosmos:theta-testnet-001': {
chainId: 'theta-testnet-001',
name: 'Cosmos Hub Testnet',
rpc: 'https://rpc-t.cosmos.nodestake.top',
namespace: 'cosmos',
},
};
/**
* Methods
*/
export const COSMOS_SIGNING_METHODS = {
COSMOS_SIGN_DIRECT: 'cosmos_signDirect',
COSMOS_SIGN_AMINO: 'cosmos_signAmino',
};
export const COSMOS_METHODS = {
...COSMOS_SIGNING_METHODS,
COSMOS_SEND_TOKENS: 'cosmos_sendTokens', // Added for pay.laconic.com
COSMOS_SEND_TRANSACTION: 'cosmos_sendTransaction', // Added for testnet onboarding app
};