repo_name stringlengths 5 122 | path stringlengths 3 232 | text stringlengths 6 1.05M |
|---|---|---|
nepoche/webb.js | packages/api-providers/src/types/currency-config.interface.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { InternalChainId } from '../chains/index.js';
import { WebbCurrencyId } from '../enums/index.js';
import { ReactElement } from './abstracts.js';
// The CurrencyType distinguishes how to interact with a particular currency in terms of
// web3 a... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/bridge-utils.ts | <gh_stars>0
/* eslint-disable */
/* tslint:disable */
// TODO resole eslint issue and merge this to protocol solidity
//@ts-nocheck
import { PoseidonHasher3 } from './poseidon-hash3.js';
/**
* Copyright 2021 Webb Technologies
* SPDX-License-Identifier: GPL-3.0-or-later-only
*/
import { ethers } from 'ethers';
impo... |
nepoche/webb.js | packages/api-providers/src/abstracts/networks-storage.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { Storage } from '../storage/index.js';
export type NetworkStore = {
networksConfig: Record<
number,
| {
defaultAccount: string;
}
| undefined
>;
defaultNetwork?: number;
defaultWallet?: number;
};
export type NetworkStorage... |
nepoche/webb.js | packages/api-providers/src/ext-providers/polkadot/polkadot-provider.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { options } from '@nepoche/api/index.js';
import { ApiInitHandler } from '@nepoche/api-providers/index.js';
import { EventBus, LoggerService } from '@nepoche/app-util/index.js';... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './make-deposit.js';
export * from './bridge-utils.js';
export * from './buffer-to-fixed.js';
export * from './evm-note.js';
export * from './pedersen-hash.js';
export * from './poseidon-hash3.js';
export * from './zkp-adapters.js';
|
nepoche/webb.js | packages/api-providers/src/utils/storage-mock.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { AppConfig } from '@nepoche/api-providers/abstracts/index.js';
import { Storage } from '../storage/index.js';
import { getEVMChainName } from './chain-utils.js';
export type MixerStorage = Record<string, { lastQueriedBlock: number; leaves: st... |
nepoche/webb.js | packages/api-providers/src/contracts/wrappers/anchor-interface.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { Deposit } from '../utils/make-deposit.js';
export type AnchorInterface = {
createDeposit(): Deposit;
deposit(commitment: string): Promise<void>;
};
|
nepoche/webb.js | packages/api-providers/src/account/Accounts.adapter.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export abstract class Account<T = unknown> {
constructor (protected readonly _inner: T, public readonly address: string) {}
// TODO abstract create react element
abstract get avatar(): unknown;
abstract get name(): string;
protected get in... |
nepoche/webb.js | packages/api-providers/src/utils/chain-utils.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { AppConfig } from '@nepoche/api-providers/index.js';
import { ChainTypeId, chainTypeIdToInternalId, InternalChainId } from '../chains/index.js';
import { WebbError, WebbErrorCodes } from '../webb-error/index.js';
export const getEVMChainName ... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/make-deposit.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { JsNote as DepositNote } from '@nepoche/wasm-utils';
import crypto from 'crypto';
// @ts-ignore
import * as ff from 'ffjavascript';
// @ts-ignore
import tornSnarkjs from 'tornado-snarkjs';
import { PoseidonHasher } from './merkle/i... |
nepoche/webb.js | packages/api-providers/__test__/utils/init-polkadot-provider.ts | /* eslint-disable @typescript-eslint/ban-ts-comment */
// eslint-disable-next-line header/header
import { InternalChainId } from '@nepoche/api-providers/chains/index.js';
import { PolkadotProvider } from '@nepoche/api-providers/ext-providers/index.js';
import { Account, AccountsAdapter, NotificationPayload, PromiseOrT... |
nepoche/webb.js | packages/api-providers/src/chains/chain-utils.spec.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { expect } from 'chai';
import { ChainType, ChainTypeId } from './chain-id.enum.js';
import { byteArrayToNum, computeChainIdType, numToByteArray, parseChainIdType } from './chain-utils.js';
describe('test various conversion functions', () => {... |
nepoche/webb.js | packages/api-providers/src/utils/misc/index.ts | <filename>packages/api-providers/src/utils/misc/index.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './app-mode.js';
export * from './get-cached-fixtures-uri.js';
|
nepoche/webb.js | packages/app-util/src/fixed-18.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import BigNumber from 'bignumber.js';
import { Codec } from '@polkadot/types/types';
/**
* @constant
* @type {(0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8)}
* @description
* | Value | Property | Description |
* | 0 | ROUND_UP | Rounds away... |
nepoche/webb.js | packages/app-util/src/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './fixed-18.js';
export * from './logger/index.js';
export * from './shared/event-bus.class.js';
|
nepoche/webb.js | packages/api-providers/src/ext-providers/web3/web3-accounts.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { Eth } from 'web3-eth';
import { Account, AccountsAdapter, PromiseOrT } from '../../account/Accounts.adapter.js';
export class Web3Account extends Account<Eth> {
get avatar () {
return '';
}
get name (): string {
return '';
}... |
nepoche/webb.js | packages/types/src/interfaces/augment-api-tx.d.ts | <reponame>nepoche/webb.js<gh_stars>0
// Auto-generated via `yarn polkadot-types-from-chain`, do not edit
/* eslint-disable */
import type { DarkwebbStandaloneRuntimeElement, PalletAssetRegistryAssetType } from '@nepoche/types/interfaces/pallets';
import type { AccountId32, MultiAddress } from '@nepoche/types/interface... |
nepoche/webb.js | packages/app-util/src/logger/logger-service.class.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { LoggerEvent } from './logger-event.class.js';
import { Color } from './logs-colors.enum.js';
import { LogLevel } from './logs-level.enum.js';
type LoggersMaps = Record<string, LoggerService>;
type LoggerFn = (...mess... |
nepoche/webb.js | packages/api-providers/src/web3/anchor-deposit.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { getEVMChainNameFromInternal } from '@nepoche/api-providers/utils/index.js';
import { LoggerService } from '@nepoche/app-util/index.js';
// eslint-disable-next-line camelcase
import { ERC20__factory as ERC20Factory } from '@nepoche/contracts';
... |
nepoche/webb.js | packages/api-providers/src/webb-error/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './interactive-feedback.class.js';
export * from './webb-error.class.js';
|
nepoche/webb.js | examples/mixer.ts | <reponame>nepoche/webb.js<filename>examples/mixer.ts<gh_stars>0
import { ApiPromise } from '@polkadot/api';
import { WsProvider } from '@polkadot/rpc-provider';
import { options } from '@nepoche/api';
// import { Note } from '@nepoche/sdk-core';
// import { JsNote } from '@nepoche/wasm-utils/njs';
async function conne... |
nepoche/webb.js | packages/api-providers/src/chains/chain-id.enum.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
// must match u16 in rust
export enum ChainType {
EVM = 0x0100,
Substrate = 0x0200,
PolkadotRelayChain = 0x0301,
KusamaRelayChain = 0x0302,
PolkadotParachain = 0x0310,
KusamaParachain = 0x0311,
}
export interface ChainTypeId {
chainType:... |
nepoche/webb.js | packages/type-definitions/src/runtime.ts | <reponame>nepoche/webb.js<gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export default {
rpc: {},
types: {
ChainId: 'u32'
}
};
|
nepoche/webb.js | packages/types/src/interfaces/merkle/definitions.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import merkle from '@nepoche/type-definitions/merkle';
import { Definitions } from '@polkadot/types/types';
export default merkle as unknown as Definitions;
|
nepoche/webb.js | packages/app-util/src/logger/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './logger-event.class.js';
export * from './logger-service.class.js';
export * from './logs-level.enum.js';
|
nepoche/webb.js | packages/api-providers/src/types/wallet-config.interface.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { ReactElement } from './abstracts.js';
export interface WalletConfig {
id: number;
logo: ReactElement;
name: string;
title: string;
platform: string;
// the wallet isn't live yet
enabled: boolean;
/// a function that will tel... |
nepoche/webb.js | packages/api-providers/src/polkadot/mixer-withdraw.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
import { OptionalActiveRelayer, OptionalRelayer, RelayedWithdrawResult, WebbRelayer, WithdrawState } from '@nepoche/api-providers/index.js';
import { fetchSubstrate... |
nepoche/webb.js | packages/api-providers/src/polkadot/anchor-api.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { Currency } from '@nepoche/api-providers/index.js';
import { AnchorApi, AnchorBase } from '../abstracts/index.js';
import { ChainTypeId } from '../chains/index.js';
import { BridgeConfig } from '../types/bridge-config.interface.js';
import { C... |
nepoche/webb.js | packages/sdk-core/src/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './fixed-point-number.js';
export * from './proving/index.js';
export * from './note.js';
export * from './token.js';
|
nepoche/webb.js | packages/api-providers/src/utils/anchor-utils.ts | <filename>packages/api-providers/src/utils/anchor-utils.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { AppConfig } from '@nepoche/api-providers/index.js';
import { InternalChainId } from '../chains/index.js';
import { WebbCurrencyId } from '../enums/index.js';
export const getAnchorAd... |
nepoche/webb.js | packages/api-providers/src/web3/webb-provider.ts | <filename>packages/api-providers/src/web3/webb-provider.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { AppConfig, MixerSize, NotificationHandler, Web3AnchorDeposit, WebbApiProvider, WebbMethods, WebbProviderEvents, WebbRelayerBuilder } from '@nepoche/api-providers/index.js';
import { Ev... |
nepoche/webb.js | packages/api-providers/src/web3/chain-query.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { Currency } from '@nepoche/api-providers/index.js';
import { ERC20__factory as ERC20Factory } from '@nepoche/contracts';
import { ethers } from 'ethers';
import { ChainQuery } from '../abstracts/index.js';
import { evmIdIntoInternalChainId } f... |
nepoche/webb.js | packages/api-providers/src/webb-error/interactive-feedback.class.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { EventBus } from '@nepoche/app-util/index.js';
export type FeedbackLevel = 'error' | 'info' | 'warning' | 'success';
export type Action = {
/// indication for the Action level to show action controller in a meaning way
level: FeedbackLevel... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/witness-calculator.ts | /* eslint-disable */
// @ts-nocheck
// TODO resole eslint issue and merge this to protocol solidity
// @ts-ignore
module.exports = async function builder(code, options) {
options = options || {};
const wasmModule = await WebAssembly.compile(code);
let wc;
const instance = await WebAssembly.instantiate(wasmMo... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/pedersen-hash.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
// eslint-disable-next-line @typescript-eslint/no-var-requires
// @ts-ignore
import circomlib from 'tornado-circomlib';
export function pedersenHash (data: Uint8Array) {
return circomlib.babyJub.unpackPoint(circomlib.pedersenHash.hash(data))[0];
}
|
nepoche/webb.js | packages/sdk-core/src/fixed-point-number.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import BigNumber from 'bignumber.js';
/**
* @constant
* @type {(0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8)}
* @description
* | Value | Property | Description |
* | 0 | ROUND_UP | Rounds away from zero |
* | 1 | ROUND_DO... |
nepoche/webb.js | packages/api-providers/src/abstracts/webb-content-state.interface.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { Chain, Wallet } from './common.js';
import { WebbApiProvider } from './webb-provider.interface.js';
export interface WebbContextState<T = unknown> {
wallets: Record<number, Wallet>;
chains: Record<number, Chain>;
activeApi?: WebbApiProv... |
nepoche/webb.js | packages/api-providers/src/abstracts/common.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { AnchorConfigEntry } from '../types/anchor-config.interface.js';
import { BridgeConfig } from '../types/bridge-config.interface.js';
import { ChainConfig } from '../types/chain-config.interface.js';
import { CurrencyConfig } from '../types/curr... |
nepoche/webb.js | packages/api-providers/src/abstracts/mixer/index.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './note.js';
export * from './mixer-deposit.js';
export * from './mixer-withdraw.js';
|
nepoche/webb.js | packages/api-providers/src/web3/mixer-withdraw.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { parseUnits } from '@ethersproject/units';
import { chainIdToRelayerName, RelayedWithdrawResult, RelayerCMDBase, WebbRelayer } from '@nepoche/api-providers/index.js';
import { LoggerService } from '@nepoche/app-util/in... |
nepoche/webb.js | packages/api-providers/src/abstracts/mixer/note.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export interface Note {
serialize(): string;
// deserialize(noteStr: string): Note;
}
|
nepoche/webb.js | packages/api-providers/src/abstracts/currency/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './currency.js';
export * from './orml-currency.js';
|
nepoche/webb.js | packages/api-providers/src/abstracts/webb-provider.interface.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { AnchorApi } from '@nepoche/api-providers/index.js';
import { EventBus } from '@nepoche/app-util/index.js';
import { AccountsAdapter } from '../account/Accounts.adapter.js';
import { InteractiveFeedback } from '../webb-error/index.js';
import ... |
nepoche/webb.js | packages/api-providers/src/ipfs/evm/anchors.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { getCachedFixtureURI, withLocalFixtures } from '@nepoche/api-providers/index.js';
export const fetchWasmForEdges = async (maxEdges: number) => {
let ipfsHash: string;
let cachedURI: string;
switch (maxEdges) {
case 1:
ipfsHash... |
nepoche/webb.js | packages/api-providers/src/types/mixer-config.interface.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export interface TornMixerEntry {
size: number;
address: string;
symbol: string;
createdAtBlock: number;
}
export interface MixerConfig {
tornMixers: TornMixerEntry[];
}
|
nepoche/webb.js | tests/utils/substrate-utils.ts | <gh_stars>0
import { ApiPromise, WsProvider } from '@polkadot/api';
import { KeyringPair } from '@polkadot/keyring/types';
import {
AnchorMTBn254X5,
generate_proof_js,
JsNote,
JsNoteBuilder,
OperationError,
ProofInputBuilder,
} from '@nepoche/wasm-utils/njs/wasm-utils-njs.js';
import { hexToU8a, u8aToHex } ... |
nepoche/webb.js | packages/type-definitions/src/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { jsonrpcFromDefs, typesAliasFromDefs, typesFromDefs } from '@open-web3/orml-type-definitions/utils/index.js';
import versioned from './types-known/versioned.js';
import merkle from './merkle.js';
import mixer from './mixer.js';
import pallets ... |
nepoche/webb.js | packages/api-providers/src/ext-providers/web3/web3-provider.spec.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { expect } from 'chai';
import { Web3Provider } from './web3-provider.js';
describe('Initialize Web3', () => {
it('Is constructable from HTTP', async () => {
const web3Provider = Web3Provider.fromUri('https://rinkeby.infura.io/v3/e54b717... |
nepoche/webb.js | packages/api-providers/src/abstracts/mixer/mixer-withdraw.ts | <filename>packages/api-providers/src/abstracts/mixer/mixer-withdraw.ts<gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { WebbApiProvider } from '@nepoche/api-providers/index.js';
import { EventBus } from '@nepoche/app-util/index.js';
import { Note } from '@nepoche/sdk-core/index.js... |
nepoche/webb.js | packages/sdk-core/src/note.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/no-unused-vars */
/* eslint-disable @typescript-eslint/no-var-requires */
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-member-... |
nepoche/webb.js | packages/api-providers/src/polkadot/anchor-deposit.ts | <filename>packages/api-providers/src/polkadot/anchor-deposit.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { AnchorApi } from '@nepoche/api-providers/index.js';
import { LoggerService } from '@nepoche/app-util/index.js';
import { Note, NoteGenInput } from '@nepoche/sdk-core/index.js';
i... |
nepoche/webb.js | packages/api-providers/src/webb-error/webb-error.class.ts | <reponame>nepoche/webb.js<filename>packages/api-providers/src/webb-error/webb-error.class.ts<gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/// list of know error codes of the dApp
export enum WebbErrorCodes {
/// Unsupported chain is switch via the extension
UnsupportedChain,
/// ... |
nepoche/webb.js | packages/api-providers/src/ext-providers/web3/web3-provider.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/ban-ts-comment */
import WalletConnectProvider from '@walletconnect/web3-provider';
import { ProvideCapabilities } from '@nepoche/api-providers/index.js';
import { ethers } from 'ethers';
import Web3 from 'web3';
i... |
nepoche/webb.js | packages/sdk-core/src/proving/proving-manager-thread.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import type { JsProofInput, Leaves, Proof } from '@nepoche/wasm-utils';
import { ProofI } from '@nepoche/sdk-core/proving/proving-manager.js';
import { Note } from '../note.js';
export type ProvingManagerSetupInput = {
note: string;
relayer: str... |
nepoche/webb.js | packages/api-providers/src/storage/storage.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { EventBus } from '@nepoche/app-util/index.js';
export interface StorageHandler<T> {
inner: T;
fetch(key: string): Promise<T>;
commit(key: string, data: T): Promise<void>;
}
export class Storage<Store> extends EventBus<{
update: Stor... |
nepoche/webb.js | packages/api-providers/src/web3/wrap-unwrap.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { Bridge, Currency, MixerSize, WrapUnWrap } from '@nepoche/api-providers/abstracts/index.js';
import { Amount, WrappingBalance, WrappingEvent } from '@nepoche/api-providers/index.js';
import { ERC20__factory as ERC20Factory } from '@nepoche/cont... |
nepoche/webb.js | tests/integration_tests/substrate/mixerTests.spec.ts | <filename>tests/integration_tests/substrate/mixerTests.spec.ts
import { JsNote, OperationError } from '@nepoche/wasm-utils/njs/wasm-utils-njs.js';
import { ApiPromise } from '@polkadot/api';
import { Keyring } from '@polkadot/keyring';
import { KeyringPair } from '@polkadot/keyring/types';
import {
catchWasmError,
... |
nepoche/webb.js | packages/types/src/interfaces/augment-api.d.ts | <gh_stars>0
/* eslint-disable */
/// <reference path="./augment-api-consts.d.ts" />
/// <reference path="./augment-api-tx.d.ts" />
/// <reference path="./augment-api-query.d.ts" />
/// <reference path="./augment-types.d.ts" /> |
nepoche/webb.js | packages/type-definitions/src/mixer.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export default {
rpc: {},
types: {
Amount: 'i128',
AmountOf: 'Amount',
CurrencyId: 'u64',
CurrencyIdOf: 'CurrencyId',
ScalarData: '[u8; 32]'
},
typesAlias: {}
};
|
nepoche/webb.js | packages/api-providers/src/utils/fixtures.ts | <reponame>nepoche/webb.js<filename>packages/api-providers/src/utils/fixtures.ts
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export const fetchTornadoCircuitData = async () => {
const IPFSUrl = 'https://ipfs.io/ipfs/QmbX8PzkcU1SQwUis3zDWEKsn8Yjgy2vALNeghVM2uh31B';
const ipfsRequest = await fe... |
nepoche/webb.js | packages/api-providers/src/polkadot/transaction.ts | <gh_stars>0
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/ban-ts-comment */
import { NotificationHandler } from '@nepoche/api-providers/index.js';
import { EventBus, LoggerService } from '@nepoche/app-util/index.js';
import lodash from 'lodash';
import { ApiP... |
nepoche/webb.js | packages/api-providers/src/contracts/tornado/Tornado__factory.ts | <gh_stars>0
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import { Contract, Signer, utils } from 'ethers';
import { Provider } from '@ethersproject/providers';
import type { Tornado, TornadoInterface } from '../tornado';
const _abi = [
{
anonymous: false,
inputs:... |
nepoche/webb.js | packages/api-providers/src/contracts/utils/poseidon-hash3.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
// @ts-ignore
import circomlib from 'circomlibjs';
const hashLeftRight = (left: bigint, right: bigint) => {
return circomlib.poseidon([left, right]);
};
export function poseidonHash3 (inputs: any[]) {
if (inputs.length !== 3) {
throw new Erro... |
nepoche/webb.js | packages/api-providers/src/web3/anchor-withdraw.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
/* eslint-disable @typescript-eslint/no-non-null-asserted-optional-chain */
import { parseUnits } from '@ethersproject/units';
import { Bridge, OptionalActiveRelayer, OptionalRelayer, RelayedWithdrawResult, RelayerCMDBase, WebbRelayer, WithdrawState }... |
nepoche/webb.js | packages/api-providers/src/ipfs/substrate/anchor.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import { getCachedFixtureURI, withLocalFixtures } from '@nepoche/api-providers/index.js';
import { LoggerService } from '@nepoche/app-util/index.js';
const logger = LoggerService.get('IPFS');
export async function fetchSubst... |
nepoche/webb.js | packages/api-providers/src/abstracts/anchor/index.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export * from './anchor.js';
export * from './anchor-deposit.js';
export * from './anchor-withdraw.js';
export * from './anchor-api.js';
|
nepoche/webb.js | packages/types/src/interfaces/runtime/definitions.ts | <reponame>nepoche/webb.js
// Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
import runtime from '@nepoche/type-definitions/runtime';
import definitions from '@polkadot/types/interfaces/runtime/definitions';
import { Definitions } from '@polkadot/types/types';
export default {
rpc: {},
types: {
... |
nepoche/webb.js | packages/sdk-core/src/type.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export type KNOWN_MODULES = 'merkle' | 'mixer';
export type CHAIN = 'dev' | 'webb';
|
nepoche/webb.js | packages/api-providers/src/types/abstracts.ts | // Copyright 2022 @nepoche/
// SPDX-License-Identifier: Apache-2.0
export type ReactElement = any;
|
nepoche/webb.js | packages/api-providers/src/contracts/tornado/Tornado.d.ts | <filename>packages/api-providers/src/contracts/tornado/Tornado.d.ts
/* Autogenerated file. Do not edit manually. */
/* tslint:disable */
/* eslint-disable */
import {
ethers,
EventFilter,
Signer,
BigNumber,
BigNumberish,
PopulatedTransaction,
BaseContract,
ContractTransaction,
PayableOverrides,
Cal... |
KevinAiken/BluTracking | angular-frontend/src/app/log.service.ts | import { Injectable } from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http';
import {Observable, of} from 'rxjs';
import {catchError, tap} from 'rxjs/operators';
import {Log} from './log';
const httpOptions = {
headers: new HttpHeaders({ 'Content-Type': 'application/json'})
};
@Injectab... |
KevinAiken/BluTracking | angular-frontend/src/app/log.ts | export class Log {
logId: number;
deviceId: number;
time: string;
btAddr: string;
}
|
KevinAiken/BluTracking | angular-frontend/src/app/add-asset/add-asset.component.ts | <filename>angular-frontend/src/app/add-asset/add-asset.component.ts
import { Component, OnInit } from '@angular/core';
import {Asset} from '../asset';
import {AssetService} from '../asset.service';
import {ActivatedRoute} from '@angular/router';
@Component({
selector: 'app-add-asset',
templateUrl: './add-asset.com... |
KevinAiken/BluTracking | angular-frontend/src/app/asset-detail/asset-detail.component.ts | import {Component, Input, OnInit} from '@angular/core';
import {Log} from '../log';
import {Asset} from '../asset';
import {ActivatedRoute} from '@angular/router';
import {AssetService} from '../asset.service';
import {LogService} from '../log.service';
import { Location } from '@angular/common';
@Component({
select... |
KevinAiken/BluTracking | angular-frontend/src/app/asset.ts | export class Asset {
id: number;
btAddr: string;
name: string;
dateEnrolled: string;
missing: string;
}
|
KevinAiken/BluTracking | angular-frontend/src/app/assets/asset.component.ts | import { Component, OnInit } from '@angular/core';
import {AssetService} from '../asset.service';
import {Asset} from '../asset';
@Component({
selector: 'app-asset',
templateUrl: './asset.component.html',
styleUrls: ['./asset.component.css']
})
export class AssetsComponent implements OnInit {
assets: Asset[];
... |
KevinAiken/BluTracking | angular-frontend/src/app/app-routing.module.ts | <gh_stars>1-10
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
import { AssetsComponent } from './assets/asset.component';
import { LogsComponent } from './logs/logs.component';
import {AssetDetailComponent} from './asset-detail/asset-detail.component';
import { AddAss... |
KevinAiken/BluTracking | angular-frontend/src/app/asset.service.ts | <filename>angular-frontend/src/app/asset.service.ts
import { Injectable } from '@angular/core';
import {HttpClient, HttpHeaders} from '@angular/common/http';
import {Observable, of} from 'rxjs';
import {catchError, tap} from 'rxjs/operators';
import {Asset} from './asset';
const httpOptions = {
headers: new HttpHead... |
Logub/logub | frontend/models/dto/FieldSearchDto.ts | <reponame>Logub/logub<filename>frontend/models/dto/FieldSearchDto.ts
import {LogLevel} from "~/models/LogLevel";
export enum FieldTypeDto {
Tag,
FullText,
Geo,
Numeric
}
export interface FieldSearchDto {
type: FieldTypeDto;
name?: string;
values: string[];
negation: boolean;
}
|
Logub/logub | frontend/models/LogubLog.ts | import { SystemProperties } from '~/models/SystemProperties';
import { LogLevel } from '~/models/LogLevel';
export interface LogubLog {
id: string;
index: string;
timestamp: number;
level: LogLevel;
tags: SystemProperties;
businessProperties: { [key: string]: string };
service?: string;
message?: strin... |
Logub/logub | frontend/models/dto/SearchLogsDto.ts | <gh_stars>1-10
import { FieldSearchDto } from '~/models/dto/FieldSearchDto';
export interface SearchLogsDto {
texts?: Array<FieldSearchDto>;
businessProperties: Array<FieldSearchDto>;
systemProperties: Array<FieldSearchDto>;
basicProperties: Array<FieldSearchDto>;
levels: Array<FieldSearchDto>;
sort: SortL... |
Logub/logub | frontend/models/dto/SchemaFieldDto.ts | <reponame>Logub/logub<filename>frontend/models/dto/SchemaFieldDto.ts
import {FieldTypeDto} from "~/models/dto/FieldSearchDto";
export interface SchemaFieldDto {
type: FieldTypeDto;
name: string;
}
|
Logub/logub | frontend/store/demo.ts | import {Module, VuexAction, VuexModule, VuexMutation} from 'nuxt-property-decorator';
import {Api} from '~/utils/api';
@Module({
name: 'demo',
stateFactory: true,
namespaced: true,
})
export default class Demo extends VuexModule {
private _users: any[] = [];
get users(): string[] {
return this._users;
... |
Logub/logub | frontend/store/logs.ts | import { Module, VuexAction, VuexModule, VuexMutation } from 'nuxt-property-decorator';
import { LogubLog } from '~/models/LogubLog';
import { Api } from '~/utils/api';
import { Mapper } from '~/utils/mapper';
import { FieldSearchDto, FieldTypeDto } from '~/models/dto/FieldSearchDto';
import { sleep } from '~/utils/hel... |
Logub/logub | frontend/utils/store-accessor.ts | import { Store } from 'vuex';
import { getModule } from 'nuxt-property-decorator';
import Logs from '~/store/logs';
import { NuxtAxiosInstance } from '@nuxtjs/axios';
import Schema from "~/store/schema";
import Demo from "~/store/demo";
import Search from "~/store/search";
let logs: Logs;
let schema: Schema;
let demo:... |
Logub/logub | frontend/models/LogDateFilter.ts | import moment from 'moment';
export interface LogDateFilter {
beginAt: Function;
endAt: Function;
text: string;
}
export const defaultLogDateFilter: LogDateFilter = {
text: 'Last 15 minutes',
beginAt: () => moment().toDate(),
endAt: () => moment().subtract(15, "minutes").toDate()
};
|
Logub/logub | frontend/utils/api.ts | <reponame>Logub/logub
import {SearchLogsDto} from '~/models/dto/SearchLogsDto';
import {LogubLogDto} from '~/models/dto/LogubLogDto';
import {$axios} from '~/utils/store-accessor';
import {SchemaFieldDto} from "~/models/dto/SchemaFieldDto";
import {FieldTypeDto} from "~/models/dto/FieldSearchDto";
export class Api {
... |
Logub/logub | frontend/models/LogLevel.ts | <gh_stars>1-10
export enum LogLevel {
INFO = "INFO",
WARN = "WARN",
ERROR = "ERROR",
DEBUG = "DEBUG",
UNKNOWN = "UNKNOWN",
}
export function logLevelColor(logLevel: LogLevel): string {
switch (logLevel) {
case LogLevel.INFO:
return "#73BD15";
case LogLevel.WARN:
return "#E0A903";
ca... |
Logub/logub | frontend/utils/helpers.ts |
import {Moment} from "moment-timezone";
import moment from "moment-timezone";
export const sleep = async (ms: number): Promise<void> => new Promise(res => setTimeout(res, ms));
export function formatDate(dateNumber: number, detail: boolean = false): string {
const date: Moment = moment(dateNumber);
return date.fo... |
Logub/logub | frontend/models/dto/SystemPropertiesDto.ts | <reponame>Logub/logub
export interface SystemPropertiesDto {
imageName?: string;
container_name?: string;
env?: string;
host?: string;
}
|
Logub/logub | frontend/store/schema.ts | <reponame>Logub/logub<gh_stars>1-10
import { Module, VuexAction, VuexModule, VuexMutation } from 'nuxt-property-decorator';
import { basicProperties } from '~/models/LogubLog';
import { Api } from '~/utils/api';
@Module({
name: 'schema',
stateFactory: true,
namespaced: true,
})
export default class Schema extend... |
Logub/logub | frontend/vuetify.options.ts | <gh_stars>1-10
import colors from 'vuetify/es5/util/colors';
import { UserVuetifyPreset } from 'vuetify';
const vuetifyOptions: UserVuetifyPreset = {
theme: {
dark: false,
themes: {
light: {
primary: "#2a5f8c",
secondary: '#424242',
accent: '#82B1FF',
error: '#FF5252',
... |
Logub/logub | frontend/models/dto/LogubLogDto.ts | <filename>frontend/models/dto/LogubLogDto.ts
import { SystemPropertiesDto } from '~/models/dto/SystemPropertiesDto';
export interface LogubLogDto {
id: string;
index: string;
service?: string;
systemProperties: SystemPropertiesDto;
businessProperties: { [key: string]: string };
message?: string;
logger?:... |
Logub/logub | frontend/plugins/axios.ts | import { Context, Plugin } from '@nuxt/types';
import { initializeAxios } from '~/utils/store-accessor';
const accessorAxios: Plugin = (ctx: Context) => {
initializeAxios((ctx as any).$axios);
};
export default accessorAxios;
|
Logub/logub | frontend/store/search.ts | <gh_stars>1-10
import {Module, VuexAction, VuexModule, VuexMutation} from 'nuxt-property-decorator';
import {FieldSearchDto, FieldTypeDto} from '~/models/dto/FieldSearchDto';
@Module({
name: 'search',
stateFactory: true,
namespaced: true,
})
export default class Search extends VuexModule {
private _searchQuery... |
Logub/logub | frontend/utils/mapper.ts | <gh_stars>1-10
import { LogubLogDto } from '~/models/dto/LogubLogDto';
import { LogubLog } from '~/models/LogubLog';
import moment from 'moment';
import { LogLevel } from '~/models/LogLevel';
export class Mapper {
static toDomain(dto: LogubLogDto): LogubLog {
const { timestamp, level, systemProperties } = dto;
... |
Sitocp/mapbox-gl-legend | lib/index.ts | import { accessToken, baseApiUrl, IControl, Map as MapboxMap } from "mapbox-gl";
// @ts-ignore
import LegendSymbol from 'legend-symbol/src';
import axios from 'axios';
export type Options = {
showDefault: boolean;
showCheckbox: boolean;
reverseOrder: boolean;
onlyRendered: boolean;
}
/**
* Mapbox GL... |
im-coder-lg/comboserdocs | .codedoc/config.ts | <filename>.codedoc/config.ts
import { configuration } from '@codedoc/core';
import { theme } from './theme';
export const config = /*#__PURE__*/configuration({
theme, // --> add the theme. modify `./theme.ts` for changing the theme.
dest: {
namespace: '/docs', ... |
marvinody/stock-tracker | src/bot/index.ts | import logger from '../util/logger';
import {makeWebhook} from '../util/discord';
import {getExtractor} from '../extractors';
const webhook = makeWebhook(process.env.WEBHOOK_URL, process.env.USERNAME);
const randomNumber = (min: number, max: number) => {
const range = max - min;
return range * Math.random() + mi... |
marvinody/stock-tracker | src/extractors/Giftgift.ts | import logger from '../util/logger';
import {waitBetweenCalls} from '../util/minWait';
import {DiscordEmbed} from '../util/discord';
import {Extractor, Item} from './IExtractor';
import axios from 'axios';
import {promises} from 'fs';
import {parse, HTMLElement} from 'node-html-parser';
const DELAY_BETWEEN_LOOKUPS_IN_... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.