@equilab/network
Advanced tools
Comparing version 0.1.3 to 0.1.4
declare const _default: { | ||
readonly statemint: { | ||
readonly genshiro: { | ||
getBalance: (pub: `0x${string}`) => { | ||
readonly section: "system"; | ||
readonly method: "account"; | ||
readonly args: readonly [`0x${string}`]; | ||
}; | ||
parseBalance: (data: any, context?: Record<string, any> | undefined) => import("../../util/math").BigDecimals; | ||
getNativeBalance: (pub: `0x${string}`) => { | ||
readonly section: "system"; | ||
readonly method: "account"; | ||
readonly args: readonly [`0x${string}`]; | ||
}; | ||
parseNativeBalance: (data: any, context?: Record<string, any> | undefined) => import("../../util/math").BigDecimals; | ||
getTransferArgs: (amount: `${number}`, pub: `0x${string}`, context?: Record<string, any> | undefined) => { | ||
readonly section: "polkadotXcm"; | ||
readonly method: "limitedReserveTransferAssets"; | ||
readonly args: readonly [`${number}`, `0x${string}`, 7, any]; | ||
}; | ||
nodes: string[]; | ||
paraId?: number | undefined; | ||
type: "substrate"; | ||
name: string; | ||
title: string; | ||
nativeToken: string; | ||
type: string; | ||
logo?: string | null | undefined; | ||
}; | ||
readonly statemint: { | ||
getBalance: (pub: `0x${string}`, context?: Record<string, any> | undefined) => { | ||
@@ -26,3 +48,3 @@ readonly section: "assets"; | ||
readonly args: readonly [{ | ||
readonly V3: { | ||
readonly V2: { | ||
readonly parents: "1"; | ||
@@ -36,3 +58,3 @@ readonly interior: { | ||
}, { | ||
readonly V3: { | ||
readonly V2: { | ||
readonly parents: 0; | ||
@@ -43,3 +65,3 @@ readonly interior: { | ||
readonly id: `0x${string}`; | ||
readonly network: null; | ||
readonly network: "Any"; | ||
}; | ||
@@ -50,3 +72,3 @@ }; | ||
}, { | ||
readonly V3: readonly [{ | ||
readonly V2: readonly [{ | ||
readonly id: { | ||
@@ -59,3 +81,3 @@ readonly Concrete: { | ||
}, { | ||
readonly GeneralIndex: 1984; | ||
readonly GeneralIndex: any; | ||
}]; | ||
@@ -74,6 +96,10 @@ }; | ||
nodes: string[]; | ||
paraId: number; | ||
logo: null; | ||
paraId?: number | undefined; | ||
type: "substrate"; | ||
name: string; | ||
title: string; | ||
nativeToken: string; | ||
logo?: string | null | undefined; | ||
}; | ||
}; | ||
export default _default; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const genshiro_1 = require("./genshiro"); | ||
const statemint_1 = require("./statemint"); | ||
exports.default = { | ||
genshiro: genshiro_1.genshiro, | ||
statemint: statemint_1.statemint, | ||
}; |
import type { BigDecimals } from "../../util/math"; | ||
export declare const statemint: { | ||
name: string; | ||
title: string; | ||
nativeToken: string; | ||
type: string; | ||
getBalance: (pub: `0x${string}`, context?: Record<string, any>) => { | ||
@@ -26,3 +22,3 @@ readonly section: "assets"; | ||
readonly args: readonly [{ | ||
readonly V3: { | ||
readonly V2: { | ||
readonly parents: "1"; | ||
@@ -36,3 +32,3 @@ readonly interior: { | ||
}, { | ||
readonly V3: { | ||
readonly V2: { | ||
readonly parents: 0; | ||
@@ -43,3 +39,3 @@ readonly interior: { | ||
readonly id: `0x${string}`; | ||
readonly network: null; | ||
readonly network: "Any"; | ||
}; | ||
@@ -50,3 +46,3 @@ }; | ||
}, { | ||
readonly V3: readonly [{ | ||
readonly V2: readonly [{ | ||
readonly id: { | ||
@@ -59,3 +55,3 @@ readonly Concrete: { | ||
}, { | ||
readonly GeneralIndex: 1984; | ||
readonly GeneralIndex: any; | ||
}]; | ||
@@ -74,4 +70,8 @@ }; | ||
nodes: string[]; | ||
paraId: number; | ||
logo: null; | ||
paraId?: number | undefined; | ||
type: "substrate"; | ||
name: string; | ||
title: string; | ||
nativeToken: string; | ||
logo?: string | null | undefined; | ||
}; |
@@ -34,9 +34,9 @@ "use strict"; | ||
{ | ||
V3: { parents: "1", interior: { X1: { Parachain: "2011" } } }, | ||
V2: { parents: "1", interior: { X1: { Parachain: "2011" } } }, | ||
}, | ||
{ | ||
V3: { | ||
V2: { | ||
parents: 0, | ||
interior: { | ||
X1: { AccountId32: { id: pub, network: null } }, | ||
X1: { AccountId32: { id: pub, network: "Any" } }, | ||
}, | ||
@@ -46,3 +46,3 @@ }, | ||
{ | ||
V3: [ | ||
V2: [ | ||
{ | ||
@@ -53,3 +53,6 @@ id: { | ||
interior: { | ||
X2: [{ PalletInstance: 50 }, { GeneralIndex: 1984 }], | ||
X2: [ | ||
{ PalletInstance: 50 }, | ||
{ GeneralIndex: context === null || context === void 0 ? void 0 : context.asset }, | ||
], | ||
}, | ||
@@ -69,7 +72,3 @@ }, | ||
}; | ||
exports.statemint = { | ||
name: "statemint", | ||
title: "Statemint", | ||
nativeToken: "dot", | ||
type: "substrate", | ||
const fns = { | ||
// balances | ||
@@ -83,2 +82,9 @@ getBalance, | ||
getTransferArgs, | ||
}; | ||
const chainDef = { | ||
name: "statemint", | ||
title: "Statemint", | ||
nativeToken: "dot", | ||
type: "substrate", | ||
logo: null, | ||
nodes: [ | ||
@@ -90,3 +96,3 @@ "wss://statemint-rpc.polkadot.io", | ||
paraId: 1000, | ||
logo: null, | ||
}; | ||
exports.statemint = Object.assign(Object.assign({}, chainDef), fns); |
import * as tokens from "./tokens"; | ||
declare const _default: { | ||
chains: { | ||
readonly statemint: { | ||
readonly genshiro: { | ||
getBalance: (pub: `0x${string}`) => { | ||
readonly section: "system"; | ||
readonly method: "account"; | ||
readonly args: readonly [`0x${string}`]; | ||
}; | ||
parseBalance: (data: any, context?: Record<string, any> | undefined) => import("../util/math").BigDecimals; | ||
getNativeBalance: (pub: `0x${string}`) => { | ||
readonly section: "system"; | ||
readonly method: "account"; | ||
readonly args: readonly [`0x${string}`]; | ||
}; | ||
parseNativeBalance: (data: any, context?: Record<string, any> | undefined) => import("../util/math").BigDecimals; | ||
getTransferArgs: (amount: `${number}`, pub: `0x${string}`, context?: Record<string, any> | undefined) => { | ||
readonly section: "polkadotXcm"; | ||
readonly method: "limitedReserveTransferAssets"; | ||
readonly args: readonly [`${number}`, `0x${string}`, 7, any]; | ||
}; | ||
nodes: string[]; | ||
paraId?: number | undefined; | ||
type: "substrate"; | ||
name: string; | ||
title: string; | ||
nativeToken: string; | ||
type: string; | ||
logo?: string | null | undefined; | ||
}; | ||
readonly statemint: { | ||
getBalance: (pub: `0x${string}`, context?: Record<string, any> | undefined) => { | ||
@@ -28,3 +50,3 @@ readonly section: "assets"; | ||
readonly args: readonly [{ | ||
readonly V3: { | ||
readonly V2: { | ||
readonly parents: "1"; | ||
@@ -38,3 +60,3 @@ readonly interior: { | ||
}, { | ||
readonly V3: { | ||
readonly V2: { | ||
readonly parents: 0; | ||
@@ -45,3 +67,3 @@ readonly interior: { | ||
readonly id: `0x${string}`; | ||
readonly network: null; | ||
readonly network: "Any"; | ||
}; | ||
@@ -52,3 +74,3 @@ }; | ||
}, { | ||
readonly V3: readonly [{ | ||
readonly V2: readonly [{ | ||
readonly id: { | ||
@@ -61,3 +83,3 @@ readonly Concrete: { | ||
}, { | ||
readonly GeneralIndex: 1984; | ||
readonly GeneralIndex: any; | ||
}]; | ||
@@ -76,4 +98,8 @@ }; | ||
nodes: string[]; | ||
paraId: number; | ||
logo: null; | ||
paraId?: number | undefined; | ||
type: "substrate"; | ||
name: string; | ||
title: string; | ||
nativeToken: string; | ||
logo?: string | null | undefined; | ||
}; | ||
@@ -80,0 +106,0 @@ }; |
@@ -0,5 +1,7 @@ | ||
import * as genshiro from "./genshiro"; | ||
import * as statemint from "./statemint"; | ||
declare const _default: { | ||
readonly genshiro: typeof genshiro; | ||
readonly statemint: typeof statemint; | ||
}; | ||
export default _default; |
@@ -26,5 +26,7 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const genshiro = __importStar(require("./genshiro")); | ||
const statemint = __importStar(require("./statemint")); | ||
exports.default = { | ||
genshiro, | ||
statemint, | ||
}; |
@@ -5,8 +5,15 @@ import type chains from "../../config/chains"; | ||
export type ChainType = "substrate" | "evm"; | ||
export interface ChainConfig<T extends ChainType> { | ||
interface BaseChain<T extends ChainType> { | ||
type: T; | ||
types: string[]; | ||
args: unknown[]; | ||
callIndex: string; | ||
name: string; | ||
title: string; | ||
nativeToken: string; | ||
logo?: string | null; | ||
} | ||
export interface SubstrateChain extends BaseChain<"substrate"> { | ||
nodes: string[]; | ||
paraId?: number; | ||
} | ||
export interface EVMChain extends BaseChain<"evm"> { | ||
} | ||
/** @deprecated still hacks */ | ||
@@ -17,1 +24,2 @@ export interface TypeMap { | ||
} | ||
export {}; |
@@ -5,2 +5,5 @@ "use strict"; | ||
const isNumStr = (numStr) => { | ||
if (!(numStr === null || numStr === void 0 ? void 0 : numStr.length)) { | ||
return false; | ||
} | ||
const num = Number(numStr); | ||
@@ -7,0 +10,0 @@ return Number.isFinite(num); |
{ | ||
"name": "@equilab/network", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"main": "./dist/index.js", | ||
@@ -5,0 +5,0 @@ "license": "none", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
705035
64
14641