Skip to content

Commit

Permalink
update lib
Browse files Browse the repository at this point in the history
  • Loading branch information
Ridel1e committed Feb 5, 2024
1 parent 5239cba commit ab0b51c
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 14 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@sentry/react": "^6.16.1",
"@sentry/tracing": "^6.16.1",
"@spectrumlabs/analytics": "^1.1.9",
"@spectrumlabs/cardano-dex-sdk": "^0.1.276",
"@spectrumlabs/cardano-dex-sdk": "^0.1.278",
"@types/file-saver": "^2.0.5",
"@types/lodash": "^4.14.172",
"@types/numeral": "^2.0.2",
Expand Down Expand Up @@ -113,6 +113,6 @@
]
},
"engines": {
"node": "^19"
"node": "^20"
}
}
13 changes: 13 additions & 0 deletions src/applicationConfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ import { DateTime } from 'luxon';
import { Dictionary } from './common/utils/Dictionary';
import { isProductionEnv } from './common/utils/env';
import { DefaultTokenListItem } from './network/cardano/api/common/defaultTokenList.ts';
import { RustModule } from "@spectrumlabs/cardano-dex-sdk/build/main/utils/rustLoader";
import { ScriptHash } from "@emurgo/cardano-serialization-lib-browser";

const isProductionHost = 'app.spectrum.fi' === location.host;

Expand Down Expand Up @@ -296,3 +298,14 @@ export const applicationConfig: ApplicationConfig = {
],
cardanoAmmSwapsOpenTime: DateTime.utc(2023, 6, 21, 19, 59, 0),
};

RustModule
.load()
.then(() => {
console.log('here1')
console.log(
RustModule.CardanoWasm.BaseAddress.from_address(RustModule.CardanoWasm.Address.from_bech32('addr1x94ec3t25egvhqy2n265xfhq882jxhkknurfe9ny4rl9k6dj764lvrxdayh2ux30fl0ktuh27csgmpevdu89jlxppvrst84slu'))
)
console.log('here2')
// RustModule.CardanoWasm.EnterpriseAddress.new(0, RustModule.CardanoWasm.StakeCredential.from_scripthash()
}).catch(console.log)
26 changes: 18 additions & 8 deletions src/network/cardano/api/operations/refund.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,15 +89,25 @@ export const refundBuilder$ = combineLatest([
script: ScriptCredsV1.ammSwapFeeSwitch,
opInRef: OpInRefsMainnetV1.ammSwapFeeSwitch,
},
deposit: {
address: OrderAddrsV1Mainnet.ammDeposit,
script: ScriptCredsV1.ammDeposit,
opInRef: OpInRefsMainnetV1.ammDeposit,
depositDefault: {
address: OrderAddrsV1Mainnet.ammDepositDefault,
script: ScriptCredsV1.ammDepositDefault,
opInRef: OpInRefsMainnetV1.ammDepositDefault,
},
redeem: {
address: OrderAddrsV1Mainnet.ammRedeem,
script: ScriptCredsV1.ammRedeem,
opInRef: OpInRefsMainnetV1.ammRedeem,
depositFeeSwitch: {
address: OrderAddrsV1Mainnet.ammDepositFeeSwitch,
script: ScriptCredsV1.ammDepositFeeSwitch,
opInRef: OpInRefsMainnetV1.ammDepositFeeSwitch,
},
redeemDefault: {
address: OrderAddrsV1Mainnet.ammRedeemDefault,
script: ScriptCredsV1.ammRedeemDefault,
opInRef: OpInRefsMainnetV1.ammRedeemDefault,
},
redeemFeeSwitch: {
address: OrderAddrsV1Mainnet.ammRedeemFeeSwitch,
script: ScriptCredsV1.ammRedeemFeeSwitch,
opInRef: OpInRefsMainnetV1.ammRedeemFeeSwitch,
},
defaultCollateralAmount: 5000000n,
},
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3337,10 +3337,10 @@
dependencies:
"@amplitude/analytics-browser" "^1.9.0"

"@spectrumlabs/cardano-dex-sdk@^0.1.276":
version "0.1.276"
resolved "https://registry.yarnpkg.com/@spectrumlabs/cardano-dex-sdk/-/cardano-dex-sdk-0.1.276.tgz#3f5cb92f34b651cb3818cd63ef986545241bb55e"
integrity sha512-63iEErA6LNAf97inMCUw15N26POZkI1vj7csLJ4+P6SPlDRUIpUJ+8adbe3DQ0O8g0eAfr/tru0ylLSPxZ2l8g==
"@spectrumlabs/cardano-dex-sdk@^0.1.278":
version "0.1.278"
resolved "https://registry.yarnpkg.com/@spectrumlabs/cardano-dex-sdk/-/cardano-dex-sdk-0.1.278.tgz#92777dda16e6df01ef48b606e9e29d1f63a3d07a"
integrity sha512-dQUSwK+p32kcgOq8OKW2J2ONn9b4X6v0qT1CEhunR8tjbJVlIbGg39ixSVI0U5bpohpW5d8PpmoQunptwuiVeQ==
dependencies:
"@emurgo/cardano-serialization-lib-browser" "^11.5.0"
axios "^0.21.1"
Expand Down

0 comments on commit ab0b51c

Please sign in to comment.