npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

freight-trust-x12-interchange

v0.9.2

Published

This is the default package.json generated for your project

Downloads

3

Readme

Interchange Standard Reference Implementation

This is an implementation of the interchangeSet function form X12 and the Interchange Group functions from the X12 Electronic Data Interchange Standard.

Note: You must have a commerical developers license to use this in production, or you mat transact through our deployments in which we have a commerical license for usage.

The interchangeSet implementation avoids data storage read and writes. Fits 8 function selectors in a single data storage slot.

The contracts/InterchangeExample.sol file shows an example of implementing X12 4010 850 EDI Data Interchange

The test/interchangeExampleTest.js file gives tests for the interchangeSet function and the Interchange Group functions.

The Implementaiton is the boilerplate code you need for a X12 Interchange Contract.

The InterchangeSegment.sol and InterchangeGroupSegment.sol contracts implement the interchangeSet function and the TA1 (i.e. Acknowledgement) functions.

The InterchangeExample.sol This contract is the Interchange Proxy. It enables upgradability in the event of contract mishap.

The InterchangeStorageContract.sol shows how to implement Interchange Transaction Data Storage. This contract includes contract ownership which can be updated should your Trading Channel conclude (e.g. you no longer do business with your counterparty).

Interchange Functions

In order to call a function that exists in an addressable Interchange you need to use the ABI information of the segment that has the function.

This infromation is provided in the TradingChannel typically. Open ABI Information for "Open Trading Channels" are a phase 2 implementation. See Roadmap

Here is an example that uses web3.js:

let GSGTPairingSegment = new web3.eth.Contract(
  GSGTPairingSegment.abi,
  interchangeAddress
);

In the code above we create a contract variable so we can call contract functions with it.

In this example we know we will use a interchange because we pass a interchange's address as the second argument. But we are using an ABI from the GSGTPairingSegment segment so we can call functions that are defined in that segment. GSGTPairingSegment's functions must have been added to the interchange (using interchangeSet) in order for the interchange to use the function information provided by the ABI of course.

Similarly you need to use the ABI of a segment in Solidity code in order to call functions from a interchange. Here's an example of Solidity code that calls a function from a interchange:

string result = GSGTPairingSegment(interchangeAddress).getResult()

Security

Contact

License

MIT license for Solidity Code Only X12.org retains all copyright and rights to the X12 EDI Transaction Set under the Commerical License