Skip to content

Instantly share code, notes, and snippets.

@maxidev
maxidev / unsigned_tx_erc20_transfer.js
Created March 17, 2025 14:02
unsigned_tx_erc20_transfer.js
import { ethers } from "ethers";
// Conexión al proveedor de Arbitrum
const provider = new ethers.JsonRpcProvider("https://arb1.arbitrum.io/rpc");
// Dirección del contrato USDC en Arbitrum Mainnet
const usdcContractAddress = "0xaf88d065e77c8cC2239327C5EDb3A432268e5831";
// ABI mínima para la función transfer
const usdcAbi = ["function transfer(address to, uint256 value) returns (bool)"];
@maxidev
maxidev / unsigned_tx_hash_native_transfer.js
Created March 17, 2025 13:59
unsigned_tx_hash_native_transfer.js
import { ethers } from "ethers";
// Conexión al proveedor de Arbitrum (no necesitamos wallet ni clave privada)
const provider = new ethers.JsonRpcProvider("https://arb1.arbitrum.io/rpc");
// Función para crear una transacción raw sin firmar
async function createUnsignedRawTransaction() {
try {
// 1. Definir los parámetros de la transacción
const tx = {
ticker: 5058
domain: emdx.io
- Component must be mounted into a Storybook page deployed to access via browser.
- Component should be a controlled input, the API must be compliant to allow developers to send options and retrieve values from.
- Disabled and Error states are open for you to manage them as desired, please provide context about decisions made and chosen approach.
- Single / Multi selection mode must be handled by implementation.
- Feel free to use plain css, styled components, tailwind, or any other desired approach to manage styles.
- Pixel perfect design and clean/readable code are a must.

Keybase proof

I hereby claim:

  • I am maxidev on github.
  • I am maxidev (https://keybase.io/maxidev) on keybase.
  • I have a public key ASAHulndivX_55vMdYP1Fa0iwHNzUyw5sX9olmk5Bhsa-wo

To claim this, I am signing this object:

var ethUtil = require('ethereumjs-util');
var ethTx = require('ethereumjs-tx');
var privkey = "";
var privBuff = new Buffer(privkey, "hex");
var msg = ethUtil.sha3("The Times 03/Jan/2009 Chancellor on brink of second bailout for banks");
var sign = ethUtil.ecsign(msg, privBuff);
console.log(sign);
var signedHash = ethUtil.toRpcSig(sign.v, sign.r, sign.s);
var sigDecoded = ethUtil.fromRpcSig(signedHash);

Keybase proof

I hereby claim:

  • I am maxidev on github.
  • I am maxidev (https://keybase.io/maxidev) on keybase.
  • I have a public key whose fingerprint is 9849 3304 C8EC C9C1 0DFB 293C 8A97 C544 5008 4A4D

To claim this, I am signing this object:

@maxidev
maxidev / escrow-contract.js
Created January 31, 2018 01:27
Escrow type contract creation
//Require Bitsign's library
const bitsignjs = require('bitsignjs');
//Instantiate the library with your access token
let api = bitsignjs.init('d2..83');
api.contracts.deploy({
password: '<your_password>',
type: 'Escrow',
"args": {
"_buyer": "<buyer_address>",
@maxidev
maxidev / notary-tx.js
Created January 31, 2018 01:20
Create notary transaction using Bitsignjs
//Require Bitsign's library
const bitsignjs = require('bitsignjs');
//Instantiate the library with your access token
let api = bitsignjs.init('d22..83');
api.transactions.notarizeTx({
address: '0x16E843402d1bEe260D5464C927A6A0DC11b0384f',
data: '<some_hexa_data>',
password: '<your_password>'
}).then(data => console.log(data))
@maxidev
maxidev / status.js
Created January 31, 2018 01:17
Blockchain Status call
//Require Bitsign's library
const bitsignjs = require('bitsignjs');
//Instantiate the library with your access token
let api = bitsignjs.init('d2..83');
api.eth.status().then(data => console.log(data));