-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmain.js.map
1 lines (1 loc) · 157 KB
/
main.js.map
1
{"version":3,"sources":["webpack:///webpack/bootstrap","webpack:///./libs/interfaces/src/index.ts","webpack:///./libs/utils/src/index.ts","webpack:///external \"tslib\"","webpack:///./libs/errors/src/index.ts","webpack:///external \"near-api-js\"","webpack:///external \"typedjson\"","webpack:///./apps/bot/src/environments/environment.test.ts","webpack:///./apps/bot/src/Command.ts","webpack:///external \"buffer\"","webpack:///./apps/bot/src/config/config.ts","webpack:///./libs/global-contract/src/index.ts","webpack:///./libs/redirect-generator/src/index.ts","webpack:///external \"bn.js\"","webpack:///./libs/crypto/src/index.ts","webpack:///./apps/bot/src/commands/shared/messages.ts","webpack:///external \"discord.js\"","webpack:///./libs/near/src/lib/contract.ts","webpack:///./apps/bot/src/commands/shared/utils.ts","webpack:///external \"tweetnacl\"","webpack:///./libs/crypto/src/lib/hash.ts","webpack:///./libs/near/src/lib/convert.ts","webpack:///./libs/torus/src/common/constants.ts","webpack:///./libs/global-state/src/index.ts","webpack:///external \"typedi\"","webpack:///./libs/near/src/index.ts","webpack:///./libs/near/src/lib/rpc.ts","webpack:///./libs/utils/src/lib/bytes.ts","webpack:///./libs/near/src/lib/utils.ts","webpack:///./libs/crypto/src/lib/keys.ts","webpack:///./libs/crypto/src/lib/sign.ts","webpack:///./libs/utils/src/lib/types.ts","webpack:///./libs/near/src/lib/constants.ts","webpack:///external \"elliptic\"","webpack:///external \"reflect-metadata\"","webpack:///external \"bs58\"","webpack:///external \"near-api-js/lib/account_creator\"","webpack:///external \"near-api-js/lib/key_stores\"","webpack:///external \"axios\"","webpack:///./apps/bot/src/managers/ActionManager.ts","webpack:///external \"@toruslabs/torus.js\"","webpack:///./libs/interfaces/src/lib/configs.ts","webpack:///./libs/interfaces/src/lib/chains.ts","webpack:///./libs/interfaces/src/lib/chain-info.ts","webpack:///./libs/interfaces/src/lib/keysource.ts","webpack:///./libs/interfaces/src/lib/crypto.ts","webpack:///./libs/interfaces/src/lib/tx.ts","webpack:///./libs/crypto/src/lib/crypto.ts","webpack:///./libs/crypto/src/lib/index.ts","webpack:///./libs/errors/src/lib/errors.ts","webpack:///./libs/utils/src/lib/utils.ts","webpack:///./libs/utils/src/lib/chains.ts","webpack:///./libs/utils/src/lib/conversions.ts","webpack:///./libs/utils/src/lib/discord.ts","webpack:///./libs/utils/src/lib/user-verifier.ts","webpack:///./libs/utils/src/lib/serialize.ts","webpack:///./libs/crypto/src/lib/utils.ts","webpack:///./libs/global-contract/src/lib/global-contract.ts","webpack:///./libs/global-contract/src/lib/constants.ts","webpack:///./libs/near/src/lib/near.ts","webpack:///./libs/chain-info/src/lib/chain-info.ts","webpack:///./libs/redirect-generator/src/lib/redirect-generator.ts","webpack:///./libs/global-state/src/lib/singletons.ts","webpack:///./libs/torus/src/common/torus.ts","webpack:///external \"dotenv\"","webpack:///./apps/bot/src/Client.ts","webpack:///external \"js-sha3\"","webpack:///external \"js-sha256\"","webpack:///./libs/near/src/lib/tx.ts","webpack:///./libs/near/src/lib/accounts.ts","webpack:///external \"near-api-js/lib/utils\"","webpack:///./libs/chain-info/src/index.ts","webpack:///external \"thunky/promise\"","webpack:///./apps/bot/src/commands/index.ts","webpack:///./apps/bot/src/commands/Ping.ts","webpack:///./apps/bot/src/commands/Send.ts","webpack:///./libs/torus/src/common/index.ts","webpack:///external \"@toruslabs/fetch-node-details\"","webpack:///external \"node-fetch\"","webpack:///./apps/bot/src/commands/SendNFT.ts","webpack:///./apps/bot/src/commands/SetDefaultNFT.ts","webpack:///./apps/bot/src/commands/AddAdmins.ts","webpack:///./apps/bot/src/commands/RemoveAdmins.ts","webpack:///./apps/bot/src/commands/Help.ts","webpack:///./apps/bot/src/events/index.ts","webpack:///./apps/bot/src/events/Message.ts","webpack:///./apps/bot/src/events/Ready.ts","webpack:///./apps/bot/src/main.ts"],"names":[],"mappings":";QAAA;QACA;;QAEA;QACA;;QAEA;QACA;QACA;QACA;QACA;QACA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C/D,MAAM,MAAM,CAAC,KAAK,CAAC,6EAAW,CAAC,iBAAiB,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,gCAAgC,CAAC,CAAC;AAChD,CAAC;AAED,IAAI,EAAE,CAAC","file":"main.js","sourcesContent":[" \t// The module cache\n \tvar installedModules = {};\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 89);\n","export * from './lib/platforms';\nexport * from './lib/configs';\nexport * from './lib/chains';\nexport * from './lib/chain-info';\nexport * from './lib/keysource';\nexport * from './lib/crypto';\nexport * from './lib/frontend';\nexport * from './lib/tx';\n","export * from './lib/utils';\n","module.exports = require(\"tslib\");","export * from './lib/errors';\n","module.exports = require(\"near-api-js\");","module.exports = require(\"typedjson\");","import { Env } from '@baf-wallet/interfaces';\nimport * as dotenv from 'dotenv';\n\nif (!process.env.NON_LOCAL) dotenv.config({ path: './env/.env.test' });\n\nexport const environment = {\n production: false,\n DISCORD_BOT_TOKEN: process.env.DISCORD_BOT_TOKEN,\n BASE_WALLET_URL: process.env.BASE_WALLET_URL ?? 'https://localhost:4200',\n env: Env.TEST,\n};\n","import { Guild, Message, User } from 'discord.js';\nimport {\n AnyChannel,\n BotClient,\n CommandOptions,\n EmbedOrMessage,\n UserCooldown,\n} from './types';\n\nexport abstract class Command {\n public conf: CommandOptions;\n public cooldowns: Set<UserCooldown>;\n\n constructor(protected client: BotClient, options: CommandOptions) {\n this.conf = {\n name: options.name,\n description: options.description ?? 'No information specified.',\n usage: options.usage ?? 'No usage specified.',\n category: options.category ?? 'Information',\n cooldown: options.cooldown ?? 1000,\n requiredPermissions:\n options.requiredPermissions ?? (['READ_MESSAGES'] as any),\n };\n this.cooldowns = new Set();\n }\n\n /**\n * Checks if the user has permission to run the command.\n * @param {User} user A Discord user.\n * @param {Message} message The original message that was sent.\n * @returns {boolean} Whether the user can run the command.\n */\n public async canRun(user: User, message: Message): Promise<boolean> {\n const onCooldown =\n [...this.cooldowns].find(\n (cd) => cd.user === user && cd.guild === message.guild\n ) !== undefined;\n const hasPermission =\n message.member !== null\n ? message.member.hasPermission(this.conf.requiredPermissions, {\n checkAdmin: true,\n checkOwner: true,\n })\n : false;\n\n if (!hasPermission || onCooldown) {\n await message.channel.send(\n 'You do not have permission for this command or you are on cooldown.'\n );\n return false;\n }\n\n return true;\n }\n\n /**\n * Sets the cooldown on a command for a Discord user.\n * @param {User} user The user that will receive a cooldown.\n * @param {Guild} guild The Discord server where the original message was sent.\n */\n public setCooldown(user: User, guild: Guild): void {\n this.cooldowns.add({ user, guild });\n\n setTimeout(() => {\n const cooldown = [...this.cooldowns].filter(\n (cd) => cd.user === user && cd.guild === guild\n )[0];\n this.cooldowns.delete(cooldown);\n }, this.conf.cooldown);\n }\n\n /**\n * Sends the message in the specified channel.\n * @param {AnyChannel} channel Any Discord channel.\n * @param {EmbedOrMessage} message The message or embed that will be sent.\n * @returns {Promise<Command>} The original command, supports method chaining.\n */\n public async respond(\n channel: AnyChannel,\n message: EmbedOrMessage\n ): Promise<Command> {\n await channel.send(message);\n\n return this;\n }\n\n /**\n * default run method for every command - does nothing\n * @param {Message} message The original message object that triggered the command.\n * @param {string[]} args The arguments that got sent with the message.\n */\n public abstract run(message: Message, args: string[]): Promise<void>;\n}\n","module.exports = require(\"buffer\");","import { keyPairFromSk, skFromString } from '@baf-wallet/crypto';\nimport { GlobalContractConfig } from '@baf-wallet/global-contract';\nimport { ed25519, ed25519Marker, Encoding } from '@baf-wallet/interfaces';\nimport {\n getNearNetworkID,\n getNearSupportedContractTokens,\n NearInitParams,\n} from '@baf-wallet/near';\nimport { environment } from '../environments/environment';\nimport { BotSettings } from '../types';\n\nexport const settings: BotSettings = {\n presence: {\n activity: {\n name: 'Axie Infinity',\n type: 'PLAYING',\n },\n },\n prefix: '%',\n};\n\nexport const constants = {\n env: environment.env,\n chainParams: {\n near: {\n keyPair: keyPairFromSk<ed25519>(\n skFromString(process.env.NEAR_SK, ed25519Marker, Encoding.BS58)\n ),\n networkID: getNearNetworkID(environment.env),\n masterAccountID: process.env.NEAR_MASTER_ACCOUNT_ID,\n } as NearInitParams,\n },\n globalContractAddress: GlobalContractConfig.contractName,\n};\n","export * from './lib/global-contract';\nexport * from './lib/constants';\n","export * from './lib/redirect-generator';\n","module.exports = require(\"bn.js\");","export * from './lib/crypto';\n","export const noDefaultNFTContractMessage = `The default NFT contract has not been set for this guild. Please contact your Discord's admins to fix this up`;\nexport const userUninitMessage = (user: string) =>\n `❌ invalid user ❌: ${user} has not initialized their account with BAF Wallet`;\nexport const usersUninitMessage = (users: string[]) =>\n `❌ invalid user ❌: ${users.join(', ')} ${\n users.length === 1 ? 'has' : 'have'\n } not initialized their account${\n users.length > 1 ? 's' : ''\n } with BAF Wallet`;\n","module.exports = require(\"discord.js\");","import { ContractInterface } from '@baf-wallet/interfaces';\nimport BN from 'bn.js';\nimport { Account, Contract as NearNativeContract } from 'near-api-js';\nimport { NearAccountID } from './accounts';\n\nimport { NearState } from './near';\n\ninterface NearNFTToken {\n id: string;\n owner_id: string;\n}\n\nexport interface TokenMetadata {\n id: string;\n name: string;\n symbol: string;\n decimals: number;\n icon: string;\n}\n\n/**\n * The following are definitions for standard Near Contracts\n */\nexport interface NEP141Contract extends NearContract {\n // TODO: fill in, see https://github.com/bafnetwork/baf-wallet-v2/issues/69\n ft_balance_of: (args: { account_id: NearAccountID }) => Promise<string>;\n ft_total_supply: () => Promise<string>;\n storage_balance_of: (args: { account_id: NearAccountID }) => Promise<string>;\n // 1 Yocto Near is the standard accepted attached deposit for ft_transfer\n ft_transfer: (\n args: {\n receiver_id: NearAccountID;\n amount: string;\n memo?: string;\n },\n gas: string,\n attachedDeposit: string\n ) => Promise<void>;\n ft_metadata: () => Promise<TokenMetadata>;\n}\n\nexport interface NEP171Contract extends NearContract {\n nft_transfer: (\n args: {\n receiver_id: NearAccountID;\n token_id: string;\n approval_id: BN | null;\n memo?: string;\n },\n gas: string,\n attachedDeposit: string\n ) => Promise<void>;\n nft_transfer_call: (\n args: {\n receiver_id: NearAccountID;\n token_id: string;\n approval_id: BN | null;\n memo?: string;\n msg: string;\n },\n gas: string,\n attachedDeposit: string\n ) => Promise<void>;\n nft_token: (args: { token_id: string }) => Promise<NearNFTToken>;\n}\n\ntype contractViewMethod = (args: any) => Promise<any>;\ntype contractChangeMethod = (\n args: any,\n gas?: string,\n attachedDeposit?: string\n) => Promise<any>;\n\n/**\n * End definitions for standard Near Contracts\n */\nexport type NearContract = {\n [fn_name: string]: contractViewMethod | contractChangeMethod;\n};\n\nexport interface NearInitContractParams {\n callerAccount?: Account;\n viewMethods: string[];\n changeMethods: string[];\n}\n\nexport const initContract = (\n nearMasterAccount: Account,\n contractAccountID\n) => async <Contract>(params: NearInitContractParams) => {\n const contract = new NearNativeContract(\n params.callerAccount ?? nearMasterAccount,\n contractAccountID,\n {\n viewMethods: params.viewMethods,\n changeMethods: params.changeMethods,\n }\n );\n return (contract as unknown) as Contract;\n};\n\nexport function getContract<\n Contract,\n ContractInitParams extends NearInitContractParams\n>(\n nearState: NearState,\n contractAccountID: string\n): ContractInterface<Contract, ContractInitParams> {\n return {\n init: initContract(nearState.nearMasterAccount, contractAccountID),\n };\n}\n","import { getGlobalContract } from '@baf-wallet/global-contract';\nimport { tryGetTorusPublicAddress } from '@baf-wallet/torus';\nimport { User } from 'discord.js';\n\nexport async function getUninitUsers(users: User[]) {\n const associatedAccounts = await Promise.all(\n users.map(async (user) => {\n const userPk = await tryGetTorusPublicAddress(user.id, 'discord');\n if (!userPk) {\n return false;\n }\n const userId = await getGlobalContract().getAccountId(userPk);\n return userId;\n })\n );\n return {\n uninitUsers: users.filter((user, i) => !associatedAccounts[i]),\n associatedAccounts: associatedAccounts.filter(\n (account) => !!account\n ) as string[],\n };\n}\n","module.exports = require(\"tweetnacl\");","import * as sha3 from 'js-sha3';\nimport { sha256 as js_sha256 } from 'js-sha256';\n\nexport function keccak256(msg: Buffer): Buffer {\n return Buffer.from(sha3.keccak256(msg), 'hex');\n}\n\nexport function sha256(msg: Buffer): Buffer {\n return Buffer.from(js_sha256(msg), 'hex');\n}\n\n// add more wrappers here as needed\n","import {\n Converter,\n KeyPair,\n PublicKey,\n Encoding,\n} from '@baf-wallet/interfaces';\nimport { KeyPair as NearKeyPair, utils as NearUtils } from 'near-api-js';\nimport { bufferConverter, encodeBytes, formatBytes } from '@baf-wallet/utils';\nimport { Buffer } from 'buffer';\nimport { BafError } from '@baf-wallet/errors';\n\nexport const nearConverter: Converter<\n NearUtils.PublicKey,\n Buffer,\n NearKeyPair\n> = {\n ...bufferConverter,\n\n pkToUnified<Curve>(\n pk: NearUtils.PublicKey,\n curveMarker: Curve\n ): PublicKey<Curve> {\n if (curveMarker.toString() !== 'ed25519') {\n throw BafError.UnsupportedKeyCurve('ed25519');\n }\n const data = Buffer.from(pk.data);\n return {\n curve: curveMarker,\n data: data,\n format: (fmt: Encoding) => formatBytes(data, fmt),\n };\n },\n\n pkFromUnified: <Curve>(unifiedPk: PublicKey<Curve>): NearUtils.PublicKey =>\n NearUtils.PublicKey.fromString(unifiedPk.format(Encoding.BS58) as string),\n\n keyPairToUnified<Curve>(\n keyPair: NearKeyPair,\n curveMarker: Curve\n ): KeyPair<Curve> {\n const skFmt = keyPair.toString();\n if (!skFmt.startsWith(curveMarker.toString())) {\n throw BafError.UnsupportedKeyCurve('ed25519');\n }\n\n const skStr = skFmt.split(':')[1];\n const skData = encodeBytes(skStr, Encoding.BS58);\n const pkData = Buffer.from(keyPair.getPublicKey().data);\n\n return {\n curve: curveMarker,\n pk: {\n curve: curveMarker,\n data: pkData,\n format: (fmt: Encoding) => formatBytes(pkData, fmt),\n },\n sk: {\n curve: curveMarker,\n data: skData,\n format: (fmt: Encoding) => formatBytes(skData, fmt),\n },\n };\n },\n\n keyPairFromUnified<Curve>(unifiedKeyPair: KeyPair<Curve>): NearKeyPair {\n const prefix = unifiedKeyPair.curve.toString();\n const skStr = unifiedKeyPair.sk.format(Encoding.BS58);\n return NearKeyPair.fromString(`${prefix}:${skStr}`);\n },\n};\n","import { LOGIN_TYPE } from '@toruslabs/torus-direct-web-sdk';\n\ntype VerifierInfo = {\n [login_type in LOGIN_TYPE]?: {\n verifier: string;\n clientId: string;\n };\n};\n\nexport const torusConstants = {\n network: 'ropsten',\n proxyAddress: process.env.TORUS_PROXY_ADDRESS,\n verifierInfo: {\n discord: {\n verifier: process.env.TORUS_VERIFIER_NAME,\n clientId: process.env.DISCORD_CLIENT_ID,\n },\n } as VerifierInfo,\n};\n\nexport type TORUS_LOGIN_TYPE = LOGIN_TYPE;\n","export * from './lib/singletons';\n","module.exports = require(\"typedi\");","export * from './lib/near';\nexport * from './lib/utils';\nexport * from './lib/constants';\nexport * from './lib/rpc';\n","import { RpcInterface } from '@baf-wallet/interfaces';\nimport { transactions } from 'near-api-js';\nimport { NearNetworkID, stringToNetworkID } from './utils';\nimport { NearState } from './near';\nimport { network } from 'near-api-js/lib/utils';\n\nexport type NearRpcInterface = RpcInterface<\n transactions.Transaction,\n transactions.SignedTransaction,\n NearSendOpts,\n NearSendResult\n>;\n\n// TODO: go spelunking in near's jsonRpcProvider and see what options it takes\n// and see what kind of stuff it actually returns so we can do better than 'any'\n// eslint-disable-next-line\nexport interface NearSendOpts {}\n\nexport type NearSendResult = any;\n\n// * add more RPC methods as they are needed\n\nexport function nearRpc(_innerSdk: NearState): NearRpcInterface {\n return {\n endpoint: getRPCUrl,\n };\n}\n\nexport function getWalletUrl(network?: string): string {\n const networkID: NearNetworkID = stringToNetworkID(network ?? 'mainnet');\n return `https://wallet.${networkID}.near.org`;\n}\n\nexport function getRPCUrl(network?: string): string {\n const networkID: NearNetworkID = stringToNetworkID(network ?? 'mainnet');\n return `https://rpc.${networkID}.near.org`;\n}\n\nexport const getHelperUrl = (networkID: string) =>\n `https://helper.${networkID}.near.org`;\n\nexport const getExplorerUrl = (networkID: string) =>\n `https://explorer.${networkID}.near.org`;\n","import { Encoding, PublicKey, SecretKey } from '@baf-wallet/interfaces';\nimport { BafError } from '@baf-wallet/errors';\nimport * as bs58 from 'bs58';\n\nexport function formatBytes(\n buf: Buffer,\n fmt = Encoding.HEX\n): string | number[] {\n switch (fmt) {\n case Encoding.HEX:\n return Buffer.from(buf).toString('hex');\n case Encoding.BS58:\n return bs58.encode(Buffer.from(buf));\n case Encoding.ARRAY:\n return [...buf];\n default:\n throw BafError.UnsupportedEncoding(fmt);\n }\n}\n\nexport function encodeBytes(str: string, fmt: Encoding): Buffer {\n switch (fmt) {\n case Encoding.HEX:\n return Buffer.from(str, 'hex');\n case Encoding.BS58:\n return bs58.decode(str);\n case Encoding.UTF8:\n return Buffer.from(str, 'utf8');\n default:\n throw BafError.UnsupportedEncoding(fmt);\n }\n}\n","import { BafError } from '@baf-wallet/errors';\nimport { Env } from '@baf-wallet/interfaces';\nimport { utils } from 'near-api-js';\n\nexport enum NearNetworkID {\n DEVNET = 'testnet',\n TESTNET = 'testnet',\n MAINNET = 'mainnet',\n}\n\nexport function stringToNetworkID(str: string): NearNetworkID {\n switch (str) {\n case NearNetworkID.DEVNET:\n return NearNetworkID.DEVNET;\n case NearNetworkID.TESTNET:\n return NearNetworkID.TESTNET;\n case NearNetworkID.MAINNET:\n return NearNetworkID.MAINNET;\n default:\n throw BafError.UnknownNetworkIdent;\n }\n}\n\nexport function getNearNetworkID(env: Env): NearNetworkID {\n switch (env) {\n case Env.DEV:\n return NearNetworkID.DEVNET;\n case Env.TEST:\n return NearNetworkID.TESTNET;\n case Env.PROD:\n return NearNetworkID.MAINNET;\n default:\n return NearNetworkID.DEVNET;\n }\n}\n\nexport function nearToYoctoNear(amount: number): string {\n const amountYoctoNearBN = utils.format.NEAR_NOMINATION.muln(amount);\n return amountYoctoNearBN.toString(10);\n}\n","import { BafError } from '@baf-wallet/errors';\nimport {\n PublicKey,\n SecretKey,\n KeyPair,\n SECP256K1_STR,\n ED25519_STR,\n secp256k1,\n secp256k1Marker,\n} from '@baf-wallet/interfaces';\nimport { bufferConverter } from '@baf-wallet/utils';\nimport { ec as EC } from 'elliptic';\nimport * as nacl from 'tweetnacl';\n\nconst ellipticSecp256k1 = new EC('secp256k1');\n\nexport function pkSecpFromXY(x: string, y: string): PublicKey<secp256k1> {\n const key = ellipticSecp256k1.keyFromPublic({ x, y }, 'hex');\n return bufferConverter.pkToUnified(\n Buffer.from(key.getPublic('array')),\n secp256k1Marker\n );\n}\n\nexport function keyPairFromSk<Curve>(sk: SecretKey<Curve>): KeyPair<Curve> {\n const pk = pkFromSk(sk);\n return {\n curve: sk.curve,\n pk,\n sk,\n };\n}\n\nexport function pkFromSk<Curve>(sk: SecretKey<Curve>): PublicKey<Curve> {\n switch (sk.curve.toString()) {\n case SECP256K1_STR: {\n const data = Buffer.from(\n ellipticSecp256k1.keyFromPrivate(sk.data).getPublic(false, 'hex'),\n 'hex'\n );\n\n return bufferConverter.pkToUnified(data, sk.curve);\n }\n case ED25519_STR: {\n const data = Buffer.from(\n nacl.sign.keyPair.fromSecretKey(new Uint8Array(sk.data)).publicKey\n );\n\n return bufferConverter.pkToUnified(data, sk.curve);\n }\n default:\n throw BafError.UnsupportedKeyCurve(sk.curve.toString());\n }\n}\n\nexport function skFromSeed<Curve>(\n seed: Uint8Array,\n curveMarker: Curve\n): SecretKey<Curve> {\n switch (curveMarker.toString()) {\n case SECP256K1_STR: {\n const entropy = nacl.hash(seed);\n const ellipticSk = ellipticSecp256k1\n .genKeyPair({ entropy })\n .getPrivate('hex');\n\n const data = Buffer.from(ellipticSk, 'hex');\n return bufferConverter.skToUnified(data, curveMarker);\n }\n case ED25519_STR: {\n const data = Buffer.from(\n nacl.sign.keyPair.fromSeed(new Uint8Array(Buffer.from(seed))).secretKey\n );\n\n return bufferConverter.pkToUnified(data, curveMarker);\n }\n default:\n throw BafError.UnsupportedKeyCurve(curveMarker.toString());\n }\n}\n\nexport function skFromRng<Curve>(curveMarker: Curve): SecretKey<Curve> {\n switch (curveMarker.toString()) {\n case ED25519_STR: {\n const data = Buffer.from(nacl.sign.keyPair().secretKey);\n return bufferConverter.skToUnified(data, curveMarker);\n }\n case SECP256K1_STR: {\n const data = Buffer.from(\n ellipticSecp256k1.genKeyPair().getPrivate('hex'),\n 'hex'\n );\n return bufferConverter.pkToUnified(data, curveMarker);\n }\n default:\n throw BafError.UnsupportedKeyCurve(curveMarker.toString());\n }\n}\n","import {\n SecretKey,\n PublicKey,\n ED25519_STR,\n SECP256K1_STR,\n Encoding,\n} from '@baf-wallet/interfaces';\nimport { keccak256, sha256 } from './hash';\nimport { ec as EC } from 'elliptic';\nimport * as nacl from 'tweetnacl';\nimport { encodeBytes } from '@baf-wallet/utils';\nimport { BafError } from '@baf-wallet/errors';\n\nconst ellipticSecp256k1 = new EC('secp256k1');\n\nexport function verifySignature<Curve>(\n pk: PublicKey<Curve>,\n msg: Buffer | string,\n signedMsg: Buffer,\n hashFn: (buf: Buffer) => Buffer = keccak256\n): boolean {\n const msgFormat =\n typeof msg === 'string' ? encodeBytes(msg, Encoding.UTF8) : msg;\n switch (pk.curve.toString()) {\n case SECP256K1_STR: {\n const msgHash = hashFn(msgFormat);\n let validSig = ellipticSecp256k1.verify(msgHash, signedMsg, pk.data);\n return validSig;\n }\n case ED25519_STR: {\n const msgHash = hashFn(msgFormat);\n return nacl.sign.detached.verify(\n new Uint8Array(msgHash),\n new Uint8Array(signedMsg),\n new Uint8Array(pk.data)\n );\n }\n default:\n throw BafError.UnsupportedKeyCurve(pk.curve.toString());\n }\n}\n\nexport function signMsg<Curve>(\n sk: SecretKey<Curve>,\n msg: Buffer | string,\n GlobalContractFormat = false,\n hashFn: (buf: Buffer) => Buffer = keccak256\n): Buffer {\n const msgFormat =\n typeof msg === 'string' ? encodeBytes(msg, Encoding.UTF8) : msg;\n switch (sk.curve.toString()) {\n case SECP256K1_STR: {\n const msgHash = hashFn(msgFormat);\n const ellipticSig = ellipticSecp256k1.sign(msgHash, sk.data, 'hex', {\n canonical: true,\n });\n return GlobalContractFormat\n ? encodeSecpSigRustContract(ellipticSig)\n : Buffer.from(ellipticSig.toDER('hex'), 'hex');\n }\n case ED25519_STR: {\n const msgHash = hashFn(msgFormat);\n return Buffer.from(\n nacl.sign.detached(new Uint8Array(msgHash), new Uint8Array(sk.data))\n );\n }\n default:\n throw BafError.UnsupportedKeyCurve(sk.curve.toString());\n }\n}\n\nexport function encodeSecpSigRustContract(sig: EC.Signature): Buffer {\n return Buffer.from(\n `${sig.r.toString('hex', 64)}${sig.s.toString('hex', 64)}`,\n 'hex'\n );\n}\n","export type Pair<T, U> = {\n fst: T;\n snd: U;\n};\n\nexport const getEnumValues = (enumObj: any) =>\n Object.keys(enumObj).map((key) => enumObj[key]);\n\nexport const arrayToObject = (array: { key: string; val: any }[]): any => {\n return array.reduce((prev, v) => {\n prev[v.key] = v.val;\n return prev;\n }, {});\n};\n\nexport type ThenArg<T> = T extends PromiseLike<infer U> ? U : T;\n","import { Env, TokenInfo } from '@baf-wallet/interfaces';\nimport { Chain, ChainConstants } from '@baf-wallet/interfaces';\nimport { getTokenInfo } from '@baf-wallet/chain-info';\nimport thunky from 'thunky/promise';\nimport { arrayToObject } from '@baf-wallet/utils';\nimport { Account } from 'near-api-js';\nimport {\n getContract,\n initContract,\n NearInitContractParams,\n NEP141Contract,\n} from './contract';\nimport { NearState } from './near';\n\nconst bridgeContractsProd = [\n '6b175474e89094c44da98b954eedeac495271d0f.factory.bridge.near',\n 'dac17f958d2ee523a2206206994597c13d831ec7.factory.bridge.near',\n '1f9840a85d5af5bf1d1762f925bdaddc4201f984.factory.bridge.near',\n '514910771af9ca656af840dff83e8264ecf986ca.factory.bridge.near',\n 'a0b86991c6218b36c1d19d4a2e9eb0ce3606eb48.factory.bridge.near',\n '2260fac5e5542a773aa44fbcfedf7c193bc2c599.factory.bridge.near',\n '7fc66500c84a76ad7e9c93437bfc5ac33e2ddae9.factory.bridge.near',\n 'a0b73e1ff0b80914ab6fe0444e65848c4c34450b.factory.bridge.near',\n '50d1c9771902476076ecfc8b2a83ad6b9355a4c9.factory.bridge.near',\n '4fabb145d64652a948d72533023f6e7a623c7c53.factory.bridge.near',\n '6f259637dcd74c767781e37bc6133cd6a68aa161.factory.bridge.near',\n '6b3595068778dd592e39a122f4f5a5cf09c90fe2.factory.bridge.near',\n 'c011a73ee8576fb46f5e1c5751ca3b9fe0af2a6f.factory.bridge.near',\n 'c944e90c64b2c07662a292be6244bdf05cda44a7.factory.bridge.near',\n '9f8f72aa9304c8b593d555f12ef6589cc3a579a2.factory.bridge.near',\n '0bc529c00c6401aef6d220be8c6ea1667f6ad93e.factory.bridge.near',\n 'c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2.factory.bridge.near',\n '0316eb71485b0ab14103307bf65a021042c6d380.factory.bridge.near',\n '111111111117dc0aa78b770fa6a738034120c302.factory.bridge.near',\n];\n\nexport const getNearSupportedContractTokens = (networkId: string) => {\n switch (networkId) {\n case 'mainnet':\n return ['berryclub.ek.near', 'wrap.near', ...bridgeContractsProd];\n case 'testnet':\n default:\n return ['ft.levtester.testnet', 'wrap.testnet'];\n }\n};\n\nexport async function getChainConstants(\n nearState: NearState\n): Promise<ChainConstants> {\n const tokenContracts = getNearSupportedContractTokens(nearState.networkID);\n const ft_metadatas = await Promise.all(\n tokenContracts.map((contractID) =>\n getContract<NEP141Contract, NearInitContractParams>(nearState, contractID)\n .init({\n viewMethods: ['ft_metadata'],\n changeMethods: [],\n })\n .then((contract) => contract.ft_metadata())\n )\n );\n const tokensContractMapping = tokenContracts.map((tokenContract, i) => {\n return {\n key: tokenContract,\n val: async (): Promise<TokenInfo> => {\n return {\n ...ft_metadatas[i],\n contractAddress: tokenContract,\n chain: Chain.NEAR,\n type: 'COIN',\n };\n },\n };\n });\n const tokens = tokenContracts.map((tokenContract, i) => {\n return {\n key: ft_metadatas[i].symbol,\n val: async (): Promise<TokenInfo> => {\n return {\n ...ft_metadatas[i],\n contractAddress: tokenContract,\n chain: Chain.NEAR,\n type: 'COIN',\n };\n },\n };\n });\n return {\n nativeTokenInfo: thunky(() => getTokenInfo(Chain.NEAR)),\n tokens: {\n ...arrayToObject(tokens),\n ...arrayToObject(tokensContractMapping),\n },\n supportedContractTokenContracts: tokenContracts,\n };\n}\n","module.exports = require(\"elliptic\");","module.exports = require(\"reflect-metadata\");","module.exports = require(\"bs58\");","module.exports = require(\"near-api-js/lib/account_creator\");","module.exports = require(\"near-api-js/lib/key_stores\");","module.exports = require(\"axios\");","import { Collection } from 'discord.js';\nimport { Service } from 'typedi';\nimport { Command } from '../Command';\nimport commandClasses from '../commands';\nimport eventClasses from '../events';\nimport { BotClient } from '../types';\n\n@Service()\nexport class ActionManager {\n public commands: Collection<string, Command> = new Collection<\n string,\n Command\n >();\n\n /**\n * Parses files into commands from the configured command path.\n * @param {BotClient} client The original client, for access to the configuration.\n * @returns {Collection<string, Command>} A dictionary of every command in a [name, object] pair.\n */\n public initializeCommands(client: BotClient): void {\n commandClasses.forEach((C) => {\n const command = new C(client);\n console.log(command.conf.name);\n this.commands.set(command.conf.name, command);\n });\n }\n\n /**\n * Initializes every event from the configured event path.\n * @param {BotClient} client The original client, for access to the configuration.\n */\n public initializeEvents(client: BotClient): void {\n eventClasses.forEach((C) => {\n const event = new C(client);\n const eventName = event.name();\n console.log(eventName);\n client.on(eventName, (args?: any) => {\n console.log(`got a event of type ${eventName}!`);\n // eslint-disable-next-line\n event.run(args);\n });\n });\n }\n}\n","module.exports = require(\"@toruslabs/torus.js\");","export enum Env {\n DEV,\n TEST,\n PROD,\n}\n","import { PublicKey, SecretKey, KeyPair, secp256k1, ed25519 } from './crypto';\nimport { Pair } from '@baf-wallet/utils';\nimport { Account as NearAccount, Contract } from 'near-api-js';\nimport { GenericTxAction, GenericTxParams } from './tx';\nimport { Env } from './configs';\nimport { TokenInfo } from '..';\n\nexport enum Chain {\n NEAR = 'near',\n}\n\n// Or the type with all the supported chain account types\nexport type ChainAccount = NearAccount;\n\nexport type Balance = string;\n\nexport interface ChainBalance {\n chain: Chain;\n balance: Balance;\n}\n\nexport interface CommonInitParams {\n supportedContractTokens: string[];\n}\n\nexport type ExplorerLink = string;\n\n/**\n * It is encouraged to store mappings from both token symbols to token infos and from\n * token contract addresses to infos\n */\nexport interface ContractTokensConstant {\n [tokenSymbolOrAddress: string]: () => Promise<TokenInfo>;\n}\nexport interface ChainConstants {\n nativeTokenInfo: () => Promise<TokenInfo>;\n tokens: ContractTokensConstant;\n supportedContractTokenContracts: string[];\n}\n\nexport interface AccountsInterface<Account, LookupParams, CreateParams> {\n lookup: (params: LookupParams) => Promise<Account>;\n create: (params: CreateParams) => Promise<Account>;\n masterAccount: Account;\n getGenericMasterAccount: () => GenericAccount;\n associatedKeys: <T>(account: Account) => Promise<PublicKey<T>[]>;\n}\n\nexport type AccountContractTokenBalFn = (\n contractAddress: string\n) => Promise<Balance>;\n\nexport interface GenericAccount {\n getBalance: () => Promise<Balance>;\n getContractTokenBalance: AccountContractTokenBalFn;\n}\n\n// bare minimum interface representing direct RPC methods to the chain\n// chains are expected to extend this with their own functions and/or values\nexport interface RpcInterface<Tx, SignedTx, SendOpts, SendResult> {\n endpoint: (network?: string) => string;\n}\n\n// minimum interface representing all transaction-related operations\n// chains are expected to extend this with their own functions and/or values\nexport interface TxInterface<\n Tx,\n BuildTxParams,\n SignedTx,\n SignOpts,\n SendOpts,\n SendResult\n> {\n build: (params: BuildTxParams) => Promise<Tx>;\n sign: <Curve>(\n tx: Tx,\n keyPair: KeyPair<Curve>,\n opts?: SignOpts\n ) => Promise<SignedTx>;\n send: (\n tx: Tx | SignedTx,\n opts?: SendOpts\n ) => Promise<Pair<SendResult, ExplorerLink>>;\n buildParamsFromGenericTx: (\n params: GenericTxParams,\n senderPkEd: PublicKey<ed25519>,\n recipientPk?: PublicKey<secp256k1> | null\n ) => Promise<BuildTxParams>;\n extractGenericActionsFromTx: (params: BuildTxParams) => GenericTxAction[];\n}\n\nexport interface ContractInterface<Contract, ContractInitParams> {\n init: (params: ContractInitParams) => Promise<Contract>;\n}\n\n// utility for going to/from key BAF Wallet unified types\n// each instance expected to be specific to a particular sdk so that\n// we aren't ever locked into using BAF types and reimplementing wheelsA\n// chains are expected to extend this with their own functions and/or values\nexport interface Converter<PK, SK, KP> {\n skFromUnified: <Curve>(unifiedSk: SecretKey<Curve>) => SK;\n skToUnified: <Curve>(sk: SK, curveMarker: Curve) => PublicKey<Curve>;\n pkFromUnified: <Curve>(unifiedPk: PublicKey<Curve>) => PK;\n pkToUnified: <Curve>(pk: PK, curveMarker: Curve) => SecretKey<Curve>;\n keyPairFromUnified: <Curve>(unifiedKeyPair: KeyPair<Curve>) => KP;\n keyPairToUnified: <Curve>(\n unifiedKeyPair: KP,\n curveMaker: Curve\n ) => KeyPair<Curve>;\n // add more methods for converting shit as necessary\n}\n","import { jsonObject, jsonMember, jsonArrayMember } from 'typedjson';\nimport { Chain } from '..';\n@jsonObject\nexport class SocialMediaInfo {\n @jsonMember(String)\n public name: string; // platform\n @jsonMember(String)\n public url: string;\n @jsonMember(String)\n public handle: string;\n}\n\n// The structure associated with the token info's found on https://github.com/bafnetwork/assets\n@jsonObject\nexport class TokenInfoAssets {\n @jsonMember(String)\n public name: string;\n @jsonMember(String)\n public website?: string;\n @jsonMember(String)\n public source_code?: string;\n @jsonMember(String)\n public white_paper?: string;\n @jsonMember(String)\n public description?: string;\n @jsonArrayMember(SocialMediaInfo)\n public socials?: SocialMediaInfo[];\n @jsonMember(String)\n public explorer?: string;\n @jsonMember(String)\n public symbol: string;\n @jsonMember(String)\n public type: 'COIN' | 'NFT';\n @jsonMember(Number)\n public decimals: number;\n @jsonMember(String)\n public status?: 'active' | 'abandoned';\n @jsonArrayMember(String)\n public tags?: string[];\n}\n\nexport interface TokenInfo extends TokenInfoAssets {\n chain: Chain;\n contractAddress: string;\n}\n","import { SupportedCurve, KeyPair } from './crypto';\n\nexport enum KeySourceMethod {\n TORUS,\n LOCAL_STORAGE,\n // e.g. file, ledger, brain, etc, as they are implemented\n}\n\n// `KeyID` is a type that represents the type used to \"look up\" a key\n// in theory this could be the public key itself, but some source mechanisms\n// may offer different ways of doing so, for instance the key for use in localStorage.setItem\n// a file path, or a derived account number for a keypair stored on a ledger nano\nexport interface KeySource<KeyID> {\n method: KeySourceMethod;\n getKeyPair: <Curve>(\n keyID: KeyID,\n curveMarker: Curve\n ) => Promise<KeyPair<Curve> | null>;\n\n // these methods are for the off-chance that you don't know which curve a particular key-pair is on\n // to use this, you'd typically call this and then case on the returned value\n // for the vast majority of cases there will be only one curve used by a particular key source mechansim\n // so these method aren't required.\n // implementors are expected to implement either all of these methods or none of them.\n getKeyCurve?: (keyID: KeyID) => Promise<SupportedCurve>;\n getKeyPairUnknownCurve?: (keyID: KeyID) => Promise<KeyPair<SupportedCurve>>;\n}\n\n// then every keySource implementation should provide this function\nexport type KeySourceInitFn<KeyID, InitParams> = (\n params: InitParams\n) => Promise<KeySource<KeyID>>;\n\nexport type KeySourceInferKeyID<T> = T extends KeySource<infer KeyID>\n ? KeyID\n : never;\nexport type KeySourceInitFnInferInitParams<T> = T extends KeySourceInitFn<\n infer _,\n infer InitParams\n>\n ? InitParams\n : never;\n","import { Buffer } from 'buffer';\n\nexport type secp256k1 = {\n toString: () => 'secp256k1';\n};\n\nexport type ed25519 = {\n toString: () => 'ed25519';\n};\n\nexport const ED25519_STR = 'ed25519';\nexport const SECP256K1_STR = 'secp256k1';\n\nexport const secp256k1Marker: secp256k1 = { toString: () => SECP256K1_STR };\nexport const ed25519Marker: ed25519 = { toString: () => ED25519_STR };\n\nexport type SupportedCurve = secp256k1 | ed25519;\n\nexport enum Encoding {\n BS58,\n HEX,\n UTF8,\n ARRAY,\n}\n\nexport interface PublicKey<Curve> {\n data: Buffer;\n curve: Curve;\n format: (fmt: Encoding) => string | number[];\n}\n\nexport interface SecretKey<Curve> {\n data: Buffer;\n curve: Curve;\n format: (fmt: Encoding) => string | number[];\n}\n\nexport interface KeyPair<Curve> {\n curve: Curve;\n sk: SecretKey<Curve>;\n pk: PublicKey<Curve>;\n}\n/**\n * A hex encoded string for the signature where sig.s is concated with sig.r\n */\nexport type RustEncodedSecpSig = number[];\n","import { ed25519, PublicKey, secp256k1 } from './crypto';\nimport { PLATFORM } from './platforms';\n\nexport enum GenericTxSupportedActions {\n TRANSFER = 'transfer',\n TRANSFER_CONTRACT_TOKEN = 'transfer contract token',\n TRANSFER_NFT = 'transfer nft',\n CONTRACT_CALL = 'contract call',\n}\n\n/**\n * Either the recipientUserId or recipientAddress has to be provided\n */\nexport interface GenericTxParams {\n recipientAddress?: string;\n recipientUserId?: string;\n oauthProvider?: PLATFORM;\n actions: GenericTxAction[];\n}\n\ninterface GenericTxActionBase {\n type: GenericTxSupportedActions;\n}\n\nexport interface GenericTxActionTransfer extends GenericTxActionBase {\n type: GenericTxSupportedActions.TRANSFER;\n // Amount is the quantity of the minimal sendable unit for a currency\n amount: string;\n}\n\nexport interface GenericTxActionContractCall extends GenericTxActionBase {\n type: GenericTxSupportedActions.CONTRACT_CALL;\n functionName: string;\n functionArgs: any;\n // a number in string form\n gasFee?: string;\n // a number in string form\n deposit?: string;\n}\n\n// An NFT connotes an ERC721 NFT, NEP 4 NFT, etc\nexport interface GenericTxActionTransferNFT extends GenericTxActionBase {\n type: GenericTxSupportedActions.TRANSFER_NFT;\n // The token's id\n tokenId: string;\n // Contract Address or Account ID\n contractAddress: string;\n // Amount is the number of NFTs to send if the contract support semi-fungible NFTs,\n // the amount should default to 1\n amount?: string;\n // An optional string with which to associate a transfer. Some chains support this as a feature\n memo?: string;\n // An optional string which is used with approval management standards which some chains have\n // like Near\n approvalId?: string;\n}\n// A contract token connotes an ERC21 token, SPL token, NEP 141 token etc\nexport interface GenericTxActionTransferContractToken\n extends GenericTxActionBase {\n type: GenericTxSupportedActions.TRANSFER_CONTRACT_TOKEN;\n // Contract Address or Account ID\n contractAddress: string;\n // Amount is the quantity of the minimal sendable unit for a currency\n amount: string;\n // An optional string with which to associate a transfer. Some chains support this as a feature\n memo?: string;\n}\n\n// To be or'd with whatever other actions we use\nexport type GenericTxAction =\n | GenericTxActionTransfer\n | GenericTxActionTransferContractToken\n | GenericTxActionTransferNFT\n | GenericTxActionContractCall;\n\nexport enum SupportedTransferTypes {\n NativeToken = 'Native Token',\n ContractToken = 'Contract Token',\n}\n","export * from './hash';\nexport * from './index';\nexport * from './keys';\nexport * from './sign';\nexport * from './utils';\n","export * from './keys';\nexport * from './hash';\nexport * from './sign';\n","import {\n Chain,\n PublicKey,\n ed25519,\n secp256k1,\n Encoding,\n} from '@baf-wallet/interfaces';\n\nexport namespace BafError {\n export const UninitChain = (chain: Chain) =>\n emitError(`You must initialize your account on ${chain} first.`);\n export const InvalidSignature = (pk: PublicKey<ed25519 | secp256k1>) =>\n emitError(\n `An invalid signature has been provided for ${pk.format(Encoding.HEX)}`\n );\n export const Unimplemented = () => emitError('Unimplemented');\n export const InvalidTransactionApproveRedirect = () =>\n emitError(\n \"The transaction must be either in the url or passed in through the component's state\"\n );\n export const InvalidPackedKey = () =>\n emitError('The key in storage has an invalid format');\n export const UnsupportedKeyCurve = (supportedCurve: string) =>\n emitError(`Only ${supportedCurve} keys are supported`);\n export const BlockedByCors = () => emitError('Not allowed by CORS policy');\n export const UninitGlobalContract = () =>\n emitError(\n 'Global Contract is not initialized yet, please call setGlobalContract'\n );\n export const UnintCommunityContract = () =>\n emitError(\n 'Community Contract is not initialized yet, please call setCommunityContract'\n );\n export const UnsupportedToken = (tokenName: string) =>\n emitError(`Unsupported token ${tokenName}`);\n export const UnsupportedChain = (chainName: string) =>\n emitError(`Unsupported blockchain ${chainName}`);\n export const MissingInitBalance = (chain: Chain) =>\n emitError(\n `An initial balance must be specified when initializing an account on ${chain}`\n );\n export const MissingKeyPair = () => {\n emitError('A key path or key pair must be provided');\n };\n export const UnknownNetworkIdent = (identifier: string) =>\n emitError(`Unknown network identifier ${identifier}`);\n export const InvalidChainTokenListJSON = (err: any) =>\n emitError(\n `Received invalid tokenlist.json: ${err}. See \\`ChainInfo\\` in chain-info/src/lib/chain-info.ts for more information`\n );\n export const InvalidChainInfoJSON = (err: any) =>\n emitError(\n `Received invalid info.json: ${err}. See \\`ChainInfo\\` in chain-info/src/lib/chain-info.ts for more information`\n );\n export const UnsupportedEncoding = (fmt: any) =>\n emitError(`Encoding for format ${fmt} is unsupported`);\n export const GenericTxRequiresOauthInfo = () =>\n emitError(\n `The generic transaction requires the recipient user id, its readable form, and the oauth provider`\n );\n export const SecpPKNotAssociatedWithAccount = (chain: Chain) =>\n emitError(\n `The provided public key is not associated with an account on ${chain}`\n );\n export const NonuniformTxActionRecipients = (chain: Chain) =>\n emitError(`${chain} only supports one recipient for a set of Tx Actions`);\n export const MissingContractAddress = () =>\n emitError(`The contract address must be specified`);\n export const InvalidTokenContractAddress = (addr: string) =>\n emitError(`Address ${addr} does not exist or is not a token contract`);\n export const InvalidContractAddress = (addr: string) =>\n emitError(`Address ${addr} does not exist or is not a contract`);\n}\n\n// A wrapper function to emit an error, this would allow us to do things such as easier Sentry logging\nfunction emitError(errStr: string) {\n return new Error(errStr);\n}\n","export * from './bytes';\nexport * from './chains';\nexport * from './conversions';\nexport * from './discord';\nexport * from './types';\nexport * from './user-verifier';\nexport * from './serialize';\n","import { Chain } from '@baf-wallet/interfaces';\nimport { getEnumValues } from './types';\nimport { BafError } from '@baf-wallet/errors';\nimport BN from 'bn.js';\n\nexport const strToChain = (chain: string): Chain | null => {\n return getEnumValues(Chain).includes(chain.toLowerCase())\n ? (chain as Chain)\n : null;\n};\n\nexport function formatTokenAmountToIndivisibleUnit(\n amount: number,\n decimals: number\n): string {\n const expStr = `${1}${new Array(decimals).fill('0').join('')}`;\n const exp = new BN(expStr);\n console.log(exp.muln(amount), amount);\n return exp.muln(amount).toString(10);\n}\n","import {\n Converter,\n SecretKey,\n PublicKey,\n Encoding,\n KeyPair,\n} from '@baf-wallet/interfaces';\nimport { formatBytes } from './bytes';\nimport { Pair } from './types';\nimport { Buffer } from 'buffer';\n\nexport const bufferConverter: Converter<\n Buffer,\n Buffer,\n Pair<Buffer, Buffer>\n> = {\n skFromUnified,\n skToUnified,\n pkFromUnified,\n pkToUnified,\n keyPairFromUnified,\n keyPairToUnified,\n};\n\nfunction skFromUnified<Curve>(unifiedSk: SecretKey<Curve>): Buffer {\n return Buffer.from(unifiedSk.data);\n}\n\nfunction skToUnified<Curve>(sk: Buffer, curveMarker: Curve): SecretKey<Curve> {\n const data = Buffer.from(sk);\n return {\n data,\n curve: curveMarker,\n format: (fmt: Encoding) => formatBytes(data, fmt),\n };\n}\n\nfunction pkFromUnified<Curve>(bafPk: PublicKey<Curve>): Buffer {\n return Buffer.from(bafPk.data);\n}\n\nfunction pkToUnified<Curve>(pk: Buffer, curveMarker: Curve): PublicKey<Curve> {\n const data = Buffer.from(pk);\n return {\n data,\n curve: curveMarker,\n format: (fmt: Encoding) => formatBytes(data, fmt),\n };\n}\n\nfunction keyPairFromUnified<Curve>(\n unifiedKeyPair: KeyPair<Curve>\n): Pair<Buffer, Buffer> {\n const { pk, sk } = unifiedKeyPair;\n return {\n fst: Buffer.from(sk.data),\n snd: Buffer.from(pk.data),\n };\n}\n\nfunction keyPairToUnified<Curve>(\n keyPair: Pair<Buffer, Buffer>,\n curveMarker: Curve\n): KeyPair<Curve> {\n const skBytes = keyPair.fst;\n const pkBytes = keyPair.snd;\n return {\n curve: curveMarker,\n sk: skToUnified(skBytes, curveMarker),\n pk: pkToUnified(pkBytes, curveMarker),\n };\n}\n","/**\n *\n * @param recipient the snowflake ID recieved by the discord bot. Ex, <@86890631690977280>\n * @returns the snowflake ID, ex 86890631690977280\n */\nexport const parseDiscordRecipient = (recipient: string): string | null => {\n try {\n const recipientParsed = recipient.split('<@!')[1].split('>')[0];\n return recipientParsed;\n } catch (e) {\n return null;\n }\n};\n\nexport const createDiscordErrMsg = (err: any): string => {\n return `🚧 an error has occurred 🚧:\n \\n\\`${err}\\`\n \\nPlease create an issue at https://github.com/bafnetwork/baf-wallet-v2/issues and HODL tight until we fix it.`;\n};\n","export function createUserVerifyMessage(userId: string, nonce: string) {\n return `${userId}:${nonce}`;\n}\n","export const serializeData = (data: any) => JSON.stringify(data);\n// TODO: add type checking. See https://github.com/bafnetwork/baf-wallet-v2/issues/36\nexport const deserializeData = <T>(uriEncoded: string) =>\n JSON.parse(uriEncoded) as T;\n","import { Encoding, PublicKey, SecretKey } from '@baf-wallet/interfaces';\nimport { encodeBytes, formatBytes } from '@baf-wallet/utils';\n\nexport function pkToString<Curve>(\n key: PublicKey<Curve>,\n keyFormat = Encoding.HEX\n): string {\n return formatBytes(key.data, keyFormat) as string;\n}\n\nexport function pkFromString<Curve>(\n key: string,\n curve: Curve,\n keyFormat = Encoding.HEX\n): PublicKey<Curve> {\n const data = encodeBytes(key, keyFormat);\n return {\n data,\n curve,\n format: (fmt: Encoding) => formatBytes(data, fmt),\n };\n}\n\nexport function skFromString<Curve>(\n key: string,\n curve: Curve,\n keyFormat = Encoding.HEX\n): SecretKey<Curve> {\n const data = encodeBytes(key, keyFormat);\n return {\n data,\n curve,\n format: (fmt: Encoding) => formatBytes(data, fmt),\n };\n}\n","import { Account, Contract } from 'near-api-js';\nimport { BafError } from '@baf-wallet/errors';\nimport ContractConfig from '../../config.json';\nimport {\n Encoding,\n PublicKey,\n RustEncodedSecpSig,\n secp256k1,\n} from '@baf-wallet/interfaces';\nimport { NearAccountID } from '@baf-wallet/near';\nimport { initContract, NearContract } from 'libs/near/src/lib/contract';\n\nexport const GlobalContractConfig = { ...ContractConfig };\n\ninterface GlobalContract extends NearContract {\n getAccountId: (pk: PublicKey<secp256k1>) => Promise<string>;\n get_account_info: (args: {\n secp_pk: number[];\n }) => Promise<{\n user_name: string;\n account_id: string;\n }>;\n get_account_nonce: (args: { secp_pk: number[] }) => Promise<string>;\n set_account_info: (args: {\n secp_pk: number[];\n user_name: string;\n secp_sig_s: RustEncodedSecpSig;\n new_account_id: NearAccountID;\n }) => Promise<void>;\n delete_account_info: (args: {\n secp_pk: number[];\n user_name: string;\n secp_sig_s: RustEncodedSecpSig;\n }) => Promise<void>;\n get_community_contract: (args: { server: string }) => Promise<string>;\n get_community_default_nft_contract: (args: {\n server: string;\n }) => Promise<string>;\n set_community_default_nft_contract: (args: {\n server: string;\n nft_contract: string;\n }) => Promise<void>;\n}\n\nlet globalContract: GlobalContract;\n\nexport async function setGlobalContract(\n account: Account\n): Promise<GlobalContract> {\n globalContract = await buildGlobalContract(account);\n return globalContract;\n}\n\nexport function getGlobalContract(): GlobalContract {\n if (globalContract) return globalContract;\n throw BafError.UninitGlobalContract();\n}\n\nasync function buildGlobalContract(account: Account): Promise<GlobalContract> {\n const contract = await initContract(\n account,\n ContractConfig.contractName\n )<GlobalContract>({\n viewMethods: [\n 'get_account_info',\n 'get_account_nonce',\n 'get_community_contract',\n 'get_community_default_nft_contract',\n ],\n changeMethods: [\n 'set_account_info',\n 'delete_account_info',\n 'set_community_default_nft_contract',\n ],\n });\n return {\n ...contract,\n getAccountId: async (pk) =>\n (\n await contract.get_account_info({\n secp_pk: pk.format(Encoding.ARRAY) as number[],\n })\n )?.account_id,\n };\n}\n","export const globalContractConstants = {\n // :)\n beneficiaryId: 'lev.near',\n};\n","import { ed25519, Encoding, KeyPair } from '@baf-wallet/interfaces';\nimport {\n Account,\n connect,\n ConnectConfig,\n KeyPair as NearKeyPair,\n Near,\n providers,\n transactions,\n utils as NearUtils,\n} from 'near-api-js';\n\nimport { NearBuildTxParams, NearSignTxOpts, nearTx } from './tx';\nimport {\n initContract,\n NearInitContractParams,\n NEP141Contract,\n} from './contract';\nimport {\n getHelperUrl,\n getRPCUrl,\n nearRpc,\n NearSendOpts,\n NearSendResult,\n} from './rpc';\nimport {\n NearAccountID,\n nearAccounts,\n NearCreateAccountParams,\n} from './accounts';\nimport { nearConverter } from './convert';\nimport { NearNetworkID } from './utils';\nimport { InMemoryKeyStore } from 'near-api-js/lib/key_stores';\nimport { KeyPairEd25519 as NearKeyPairEd25519 } from 'near-api-js/lib/utils';\nimport { BafError } from '@baf-wallet/errors';\nimport { getContract } from './contract';\nimport { getChainConstants } from './constants';\nimport { ThenArg } from '@baf-wallet/utils';\n\nexport type { NearAccountID, NearCreateAccountParams } from './accounts';\nexport type {\n NearTransaction,\n NearBuildTxParams,\n NearAction,\n NearSupportedActionTypes,\n} from './tx';\nexport interface NearState {\n near: Near;\n rpcProvider: providers.JsonRpcProvider;\n networkID: NearNetworkID;\n nearMasterAccount: Account;\n getFungibleTokenContract: (contractName: string) => Promise<NEP141Contract>;\n}\n\nexport interface NearInitParams {\n networkID: NearNetworkID;\n masterAccountID: NearAccountID;\n keyPath?: string;\n keyPair?: KeyPair<ed25519>;\n}\n\nexport const getNearChainInterface = async (params: NearInitParams) => {\n const state = await init(params);\n return {\n accounts: nearAccounts(state),\n tx: nearTx(state),\n convert: nearConverter,\n rpc: nearRpc,\n getContract,\n constants: await getChainConstants(state),\n };\n};\nexport type NearChainInterface = ThenArg<\n ReturnType<typeof getNearChainInterface>\n>;\n\nasync function init({\n networkID,\n masterAccountID,\n keyPath,\n keyPair,\n}: NearInitParams): Promise<NearState> {\n const nodeUrl = getRPCUrl(networkID);\n const connectConfig = {\n networkId: networkID,\n nodeUrl,\n helperUrl: getHelperUrl(networkID),\n masterAccount: masterAccountID,\n keyPath,\n } as ConnectConfig;\n if (keyPair) {\n const keyStore = new InMemoryKeyStore();\n const nearKp = new NearKeyPairEd25519(\n keyPair.sk.format(Encoding.BS58) as string\n );\n keyStore.setKey(networkID, masterAccountID, nearKp);\n connectConfig.deps = {\n keyStore: keyStore,\n };\n connectConfig.keyStore = keyStore;\n } else if (keyPath) {\n const keyStore = new InMemoryKeyStore();\n connectConfig.deps = {\n keyStore: keyStore,\n };\n } else {\n throw BafError.MissingKeyPair();\n }\n\n const near = await connect(connectConfig);\n\n const nearMasterAccount = await near.account(masterAccountID);\n return {\n near,\n networkID,\n rpcProvider: new providers.JsonRpcProvider(nodeUrl),\n nearMasterAccount,\n getFungibleTokenContract: (contractAccountID: string) =>\n initContract(\n nearMasterAccount,\n contractAccountID\n )({\n viewMethods: ['ft_balance_of', 'ft_total_supply', 'storage_balance_of'],\n changeMethods: ['ft_transfer'],\n }),\n };\n}\n","import axios from 'axios';\nimport { BafError } from '@baf-wallet/errors';\nimport 'reflect-metadata';\nimport { jsonObject, jsonMember, TypedJSON, jsonArrayMember } from 'typedjson';\nimport {\n Chain,\n ContractTokensConstant,\n TokenInfo,\n TokenInfoAssets,\n} from '@baf-wallet/interfaces';\n\nconst baseRawUrl = 'https://raw.githubusercontent.com/bafnetwork/assets/master';\nconst contentsApiUrl =\n 'https://api.github.com/repos/bafnetwork/assets/contents';\n\n// typed JSON objects for parsing info.json's from trustwallet's assets repo\n// e.g. https://github.com/trustwallet/assets/blob/master/blockchains/bitcoin/info/info.json\n\n// TODO: have some intelligent way to get the rest\nexport type DappUrl =\n | '0x.org'\n | '1inch.exchange'\n | 'aave.com'\n | 'aavegotchi.com'\n | 'app.aave.com'\n | 'app.compound.finance'\n | 'app.ens.domains'\n | 'app.paraswap.io'\n | 'app.pooltogether.com'\n | 'app.uniswap.org'\n | 'axieinfinity.com'\n | 'balancer.finance'\n | 'bank.spankchain.com'\n | 'cdp.makerdao'\n | 'compound.finance'\n | 'curve.fi'\n | 'dydx.exhange'\n | 'ens.domains'\n | 'info.uniswap.org'\n | 'instadapp.io'\n | 'kyber.network'\n | 'kyber.org'\n | 'market.decentraland.org'\n | 'marketplace.axieinfinity.com'\n | 'opensea.io'\n | 'pooltogether.com'\n | 'pooltogether.us'\n | 'rarible.com'\n | 'snark.art'\n | 'uniswap.io'\n | 'uniswap.exchange'\n | 'yearn.finance';\n\nexport const getChainFolderPrefix = (chain: Chain): string =>\n `${baseRawUrl}/blockchains/${chain}`;\n\nconst getNonNativeTokenInfoUrl = (\n chain: Chain,\n contractAddress: string\n): string =>\n `${getChainFolderPrefix(chain)}/assets/${contractAddress}/info.json`;\n\nconst getChainInfoUrl = (chain: Chain): string =>\n `${getChainFolderPrefix(chain)}/info/info.json`;\n\nconst getNonNativeTokenLogoUrl = (\n chain: Chain,\n contractAddress: string\n): string =>\n `${getChainFolderPrefix(chain)}/assets/${contractAddress}/logo.png`;\n\nconst getChainLogoUrl = (chain: Chain): string =>\n `${getChainFolderPrefix(chain)}/info/logo.png`;\n\nexport const getTokenLogoUrl = (chain: Chain, contractAddress?: string) =>\n chain === contractAddress || !contractAddress\n ? getChainLogoUrl(chain)\n : getNonNativeTokenLogoUrl(chain, contractAddress);\n\nexport const getDappLogoUrl = (dappUrl: DappUrl): string =>\n `${baseRawUrl}/dapps/${dappUrl}.png`;\n\nexport async function getContractAddresses(\n chain: Chain,\n filterFn?: (contractInfoJSON: any) => boolean\n): Promise<string[]> {\n const url = `${contentsApiUrl}/blockchains/${chain}/assets`;\n try {\n const res = await axios.get(url);\n const { data } = res;\n\n if (filterFn) {\n return data.filter(filterFn).map((infoJSON) => infoJSON.name);\n }\n\n return data.map((infoJSON) => infoJSON.name);\n } catch (err) {\n console.error(`could not fetch addresses: ${err}`);\n return null;\n }\n}\n\nexport async function getTokenInfo(\n chain: Chain,\n contractAddress?: string\n): Promise<TokenInfo> {\n const tokenIsChain = chain === contractAddress || !contractAddress;\n const url = tokenIsChain\n ? getChainInfoUrl(chain)\n : getNonNativeTokenInfoUrl(chain, contractAddress);\n try {\n const res = await axios.get(url);\n const { data } = res;\n\n // remove binance shill link\n if (data.research !== undefined) {\n delete data.research;\n }\n\n const serializer = new TypedJSON(TokenInfoAssets);\n const _tokInfo = serializer.parse(data);\n return {\n ..._tokInfo,\n contractAddress,\n chain,\n };\n } catch (err) {\n if (err.isAxiosError) {\n console.error(\n `Chain not found: only chains in ${baseRawUrl} are supported.`\n );\n return null;\n }\n throw BafError.InvalidChainInfoJSON(err);\n }\n}\n\nexport async function getContractTokenInfoFromSymbol(\n symbol: string,\n contractTokens: ContractTokensConstant\n): Promise<{ tokenInfo: TokenInfo; contract: string } | null> {\n const contracts = Object.keys(contractTokens);\n const tokenProms = contracts.map((contract) => contractTokens[contract]());\n const tokenInfos = await Promise.all(tokenProms);\n const ind = tokenInfos.map((tokenInfo) => tokenInfo.symbol).indexOf(symbol);\n if (ind === -1) return null;\n return { tokenInfo: tokenInfos[ind], contract: contracts[ind] };\n}\n","import { Chain, GenericTxParams } from '@baf-wallet/interfaces';\nimport { deserializeData, serializeData } from '@baf-wallet/utils';\n\n// TODO: interface check\nexport const deserializeTxParams = (paramsEncoded: string): GenericTxParams => {\n return deserializeData(decodeURIComponent(paramsEncoded)) as GenericTxParams;\n};\n\nexport const createApproveRedirectURL = (\n chain: Chain,\n baseURL: string,\n opts: GenericTxParams\n) => {\n return encodeURI(\n `${baseURL}/#/approve-redirect/${chain.toString()}/${encodeURIComponent(\n serializeData(opts)\n )}`\n );\n};\n","/**\n * singletons provides methods to initialize and get the wrapped chain interfaces\n */\nimport { Chain, Env } from '@baf-wallet/interfaces';\nimport { BafError } from '@baf-wallet/errors';\nimport {\n NearChainInterface,\n NearInitParams,\n getNearChainInterface,\n} from '@baf-wallet/near';\n\nlet nearChain: NearChainInterface;\nlet init = false;\n\nexport async function initNearChain(params: NearInitParams, env: Env) {\n nearChain = await getNearChainInterface(params);\n init = true;\n}\n\nexport function getNearChain(): NearChainInterface {\n if (!init) throw BafError.UninitChain(Chain.NEAR);\n return nearChain;\n}\n","import { Encoding, PublicKey, secp256k1 } from '@baf-wallet/interfaces';\nimport Torus from '@toruslabs/torus.js';\nimport NodeDetailsManager from '@toruslabs/fetch-node-details';\nimport * as fetch from 'node-fetch';\nimport { torusConstants, TORUS_LOGIN_TYPE } from './constants';\nimport { pkSecpFromXY } from '@baf-wallet/crypto';\n\nconst torus = new Torus({\n metadataHost: 'https://metadata.tor.us',\n allowHost: 'https://signer.tor.us/api/allow',\n});\nTorus.setAPIKey('torus-default');\n\nexport async function tryGetTorusPublicAddress(\n userId: string,\n loginType: TORUS_LOGIN_TYPE\n): Promise<PublicKey<secp256k1> | null> {\n try {\n return getTorusPublicAddress(userId, loginType);\n } catch (e) {\n return null;\n }\n}\n\nexport async function getTorusPublicAddress(\n userId: string,\n loginType: TORUS_LOGIN_TYPE\n): Promise<PublicKey<secp256k1>> {\n assertLoginTypeRegistered(loginType);\n // Configuration from https://github.com/torusresearch/torus-direct-web-sdk/blob/master/src/login.ts\n const nodeManager = new NodeDetailsManager({\n network: torusConstants.network as any,\n proxyAddress: torusConstants.proxyAddress,\n });\n\n const {\n torusNodeEndpoints,\n torusNodePub,\n torusIndexes,\n } = await nodeManager.getNodeDetails();\n\n (global as any).fetch = fetch;\n const torusPublicKey = await torus.getPublicAddress(\n torusNodeEndpoints,\n torusNodePub,\n {\n verifier: torusConstants.verifierInfo[loginType].verifier,\n verifierId: userId,\n },\n true\n );\n\n return pkSecpFromXY((torusPublicKey as any).X, (torusPublicKey as any).Y);\n}\n\nexport function assertLoginTypeRegistered(\n loginType: TORUS_LOGIN_TYPE\n): boolean {\n if (!torusConstants.verifierInfo[loginType])\n throw `No verifier info exits for login type ${loginType}`;\n return true;\n}\n","module.exports = require(\"dotenv\");","import { Client as DiscordClient, Collection } from 'discord.js';\nimport { connect } from 'near-api-js';\nimport { InMemoryKeyStore } from 'near-api-js/lib/key_stores';\nimport 'reflect-metadata';\nimport { Service } from 'typedi';\nimport { Command } from './Command';\nimport { settings as configuration } from './config/config';\nimport getConfig from './getConfig';\nimport { ActionManager } from './managers/ActionManager';\nimport { BotClient, BotSettings } from './types';\n\n@Service()\nexport class Client extends DiscordClient implements BotClient {\n public settings: BotSettings;\n\n constructor(private readonly actionManager: ActionManager) {\n super(configuration.clientOptions ?? {});\n this.settings = configuration;\n this.initialize();\n }\n\n private initialize(): void {\n try {\n this.actionManager.initializeCommands(this);\n this.actionManager.initializeEvents(this);\n } catch (e) {\n console.error(`Could not initialize bot: ${e as string}`);\n }\n }\n\n public get commands(): Collection<string, Command> {\n return this.actionManager.commands;\n }\n}\n","module.exports = require(\"js-sha3\");","module.exports = require(\"js-sha256\");","import {\n KeyPair,\n TxInterface,\n PublicKey,\n secp256k1,\n ed25519,\n ExplorerLink,\n GenericTxParams,\n GenericTxSupportedActions,\n GenericTxAction,\n GenericTxActionTransfer,\n GenericTxActionTransferContractToken,\n Chain,\n GenericTxActionTransferNFT,\n GenericTxActionContractCall,\n} from '@baf-wallet/interfaces';\nimport { getGlobalContract } from '@baf-wallet/global-contract';\nimport { Pair } from '@baf-wallet/utils';\nimport { sha256 } from '@baf-wallet/crypto';\nimport { Buffer } from 'buffer';\nimport BN from 'bn.js';\nimport { transactions, utils } from 'near-api-js';\n\nimport { NearState } from './near';\nimport { NearSendOpts, NearSendResult } from './rpc';\nimport { NearAccountID } from './accounts';\nimport { nearConverter } from './convert';\nimport {\n Action as NearNativeAction,\n SignedTransaction,\n Transaction,\n} from 'near-api-js/lib/transaction';\nimport { BafError } from '@baf-wallet/errors';\n\nexport type NearTxInterface = TxInterface<\n Transaction,\n NearBuildTxParams,\n SignedTransaction,\n NearSignTxOpts,\n NearSendOpts,\n NearSendResult\n>;\nexport type NearSupportedActionTypes = GenericTxSupportedActions;\nexport type NearTransaction = Transaction;\n\nexport type NearAction = GenericTxAction;\nexport interface NearBuildTxParams {\n actions: NearAction[];\n senderPk: PublicKey<ed25519>;\n senderAccountID: NearAccountID;\n recipientAccountID: NearAccountID;\n}\n\n// eslint-disable-next-line\nexport interface NearSignTxOpts {}\n\nexport function nearTx(innerSdk: NearState): NearTxInterface {\n return {\n build: buildNearTx(innerSdk),\n sign: signNearTx,\n send: sendNearTx(innerSdk),\n buildParamsFromGenericTx: buildParamsFromGenericTx(innerSdk),\n extractGenericActionsFromTx,\n };\n}\n\nfunction buildNativeAction(\n receiverId: string,\n action: NearAction,\n innerSdk: NearState\n): NearNativeAction[] {\n const actionType = action.type;\n switch (actionType) {\n case GenericTxSupportedActions.TRANSFER:\n return [\n transactions.transfer(\n new BN((action as GenericTxActionTransfer).amount, 10)\n ),\n ];\n\n case GenericTxSupportedActions.TRANSFER_CONTRACT_TOKEN: {\n const params = action as GenericTxActionTransferContractToken;\n return [\n transactions.functionCall(\n 'ft_transfer',\n {\n receiver_id: receiverId,\n amount: params.amount,\n memo: params.memo ?? null,\n },\n // TODO: maximum gas fees per chain: see https://github.com/bafnetwork/baf-wallet-v2/issues/68\n new BN(10000000000000), // Maximum gas fee\n new BN(1) // A deposit associated with the ft_transfer action\n ),\n ];\n }\n\n case GenericTxSupportedActions.TRANSFER_NFT: {\n const params = action as GenericTxActionTransferNFT;\n return [\n transactions.functionCall(\n 'nft_transfer',\n {\n receiver_id: receiverId,\n token_id: params.tokenId,\n approval_id: params.approvalId ?? null,\n memo: params.memo ?? null,\n },\n // TODO: maximum gas fees per chain: see https://github.com/bafnetwork/baf-wallet-v2/issues/68\n new BN(10000000000000), // Maximum gas fee\n new BN(1)\n ),\n ];\n }\n\n case GenericTxSupportedActions.CONTRACT_CALL: {\n const params = action as GenericTxActionContractCall;\n return [\n transactions.functionCall(\n params.functionName,\n params.functionArgs,\n new BN(10000000000000), // Maximum gas fee\n new BN(params.deposit || 0)\n ),\n ];\n }\n\n default:\n throw `Action of type ${actionType} is unsupported`;\n }\n}\n\nconst checkAllContractActions = (actions: NearAction[]) => {\n if (!actions.every(isContractCall)) {\n return false;\n }\n if (actions.length === 0) {\n return true;\n }\n\n const contract = (actions[0] as GenericTxActionTransferContractToken)\n .contractAddress;\n\n for (let i = 1; i < actions.length; i++) {\n if (\n (actions[i] as GenericTxActionTransferContractToken).contractAddress !==\n contract\n ) {\n return false;\n }\n }\n return true;\n};\n\nconst isContractCall = (action: NearAction) =>\n action.type === GenericTxSupportedActions.TRANSFER_CONTRACT_TOKEN ||\n action.type === GenericTxSupportedActions.TRANSFER_NFT;\n\nexport const extractGenericActionsFromTx = (\n txParams: NearBuildTxParams\n): GenericTxAction[] => {\n return txParams.actions;\n};\n\nexport const buildParamsFromGenericTx = (innerSdk: NearState) => async (\n txParams: GenericTxParams,\n senderPk: PublicKey<ed25519>,\n recipientPk?: PublicKey<secp256k1>,\n): Promise<NearBuildTxParams> => {\n let recipientAccountID = txParams.recipientAddress\n ? txParams.recipientAddress\n : await getGlobalContract().getAccountId(recipientPk);\n\n if (!recipientAccountID) {\n throw BafError.SecpPKNotAssociatedWithAccount(Chain.NEAR);\n }\n\n const nearTxParams: NearBuildTxParams = {\n actions: txParams.actions,\n senderPk: senderPk,\n senderAccountID: innerSdk.nearMasterAccount.accountId,\n recipientAccountID,\n };\n return nearTxParams;\n};\n\nexport const buildNearTx = (innerSdk: NearState) => async ({\n actions,\n senderPk,\n senderAccountID,\n recipientAccountID,\n}: NearBuildTxParams): Promise<Transaction> => {\n if (actions.some(isContractCall) && !checkAllContractActions(actions)) {\n throw BafError.NonuniformTxActionRecipients(Chain.NEAR);\n }\n\n const nearSenderPk = nearConverter.pkFromUnified(senderPk);\n const accessKey = await innerSdk.rpcProvider.query(\n `access_key/${senderAccountID}/${nearSenderPk.toString()}`,\n ''\n );\n\n const nonce = ++accessKey.nonce;\n const recentBlockHash = utils.serialize.base_decode(accessKey.block_hash);\n const nativeActions = actions.flatMap((action) =>\n buildNativeAction(recipientAccountID, action, innerSdk)\n );\n\n const transactionRecipient =\n actions.some(isContractCall) && actions.length > 0\n ? (actions[0] as GenericTxActionTransferContractToken).contractAddress\n : recipientAccountID;\n\n return transactions.createTransaction(\n senderAccountID,\n nearSenderPk,\n transactionRecipient,\n nonce,\n nativeActions,\n recentBlockHash\n );\n};\n\nexport async function signNearTx<Curve>(\n tx: transactions.Transaction,\n keyPair: KeyPair<Curve>,\n _opts?: NearSignTxOpts\n): Promise<transactions.SignedTransaction> {\n const nearKeyPair = nearConverter.keyPairFromUnified(keyPair);\n const serializedTx = utils.serialize.serialize(transactions.SCHEMA, tx);\n const serializedTxHash = new Uint8Array(sha256(Buffer.from(serializedTx)));\n const signature = nearKeyPair.sign(serializedTxHash);\n // const [_, signedTx] = await signTransaction(tx, )\n return new transactions.SignedTransaction({\n transaction: tx,\n signature: new transactions.Signature({\n keyType: tx.publicKey.keyType,\n data: signature.signature,\n }),\n });\n}\n\nexport const sendNearTx = (innerSdk: NearState) => async (\n tx: SignedTransaction\n): Promise<Pair<NearSendResult, ExplorerLink>> => {\n const serialized = tx.encode();\n const result = await innerSdk.rpcProvider.sendJsonRpc('broadcast_tx_commit', [\n Buffer.from(serialized).toString('base64'),\n ]);\n\n const explorerLink = `https://explorer.${innerSdk.networkID}.near.org/transactions/${result.transaction.hash}`;\n return {\n fst: result,\n snd: explorerLink,\n };\n};\n","import {\n AccountsInterface,\n Balance,\n Chain,\n ed25519,\n ed25519Marker,\n Encoding,\n secp256k1,\n} from '@baf-wallet/interfaces';\nimport { Account as NearAccount } from 'near-api-js';\nimport {\n AccountCreator,\n UrlAccountCreator,\n LocalAccountCreator,\n} from 'near-api-js/lib/account_creator';\nimport BN from 'bn.js';\n\nimport { PublicKey } from '@baf-wallet/interfaces';\nimport { NearState } from './near';\nimport { nearConverter } from './convert';\nimport { BafError } from '@baf-wallet/errors';\nimport { pkFromString } from '@baf-wallet/crypto';\n\nexport type NearAccountID = string;\n\nconst NEP141ViewMethods = [\n 'ft_balance_of',\n 'ft_total_supply',\n 'storage_balance_of',\n];\nconst NEP141ChangeMethods = [\n 'ft_transfer',\n 'ft_transfer_call',\n 'storage_deposit',\n];\n\nexport function nearAccounts(\n nearState: NearState\n): AccountsInterface<NearAccount, NearAccountID, NearCreateAccountParams> {\n const { near } = nearState;\n return {\n lookup: async (accountID: NearAccountID): Promise<NearAccount> =>\n await near.account(accountID),\n masterAccount: nearState.nearMasterAccount,\n getGenericMasterAccount: () => {\n return {\n getBalance: async () =>\n (await nearState.nearMasterAccount.getAccountBalance())\n .total as Balance,\n getContractTokenBalance: async (\n contractName: string\n ): Promise<string> => {\n const contract = await nearState.getFungibleTokenContract(\n contractName\n );\n return await (contract as any).ft_balance_of({\n account_id: nearState.nearMasterAccount.accountId,\n });\n },\n };\n },\n\n associatedKeys,\n\n create: async ({\n accountID,\n newAccountPk,\n initialBalance,\n method = 'helper',\n }: NearCreateAccountParams): Promise<NearAccount> => {\n if (method === 'local' && !initialBalance) {\n throw BafError.MissingInitBalance(Chain.NEAR);\n }\n const masterAccount = await near.account(near.config.masterAccount);\n const accountCreator: AccountCreator =\n method === 'helper'\n ? new UrlAccountCreator(near.connection, near.config.helperUrl)\n : new LocalAccountCreator(masterAccount, initialBalance);\n\n await accountCreator.createAccount(\n accountID,\n nearConverter.pkFromUnified(newAccountPk)\n );\n return await near.account(accountID);\n },\n };\n}\n\nexport async function associatedKeys<Curve extends ed25519>(\n account: NearAccount\n) {\n const keys = await account.getAccessKeys();\n const edPkStrs = keys\n .map((key) => key.public_key as string)\n .filter((keyStr) => keyStr.includes('ed25519:'))\n .map((key) => key.split('ed25519:')[1]);\n return edPkStrs.map((str) =>\n pkFromString<ed25519>(str, ed25519Marker, Encoding.BS58)\n );\n}\n\nexport interface NearCreateAccountParams {\n accountID: NearAccountID;\n newAccountPk: PublicKey<ed25519 | secp256k1>;\n initialBalance?: BN;\n method?: 'helper' | 'local';\n}\n","module.exports = require(\"near-api-js/lib/utils\");","export * from './lib/chain-info';\n","module.exports = require(\"thunky/promise\");","import Ping from './Ping';\nimport Send from './Send';\nimport SendNFT from './SendNFT';\nimport setDefaultNFT from './SetDefaultNFT';\nimport AddAdmins from './AddAdmins';\nimport RemoveAdmins from './RemoveAdmins';\nimport Help from './Help';\n\nexport default [\n Ping,\n Send,\n SendNFT,\n setDefaultNFT,\n AddAdmins,\n RemoveAdmins,\n Help,\n];\n","import { Message } from 'discord.js';\nimport { Command } from '../Command';\nimport { BotClient } from '../types';\n\nexport default class Ping extends Command {\n constructor(client: BotClient) {\n super(client, {\n name: 'ping',\n description: 'Pings the bot.',\n category: 'Information',\n usage: client.settings.prefix.concat('ping'),\n cooldown: 1000,\n requiredPermissions: ['SEND_MESSAGES'],\n });\n }\n\n public async run(message: Message): Promise<void> {\n await super.respond(message.channel, 'Pong!');\n }\n}\n","import { Message } from 'discord.js';\nimport { Command } from '../Command';\nimport { BotClient } from '../types';\nimport { createApproveRedirectURL } from '@baf-wallet/redirect-generator';\nimport { environment } from '../environments/environment';\nimport {\n Chain,\n GenericTxAction,\n GenericTxParams,\n GenericTxSupportedActions,\n} from '@baf-wallet/interfaces';\nimport {\n createDiscordErrMsg,\n formatTokenAmountToIndivisibleUnit,\n parseDiscordRecipient,\n strToChain,\n} from '@baf-wallet/utils';\nimport { getNearChain } from '@baf-wallet/global-state';\nimport { getContractTokenInfoFromSymbol } from '@baf-wallet/chain-info';\nimport { nearToYoctoNear } from '@baf-wallet/near';\nimport {\n getTorusPublicAddress,\n tryGetTorusPublicAddress,\n} from '@baf-wallet/torus';\nimport { userUninitMessage } from './shared/messages';\nimport { getUninitUsers } from './shared/utils';\n\nconst getUsage = (prefix: string) =>\n `${prefix}send [amount of fungible token] [asset, i.e. NEAR, Berries, etc.] to [recipient]\\n\\n` +\n `Supported assets include: ${Object.keys(\n getNearChain()?.constants.tokens\n ).join(', ')}, and NEAR`;\n\nexport default class send extends Command {\n constructor(protected client: BotClient) {\n super(client, {\n name: 'send',\n description: 'sends NEAR or NEP-141 tokens on NEAR testnet',\n category: 'Utility',\n usage: getUsage(client.settings.prefix),\n cooldown: 1000,\n requiredPermissions: [],\n });\n }\n\n private extractArgs(content: string): string[] | null {\n const rx = /^\\%send (.*) (.*) to (.*)$/g;\n const matched = rx.exec(content);\n if (!matched) return null;\n // The first element of the match is the whole string if it matched\n return matched.length < 3 ? null : matched.slice(1);\n }\n\n private async buildGenericTx(\n message: Message,\n asset: string,\n amount: number,\n recipientParsed: string\n ): Promise<GenericTxParams | null> {\n let actions: GenericTxAction[];\n const nearConstants = getNearChain().constants;\n // assume that we are on NEAR for now\n if (asset === (await nearConstants.nativeTokenInfo()).symbol) {\n actions = [\n {\n type: GenericTxSupportedActions.TRANSFER,\n amount: nearToYoctoNear(amount),\n },\n ];\n } else {\n // TODO not right\n const tokenInfoFn = getNearChain()?.constants.tokens[asset];\n if (!tokenInfoFn) {\n await super.respond(\n message.channel,\n `❌ invalid asset ❌: ${asset} is currently not supported`\n );\n return null;\n }\n const tokenInfoRet = await tokenInfoFn();\n actions = [\n {\n type: GenericTxSupportedActions.TRANSFER_CONTRACT_TOKEN,\n contractAddress: tokenInfoRet.contractAddress,\n amount: formatTokenAmountToIndivisibleUnit(\n amount,\n tokenInfoRet.decimals\n ),\n },\n ];\n }\n\n const tx: GenericTxParams = {\n recipientUserId: recipientParsed,\n actions,\n oauthProvider: 'discord',\n };\n return tx;\n }\n\n public async run(message: Message): Promise<void> {\n const content = message.content;\n if (!content) {\n throw Error('message content is empty!');\n }\n const args = this.extractArgs(content);\n\n if (!args) {\n await super.respond(\n message.channel,\n `Invalid command, \\n\\`usage: ${this.conf.usage}\\``\n );\n return;\n } else if (args.length !== 3) {\n await super.respond(\n message.channel,\n `expected 3 parameters, got ${args.length - 1}.\\n\\`usage: ${\n this.conf.usage\n }\\``\n );\n return;\n }\n\n // If there are only two arguments, assume that the user is sending an NFT\n const amount = parseInt(args[0]);\n if (Number.isNaN(amount) || amount < 0) {\n await super.respond(\n message.channel,\n '❌ invalid amount ❌: amount must be a nonnegative number!'\n );\n return;\n }\n const asset = args[1];\n const recipient: string = args[2];\n\n const recipientParsed = parseDiscordRecipient(recipient);\n\n if (!recipientParsed) {\n await super.respond(\n message.channel,\n '❌ invalid user ❌: the user must be tagged!'\n );\n return;\n }\n const recipientUser = this.client.users.resolve(recipientParsed);\n const recipientUserReadable = `${recipientUser.username}#${recipientUser.discriminator}`;\n const { uninitUsers } = await getUninitUsers([recipientUser]);\n\n if (uninitUsers.length > 0) {\n await super.respond(\n message.channel,\n userUninitMessage(recipientUserReadable)\n );\n return;\n }\n\n try {\n const tx = await this.buildGenericTx(\n message,\n asset,\n amount,\n recipientParsed\n );\n if (!tx) return;\n\n const link = createApproveRedirectURL(\n Chain.NEAR,\n environment.BASE_WALLET_URL,\n tx\n );\n\n await super.respond(\n message.channel,\n \"Please check your DM's for a link to approve the transaction!\"\n );\n await message.author.send(\n `To open BAF Wallet and approve your transfer to ${recipientUserReadable}, please open this link: ${link}`\n );\n } catch (err) {\n console.error(err);\n await super.respond(message.channel, createDiscordErrMsg(err));\n return;\n }\n }\n}\n","export * from './constants';\nexport * from './torus';\n","module.exports = require(\"@toruslabs/fetch-node-details\");","module.exports = require(\"node-fetch\");","import { Message } from 'discord.js';\nimport { Command } from '../Command';\nimport { BotClient } from '../types';\nimport { createApproveRedirectURL } from '@baf-wallet/redirect-generator';\nimport { environment } from '../environments/environment';\nimport {\n Chain,\n GenericTxActionTransferNFT,\n GenericTxParams,\n GenericTxSupportedActions,\n} from '@baf-wallet/interfaces';\nimport { createDiscordErrMsg, parseDiscordRecipient } from '@baf-wallet/utils';\nimport { getGlobalContract } from '@baf-wallet/global-contract';\nimport {\n noDefaultNFTContractMessage,\n userUninitMessage,\n} from './shared/messages';\nimport { tryGetTorusPublicAddress } from '@baf-wallet/torus';\nimport { getUninitUsers } from './shared/utils';\n\nexport default class SendNFT extends Command {\n constructor(protected client: BotClient) {\n super(client, {\n name: 'sendNFT',\n description: 'sends NEP171 compatible NFTs',\n category: 'Utility',\n usage: `You can do either \\`${client.settings.prefix}sendNFT [NFT ID] to [recipient]\\` to send from the default NFT contract or \\`[NFT ID] from [NFT Contract] to [recipient]\\``,\n cooldown: 1000,\n requiredPermissions: [],\n });\n }\n\n private extractArgs(content: string): string[] | null {\n const rx = /^\\%sendNFT ((.*) from (.*) to (.*)|(.*) to (.*))$/g;\n const matched = rx.exec(content)?.filter((elem) => elem !== undefined);\n if (!matched) return null;\n // The first element of the match is the whole string if it matched, the second is the chunk of the or clause\n return matched.length < 2 ? null : matched.slice(2);\n }\n\n private async buildGenericTx(\n message: Message,\n contractAddress: string,\n tokenId: string,\n recipientParsed: string\n ): Promise<GenericTxParams | null> {\n const action: GenericTxActionTransferNFT = {\n type: GenericTxSupportedActions.TRANSFER_NFT,\n tokenId,\n contractAddress,\n };\n\n const tx: GenericTxParams = {\n recipientUserId: recipientParsed,\n actions: [action],\n oauthProvider: 'discord',\n };\n return tx;\n }\n\n public async run(message: Message): Promise<void> {\n const content = message.content;\n if (!content) {\n throw Error('message content is empty!');\n }\n const args = this.extractArgs(content);\n\n if (!args) {\n await super.respond(\n message.channel,\n `Invalid command, \\n\\`usage: ${this.conf.usage}\\``\n );\n return;\n } else if (args.length !== 2 && args.length !== 3) {\n await super.respond(\n message.channel,\n `expected 2 or 3 parameters, got ${args.length - 1}.\\n\\`usage: ${\n this.conf.usage\n }\\``\n );\n return;\n }\n\n const tokenId = args[0];\n const argsOffset = args.length === 3 ? 1 : 0;\n let community_nft_contract = '';\n if (args.length !== 3) {\n community_nft_contract = await getGlobalContract().get_community_default_nft_contract(\n { server: message.guild.id }\n );\n if (!community_nft_contract) {\n await super.respond(message.channel, noDefaultNFTContractMessage);\n return;\n }\n }\n const contractAddress =\n args.length === 3 ? args[argsOffset] : community_nft_contract;\n const recipient: string = args[1 + argsOffset];\n\n const recipientParsed = parseDiscordRecipient(recipient);\n\n if (!recipientParsed) {\n await super.respond(\n message.channel,\n '❌ invalid user ❌: the user must be tagged!'\n );\n return;\n }\n\n const recipientUser = this.client.users.resolve(recipientParsed);\n const recipientUserReadable = `${recipientUser.username}#${recipientUser.discriminator}`;\n const { uninitUsers } = await getUninitUsers([recipientUser]);\n\n if (uninitUsers.length > 0) {\n await super.respond(\n message.channel,\n userUninitMessage(recipientUserReadable)\n );\n return;\n }\n try {\n const tx = await this.buildGenericTx(\n message,\n contractAddress,\n tokenId,\n recipientParsed\n );\n if (!tx) return;\n const link = createApproveRedirectURL(\n Chain.NEAR,\n environment.BASE_WALLET_URL,\n tx\n );\n\n await super.respond(\n message.channel,\n \"Please check your DM's for a link to approve the transaction!\"\n );\n await message.author.send(\n `To open BAF Wallet and approve your NFT transfer, please open this link: ${link}`\n );\n } catch (err) {\n console.error(err);\n await super.respond(message.channel, createDiscordErrMsg(err));\n return;\n }\n }\n}\n","import { Message } from 'discord.js';\nimport { Command } from '../Command';\nimport { BotClient } from '../types';\nimport { createApproveRedirectURL } from '@baf-wallet/redirect-generator';\nimport { environment } from '../environments/environment';\nimport {\n Chain,\n GenericTxAction,\n GenericTxActionTransferNFT,\n GenericTxParams,\n GenericTxSupportedActions,\n} from '@baf-wallet/interfaces';\nimport { createDiscordErrMsg, parseDiscordRecipient } from '@baf-wallet/utils';\nimport { constants } from '../config/config';\nimport {\n getGlobalContract,\n GlobalContractConfig,\n} from '@baf-wallet/global-contract';\n\nexport default class setDefaultNFT extends Command {\n constructor(protected client: BotClient) {\n super(client, {\n name: 'setDefaultNFT',\n description: 'Set the default NFT contract for this Discord',\n category: 'Utility',\n usage: `${client.settings.prefix}setDefaultNFT [NFT Contract]`,\n cooldown: 1000,\n requiredPermissions: [],\n });\n }\n\n private buildGenericTx(\n guildId: string,\n globalContractAddr: string,\n nftContractAddress: string\n ): GenericTxParams {\n let actions: GenericTxAction[];\n actions = [\n {\n type: GenericTxSupportedActions.CONTRACT_CALL,\n functionName: 'set_community_default_nft_contract',\n functionArgs: {\n guild_id: guildId,\n nft_contract: nftContractAddress,\n },\n deposit: '0',\n },\n ];\n\n const tx: GenericTxParams = {\n recipientAddress: globalContractAddr,\n actions,\n oauthProvider: 'discord',\n };\n\n return tx;\n }\n\n private extractArgs(content: string): string[] | null {\n const rx = /^\\%setDefaultNFT (.*)$/g;\n const matched = rx.exec(content);\n if (!matched) return null;\n // The first element of the match is the whole string if it matched\n return matched.length < 2 ? null : matched.slice(1);\n }\n\n public async run(message: Message): Promise<void> {\n const content = message.content;\n if (!content) {\n throw Error('message content is empty!');\n }\n const args = this.extractArgs(content);\n\n if (!args) {\n await super.respond(\n message.channel,\n `Invalid command, \\n\\`usage: ${this.conf.usage}\\``\n );\n return;\n } else if (args.length !== 1) {\n await super.respond(\n message.channel,\n `expected 1 parameter, got ${args.length - 1}.\\n\\`usage: ${\n this.conf.usage\n }\\``\n );\n return;\n }\n\n const defaultNFTContract = args[0];\n\n try {\n const tx = await this.buildGenericTx(\n message.guild.id,\n constants.globalContractAddress,\n defaultNFTContract\n );\n if (!tx) return;\n const link = createApproveRedirectURL(\n Chain.NEAR,\n environment.BASE_WALLET_URL,\n tx\n );\n\n await super.respond(\n message.channel,\n \"Please check your DM's for a link to approve the transaction!\"\n );\n await message.author.send(\n `To open BAF Wallet and approve changing the default NFT contract to ${defaultNFTContract}, please open this link: ${link}`\n );\n } catch (err) {\n console.error(err);\n await super.respond(message.channel, createDiscordErrMsg(err));\n return;\n }\n }\n}\n","import { Message } from 'discord.js';\nimport { getTorusPublicAddress } from '@baf-wallet/torus';\nimport { Command } from '../Command';\nimport { BotClient } from '../types';\nimport { createApproveRedirectURL } from '@baf-wallet/redirect-generator';\nimport { environment } from '../environments/environment';\nimport {\n Chain,\n GenericTxAction,\n GenericTxActionTransferNFT,\n GenericTxParams,\n GenericTxSupportedActions,\n} from '@baf-wallet/interfaces';\nimport { createDiscordErrMsg, parseDiscordRecipient } from '@baf-wallet/utils';\nimport { constants } from '../config/config';\nimport { getGlobalContract } from '@baf-wallet/global-contract';\nimport { getUninitUsers } from './shared/utils';\nimport { usersUninitMessage } from './shared/messages';\n\nexport default class AddAdmins extends Command {\n constructor(protected client: BotClient) {\n super(client, {\n name: 'addAdmins',\n description: 'Add admin Near Accounts to the contract',\n category: 'Utility',\n usage: `${client.settings.prefix}addAdmins adminAccount1, adminAccount2, adminAccount3...`,\n cooldown: 1000,\n requiredPermissions: [],\n });\n }\n\n private buildGenericTx(\n guildId: string,\n contractAddress: string,\n new_admins: string[]\n ): GenericTxParams {\n let actions: GenericTxAction[];\n actions = [\n {\n type: GenericTxSupportedActions.CONTRACT_CALL,\n functionName: 'add_community_admins',\n functionArgs: {\n new_admins,\n guild_id: guildId,\n },\n deposit: '0',\n },\n ];\n\n const tx: GenericTxParams = {\n recipientAddress: contractAddress,\n actions,\n oauthProvider: 'discord',\n };\n\n return tx;\n }\n\n private extractArgs(content: string): string[] | null {\n const rx = /^\\%addAdmins (.*)$/g;\n const matched = rx.exec(content);\n if (!matched) return null;\n // The first element of the match is the whole string if it matched\n return matched.length < 2 ? null : matched.slice(1);\n }\n\n public async run(message: Message): Promise<void> {\n const content = message.content;\n if (!content) {\n throw Error('message content is empty!');\n }\n const args = this.extractArgs(content);\n\n if (!args) {\n await super.respond(\n message.channel,\n `Invalid command, \\n\\`usage: ${this.conf.usage}\\``\n );\n return;\n } else if (args.length !== 1) {\n await super.respond(\n message.channel,\n `expected 1 parameter, got ${args.length - 1}.\\n\\`usage: ${\n this.conf.usage\n }\\``\n );\n return;\n }\n\n const admins = args[0].split(', ');\n\n const adminsParsed = admins.map(parseDiscordRecipient);\n\n if (adminsParsed.some((admin) => admin === null)) {\n await super.respond(\n message.channel,\n '❌ invalid user ❌: the user must be tagged!'\n );\n return;\n }\n const adminsDiscordInfo = adminsParsed.map((admin) => this.client.users.resolve(admin));\n const { uninitUsers, associatedAccounts } = await getUninitUsers(\n adminsDiscordInfo\n );\n if (uninitUsers.length > 0) {\n await super.respond(\n message.channel,\n usersUninitMessage(\n uninitUsers.map((user) => `${user.username}#${user.discriminator}`)\n )\n );\n return;\n }\n\n try {\n const tx = await this.buildGenericTx(\n message.guild.id,\n constants.globalContractAddress,\n associatedAccounts\n );\n if (!tx) return;\n const link = createApproveRedirectURL(\n Chain.NEAR,\n environment.BASE_WALLET_URL,\n tx\n );\n\n await super.respond(\n message.channel,\n \"Please check your DM's for a link to approve the transaction!\"\n );\n await message.author.send(\n `To open BAF Wallet and add ${JSON.stringify(\n admins\n )} as admins, please open this link: ${link}`\n );\n } catch (err) {\n console.error(err);\n await super.respond(message.channel, createDiscordErrMsg(err));\n return;\n }\n }\n}\n","import { GuildAuditLogs, Message } from 'discord.js';\nimport { Command } from '../Command';\nimport { BotClient } from '../types';\nimport { createApproveRedirectURL } from '@baf-wallet/redirect-generator';\nimport { environment } from '../environments/environment';\nimport {\n Chain,\n GenericTxAction,\n GenericTxActionTransferNFT,\n GenericTxParams,\n GenericTxSupportedActions,\n} from '@baf-wallet/interfaces';\nimport { createDiscordErrMsg, parseDiscordRecipient } from '@baf-wallet/utils';\nimport { constants } from '../config/config';\nimport { getTorusPublicAddress } from '@baf-wallet/torus';\nimport { getGlobalContract } from '@baf-wallet/global-contract';\nimport { getUninitUsers } from './shared/utils';\nimport { usersUninitMessage } from './shared/messages';\n\nexport default class RemoveAdmins extends Command {\n constructor(protected client: BotClient) {\n super(client, {\n name: 'removeAdmins',\n description: 'Remove admin Near Accounts from the contract',\n category: 'Utility',\n usage: `${client.settings.prefix}removeAdmins adminAccount1, adminAccount2, adminAccount3...`,\n cooldown: 1000,\n requiredPermissions: [],\n });\n }\n\n private buildGenericTx(\n guildId: string,\n contractAddress: string,\n admins: string[]\n ): GenericTxParams {\n let actions: GenericTxAction[];\n actions = [\n {\n type: GenericTxSupportedActions.CONTRACT_CALL,\n functionName: 'remove_community_admins',\n functionArgs: {\n admins,\n guild_id: GuildAuditLogs,\n },\n deposit: '0',\n },\n ];\n\n const tx: GenericTxParams = {\n recipientAddress: contractAddress,\n actions,\n oauthProvider: 'discord',\n };\n\n return tx;\n }\n\n private extractArgs(content: string): string[] | null {\n const rx = /^\\%removeAdmins (.*)$/g;\n const matched = rx.exec(content);\n if (!matched) return null;\n // The first element of the match is the whole string if it matched\n return matched.length < 2 ? null : matched.slice(1);\n }\n\n public async run(message: Message): Promise<void> {\n const content = message.content;\n if (!content) {\n throw Error('message content is empty!');\n }\n const args = this.extractArgs(content);\n\n if (!args) {\n await super.respond(\n message.channel,\n `Invalid command, \\n\\`usage: ${this.conf.usage}\\``\n );\n return;\n } else if (args.length !== 1) {\n await super.respond(\n message.channel,\n `expected 1 parameter, got ${args.length - 1}.\\n\\`usage: ${\n this.conf.usage\n }\\``\n );\n return;\n }\n\n const admins = args[0].split(', ');\n const adminsParsed = admins.map(parseDiscordRecipient);\n\n if (adminsParsed.some((admin) => admin === null)) {\n await super.respond(\n message.channel,\n '❌ invalid user ❌: the user must be tagged!'\n );\n return;\n }\n const adminsDiscordInfo = adminsParsed.map((admin) =>\n this.client.users.resolve(admin)\n );\n const { uninitUsers, associatedAccounts } = await getUninitUsers(\n adminsDiscordInfo\n );\n if (uninitUsers.length > 0) {\n await super.respond(\n message.channel,\n usersUninitMessage(\n uninitUsers.map((user) => `${user.username}#${user.discriminator}`)\n )\n );\n return;\n }\n\n try {\n const tx = await this.buildGenericTx(\n message.guild.id,\n constants.globalContractAddress,\n associatedAccounts\n );\n if (!tx) return;\n const link = createApproveRedirectURL(\n Chain.NEAR,\n environment.BASE_WALLET_URL,\n tx\n );\n\n await super.respond(\n message.channel,\n \"Please check your DM's for a link to approve the transaction!\"\n );\n await message.author.send(\n `To open BAF Wallet and remove ${JSON.stringify(\n admins\n )} as admins, please open this link: ${link}`\n );\n } catch (err) {\n console.error(err);\n await super.respond(message.channel, createDiscordErrMsg(err));\n return;\n }\n }\n}\n","import { Message } from 'discord.js';\nimport { Command } from '../Command';\nimport { BotClient } from '../types';\n\nexport default class Help extends Command {\n constructor(client: BotClient) {\n super(client, {\n name: 'help',\n description: 'Shows help messages',\n category: 'Information',\n usage: client.settings.prefix.concat('help'),\n cooldown: 1000,\n requiredPermissions: ['SEND_MESSAGES'],\n });\n }\n\n public async run(message: Message): Promise<void> {\n await super.respond(\n message.channel,\n 'BAF Wallet is a discord bot that lets you send crypto assets through discord.\\n\\n'\n + 'Built with ❤️ on NEAR by the Blockchain Acceleration Foundation.\\n\\n'\n + '**List of commands**:\\n\\n'\n + '`Ping` - Respond Pong! \\n'\n + `\\`${this.client.settings.prefix}send\\` - sends NEAR or NEP-141 tokens on NEAR.\\n`\n + `\\`${this.client.settings.prefix}sendNFT\\` - sends NEP171 compatible NFTs on NEAR.\\n`\n + `\\`${this.client.settings.prefix}help\\` - lists the available commands and what they do.\\n`\n + `\\n`\n + `To see usage details of a particular command, do \\`${this.client.settings.prefix}<Command Name>\\`.`\n );\n }\n}\n","import Message from './Message';\nimport Ready from './Ready';\n\nexport default [Message, Ready];\n","/* eslint-disable @typescript-eslint/no-non-null-assertion */\nimport { Message as DiscordMessage } from 'discord.js';\nimport { BotClient, BotEvent } from '../types';\n\nexport default class Message implements BotEvent {\n constructor(private readonly client: BotClient) {}\n\n name(): string {\n return 'message';\n }\n\n public async run(args?: any): Promise<void> {\n if (!(args instanceof DiscordMessage)) {\n // TODO use winston\n console.error('invalid args for Message event');\n return args;\n }\n\n const message: DiscordMessage = args;\n\n if (\n message.author.bot ||\n !message.content.startsWith(this.client.settings.prefix)\n )\n return;\n\n const argus = message.content.split(/\\s+/g);\n const command = argus.shift()!.slice(this.client.settings.prefix.length);\n const cmd = this.client.commands.get(command);\n\n if (cmd === undefined || !(await cmd.canRun(message.author, message)))\n return;\n await cmd.run(message, argus);\n\n if (message.guild !== null) cmd.setCooldown(message.author, message.guild);\n }\n}\n","import { BotClient, BotEvent } from '../types';\n\nexport default class Ready implements BotEvent {\n private readonly client: BotClient;\n constructor(client: BotClient) {\n this.client = client;\n }\n\n name(): string {\n return 'ready';\n }\n\n public async run(): Promise<void> {\n if (this.client.user !== null) {\n console.log(`${this.client.user.username} is ready!`);\n await this.client.user.setPresence(this.client.settings.presence);\n }\n }\n}\n","import 'reflect-metadata';\nimport { environment } from './environments/environment';\nimport { Container } from 'typedi';\nimport { Client } from './Client';\nimport { getNearChain, initNearChain } from '@baf-wallet/global-state';\nimport { constants } from './config/config';\nimport { setGlobalContract } from '@baf-wallet/global-contract';\nimport { Chain } from '@baf-wallet/interfaces';\n\n// Initialize the Client using the IoC.\n\nasync function main() {\n await initNearChain(constants.chainParams[Chain.NEAR], constants.env);\n const client = Container.get<Client>(Client);\n await setGlobalContract(getNearChain().accounts.masterAccount);\n await client.login(environment.DISCORD_BOT_TOKEN);\n console.log('tokenbot happily hodling along');\n}\n\nmain();\n"],"sourceRoot":""}