stronger reliance on env variables
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
# misc
|
||||
.DS_Store
|
||||
.env
|
||||
.env.local
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
|
||||
@@ -31,7 +31,7 @@ class TransactionForm extends React.Component {
|
||||
const msgSend = {
|
||||
fromAddress: this.props.address,
|
||||
toAddress: toAddress,
|
||||
amount: coins(amount * 1000000, "stake"),
|
||||
amount: coins(amount * 1000000, process.env.NEXT_PUBLIC_DENOM),
|
||||
};
|
||||
const msg = {
|
||||
typeUrl: "/cosmos.bank.v1beta1.MsgSend",
|
||||
@@ -39,14 +39,14 @@ class TransactionForm extends React.Component {
|
||||
};
|
||||
const gasLimit = gas;
|
||||
const fee = {
|
||||
amount: coins(2000, "stake"),
|
||||
amount: coins(2000, process.env.NEXT_PUBLIC_DENOM),
|
||||
gas: gasLimit.toString(),
|
||||
};
|
||||
|
||||
return {
|
||||
accountNumber: this.props.accountOnChain.accountNumber,
|
||||
sequence: this.props.accountOnChain.sequence,
|
||||
chainId: "purp-chain",
|
||||
chainId: process.env.NEXT_PUBLIC_CHAIN_ID,
|
||||
msgs: [msg],
|
||||
fee: fee,
|
||||
memo: this.state.memo,
|
||||
|
||||
@@ -50,8 +50,10 @@ export default class TransactionSigning extends React.Component {
|
||||
preferNoSetFee: true,
|
||||
},
|
||||
};
|
||||
await window.keplr.enable("purp-chain");
|
||||
const walletAccount = await window.keplr.getKey("purp-chain");
|
||||
await window.keplr.enable(process.env.NEXT_PUBLIC_CHAIN_ID);
|
||||
const walletAccount = await window.keplr.getKey(
|
||||
process.env.NEXT_PUBLIC_CHAIN_ID
|
||||
);
|
||||
this.setState({ walletAccount });
|
||||
} catch (e) {
|
||||
console.log("enable err: ", e);
|
||||
@@ -60,13 +62,15 @@ export default class TransactionSigning extends React.Component {
|
||||
|
||||
signTransaction = async () => {
|
||||
try {
|
||||
const offlineSigner = window.getOfflineSignerOnlyAmino("purp-chain");
|
||||
const offlineSigner = window.getOfflineSignerOnlyAmino(
|
||||
process.env.NEXT_PUBLIC_CHAIN_ID
|
||||
);
|
||||
const accounts = await offlineSigner.getAccounts();
|
||||
const signingClient = await SigningStargateClient.offline(offlineSigner);
|
||||
const signerData = {
|
||||
accountNumber: this.props.tx.accountNumber,
|
||||
sequence: this.props.tx.sequence,
|
||||
chainId: "purp-chain",
|
||||
chainId: process.env.NEXT_PUBLIC_CHAIN_ID,
|
||||
};
|
||||
const { bodyBytes, signatures } = await signingClient.sign(
|
||||
this.state.walletAccount.bech32Address,
|
||||
|
||||
@@ -14,9 +14,14 @@ import TransactionList from "../../../components/dataViews/TransactionList";
|
||||
export async function getServerSideProps(context) {
|
||||
let holdings;
|
||||
try {
|
||||
const client = await StargateClient.connect(process.env.NODE_ADDRESS);
|
||||
const client = await StargateClient.connect(
|
||||
process.env.NEXT_PUBLIC_NODE_ADDRESS
|
||||
);
|
||||
const multisigAddress = context.params.address;
|
||||
holdings = await client.getBalance(multisigAddress, "stake");
|
||||
holdings = await client.getBalance(
|
||||
multisigAddress,
|
||||
process.env.NEXT_PUBLIC_DENOM
|
||||
);
|
||||
const accountOnChain = await getMultisigAccount(multisigAddress, client);
|
||||
|
||||
return {
|
||||
@@ -34,7 +39,6 @@ const multipage = (props) => {
|
||||
const [showTxForm, setShowTxForm] = useState(false);
|
||||
const router = useRouter();
|
||||
const { address } = router.query;
|
||||
console.log(props);
|
||||
return (
|
||||
<Page>
|
||||
<StackableContainer base>
|
||||
|
||||
@@ -18,7 +18,7 @@ import CompletedTransaction from "../../../../components/dataViews/CompletedTran
|
||||
|
||||
export async function getServerSideProps(context) {
|
||||
// get multisig account and transaction info
|
||||
const nodeAddress = process.env.NODE_ADDRESS;
|
||||
const nodeAddress = process.env.NEXT_PUBLIC_NODE_ADDRESS;
|
||||
const client = await StargateClient.connect(nodeAddress);
|
||||
const multisigAddress = context.params.address;
|
||||
const holdings = await client.getBalance(multisigAddress, "uatom");
|
||||
|
||||
Reference in New Issue
Block a user