Skip to content

Instantly share code, notes, and snippets.

View hoffmabc's full-sized avatar

Brian Hoffman hoffmabc

View GitHub Profile
{
"jsonrpc": "2.0",
"id": "curlycurl2",
"method": "send_transaction",
"params": {
"version": 0,
"signatures": [
[
225,
126,
use arch_program::{
account::{AccountInfo, AccountMeta},
entrypoint,
next_account_info,
instruction::Instruction,
msg,
program_error::ProgramError,
pubkey::Pubkey,
program::get_clock,
};
pub fn prepare_settlement_batch(accounts: &[AccountInfo], params: &SettlementBatchParams, raw_params_data: &[u8]) -> Result<(), ProgramError> {
validate_account(accounts, 0, true, true, Some(AccountType::Program), None)?;
if ProgramState::get_settlement_hash(&accounts[0])? != EMPTY_HASH {
return Err(ProgramError::Custom(ERROR_SETTLEMENT_IN_PROGRESS));
}
ProgramState::clear_events(&accounts[0])?;
let mut running_netting_total: i64 = 0;
for token_settlements in &params.settlements {
validate_account(accounts, token_settlements.account_index, false, false, Some(AccountType::Token), Some(0))?;
import express from 'express';
import { RpcConnection, MessageUtil, PubkeyUtil } from '@saturnbtcio/arch-sdk';
import * as borsh from 'borsh';
import Bitcoin from 'bitcoinjs-lib';
// import { ECPairFactory } from 'bitcoinjs-lib/src/ecpair';
import { ECPairFactory } from 'ecpair';
import * as ecc from 'tiny-secp256k1';
import cors from 'cors';
import { hexToBytes } from '@noble/hashes/utils';
import dotenv from 'dotenv';

Understanding the Fungible Token Standard on Arch Network

Introduction

The Fungible Token Standard program is a crucial piece of infrastructure for the Arch Network ecosystem that enables the creation and management of fungible tokens. Similar to ERC-20 on Ethereum, this standard provides a consistent interface for implementing fungible tokens on Arch Network.

Core Components

Token Mint Details

The foundation of the standard is the TokenMintDetails struct which manages token metadata and supply:

@hoffmabc
hoffmabc / gist:4673cd86d798dfdd10922450bce0a444
Created October 23, 2018 17:25
OpenBazaar web relay authentication scheme
1. Send HelloMessage to relay server
```go
type HelloMessage struct {
UserID string `json:"userID"`
}
```
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQCsC7jy0gH0T7M+NRxDZNGbpAIr3LgAbXlRGgD++sRH8YB0Zi9y89rUo5H/Hfl62cq97zhkh4afVwwkZGlkjNzWWSBWyZzXXvwHPK+4OvyIkPexkr1NF/IKwKlmqFVLQBGQJxubvsXSCeeVd6qeaLIAuMUoaB4zqyt32T6SFkmRZ9w7gAT5GzRhC85f1PSOT6jQ+RPUzKnbX9OoCqArSYOQTxtK+DUe7ThK7udzyg3xeofQZjDqLGE5/C+8gkgYC+dbluBc2vUZeIJaDVMlDRdKlEsX/StIpXvmiwrgrgefdpWnPIHNGXmO22+5ZxOggNCtwU980KySoDY8ta24lwg/ [email protected]
Since its release, OpenBazaar has become the largest decentralized marketplace online, offering users unparalleled privacy and freedom over their own trade.
The OpenBazaar platform is made up of buyers, sellers, developers and curators from around the world and over 25,000 of them are already working together to make this completely decentralized network easy to use for everyone. Everywhere.
If you're ready to give the Amazons & Ebays of the world a run for their money, that's great! Clearly, so are we, but it's not going to happen overnight.
We all need more...
More time to build the code and capabilities.
More features to help people buy and sell excellently from anywhere in the world.
More reasons to stick with OpenBazaar through it's entire disruptive evolution.
0xfBD6792a1a78D1E654EaCA6F43E712De1F5e6C54
@hoffmabc
hoffmabc / gist:38883a3fb08f26b80330
Last active May 22, 2016 07:28
OpenBazaar REST API
swagger: '2.0'
info:
title: OpenBazaar API
description: Let's make trade free
version: "1.0.0"
# the domain of the service
host: localhost
# array of all schemes that your API supports
schemes:
- http