Skip to content

Instantly share code, notes, and snippets.

@justinbarry
justinbarry / multi-message-send-token.ts
Created June 7, 2024 18:53
An example of how to send multiple send token messages inside one transaction
import {MsgSendEncodeObject, SigningStargateClient, StdFee} from "@cosmjs/stargate";
import {DirectSecp256k1Wallet, OfflineDirectSigner} from "@cosmjs/proto-signing";
import {fromHex} from "@cosmjs/encoding";
(async function () {
const recipients = [
'xion1adgdmkfrpgu749d5qahwxmu3jzcp77mm5wxddq',
'xion19jerqdcz7u2220q2xj078hndcqv8z8kjj3trsp',
'xion1te8gp204fserypat7h8mere5pz39afsn6ssn67',
@justinbarry
justinbarry / test.txt
Created June 7, 2024 18:40
multiple message send example
Test

Private Key Example

import { makeADR36AminoSignDoc, serializeSignDoc } from "@keplr-wallet/cosmos";
import { Hash, PrivKeySecp256k1 } from "@keplr-wallet/crypto";
function signArbFn(address: string, privateKey: string) {
const cryptoPrivKey = new PrivKeySecp256k1(fromHex(privateKey));
return async (message: string | Uint8Array): Promise<string> => {
const signDoc = makeADR36AminoSignDoc(address, message);
const serializedSignDoc = serializeSignDoc(signDoc);
const digest = Hash.sha256(serializedSignDoc);
const {send: transportGRPC} = require("@onflow/transport-grpc")
const fcl = require("@onflow/fcl")
const {TransactionAuthorizer} = require("@freshmint/core")
const {
HashAlgorithm,
InMemoryECSigner,
SignatureAlgorithm,
InMemoryECPrivateKey,
} = require("@freshmint/core/crypto")
import FungibleToken from 0xf233dcee88fe0abe
import FiatToken from 0xb19436aae4d94622
transaction {
prepare(signer: AuthAccount) {
// Return early if the account already stores a FiatToken Vault
if signer.borrow<&FiatToken.Vault>(from: FiatToken.VaultStoragePath) != nil {
return
}
// Create a new ExampleToken Vault and put it in storage
@justinbarry
justinbarry / .gitignore
Last active March 29, 2022 16:50
Ledger Bug Example
# folders
node_modules/
dist/
.parcel-cache/
flowdb/
.exrc
.DS_Store
# file types
  1. Is the candidate comfortable working remotely?
  2. What is the expected graduation date of the candidate?
  3. Is the candidate open to 4-month or 8-month internship?
  4. If the candidate is from University of Waterloo, ask for the date that they plan to submit employer rating. (note: this is because we need to extend an offer before that date if it’s a match)
  5. Confirm the candidate’s location is US or Canada + the candidate can legally work in these two locations

Requirement Collection:

Functionality:

#!/bin/bash
((!$#)) && echo No issue number provided, command ignored! && exit 1;
TITLE=$(gh issue view $1 --json title | jq --raw-output '.title' )
ESCAPED_TITLE=$(echo "GH-$1-${TITLE// /-}" | tr -cd '[:alnum:][\-]' | cut -c1-100);
if [ `git branch --list $ESCAPED_TITLE` ]; then
git checkout $ESCAPED_TITLE;
/**
*Submitted for verification at Etherscan.io on 2020-09-14
*/
// File: @openzeppelin/contracts/GSN/Context.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.6.0;