repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
zhangCan112/stm_web_project | stmproject/src/App.tsx | import React, { Component } from 'react';
import { createStore } from "redux";
import rootReducer from "./reducers/index";
import { Provider } from 'react-redux';
import './App.css';
import { Router, Switch, Redirect, Route as R } from 'react-router';
import Route from "./utils/route";
import browserHistory from './his... |
zhangCan112/stm_web_project | stmproject/src/reducers/index.ts | import { combineReducers } from 'redux'
function test(state = {}, action: any) {
return state
}
const rootReducer = combineReducers({
test,
})
export default rootReducer;
export type StateType = ReturnType<typeof rootReducer> |
zhangCan112/stm_web_project | stmproject/src/components/tomato/tomato.tsx | import React, { Component } from 'react';
import { Timeline, List } from 'antd';
import CountdownButton from "./countdownButton";
import css from './tomato.module.css';
import InfiniteScroll from 'react-infinite-scroller'
interface IProps {
}
interface IState {
}
export default class Tomato extends Component<IPro... |
zhangCan112/stm_web_project | stmproject/src/pages/404/404.tsx | import React, { Component } from 'react';
import { Button, Result } from 'antd';
import History from "../../history";
export default class NotFoundPage extends Component {
render() {
return <Result
status="404"
title="404"
subTitle="Sorry, the page you visited does not exist."
... |
zhangCan112/stm_web_project | stmproject/src/utils/Route.tsx | import React, { Component } from 'react';
import { Route, withRouter, RouteComponentProps } from 'react-router-dom';
import { RouteChildrenProps } from 'react-router';
import cookies from "./cookies"
import * as Path from './routepaths'
interface IRouteProps extends RouteComponentProps {
component?: React.Componen... |
zhangCan112/stm_web_project | stmproject/src/utils/routepaths.ts |
/**
* 首页
*/
export const Home = '/'
/**
* 工作台
*/
export const Workbench = '/workbench'
/**
* 登陆页
*/
export const Login = '/login'
/**
* 忘记密码
*/
export const Forget = '/forget'
/**
* 用户注册
*/
export const Register = '/register' |
zhangCan112/stm_web_project | stmproject/src/components/gtd/task.tsx | <reponame>zhangCan112/stm_web_project<gh_stars>0
import React, { Component } from 'react';
import { Checkbox, Icon } from 'antd';
import css from './gtd.module.css';
interface IProps {
/**
* tag标记
*/
tag?: string,
/**
* 当点击了checkboxIcon时
*/
onCheck?: (tag?: string) => void,
/**... |
zhangCan112/stm_web_project | stmproject/src/pages/forget/forget.tsx | import React, { Component } from 'react';
import './forget.css';
class Forget extends Component {
render() {
return (
<div>
忘记密码页面!!!
</div>
);
}
}
export default Forget |
zhangCan112/stm_web_project | stmproject/src/utils/cookies.ts | import * as cookie from "react-cookie";
import { GET } from "../utils/request";
import URLS from "../utils/urls";
// Cookie数据中的约定值的Key值
const LoginKey = "isLogin"
export function isLogin() {
GET(URLS.HEALTH)
let cookies = new cookie.Cookies()
return cookies.get(LoginKey) === "true"
}
export default {
... |
zhangCan112/stm_web_project | stmproject/src/components/gtd/gtd.tsx | import React, { Component } from 'react';
import { Input, Icon, Timeline, List } from 'antd';
import css from './gtd.module.css';
import TaskCell from "./task";
import InfiniteScroll from 'react-infinite-scroller'
interface IProps {
}
interface IState {
}
export default class GTD extends Component<IProps, IState> ... |
zhangCan112/stm_web_project | stmproject/src/containers/home/home.tsx | <reponame>zhangCan112/stm_web_project
import React, { Component } from 'react';
import { Layout, Icon, Avatar, Button, Popover, message } from 'antd';
import css from './home.module.css';
import { NavLink } from 'react-router-dom';
import * as RoutePath from '../../utils/routepaths';
import { GET, filterSuccessCode } f... |
zhangCan112/stm_web_project | stmproject/src/pages/workbench/workbench.tsx | import React, { Component } from 'react';
import Home from "../../containers/home/home";
import Tomato from '../../components/tomato/tomato';
import GTD from '../../components/gtd/gtd';
import css from './workbench.module.css';
interface Iprops {
}
class Workbench extends Component<Iprops> {
render() {
... |
zhangCan112/stm_web_project | stmproject/src/utils/request.ts | var pkg = require("../../package.json");
const ServiceErrorMsg = "服务器错误!"
// 业务Api的commonUrl
var commonUrl: string = pkg.projectConfig.proxy
// 业务API返回的Body数据格式
export interface ResponseBody<B> {
scode: number
body?: B
msg?: string
}
//GET GET请求方法
export const GET = <B>(url: string, querry?: {[key: str... |
r0bs/csp-generator | index.spec.ts | import { expect } from "chai";
import { CspSource, generate } from ".";
import { readFileSync } from "fs";
describe("index", () => {
it("generates a short csp", () => {
const csp = generate({
"script-src": ["'self'", "www.example.com"],
});
expect(csp).to.equal("script-src 'self' www.example.com;"... |
r0bs/csp-generator | index.ts | enum CspKeywords {
"'none'",
"'report-sample'",
"'self'",
"'strict-dynamic'",
"'unsafe-allow-redirects'",
"'unsafe-eval'",
"'unsafe-hashes'",
"'unsafe-inline'",
"data:",
}
enum CspDirectiveKeys {
"base-uri",
"block-all-mixed-content",
"connect-src",
"default-src",
"font-src",
"form-action... |
SevereCloud/vk-limits | src/App.tsx | import React from 'react';
import {
AppRoot,
SplitLayout,
SplitCol,
ViewWidth,
Panel,
PanelHeader,
Header,
Group,
Search,
PanelHeaderButton,
SimpleCell,
Footer,
withAdaptivity,
View,
} from '@vkontakte/vkui';
import '@vkontakte/vkui/dist/vkui.css';
import { data, DataGroup, DataItem } from '... |
SevereCloud/vk-limits | src/index.tsx | import React from 'react';
import ReactDOM from 'react-dom';
import App from './App';
import { VKMiniAppAPI } from '@vkontakte/vk-mini-apps-api';
import bridge from '@vkontakte/vk-bridge';
import { AdaptivityProvider, ConfigProvider } from '@vkontakte/vkui';
const isMobileApps = () => {
const url = new URL(window.lo... |
SevereCloud/vk-limits | src/data.ts | import {
Icon28UserOutline,
Icon28NameTagOutline,
Icon28PictureStackOutline,
Icon28Users3Outline,
Icon28DocumentOutline,
Icon28UserSquareOutline,
Icon28UploadOutline,
Icon28MarketOutline,
Icon28MarketLikeOutline,
Icon24Crop,
Icon24Fullscreen,
Icon28MusicOutline,
Icon28VideocamOutline,
Icon28... |
SevereCloud/vk-limits | src/types.ts | import type { HTMLAttributes, RefObject, RefCallback } from 'react';
export interface IconProps extends HTMLAttributes<HTMLDivElement> {
fill?: string;
width?: number;
height?: number;
getRootRef?: RefCallback<HTMLDivElement> | RefObject<HTMLDivElement>;
}
|
64Mega/typestyle | src/tests/supports.ts | <reponame>64Mega/typestyle
import { style, getStyles, reinit } from '../index';
import * as assert from 'assert';
describe('@supports', () => {
it('standard freestyle', () => {
reinit();
style({
color: 'red',
$nest: {
'@supports (display: flex)': {
color: 'white'
}
... |
64Mega/typestyle | src/tests/rule.tsx | <filename>src/tests/rule.tsx
import { getStyles, reinit, cssRule } from '../index';
import * as assert from 'assert';
describe("test rules", () => {
it("it should provide expected output when used as css framework", () => {
reinit();
/** Sample variables */
const colors = {
primary: 'blue',
... |
64Mega/typestyle | src/tests/extend.ts | <filename>src/tests/extend.ts
import { extend } from '../index';
import * as assert from 'assert';
describe("extend", () => {
it("plain objects should be preserved", () => {
assert.deepEqual(extend({ color: 'red' }), { color: 'red' });
});
it("nested objects should not get flattened", () => {
assert.dee... |
hellow554/rhino | binding/vue/src/rhino.ts | /*
Copyright 2022 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS IS" BA... |
hellow554/rhino | binding/react/src/index.ts | import { useRhino, RhinoHookArgs } from './use_rhino';
export {
useRhino,
RhinoHookArgs,
};
|
hellow554/rhino | binding/react-native/src/rhino_errors.tsx | <filename>binding/react-native/src/rhino_errors.tsx
//
// Copyright 2021 Picovoice Inc.
//
// You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
// file accompanying this source.
//
// Unless required by applicable law or agreed to in writing, software dis... |
hellow554/rhino | binding/react-native/src/index.tsx | //
// Copyright 2020-2021 Picovoice Inc.
//
// You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
// file accompanying this source.
//
// Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
//... |
hellow554/rhino | binding/vue/src/index.ts | <reponame>hellow554/rhino
import rhinoMixin, { RhinoVue, RhinoWorkerFactoryArgs } from './rhino';
// Create module definition for Vue.use()
const plugin = {
install: function(Vue: any) {
Vue.mixin(rhinoMixin);
}
};
// Auto-install when vue is found (eg. in browser via <script> tag)
let GlobalVue = null;
if (t... |
hellow554/rhino | binding/web/template/src/rhino.ts | /*
Copyright 2018-2022 Picovoice Inc.
You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
file accompanying this source.
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
an "AS I... |
hellow554/rhino | demo/angular/src/app/app.component.ts | <filename>demo/angular/src/app/app.component.ts
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
title = 'rhino-web-angular-demo-rhino';
show = true
toggle() {
this.show... |
hellow554/rhino | binding/react-native/src/rhino_manager.tsx | <filename>binding/react-native/src/rhino_manager.tsx<gh_stars>100-1000
//
// Copyright 2020 Picovoice Inc.
//
// You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
// file accompanying this source.
//
// Unless required by applicable law or agreed to in wr... |
hellow554/rhino | binding/angular/projects/rhino-web-angular/src/public-api.ts | <filename>binding/angular/projects/rhino-web-angular/src/public-api.ts<gh_stars>100-1000
/*
* Public API Surface of rhino-web-angular
*/
export * from './lib/rhino.service';
|
hellow554/rhino | demo/react-native/App.tsx | import React, { Component } from 'react';
import { PermissionsAndroid, Platform, TouchableOpacity } from 'react-native';
import { StyleSheet, Text, View } from 'react-native';
import { RhinoManager, RhinoInference, RhinoErrors } from '@picovoice/rhino-react-native';
type Props = {};
type State = {
buttonText: string... |
hellow554/rhino | binding/react-native/src/rhino.tsx | <gh_stars>100-1000
//
// Copyright 2020-2021 Picovoice Inc.
//
// You may not use this file except in compliance with the license. A copy of the license is located in the "LICENSE"
// file accompanying this source.
//
// Unless required by applicable law or agreed to in writing, software distributed under the License i... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/merkle/storage.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export class Storage<T = Record<string, unknown>> {
private db: T = {} as T;
get<K extends keyof T> (key: K): T[K] | undefined {
return this.db[key];
}
getOrDefault<K extends keyof T> (key: K, defaultElement: T[K]) {
return this.db[ke... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/buffer-to-fixed.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
// @ts-ignore
import * as snarkjs from 'tornado-snarkjs';
const { bigInt } = snarkjs;
export const bufferToFixed = (number: Buffer | any, length = 32) => {
return (
'0x' + (number instanceof Buffer ? number.toString('hex') : bigInt(number).toSt... |
nepoche/webb.js | packages/app-util/src/__test__/event-bus.class.spec.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { expect } from 'chai';
import { EventBus } from '../shared/event-bus.class.js';
class TestEvent extends EventBus<{ log: number }> {
override readonly sendEvent: EventBus<{ log: number }>['emit'];
constructor () {
super();
this.se... |
nepoche/webb.js | packages/api-providers/src/contracts/wrappers/webb-governed-token.ts | <filename>packages/api-providers/src/contracts/wrappers/webb-governed-token.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable camelcase */
import { LoggerService } from '@nepoche/app-util/index.js';
import { GovernedTokenWrapper, GovernedTokenWrapper__factory } from '@nepoche/con... |
nepoche/webb.js | packages/api-providers/src/utils/misc/app-mode.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { LoggerService } from '@nepoche/app-util/index.js';
export type AppMode = 'development' | 'production';
const appLogger = LoggerService.get('App');
export function appMode (): AppMode {
// @ts-ignore
return proce... |
nepoche/webb.js | packages/api-providers/src/abstracts/anchor/anchor.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { InternalChainId } from '../../chains/index.js';
import { WebbCurrencyId } from '../../enums/index.js';
import { BridgeConfig } from '../../types/bridge-config.interface.js';
import { CurrencyRole } from '../../types/currency-config.interface.j... |
nepoche/webb.js | packages/api-providers/src/abstracts/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './anchor/index.js';
export * from './chain-query/index.js';
export * from './currency/index.js';
export * from './common.js';
export * from './mixer/index.js';
export * from './networks-storage.js';
export * from './relayer/index.js';
e... |
nepoche/webb.js | packages/api-providers/src/utils/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './anchor-utils.js';
export * from './chain-utils.js';
export * from './fixtures.js';
export * from './relayer-utils.js';
export * from './retry-promise.js';
export * from './storage-mock.js';
export * from './misc/index.js';
|
nepoche/webb.js | packages/api-providers/src/polkadot/mixer-deposit.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { Currency, DepositPayload as TDepositPayload, MixerSize, ORMLCurrency } from '@nepoche/api-providers/index.js';
import { LoggerService } from '@nepoche/app-util/index.js';
impo... |
nepoche/webb.js | packages/api-providers/src/polkadot/webb-provider.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { ApiInitHandler, AppConfig, NotificationHandler, ProvideCapabilities, WasmFactory, WebbApiProvider, WebbMethods, WebbProviderEvents, WebbRelayerBuilder } from '@nepoche/api-providers/index.js';
import { EventBus } from '@nepoche/app... |
nepoche/webb.js | packages/api-providers/src/types/anchor-config.interface.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { InternalChainId } from '../chains/index.js';
export type ChainAddressConfig = { [key in InternalChainId]?: string };
export type AnchorConfigEntry = {
amount: string;
// EVM based
anchorAddresses: ChainAddressConfig;
// Substrate bas... |
nepoche/webb.js | packages/api-providers/src/ext-providers/polkadot/polkadot-accounts.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { InjectedAccount, InjectedExtension } from '@polkadot/extension-inject/types';
import { Account, AccountsAdapter, PromiseOrT } from '../../account/Accounts.adapter.js';
export class PolkadotAccount extends Account<InjectedAccount> {
get ava... |
nepoche/webb.js | packages/api-providers/src/polkadot/anchor-withdraw.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { fetchSubstrateAnchorProvingKey } from '@nepoche/api-providers/ipfs/substrate/anchor.js';
import { LoggerService } from '@nepoche/app-util/index.js';
import { Note, ProvingManager, ProvingManagerSetupInput } from '@nepoche/sdk-core/... |
nepoche/webb.js | packages/api-providers/src/types/chain-config.interface.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { ChainType } from '../chains/index.js';
import { WebbCurrencyId } from '../enums/index.js';
import { ReactElement } from './abstracts.js';
export interface ChainConfig {
id: number;
chainType: ChainType;
name: string;
group: string;
... |
nepoche/webb.js | packages/api-providers/src/abstracts/anchor/anchor-api.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { WebbCurrencyId } from '@nepoche/api-providers/enums/index.js';
import { ChainTypeId, chainTypeIdToInternalId, Currency, InternalChainId } from '@nepoche/api-providers/index.js';
import { BehaviorSubject, Observable } from 'rxjs';
export type ... |
nepoche/webb.js | packages/app-util/src/logger/logs-level.enum.ts | <filename>packages/app-util/src/logger/logs-level.enum.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export enum LogLevel {
trace,
log,
info,
warn,
debug,
error
}
|
nepoche/webb.js | packages/api-providers/src/utils/misc/get-cached-fixtures-uri.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export function getCachedFixtureURI (fileName: string) {
return `/cached-fixtures/${fileName}`;
}
|
nepoche/webb.js | packages/api-providers/src/contracts/utils/merkle/merkle-tree.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { Storage } from './storage.js';
export interface Hasher {
hash(level: any, left: any, right: any): any;
}
interface TraverserHandler {
handleIndex(level: number, elementIndex: number, siblingIndex: number): void;
}
class UpdateTraverser ... |
nepoche/webb.js | packages/sdk-core/src/proving/proving-manager.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { ProvingManagerSetupInput, ProvingManagerWrapper } from '@nepoche/sdk-core/proving/proving-manager-thread.js';
import { Proof } from '@nepoche/wasm-utils';
export type ProofI = Omit<Proof, 'free'>;
export class ProvingManager {
constructor ... |
nepoche/webb.js | packages/api-providers/src/contracts/tornado/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './Tornado.js';
export * from './Tornado__factory.js';
|
nepoche/webb.js | packages/types/src/interfaces/merkle/types.ts | <reponame>nepoche/webb.js
// Auto-generated via `yarn polkadot-types-from-defs`, do not edit
/* eslint-disable */
import type { u32 } from '@polkadot/types-codec';
/** @name KeyId */
export interface KeyId extends u32 {}
/** @name TreeId */
export interface TreeId extends u32 {}
export type PHANTOM_MERKLE = 'merkle... |
nepoche/webb.js | packages/api-providers/src/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './web3/index.js';
export * from './polkadot/index.js';
export * from './abstracts/index.js';
export * from './webb-error/index.js';
export * from './contracts/index.js';
export * from './utils/index.js';
export * from './types/index.js';... |
nepoche/webb.js | packages/app-util/src/__test__/fixed-18.spec.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import BigNumber from 'bignumber.js';
import { expect } from 'chai';
import { Fixed18 } from '../fixed-18.js';
describe('fixed 128 constructor', () => {
it('constructor should work', () => {
const a = new Fixed18(1);
const b = new Fixed18('... |
nepoche/webb.js | packages/api-providers/src/contracts/wrappers/index.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './types.js';
export * from './anchor-interface.js';
export * from './tornado-anchor.js';
export * from './webb-anchor.js';
export * from './webb-governed-token.js';
export * from './webb-utils.js';
|
nepoche/webb.js | packages/api-providers/src/web3/mixer-deposit.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { getEVMChainName, getNativeCurrencySymbol } from '@nepoche/api-providers/utils/index.js';
import { Note, NoteGenInput } from '@nepoche/sdk-core/index.js';
import utils from 'web3-utils';
import { u8aToHex } from '@polkadot/util';
import { Dep... |
nepoche/webb.js | packages/api-providers/src/utils/retry-promise.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export const sleep = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms));
export async function retryPromise<T extends () => Promise<any>>(
executor: T,
maxReties = 20,
sleepTime = 0
): Promise<ReturnType<T>> {
let resolved = fal... |
nepoche/webb.js | packages/type-definitions/scripts/generate.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { rpc, types, typesBundleForPolkadot } from '@nepoche/type-definitions/index';
import fs from 'fs';
fs.writeFileSync('packages/type-definitions/src/json/types.json', JSON.stringify(types, null, 4));
fs.writeFileSync(
... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/merkle/sponge-hasher.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
// @ts-ignore
import circomlib from 'tornado-circomlib';
import { Hasher } from './merkle-tree.js';
const { mimcsponge } = circomlib;
export class MimcSpongeHasher implements Hasher {
hash (level: any, left: any, right: a... |
nepoche/webb.js | packages/api-providers/src/abstracts/anchor/anchor-deposit.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { DepositPayload, MixerDeposit, MixerSize } from '../mixer/mixer-deposit.js';
import { WebbApiProvider } from '../webb-provider.interface.js';
export type AnchorSize = MixerSize;
export abstract class AnchorDeposit<
T extends WebbApiProvider... |
nepoche/webb.js | packages/type-definitions/src/types-known/versioned.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
const typesBundleTypes = [
{
types: {
Address: 'AccountId',
LookupSource: 'AccountId'
}
}
];
export default typesBundleTypes;
|
nepoche/webb.js | packages/sdk-core/src/__test__/fixed-point-number.spec.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { expect } from 'chai';
import { FixedPointNumber } from '../fixed-point-number.js';
describe('fixed point number constructor should work', () => {
it('toString & toNumber', () => {
const a = FixedPointNumber.fromInner('12345... |
nepoche/webb.js | tests/examples/anchor-chain-state.ts | import {
createAnchor,
getAnchors,
KillTask,
preparePolkadotApi,
setORMLTokenBalance,
sleep,
startWebbNode,
transferBalance,
} from '../utils';
import { Keyring } from '@polkadot/keyring';
import { ApiPromise } from '@polkadot/api';
import { KeyringPair } from '@polkadot/keyring/types';
let keyring: {
... |
nepoche/webb.js | packages/api-providers/src/polkadot/wrap-unwrap.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { Amount, MixerSize, WrappingBalance, WrappingEvent } from '@nepoche/api-providers/index.js';
import { Observable } from 'rxjs';
import { WrapUnWrap } from '../abstracts/index.js';
import { WebbCurrencyId } from '../enums/index.js';... |
nepoche/webb.js | packages/api-providers/__test__/bootstraping.spec.ts | <filename>packages/api-providers/__test__/bootstraping.spec.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { expect } from 'chai';
import { initPolkadotProvider } from './utils/init-polkadot-provider.js';
describe('Bootstrap providers', function () {
this.timeout(120_000);
it('Shou... |
nepoche/webb.js | tests/utils/backend-utils.ts | <reponame>nepoche/webb.js
import { execSync, spawn, SpawnOptionsWithoutStdio } from 'child_process';
import { sleep } from './index.js';
function spawnWithLogger(
command: string,
options?: SpawnOptionsWithoutStdio,
allLogs = false
) {
const process = spawn(command, options);
if (allLogs) {
process.stdo... |
nepoche/webb.js | packages/api-providers/src/abstracts/mixer/mixer-deposit.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { WebbApiProvider } from '@nepoche/api-providers/abstracts/index.js';
import { EventBus } from '@nepoche/app-util/index.js';
import { Note } from './note';
export type DepositPayload<T extends Note = Note, DepositParams = unknown> = {
note: ... |
nepoche/webb.js | packages/sdk-core/src/__test__/note.spec.ts | <filename>packages/sdk-core/src/__test__/note.spec.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
import { expect } from 'chai';
import { Note, NoteGenInput } from '../note.js';
describe('Note class', () => {
it.only('should tes... |
nepoche/webb.js | packages/types/src/interfaces/pallets/definitions.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import pallets from '@nepoche/type-definitions/pallets';
import { Definitions } from '@polkadot/types/types';
export default pallets as Definitions;
|
nepoche/webb.js | packages/api-providers/src/contracts/wrappers/types.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export type ZKPTornPublicInputs = {
nullifierHash: string;
relayer: string;
recipient: string;
fee: number;
refund: number;
};
export type ZKPTornInputsWithoutMerkle = {
nullifierHash: string;
relayer: string;
recipient: string;
fee:... |
nepoche/webb.js | packages/api-providers/src/types/bridge-config.interface.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { WebbCurrencyId } from '../enums/index.js';
import { AnchorConfigEntry } from './anchor-config.interface.js';
export interface BridgeConfig {
asset: WebbCurrencyId;
anchors: AnchorConfigEntry[];
}
|
nepoche/webb.js | packages/api-providers/src/web3/EvmChainMixersInfo.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { AppConfig, evmChainStorageFactory, MixerSize, MixerStorage } from '@nepoche/api-providers/index.js';
import { EVMChainId, evmIdIntoInternalChainId } from '../chains/index.js';
import { Storage } from '../storage/index.js';
import { MixerConfi... |
nepoche/webb.js | packages/api-providers/__test__/utils/mock-config.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { ChainType, EVMChainId, InternalChainId, SubstrateChainId } from '@nepoche/api-providers/chains/index.js';
import { ZERO, zeroAddress } from '@nepoche/api-providers/contracts/index.js';
import { WebbCurrencyId } from '@nepoche/api-p... |
nepoche/webb.js | packages/api-providers/src/abstracts/currency/orml-currency.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { LoggerService } from '@nepoche/app-util/index.js';
import { WebbPolkadot } from '../../polkadot/index.js';
export type ORMLAsset = {
existentialDeposit: string;
locked: false;
name: string;
id: string;
};
const logger = ... |
nepoche/webb.js | packages/api-providers/src/web3/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './webb-provider.js';
export * from './anchor-deposit.js';
export * from './anchor-withdraw.js';
export * from './mixer-withdraw.js';
export * from './mixer-deposit.js';
export * from './wrap-unwrap.js';
|
nepoche/webb.js | packages/api-providers/src/chains/index.ts | <filename>packages/api-providers/src/chains/index.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './chain-id.enum.js';
export * from './chain-utils.js';
|
nepoche/webb.js | packages/api-providers/src/contracts/wrappers/webb-anchor.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable camelcase */
import { Log } from '@ethersproject/abstract-provider';
import { anchorDeploymentBlock, bridgeCurrencyBridgeStorageFactory, MixerStorage } from '@nepoche/api-providers/utils/index.js';
import { retryPromise } from '@nepo... |
nepoche/webb.js | packages/api-providers/src/abstracts/wrap-unwrap/index.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { BehaviorSubject, Observable, Subscription } from 'rxjs';
import { WebbCurrencyId } from '../../enums/index.js';
import { MixerSize } from '../mixer/index.js';
/**
*
* */
export type WrappingEvent = {
ready: nul... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/merkle/poseidon-hasher.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
// @ts-ignore
import { poseidon } from 'circomlibjs';
import { Hasher } from './merkle-tree.js';
const hashLeftRight = (left: bigint, right: bigint) => {
return poseidon([left, right]);
};
export class PoseidonHasher implements Hasher {
hash (le... |
nepoche/webb.js | packages/api-providers/src/abstracts/anchor/anchor-withdraw.ts | <filename>packages/api-providers/src/abstracts/anchor/anchor-withdraw.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { InternalChainId } from '@nepoche/api-providers/chains/chain-id.enum.js';
import { MixerWithdraw } from '../mixer/index.js';
import { WebbApiProvider } from '../webb-prov... |
nepoche/webb.js | packages/api-providers/src/contracts/wrappers/tornado-anchor.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { Log } from '@ethersproject/abstract-provider';
import { fetchTornadoCircuitData, fetchTornadoProvingKey, retryPromise } from '@nepoche/api-providers/index.js';
import { LoggerService } fr... |
nepoche/webb.js | packages/api-providers/src/polkadot/chain-query.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { ChainQuery } from '../abstracts/index.js';
import { WebbCurrencyId } from '../enums/index.js';
import { WebbPolkadot } from './webb-provider.js';
export class PolkadotChainQuery extends ChainQuery<WebbPolkadot> {
constructor (protected inne... |
nepoche/webb.js | packages/api-providers/src/utils/relayer-utils.ts | <reponame>nepoche/webb.js<filename>packages/api-providers/src/utils/relayer-utils.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { InternalChainId } from '../chains/index.js';
export function relayerSubstrateNameToChainId (name: string): InternalChainId {
switch (name) {
case 'loca... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/zkp-adapters.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { bufferToFixed, Deposit } from '../utils/index.js';
import { ZKPTornPublicInputs } from '../wrappers/index.js';
export type ZKPTornFromDepositInput = {
relayer?: string;
recipient: string;
refund?: number;
fee?: number;
};
export func... |
nepoche/webb.js | packages/types/src/interfaces/augment-api-query.d.ts | <gh_stars>0
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { DarkwebbStandaloneRuntimeElement, OrmlTokensAccountData, OrmlTokensBalanceLock, PalletAnchorAnchorMetadata, PalletAssetRegistryAssetDetails, PalletAssetRegistryAssetMetadata, PalletMixerMixerMetadata } fr... |
nepoche/webb.js | packages/api-providers/src/abstracts/currency/currency.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { ChainTypeId, InternalChainId } from '../../chains/index.js';
import { WebbCurrencyId } from '../../enums/index.js';
import { CurrencyConfig, CurrencyRole, CurrencyView } from '../../types/currency-config.interface.js';
import { App... |
nepoche/webb.js | packages/types/src/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { rpc as webbRpc, types as webbTypes, typesAlias as webbTypeAlias, typesBundle as webbTypesBundle } from '@nepoche/type-definitions/index.js';
import { DefinitionRpc, DefinitionRpcSub, OverrideBundleType, OverrideModuleType, RegistryTypes } fro... |
nepoche/webb.js | packages/api-providers/src/abstracts/chain-query/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
// The chain query class returns information from the selected provider
import { WebbCurrencyId } from '../../enums/index.js';
export abstract class ChainQuery<Provider> {
constructor (protected inner: Provider) {}
abstract tokenBalanceByCurrenc... |
nepoche/webb.js | packages/api-providers/src/ipfs/evm/tornados.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { getCachedFixtureURI, withLocalFixtures } from '@nepoche/api-providers/index.js';
export const fetchTornadoCircuitData = async () => {
const IPFSUrl = 'https://ipfs.io/ipfs/QmbX8PzkcU1SQwUis3zDWEKsn8Yjgy2vALNeghVM2u... |
nepoche/webb.js | packages/api/src/index.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import webbTypesPkg from '@nepoche/types/index.js';
import { ApiOptions } from '@polkadot/api/types';
const { rpc: webbRpc, types: webbTypes, typesAlias: webbTypesAlias, typesBundle: webbTypesBundle } = webbTypesPkg;
export... |
nepoche/webb.js | packages/api-providers/src/abstracts/relayer/webb-relayer.class.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { getAnchorAddressForBridge } from '@nepoche/api-providers/index.js';
import { LoggerService } from '@nepoche/app-util/index.js';
import { Observable, Subject } from 'rxjs';
import { filter } from 'rxjs/operators';
import { InternalChainId } fr... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/evm-note.ts | <filename>packages/api-providers/src/contracts/utils/evm-note.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
// @ts-ignore
import snarkjs from 'tornado-snarkjs';
import { WebbError, WebbErrorCodes } from '../../webb-error/index.js';
import { bufferToFixed } from './buffer-to-fixed.js';
import {... |
nepoche/webb.js | packages/api-providers/src/contracts/wrappers/webb-utils.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
// @ts-ignore
import * as snarkjs from 'snarkjs';
import { fetchKeyForEdges, fetchWasmForEdges } from '../../ipfs/evm/anchors.js';
import { AnchorWitnessInput } from './types.js';
type MaxEdges = 1 | 2 | 3 | 4 | 5;
export const zeroAddre... |
nepoche/webb.js | packages/api-providers/src/abstracts/relayer/types.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { InternalChainId } from '../../chains/index.js';
export type RelayedChainConfig = {
account: string;
beneficiary?: string;
contracts: Contract[];
};
export type Capabilities = {
hasIpService: boolean;
supportedChains: {
substrate... |
nepoche/webb.js | packages/api-providers/src/types/index.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './abstracts.js';
export * from './anchor-config.interface.js';
export * from './bridge-config.interface.js';
export * from './chain-config.interface.js';
export * from './currency-config.interface.js';
export * ... |
nepoche/webb.js | packages/api-providers/src/enums/webb-currency-id.enum.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
// Do NOT change the ordering of this enum and always add to the end. Otherwise notes may break.
export enum WebbCurrencyId {
/// Production edgeware token
EDG,
/// Test edgeware token
TEDG,
/// Ether token
ETH,
/// Harmony token
ONE,
... |
nepoche/webb.js | packages/api-providers/src/chains/chain-utils.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { WebbError, WebbErrorCodes } from '../webb-error/index.js';
import { ChainType, ChainTypeId, EVMChainId, InternalChainId, SubstrateChainId } from './chain-id.enum.js';
export const byteArrayToNum = (arr: number[]): number => {
let n = 0;
... |
nepoche/webb.js | packages/api-providers/src/web3/anchor-api.ts | <filename>packages/api-providers/src/web3/anchor-api.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { AnchorBase, BridgeConfig, Currency, CurrencyRole, CurrencyType } from '@nepoche/api-providers/index.js';
import { AnchorApi } from '../abstracts/index.js';
import { ChainTypeId, chainTyp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.