@cartridge/controller
Advanced tools
Comparing version 0.1.56 to 0.1.57
import { AccountInterface } from "starknet"; | ||
import { Scope } from "./types"; | ||
import { BigNumberish } from "starknet/utils/number"; | ||
declare class Controller { | ||
@@ -27,2 +28,7 @@ private selector; | ||
} | ||
export declare function split(n: BigNumberish): { | ||
x: BigNumberish; | ||
y: BigNumberish; | ||
z: BigNumberish; | ||
}; | ||
export * from "./types"; | ||
@@ -29,0 +35,0 @@ export * from "./errors"; |
@@ -29,3 +29,5 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.split = void 0; | ||
const query_string_1 = __importDefault(require("query-string")); | ||
const starknet_1 = require("starknet"); | ||
const penpal_1 = require("@cartridge/penpal"); | ||
@@ -193,3 +195,3 @@ const device_1 = __importDefault(require("./device")); | ||
} | ||
const BASE = (0, number_1.toBN)(2).pow((0, number_1.toBN)(86)); | ||
const BASE = starknet_1.number.toBN(2).pow((0, number_1.toBN)(86)); | ||
function split(n) { | ||
@@ -201,2 +203,3 @@ const x = n.mod(BASE); | ||
} | ||
exports.split = split; | ||
__exportStar(require("./types"), exports); | ||
@@ -203,0 +206,0 @@ __exportStar(require("./errors"), exports); |
@@ -18,9 +18,3 @@ "use strict"; | ||
const base64url_1 = __importDefault(require("base64url")); | ||
const BASE = starknet_1.number.toBN(2).pow(86); | ||
function split(n) { | ||
const x = n.mod(BASE); | ||
const y = n.div(BASE).mod(BASE); | ||
const z = n.div(BASE).div(BASE); | ||
return { x, y, z }; | ||
} | ||
const _1 = require("."); | ||
function convertUint8ArrayToWordArray(u8Array) { | ||
@@ -89,4 +83,4 @@ var words = [], i = 0, len = u8Array.length; | ||
const s = starknet_1.number.toBN("0x" + Buffer.from(usignature.slice(sStart)).toString("hex")); | ||
const { x: r0, y: r1, z: r2 } = split(r); | ||
const { x: s0, y: s1, z: s2 } = split(s); | ||
const { x: r0, y: r1, z: r2 } = (0, _1.split)(r); | ||
const { x: s0, y: s1, z: s2 } = (0, _1.split)(s); | ||
return [ | ||
@@ -93,0 +87,0 @@ "0", |
{ | ||
"name": "@cartridge/controller", | ||
"version": "0.1.56", | ||
"version": "0.1.57", | ||
"description": "Cartridge Controller", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
1025
63939