This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ | |
"name": "Tonkeeper", | |
"image": "https://tonkeeper.com/assets/tonconnect-icon.png", | |
"tondns": "tonkeeper.ton", | |
"about_url": "https://tonkeeper.com", | |
"universal_url": "https://app.tonkeeper.com/ton-connect", | |
"bridge": [ | |
{ | |
"type": "sse", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"url": "https://ton-connect.github.io/demo-dapp/", | |
"name": "Demo Dapp", | |
"iconUrl": "https://ton-connect.github.io/demo-dapp/apple-touch-icon.png", | |
"termsOfUseUrl": "https://ton-connect.github.io/demo-dapp/terms-of-use.txt", | |
"privacyPolicyUrl": "https://ton-connect.github.io/demo-dapp/privacy-policy.txt" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@logClass | |
class Person { | |
public name: string; | |
constructor(name : string) { | |
this.name = name; | |
} | |
public myMethod() { | |
console.log('method works!'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function OnChange<ClassT, T>(callback: (ClassT, T) => void): any { | |
return (target: Object, propertyKey: string | symbol) => { | |
const symbolKey = Symbol(propertyKey.toString()); | |
// Необходимо задействовать существующий дескриптор, если он есть. | |
// Это позволит объявять несколько декораторов на одном свойстве. | |
const descriptor = Object.getOwnPropertyDescriptor(target, propertyKey) | |
|| {configurable: true, enumerable: true}; | |
// Подменяем или объявляем get и set | |
const originalGet = descriptor.get || function() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Validator { | |
// Map<Class.prototype, Map<MethodName, IndexesToCheck>> | |
private static notEmptyValidatorMap: Map<Object, Map<string, number[]>> = new Map(); | |
static registerNotEmpty(target: Object, methodName: string, paramIndex: number): void { | |
let paramMap = this.notEmptyValidatorMap.get(target); | |
if (!paramMap) { | |
paramMap = new Map(); | |
this.notEmptyValidatorMap.set(target, paramMap); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'reflect-metadata'; | |
const ControllerNameMetadataKey = Symbol('ControllerMetadata'); | |
const ControllerMetaUrl = Symbol('ControllerMetaUrl'); | |
function Controller(name: string) { | |
return function(target: Function) { | |
Reflect.defineMetadata(ControllerNameMetadataKey, name, target.prototype); | |
}; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'reflect-metadata'; | |
class Injector { | |
// Map<interfaceType, instance> | |
services: Map<Function, Object> = new Map(); | |
registerService(interfaceType: Function, instance: Object) { | |
this.services.set(interfaceType, instance); | |
} | |
getService(interfaceType: Function): Object { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Calculator { | |
@Cache(200) | |
public add(a: number, b: number): number { | |
console.log('add called!') | |
return a + b; | |
} | |
@Cache(3000) | |
public sub(a: number, b: number): number { | |
console.log('sub called!') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Rubic Crypto Price Widget v1.2.0 | |
// Copyright (c) 2021 Sergey Andreev <andreev@mywish.io> | |
// Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: | |
// The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. | |
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Web3 from 'web3'; | |
import dotenv from 'dotenv'; | |
import util from "ethereumjs-util"; | |
dotenv.config(); | |
const rawTx = { | |
from: '0x83757c40420e58135d5881c0c1e30d5424462101', | |
gas: 100000, | |
to: '0xecA0A3eFCf009519052Dc92306fE821b9c7A32A2', | |
value: 2000, |
NewerOlder