Code Monkey home page Code Monkey logo

fleet's People

Contributors

arobsn avatar capt-nemo429 avatar github-actions[bot] avatar nn-dmt avatar ross-weir avatar sepehrganji avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

fleet's Issues

GraphQL error: Value cannot be zero

Upon what i felt was the successful formation of registers in a contract, the tx allowed me to sign and then graphQL gave Error 2 back about the number 0 being invalid in one of the registers.. the value being used is "0400"

`blake2b256` is hashing byte array differently than hex strings

blake2b256 function is not validating string inputs and encoding them as UTF-8 before to hash.

  • Hashes from blake2b256(UInt8Array.from([0xde, 0xad, 0xbe, 0xef])) and blake2b256("deadbeef") must be the same.
  • It must throw if input is not a correct Base16 encoded string nor a UInt8Array.

Blockchain data providers

Planned Implementations

  • #18
  • Indexed node package

Interface

All packages must implement and extend the following interface and throw a NotSupportedError for not supported operations:

export interface IChainDataClient<B extends BoxWhere> {
/**
* Get unspent boxes from the blockchain.
*/
getUnspentBoxes(query: BoxQuery<B>): Promise<ChainClientBox[]>;
/**
* Get the last `n` block headers from the blockchain.
*/
getLastHeaders(count: number): Promise<BlockHeader[]>;
/**
* Check for transaction validity without broadcasting it to the network.
*/
checkTransaction(transaction: SignedTransaction): Promise<boolean>;
/**
* Broadcast a transaction to the network.
*/
submitTransaction(transaction: SignedTransaction): Promise<TransactionId>;
/**
* Evaluate a transaction and return Base16-encoded evaluation result.
*/
reduceTransaction(transaction: UnsignedTransaction): Promise<HexString>;
}

Should we rename Fleet SDK to something with ergo in its name?

In short, I think Fleet is a great name, but it does not reflect the specific purpose of our Ergo SDK. Should we rename it?

Fleet is a catchy name that fits well in the Nautilus narrative, but it may cause confusion for newcomers. We often see them choosing outdated and unsafe libraries like ergo-ts and ergo-js over actively maintained ones like AppKit, sigma-rust, or Fleet.

I believe this is partly due to the naming. The tooling name should clearly indicate its purpose and scope. Therefore, I would like to hear your opinion on renaming Fleet to something that includes Ergo/ERG in its name.

Some possible alternatives are:

  • ErgoKit
  • erg.ts
  • w3erg (web3 + erg)
  • ErgoSDK.js
  • something else?
  • keep it as Fleet, you damn perfectionist.

v1.0 is quite close and that will represent breaking changes for implementors, so if we are going to rename it, a major release is a good opportunity for it.

I would love to know your opinions and suggestions on this proposal.

Replace TS enums by plain objects

TypeScript Enums are bad, consider replacing them by plain objects for improved compatibility and efficiency.

Plain object enum example:

export const ergoTreeHeaderFlags = {
  sizeInclusion: 0x08,
  constantSegregation: 0x10
} as const;

export type ErgoTreeHeaderFlag = (typeof ergoTreeHeaderFlags)[keyof typeof ergoTreeHeaderFlags];

Keep order of calls when minting tokens

from discord:

@capt_nemo @anon_br when I mint and transfer a token in one box as such
const singletonMintOutput = new OutputBuilder(mintTarget, changeAddress)
.addTokens(parentToken)
.mintToken({
amount: BigInt(1),
name: "SubNames Child Singleton",
decimals: 0,
description: "test"
})

I get the minted token at index 0 and the transferred one at index 1
is there anyway it can be done such that it is in order or the arguments?
so in the posted code, the transferred token should have been at index 0

More verbose logging for register type formatting errors

Script reduced to false input(n) is the only error which appears when register conditions are not met.

Verbose logging on which register of which output is malformed versus what the contract expects, and potentially why - would be incredibly helpful for front end developers who may be relying on web searches or limited instructions to debug information with ergo contract implementations.

Fix ESM and CJS exports

From MGpai on discord:

  import { Network } from "@fleet-sdk/core"
           ^^^^^^^
SyntaxError: Named export 'Network' not found. The requested module '@fleet-sdk/core' is a CommonJS module, which may not support all module.exports as named exports.
CommonJS modules can always be imported via the default export, for example using:

import pkg from '@fleet-sdk/core';
const { Network } = pkg;

    at ModuleJob._instantiate (node:internal/modules/esm/module_job:124:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:190:5)

Node.js v18.18.2

From @ross-weir on discord:

To fix ^ we either need to change the compiled esm files to be index.esm.js -> index.mjs or add type: module to package.json in all packages and update file extension of commonjs files index.cjs.js -> index.cjs

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.