@tomo-inc/chains-service 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/README.md +15 -0
- package/package.json +38 -0
- package/project.json +59 -0
- package/src/api/__tests__/config.ts +21 -0
- package/src/api/__tests__/token.test.ts +120 -0
- package/src/api/__tests__/transaction.test.ts +86 -0
- package/src/api/__tests__/user.test.ts +105 -0
- package/src/api/__tests__/wallet.test.ts +73 -0
- package/src/api/base.ts +52 -0
- package/src/api/index.ts +24 -0
- package/src/api/network-data.ts +572 -0
- package/src/api/network.ts +81 -0
- package/src/api/token.ts +182 -0
- package/src/api/transaction.ts +59 -0
- package/src/api/types/common.ts +35 -0
- package/src/api/types/index.ts +13 -0
- package/src/api/types/type.ts +283 -0
- package/src/api/user.ts +83 -0
- package/src/api/utils/index.ts +34 -0
- package/src/api/utils/signature.ts +60 -0
- package/src/api/wallet.ts +57 -0
- package/src/base/network.ts +55 -0
- package/src/base/service.ts +33 -0
- package/src/base/token.ts +43 -0
- package/src/base/transaction.ts +58 -0
- package/src/config.ts +21 -0
- package/src/dogecoin/base.ts +39 -0
- package/src/dogecoin/config.ts +43 -0
- package/src/dogecoin/rpc.ts +449 -0
- package/src/dogecoin/service.ts +451 -0
- package/src/dogecoin/type.ts +29 -0
- package/src/dogecoin/utils-doge.ts +105 -0
- package/src/dogecoin/utils.ts +601 -0
- package/src/evm/rpc.ts +68 -0
- package/src/evm/service.ts +403 -0
- package/src/evm/utils.ts +92 -0
- package/src/index.ts +28 -0
- package/src/solana/config.ts +5 -0
- package/src/solana/service.ts +312 -0
- package/src/solana/types.ts +91 -0
- package/src/solana/utils.ts +635 -0
- package/src/types/account.ts +58 -0
- package/src/types/dapp.ts +7 -0
- package/src/types/gas.ts +53 -0
- package/src/types/index.ts +81 -0
- package/src/types/network.ts +66 -0
- package/src/types/tx.ts +181 -0
- package/src/types/wallet.ts +49 -0
- package/src/wallet.ts +96 -0
- package/tsconfig.json +14 -0
- package/tsup.config.ts +18 -0
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import CryptoJS from "crypto-js";
|
|
2
|
+
|
|
3
|
+
interface SignConfig {
|
|
4
|
+
method: string;
|
|
5
|
+
url: string;
|
|
6
|
+
data?: any;
|
|
7
|
+
apiKey: string;
|
|
8
|
+
apiSecret: string;
|
|
9
|
+
salt: string;
|
|
10
|
+
debug?: boolean;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Generate signature for API request
|
|
15
|
+
* @param config Sign configuration
|
|
16
|
+
* @returns Signature and timestamp
|
|
17
|
+
*/
|
|
18
|
+
export function generateSignature(config: SignConfig): { signature: string; timestamp: string } {
|
|
19
|
+
const timestamp = Math.floor(Date.now() / 1000).toString();
|
|
20
|
+
const method = config.method.toUpperCase();
|
|
21
|
+
let data = config.data ? config.data : {};
|
|
22
|
+
if (method === "GET") {
|
|
23
|
+
data = JSON.stringify({ key: "value" });
|
|
24
|
+
} else {
|
|
25
|
+
if (typeof data !== "string") {
|
|
26
|
+
data = JSON.stringify(data);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const message = [method, config.url, timestamp, data, config.apiKey, config.apiSecret, config.salt].join("");
|
|
31
|
+
|
|
32
|
+
// if (config.debug) {
|
|
33
|
+
// console.log("Signature debug:", message);
|
|
34
|
+
// }
|
|
35
|
+
|
|
36
|
+
const signature = CryptoJS.SHA256(message).toString();
|
|
37
|
+
return { signature, timestamp };
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Cube signature generation function
|
|
42
|
+
* @param data - data
|
|
43
|
+
* @param salt - salt
|
|
44
|
+
* @returns signed request object
|
|
45
|
+
*/
|
|
46
|
+
export const generateCubeSignature = async (data: any, salt: string) => {
|
|
47
|
+
if (!salt) {
|
|
48
|
+
throw new Error("salt is required");
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
const timestamp = Date.now().toString();
|
|
52
|
+
const req = {
|
|
53
|
+
...data,
|
|
54
|
+
timestamp,
|
|
55
|
+
};
|
|
56
|
+
const reqString = JSON.stringify(req);
|
|
57
|
+
const signature = CryptoJS.SHA256(reqString + salt).toString();
|
|
58
|
+
|
|
59
|
+
return { timestamp, signature };
|
|
60
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CreateWalletParams,
|
|
3
|
+
DeleteWalletParams,
|
|
4
|
+
IPublicApiBaseConfig,
|
|
5
|
+
RemoteResponse,
|
|
6
|
+
SyncWalletParams,
|
|
7
|
+
} from "./types";
|
|
8
|
+
import { BasePublicService } from "./base";
|
|
9
|
+
import { TomoAppInfo } from "../types";
|
|
10
|
+
|
|
11
|
+
export class WalletAPIs extends BasePublicService {
|
|
12
|
+
private static instance: WalletAPIs;
|
|
13
|
+
|
|
14
|
+
private constructor(apiBase: IPublicApiBaseConfig, tomoAppInfo: TomoAppInfo) {
|
|
15
|
+
super(apiBase, tomoAppInfo);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
public static getInstance(apiBase: IPublicApiBaseConfig, tomoAppInfo: TomoAppInfo) {
|
|
19
|
+
if (!this.instance) {
|
|
20
|
+
this.instance = new WalletAPIs(apiBase, tomoAppInfo);
|
|
21
|
+
}
|
|
22
|
+
return this.instance;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async createWallet(params: CreateWalletParams): Promise<RemoteResponse<any>> {
|
|
26
|
+
try {
|
|
27
|
+
if (!params) throw new Error("Params is required");
|
|
28
|
+
const res = await this.walletApi.post("/v1/wallet/create", params, {});
|
|
29
|
+
return res?.data || {};
|
|
30
|
+
} catch (error: any) {
|
|
31
|
+
if (error?.response?.data?.code === "60003") {
|
|
32
|
+
return { success: false, message: "Wallet already exists", data: null };
|
|
33
|
+
}
|
|
34
|
+
console.error("Failed to create wallet:", error);
|
|
35
|
+
throw error;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async syncWallet(params: SyncWalletParams): Promise<RemoteResponse<any>> {
|
|
40
|
+
try {
|
|
41
|
+
const res = await this.walletApi.post("/v1/wallet/sync", params, {});
|
|
42
|
+
return res?.data || {};
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error("Failed to sync wallet:", error);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async deleteWallet(params: DeleteWalletParams): Promise<RemoteResponse<any>> {
|
|
49
|
+
try {
|
|
50
|
+
const res = await this.walletApi.post("/v1/wallet/delete", params, {});
|
|
51
|
+
return res?.data || {};
|
|
52
|
+
} catch (error) {
|
|
53
|
+
console.error("Failed to sync wallet:", error);
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { ChainTypes, SupportedChainTypes } from "@tomo-inc/wallet-utils";
|
|
2
|
+
|
|
3
|
+
import { INetwork } from "../types";
|
|
4
|
+
import { NetworkAPIs } from "../api/network";
|
|
5
|
+
|
|
6
|
+
//chainType = all for wallet
|
|
7
|
+
export class Networks {
|
|
8
|
+
private chainType: ChainTypes | "";
|
|
9
|
+
public networkAPIs: NetworkAPIs;
|
|
10
|
+
|
|
11
|
+
public constructor(networkAPIs: NetworkAPIs, chainType?: ChainTypes) {
|
|
12
|
+
this.chainType = chainType || "";
|
|
13
|
+
this.networkAPIs = networkAPIs;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
public setChainType(chainType: ChainTypes): void {
|
|
17
|
+
this.chainType = chainType;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
public async getNetworks(chainType?: ChainTypes | ""): Promise<INetwork[]> {
|
|
21
|
+
const networks = this.networkAPIs.getAllNetworks(chainType || "");
|
|
22
|
+
return networks;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
public async getNetworkByChainId(chainId: string): Promise<INetwork> {
|
|
26
|
+
const network = await this.networkAPIs.getNetworkByChainId(chainId);
|
|
27
|
+
if (!network) {
|
|
28
|
+
throw new Error("Network not found");
|
|
29
|
+
}
|
|
30
|
+
return network;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
public async getNetworkByChainIndex(chainIndex: number): Promise<INetwork> {
|
|
34
|
+
const network = await this.networkAPIs.getNetworkByChainIndex(chainIndex);
|
|
35
|
+
if (!network) {
|
|
36
|
+
throw new Error("Network not found");
|
|
37
|
+
}
|
|
38
|
+
return network;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
public async getCurrentNetwork(): Promise<INetwork> {
|
|
42
|
+
const chainType = this.chainType as keyof typeof SupportedChainTypes;
|
|
43
|
+
let chainId = await this.networkAPIs.getCurrentNetwork(chainType);
|
|
44
|
+
if (chainId === "") {
|
|
45
|
+
chainId = SupportedChainTypes?.[chainType]?.chainId || "";
|
|
46
|
+
}
|
|
47
|
+
return this.getNetworkByChainId(chainId);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
public async setCurrentNetwork(chainId: string): Promise<boolean> {
|
|
51
|
+
const chainType = this.chainType || "";
|
|
52
|
+
await this.networkAPIs.setCurrentNetwork(chainType, chainId);
|
|
53
|
+
return true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Networks } from "./network";
|
|
2
|
+
import { Tokens } from "./token";
|
|
3
|
+
import { Transactions } from "./transaction";
|
|
4
|
+
|
|
5
|
+
import { CONFIG } from "../config";
|
|
6
|
+
import { tomoPublicApiService } from "../api";
|
|
7
|
+
import { TomoAppInfo } from "../types";
|
|
8
|
+
|
|
9
|
+
export class BaseService {
|
|
10
|
+
public isDappConnected: boolean;
|
|
11
|
+
public approveParams: any;
|
|
12
|
+
public accountInfo: any;
|
|
13
|
+
public networks: Networks;
|
|
14
|
+
public tokens: Tokens;
|
|
15
|
+
public transactions: Transactions;
|
|
16
|
+
|
|
17
|
+
public constructor(tomoAppInfo: TomoAppInfo, accountInfo?: any) {
|
|
18
|
+
if (!tomoAppInfo.tomoStage || !CONFIG[tomoAppInfo.tomoStage]) {
|
|
19
|
+
throw new Error("Tomo stage is required");
|
|
20
|
+
}
|
|
21
|
+
const baseUrlConfig = CONFIG[tomoAppInfo.tomoStage];
|
|
22
|
+
const { tokenAPIs, transactionAPIs, networkAPIs } = tomoPublicApiService(baseUrlConfig, tomoAppInfo);
|
|
23
|
+
this.accountInfo = accountInfo;
|
|
24
|
+
this.networks = new Networks(networkAPIs);
|
|
25
|
+
this.tokens = new Tokens(tokenAPIs);
|
|
26
|
+
this.transactions = new Transactions(transactionAPIs);
|
|
27
|
+
this.isDappConnected = false;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
public async setApproveParams(params: any) {
|
|
31
|
+
this.approveParams = params;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//types
|
|
2
|
+
import { TokenInfo } from "../types";
|
|
3
|
+
import { TokenAPIs } from "../api/token";
|
|
4
|
+
|
|
5
|
+
export class Tokens {
|
|
6
|
+
public tokenAPIs: TokenAPIs;
|
|
7
|
+
|
|
8
|
+
public constructor(tokenService: TokenAPIs) {
|
|
9
|
+
this.tokenAPIs = tokenService;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
public async searchTokens({ chainIndex, query }: { chainIndex?: number; query?: string }): Promise<TokenInfo[]> {
|
|
13
|
+
const { data: tokens = [] }: any = await this.tokenAPIs.queryRemoteTokens({ keyword: query || "", chainIndex });
|
|
14
|
+
return tokens;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// public async addToken(tokenInfo: Omit<TokenInfo, "id">): Promise<TokenInfo> {
|
|
18
|
+
// const { data: tokenInfoData }: any = await this.tokenService.addCustomToken(tokenInfo as any);
|
|
19
|
+
// return tokenInfoData;
|
|
20
|
+
// }
|
|
21
|
+
|
|
22
|
+
public async getTokenInfo({ address, chainIndex }: { address: string; chainIndex: number }): Promise<TokenInfo> {
|
|
23
|
+
const {
|
|
24
|
+
data: { data: tokenInfo },
|
|
25
|
+
}: any = await this.tokenAPIs.getTokenInfo({ address, chainIndex });
|
|
26
|
+
return tokenInfo;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
public async getTokenRiskInfo(_params: { chainIndex: number; tokenAddress: string }): Promise<any> {
|
|
30
|
+
const { data: tokenRiskInfo }: any = await this.tokenAPIs.getTokenRisk(_params);
|
|
31
|
+
return tokenRiskInfo;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
public async getTokenDetail(_params: { chainName: string; chainIndex: number; tokenAddress: string }): Promise<any> {
|
|
35
|
+
const { data }: any = await this.tokenAPIs.getTokenDetail(_params);
|
|
36
|
+
return data;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// public async addMyToken(tokenId: string): Promise<boolean> {
|
|
40
|
+
// const { success = false } = (await this.tokenService.addAccountToken({ tokenId })) as { success: boolean };
|
|
41
|
+
// return success;
|
|
42
|
+
// }
|
|
43
|
+
}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { TransactionAPIs } from "../api/transaction";
|
|
2
|
+
import { QueryGasParams } from "../types";
|
|
3
|
+
|
|
4
|
+
import { ChainTypes } from "@tomo-inc/wallet-utils";
|
|
5
|
+
const MYDOGE_PLATFORM_IN_SERVICE = 4;
|
|
6
|
+
|
|
7
|
+
const notSupportChainTypes = {
|
|
8
|
+
[ChainTypes.BTC]: true,
|
|
9
|
+
[ChainTypes.COSMOS]: true,
|
|
10
|
+
[ChainTypes.DOGE]: true,
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
//src/background/services/socials/tomo.ts
|
|
14
|
+
export class Transactions {
|
|
15
|
+
public transactionAPIs: TransactionAPIs;
|
|
16
|
+
|
|
17
|
+
public constructor(transactionAPIs: TransactionAPIs) {
|
|
18
|
+
this.transactionAPIs = transactionAPIs;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/*
|
|
22
|
+
baseFee: 1
|
|
23
|
+
gasLimit: 0
|
|
24
|
+
priorityFeeHigh: 0
|
|
25
|
+
priorityFeeLow: 0
|
|
26
|
+
priorityFeeMedium: 0
|
|
27
|
+
*/
|
|
28
|
+
public async queryGasInfo({ chainType, params }: { chainType: string; params: QueryGasParams }): Promise<any> {
|
|
29
|
+
try {
|
|
30
|
+
const res: any = await this.transactionAPIs.queryGasInfo(chainType, params as any);
|
|
31
|
+
return {
|
|
32
|
+
success: res?.code === 0,
|
|
33
|
+
data: res?.result || {},
|
|
34
|
+
};
|
|
35
|
+
} catch (err: any) {
|
|
36
|
+
return {
|
|
37
|
+
success: false,
|
|
38
|
+
message: err?.message || "Failed to query gas info",
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
public async getTransactions(params: {
|
|
44
|
+
walletId: string;
|
|
45
|
+
chainIndex: number;
|
|
46
|
+
pageLimit?: number;
|
|
47
|
+
cursor?: string;
|
|
48
|
+
}): Promise<{ cursor: string; transactionList: any[] }> {
|
|
49
|
+
const res: any = await this.transactionAPIs.getTransactions(params);
|
|
50
|
+
const { cursor = "", transactionList = [] } = res || {};
|
|
51
|
+
return { cursor, transactionList };
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
public async getTransaction(params: { walletId: string; txHash: string; chainIndex: number }): Promise<any> {
|
|
55
|
+
const res: any = await this.transactionAPIs.getTransaction(params);
|
|
56
|
+
return res?.data || {};
|
|
57
|
+
}
|
|
58
|
+
}
|
package/src/config.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { TomoApiDomains, TomoStage } from "@tomo-inc/wallet-utils";
|
|
2
|
+
|
|
3
|
+
function getConfig(tomoStage: TomoStage) {
|
|
4
|
+
const domain = TomoApiDomains[tomoStage];
|
|
5
|
+
if (!domain) {
|
|
6
|
+
throw new Error("Invalid tomo stage");
|
|
7
|
+
}
|
|
8
|
+
return {
|
|
9
|
+
rpcBaseUrl: `${domain}`,
|
|
10
|
+
walletBaseUrl: `${domain}/wallet`,
|
|
11
|
+
txBaseUrl: `${domain}/quote`,
|
|
12
|
+
tokenBaseUrl: `${domain}/token`,
|
|
13
|
+
userBaseUrl: `${domain}/user/api`,
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const CONFIG = {
|
|
18
|
+
prod: getConfig("prod"),
|
|
19
|
+
pre: getConfig("pre"),
|
|
20
|
+
dev: getConfig("dev"),
|
|
21
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export function fromHex(hex: string): Uint8Array {
|
|
2
|
+
const cleanHex = hex.startsWith("0x") ? hex.slice(2) : hex;
|
|
3
|
+
|
|
4
|
+
const paddedHex = cleanHex.length % 2 === 0 ? cleanHex : "0" + cleanHex;
|
|
5
|
+
|
|
6
|
+
const bytes = new Uint8Array(paddedHex.length / 2);
|
|
7
|
+
for (let i = 0; i < paddedHex.length; i += 2) {
|
|
8
|
+
bytes[i / 2] = parseInt(paddedHex.substr(i, 2), 16);
|
|
9
|
+
}
|
|
10
|
+
return bytes;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function toHex(data: Uint8Array | Buffer | string): string {
|
|
14
|
+
if (typeof data === "string") {
|
|
15
|
+
return data.startsWith("0x") ? data.slice(2) : data;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const buffer = Buffer.isBuffer(data) ? data : Buffer.from(data);
|
|
19
|
+
return buffer.toString("hex");
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export function toBase64(data: Uint8Array | Buffer | string): string {
|
|
23
|
+
if (typeof data === "string") {
|
|
24
|
+
const buffer = Buffer.from(data, "hex");
|
|
25
|
+
return buffer.toString("base64");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
const buffer = Buffer.isBuffer(data) ? data : Buffer.from(data);
|
|
29
|
+
return buffer.toString("base64");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export function fromBase64(base64: string): Uint8Array {
|
|
33
|
+
const buffer = Buffer.from(base64, "base64");
|
|
34
|
+
return new Uint8Array(buffer);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function toBase58(data: Uint8Array | Buffer | string): string {
|
|
38
|
+
throw new Error("toBase58 requires bs58 package. Install it: pnpm add bs58");
|
|
39
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { ChainTypes, SupportedChainTypes } from "@tomo-inc/wallet-utils";
|
|
2
|
+
|
|
3
|
+
export const BaseConfig = SupportedChainTypes[ChainTypes.DOGE] as any;
|
|
4
|
+
|
|
5
|
+
export const BLOCK_CONFIRMATIONS = 1;
|
|
6
|
+
export const FEE_RATE_KB = 0.5;
|
|
7
|
+
|
|
8
|
+
export const DOGE_DECIMALS = 8;
|
|
9
|
+
export const DECIMALS = 100000000; //10..8
|
|
10
|
+
|
|
11
|
+
export const NOWNODES_SLEEP_S = 10;
|
|
12
|
+
export const MAX_CHUNK_LEN = 240;
|
|
13
|
+
export const MAX_PAYLOAD_LEN = 1500;
|
|
14
|
+
|
|
15
|
+
export const TRANSACTION_PAGE_SIZE = 10;
|
|
16
|
+
|
|
17
|
+
export const NETWORK = "livenet";
|
|
18
|
+
export const MYDOGE_BASE_URL = "https://api.mydoge.com";
|
|
19
|
+
export const TX_LINK = "https://chain.so/tx/DOGE/";
|
|
20
|
+
|
|
21
|
+
export const RPC_URL = "https://api.bitcore.io/api/DOGE/mainnet";
|
|
22
|
+
export const RPC_TIMEOUT = 20 * 1000;
|
|
23
|
+
|
|
24
|
+
export const TX_OVERHEAD = 10;
|
|
25
|
+
export const P2SH_INPUT_SIZE = 148;
|
|
26
|
+
export const TX_OUTPUT_SIZE = 34;
|
|
27
|
+
|
|
28
|
+
export const DEFAULT_OUTPUT_COUNT = 2;
|
|
29
|
+
|
|
30
|
+
export const TX_SIZE = 1 * P2SH_INPUT_SIZE + DEFAULT_OUTPUT_COUNT * TX_OUTPUT_SIZE + TX_OVERHEAD;
|
|
31
|
+
|
|
32
|
+
export const network = {
|
|
33
|
+
messagePrefix: "\x19Dogecoin Signed Message:\n",
|
|
34
|
+
bech32: "dc",
|
|
35
|
+
bip44: 3,
|
|
36
|
+
bip32: {
|
|
37
|
+
public: 0x02facafd,
|
|
38
|
+
private: 0x02fac398,
|
|
39
|
+
},
|
|
40
|
+
pubKeyHash: 0x1e,
|
|
41
|
+
scriptHash: 0x16,
|
|
42
|
+
wif: 0x9e,
|
|
43
|
+
};
|