import * as $ from "@manahippo/move-to-ts"; import {AptosDataCache, AptosParserRepo, DummyCache, AptosLocalCache} from "@manahippo/move-to-ts"; import {U8, U64, U128} from "@manahippo/move-to-ts"; import {u8, u64, u128} from "@manahippo/move-to-ts"; import {TypeParamDeclType, FieldDeclType} from "@manahippo/move-to-ts"; import {AtomicTypeTag, StructTag, TypeTag, VectorTag, SimpleStructTag} from "@manahippo/move-to-ts"; import {OptionTransaction} from "@manahippo/move-to-ts"; import {HexString, AptosClient, AptosAccount, TxnBuilderTypes, Types} from "aptos"; export const packageName = "swap"; export const moduleAddress = new HexString("0x870723e9a8f6d07c350e79d63655de673fb24d0695c702f479c201ab7b055f41"); export const moduleName = "math"; export function sqrt_ ( x: U64, $c: AptosDataCache, ): U64 { let bit, res, x__1; bit = (u128("1")).shl(u8("64")); res = u128("0"); x__1 = u128($.copy(x)); while (($.copy(bit)).neq(u128("0"))) { { if (($.copy(x__1)).ge(($.copy(res)).add($.copy(bit)))) { x__1 = ($.copy(x__1)).sub(($.copy(res)).add($.copy(bit))); res = (($.copy(res)).shr(u8("1"))).add($.copy(bit)); } else{ res = ($.copy(res)).shr(u8("1")); } bit = ($.copy(bit)).shr(u8("2")); } }return u64($.copy(res)); } export function loadParsers(repo: AptosParserRepo) { } export class App { constructor( public client: AptosClient, public repo: AptosParserRepo, public cache: AptosLocalCache, ) { } get moduleAddress() {{ return moduleAddress; }} get moduleName() {{ return moduleName; }} }