Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

Ls/feat/update contracts and client libs #32

Merged
merged 2 commits into from
Apr 11, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,6 @@ Cargo.lock

# These are backup files generated by rustfmt
**/*.rs.bk

# Remove macOS's .DS_Store files
.DS_Store
3 changes: 2 additions & 1 deletion client/.env.example
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
REACT_APP_FUEL_PROVIDER_URL=https://node.swayswap.io/graphql
REACT_APP_FUEL_PROVIDER_URL=https://node.swayswap.io/graphql
REACT_APP_CONTRACT_ID=0x0000000000000000000000000000000000000000000000000000000000000000
7 changes: 5 additions & 2 deletions client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"@types/react": "^17.0.39",
"@types/react-dom": "^17.0.11",
"ethers": "^5.5.4",
"fuels": "^0.0.0-master-8de80f9",
"fuels": "^0.0.0-master-5ce88dc",
"prettier": "^2.5.1",
"react": "^17.0.2",
"react-dom": "^17.0.2",
Expand All @@ -25,6 +25,7 @@
"web-vitals": "^2.1.4"
},
"scripts": {
"build-typechain": "typechain --target fuels ../contracts/swayswap_contract/out/debug/swayswap_contract-abi.json --out-dir ./src/types/fuels-contracts",
"postinstall": "sh ./scripts/postinstall.sh",
"start": "react-scripts start",
"build": "react-scripts build",
Expand Down Expand Up @@ -57,6 +58,8 @@
"eslint": "^8.4.1",
"postcss": "^8.4.7",
"prettier-plugin-tailwindcss": "^0.1.8",
"tailwindcss": "^3.0.23"
"tailwindcss": "^3.0.23",
"typechain": "^8.0.0",
"typechain-target-fuels": "^0.5.0"
}
}
35 changes: 11 additions & 24 deletions client/src/context/WalletContext.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,33 +53,20 @@ export const WalletProvider = ({ children }: PropsWithChildren<{}>) => {
getWallet,
faucet: async () => {
const wallet = getWallet() as Wallet;
const transactionRequest: ScriptTransactionRequest = {
type: TransactionType.Script,
const transactionRequest = new ScriptTransactionRequest({
gasPrice: 0,
gasLimit: "0x0F4240",
script: "0x24400000",
scriptData: genBytes32(),
bytePrice: 0,
inputs: [
{
type: InputType.Coin,
id: "0x000000000000000000000000000000000000000000000000000000000000000000",
assetId: CoinETH,
amount: parseUnits("0.5", 9),
owner:
"0xf1e92c42b90934aa6372e30bc568a326f6e66a1a0288595e6e3fbd392a4f3e6e",
witnessIndex: 0,
},
],
outputs: [
{
type: OutputType.Coin,
to: wallet.address,
assetId: CoinETH,
amount: parseUnits("0.5", 9),
},
],
};
scriptData: genBytes32()
});
// @ts-ignore
transactionRequest.addCoin({
id: "0x000000000000000000000000000000000000000000000000000000000000000000",
assetId: CoinETH,
amount: parseUnits(".5", 9),
owner: "0xf1e92c42b90934aa6372e30bc568a326f6e66a1a0288595e6e3fbd392a4f3e6e",
});
transactionRequest.addCoinOutput(wallet.address, parseUnits(".5", 9), CoinETH);
const submit = await wallet.sendTransaction(transactionRequest);

return submit.wait();
Expand Down
276 changes: 0 additions & 276 deletions client/src/lib/swayswap-abi.json

This file was deleted.

Loading