This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { | |
getContract, | |
keccak256, | |
toHex, | |
encodeAbiParameters, | |
parseAbiParameters, | |
pad, | |
encodePacked, | |
} from "viem"; | |
import { Address, prepareWriteContract } from "@wagmi/core"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"redirects": [ | |
{ | |
"source": "/(.*)/", | |
"destination": "/$1", | |
"permanent": true | |
}, | |
{ | |
"source": "/index.html", | |
"destination": "/", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import { Address } from "@ton/core"; | |
import { JettonsService } from "../../jettons/jettonsService"; | |
import { WalletService } from "../../wallet/walletService"; | |
import { PROXY_TON, Web3TransportService } from "../../web3infra/web3TransportService"; | |
import { zeroTONtopTON } from "../../web3infra/zeroTONtopTON"; | |
import { Asset, Factory, MAINNET_FACTORY_ADDR, PoolType, VaultNative, ReadinessStatus, JettonRoot, VaultJetton, Pool } from '@dedust/sdk'; | |
import { Address, OpenedContract, Sender, toNano, TonClient, TonClient4, WalletContractV3R1, WalletContractV4 } from "@ton/ton"; | |
import { SimulateSwap, Swap } from "../swapService"; | |
export class Dedust { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Transfer | |
# Transfer swap | |
async transferSwap(userId: number, accountIndex: number, params: { swapTxParams: SwapTxParams }) { | |
const { swapTxParams } = params; | |
const [connectedWallet, secretKey] = await Promise.all([ | |
await this.walletService.getTONWallet({ | |
userId, | |
accountIndex | |
}), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func testAsyncEffect() -> Effect<Int, MainError> { | |
Effect<String, MainError>.future { callback in | |
DispatchQueue.global().async { | |
sleep(5) | |
callback(.success("All good")) | |
} | |
} | |
.flatMap { value -> Effect<Int, MainError> in | |
Effect.result { | |
.success(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func testAsyncEffect() -> Effect<Int, MainError> { | |
Effect<String, MainError>.future { callback in | |
DispatchQueue.global().async { | |
sleep(5) | |
callback(.success("All good")) | |
} | |
} | |
.flatMap { value -> Effect<Int, MainError> in | |
Effect.result { | |
.success(2) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity 0.8.10; | |
import "../../lib/ds-test/src/test.sol"; | |
import "../../lib/forge-std/src/Vm.sol"; | |
import "../../lib/forge-std/src/Test.sol"; | |
interface ERC20 { | |
function totalSupply() external view returns (uint); | |
function balanceOf(address tokenOwner) external view returns (uint balance); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SwiftUI | |
// Example was taken from here | |
// https://www.xtabbas.com/implementing-snap-carousel-in-swiftui/ | |
/// FullscreenCarouselCard is a wrapper view with fixed width and VStack | |
struct FullscreenCarouselCard<Content: View, ItemData: Identifiable>: View { | |
private let content: Content | |
private let width: CGFloat | |
init( | |
_ itemData: ItemData, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@mixin optional-at-root($sel) { | |
@at-root #{if(not &, $sel, selector-append(&, $sel))} { | |
@content; | |
} | |
} | |
@mixin placeholder { | |
@include optional-at-root('::-webkit-input-placeholder') { | |
@content; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="utf-8"> | |
<title>title</title> | |
</head> | |
<body> | |
<div class="for_test"> |
NewerOlder