Skip to content

Commit

Permalink
Factory: Helpers: Casper: Prepare for NWL
Browse files Browse the repository at this point in the history
  • Loading branch information
imsk17 committed Nov 6, 2023
1 parent 7e430d3 commit 450970f
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/factory/factories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ export namespace ChainFactoryConfigs {
feeMargin,
},
casperParams: {
nwl: true,
network: "casper-test",
rpc: TestNetRpcUri.CASPER,
bridge:
Expand Down Expand Up @@ -560,6 +561,7 @@ export namespace ChainFactoryConfigs {
feeMargin,
},
casperParams: {
nwl: false,
bridge:
"hash-9af986599cf7625dae425a9e0e65b333d0d0daaaa67abca5b5abcf59e65b81b4",
feeMargin,
Expand Down
11 changes: 10 additions & 1 deletion src/helpers/casper/casper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import { CEP78Client } from "casper-cep78-js-client/dist/src";
import {
BalanceCheck,
ChainNonceGet,
EstimateDeployFees,
EstimateTxFees,
FeeMargins,
GetExtraFees,
Expand Down Expand Up @@ -41,6 +42,7 @@ export interface CasperParams {
umt: string;
feeMargin: FeeMargins;
sig: SignatureService;
nwl: boolean;
}

export interface CasperNFT {
Expand Down Expand Up @@ -77,7 +79,8 @@ export type CasperHelper = ChainNonceGet &
UnfreezeForeignNft<CasperLabsHelper, CasperNFT, string> &
EstimateTxFees<CasperNFT> & { XpNft: string } & GetExtraFees &
MintNft<CasperLabsHelper, CasperMintNft, string> &
CasperBrowserAdapt;
CasperBrowserAdapt &
EstimateDeployFees;

function getTokenIdentifier(nft: NftInfo<CasperNFT>): string {
if (nft.native.tokenId || nft.native.tokenHash) {
Expand Down Expand Up @@ -202,6 +205,12 @@ export async function casperHelper({
bridgeClient = new XpBridgeClient(rpc, network);
bridgeClient.setContractHash(bridge);
},
async estimateUserStoreDeploy() {
return new BigNumber("30000000000");
},
async estimateContractDeploy() {
return new BigNumber("30000000000");
},
toAccountHash(account: string) {
return CLPublicKey.fromHex(account).toAccountRawHashStr();
},
Expand Down

0 comments on commit 450970f

Please sign in to comment.