5.7.113 • Published 11 months ago

@patrtorg/similique-corporis v5.7.113

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

@patrtorg/similique-corporis npm version

CAIP standard utils

ChainId (CAIP-2)

Object-oriented

import { ChainId } from "@patrtorg/similique-corporis";

const chainId = new ChainId("eip155:1");

// OR

const chainId = new ChainId({ namespace: "eip155", reference: "1" });

// THEN

chainId.toString();
// "eip155:1"

chainId.toJSON();
// { namespace: "eip155", reference: "1" }

Functional

import { ChainId } from "@patrtorg/similique-corporis";

ChainId.parse("eip155:1");
// { namespace: "eip155", reference: "1" }

// AND

ChainId.format({ namespace: "eip155", reference: "1" });
// "eip155:1"

AccountId (CAIP-10)

Object-oriented

import { AccountId } from "@patrtorg/similique-corporis";

const accountId = new AccountId(
  "eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"
);

// OR

const accountId = new AccountId({
  chainId: { namespace: "eip155", reference: "1" },
  address: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
});

// ALSO

const accountId = new AccountId({
  chainId: "eip155:1",
  address: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
});

// THEN

accountId.toString();
// "eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"

accountId.toJSON();
// { address: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb", chainId: { namespace: "eip155", reference: "1" } }

Functional

import { AccountId } from "@patrtorg/similique-corporis";

AccountId.parse("eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb");
// { address: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb", chainId: { namespace: "eip155", reference: "1" } }

// AND

AccountId.format({
  chainId: { namespace: "eip155", reference: "1" },
  address: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
});
//"eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"

// OR

AccountId.format({
  chainId: "eip155:1",
  address: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
});
//"eip155:1:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"

AssetId (CAIP-19)

Object-oriented

import { AssetId } from "@patrtorg/similique-corporis";

const assetId = new AssetId(
  "eip155:1/erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb/1"
);

// OR

const assetId = new AssetId({
  chainId: { namespace: "eip155", reference: "1" },
  assetName: {
    namespace: "erc721",
    reference: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
  },
  tokenId: "1",
});

// ALSO

const assetId = new AssetId({
  chainId: "eip155:1",
  assetName: "erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
  tokenId: "1",
});

// THEN

assetId.toString();
// "eip155:1/erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb/1"

assetId.toJSON();
// {
//   chainId: { namespace: "eip155", reference: "1" },
//   assetName: { namespace: "erc721", reference: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb" },
//   tokenId: "1",
// }

Functional

import { AssetId } from "@patrtorg/similique-corporis";

AssetId.parse("eip155:1/erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb/1");
// {
//   chainId: { namespace: "eip155", reference: "1" },
//   assetName: { namespace: "erc721", reference: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb" },
//   tokenId: "1",
// }

// AND

AssetId.format({
  chainId: { namespace: "eip155", reference: "1" },
  assetName: {
    namespace: "erc721",
    reference: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
  },
  tokenId: "1",
});
// "eip155:1/erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb/1"

// OR

AssetId.format({
  chainId: "eip155:1",
  assetName: "erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
  tokenId: "1",
});
// "eip155:1/erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb/1"

AssetType (CAIP-19)

Object-oriented

import { AssetType } from "@patrtorg/similique-corporis";

const assetType = new AssetType(
  "eip155:1/erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"
);

// OR

const assetType = new AssetType({
  chainId: { namespace: "eip155", reference: "1" },
  assetName: {
    namespace: "erc721",
    reference: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
  },
});

// ALSO

const assetType = new AssetType({
  chainId: "eip155:1",
  assetName: "erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
});

// THEN

assetType.toString();
// "eip155:1/erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"

assetType.toJSON();
// {
//   chainId: { namespace: "eip155", reference: "1" },
//   assetName: { namespace: "erc721", reference: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb" },
// }

Functional

import { AssetType } from "@patrtorg/similique-corporis";

AssetType.parse("eip155:1/erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb");
// {
//   chainId: { namespace: "eip155", reference: "1" },
//   assetName: { namespace: "erc721", reference: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb" },
// }

// AND

AssetType.format({
  chainId: { namespace: "eip155", reference: "1" },
  assetName: {
    namespace: "erc721",
    reference: "0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
  },
});
// "eip155:1/erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"

// OR

AssetType.format({
  chainId: "eip155:1",
  assetName: "erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb",
});
// "eip155:1/erc721:0xab16a96d359ec26a11e2c2b3d8f8b8942d5bfcdb"
whichstyleguideFloat32Arrayfork3djson-schema-validatortslibArray.prototype.flatteninputReactiveExtensionstermcurlanimationES2016apolloglobal this valueES2015ArraylockfilereverseclassnamesoptionjshintzerooptimizercircularserializeloadbalancinghasOwnexpressasterisksspringrecursiveES2017workspace:*chromeES6ES2021manipulationreusegenericsgloblibphonenumberdiffdirselflogbannerclienttapetelephoneJSONprunecharacterflatlruInt16ArrayReflect.getPrototypeOfupemrcoercibleformhookformreadablecensornativeTypeBoxECMAScript 2023widthdependency managerpoint-freeprotobufjestArray.prototype.includesparsepicomatchstoragegatewayeslint-plugines-abstractvpcresolvesettingsfantasy-landeslintconfigomites2018simpledbrobustObject.assignhelpersfunctioni18nxmlslicephonequoteObject.islistenersnopefrommodulesemitnegativefile systemsinatracontainsflagsbyteLengthloggercall-boundpathgetOwnPropertyDescriptorbinariesrangeerrorrmboundvesta11yfunction.lengthredirectwhatwghardlinkstypescriptbundlerastnpmassert[[Prototype]]Array.prototype.filtersidetraversepackagefunctionsloading_.extendstylesspawnincludesbabel-coreconcatMapPromisegesturesSetform-validationec2ECMAScript 2018ESslotpolyfillwalkingexecfilecallboundcreateArray.prototype.containspinopostcssimports3typanionfpsavajQuerytestingframeworksnsdropdescriptioncolumnsObject.getPrototypeOflinkescapeietranspilerArray.prototype.flatnodejsbindtextgroupByassertsgetterrandomsettercallbindcommand-lineoptimistWeakSetthreebeanstalksymbolWeakMapECMAScript 6superagenttestreact animationlastUint8ClampedArrayjsxtranspilerequiredeepclonetc39RegExp.prototype.flagscolores6schemarouteres2017fullwidthesiteratormulti-packagedotenvawesomesauceqslooktrimpopmotionjson-schema-validationObject.definePropertyURLSearchParamsserializerwritestructuredClonequeueTypeScriptoffseturlremoveclonewritableUint8Arrayreadablestreamclassnamewgetatomtostringtagsqsgraphqlpushl10nistanbulhttpschaiES2023ramdaUnderscoreformatting.gitignoreflagmergecurriedpyyamlmapreducegetoptmapRFC-6455directoryendertoArrayes2016matchAllequalstylingextrawebpositiveECMAScriptInt32ArrayaccessibilityObject.keysObject.valuesshamES2018browserslistargsmatchArrayBuffer.prototype.sliceecmascriptuuiddefinesetImmediatetrimLeft6to5call-bindobjectAsyncIteratorfastformatjapaneseObject.entriespnpm9specconstCSSStyleDeclarationjsonfolderdeepcopylook-uprmdirimmutablepluginlocalprefixmkdirskoreanserializationfetchlintprototakeObservablecoredebugdescriptorsStyleSheetfastifyFunction.prototype.nameStreamsECMAScript 7URLtoStringTagECMAScript 2020httphasOwnPropertyreact-testing-librarywafpropweaksetpatchutil.inspectESnextsyntaxprivatejsonschemacommanderequalitychannelECMAScript 2015reversedstarterpipeloggingcloudfrontSystem.globalrulesjoiFloat64Arraysharedarraybufferredux-toolkitcoverageinternal slotString.prototype.matchAllruntimehooksjavascriptmkdirwaitmatchesaccessortypedarrayssymbolsWebSocketses5makeperformanceString.prototype.trimIteratorRegExp#flagsjsviewcheckamazonestreeBigInt64Arrayenumerableponyfillstyled-componentses-shim APIfast-deep-copyprocesstrimRightregulareslintapiJSON-SchemaguideventsObjectvalidationinstallhashreworkasyncvarreal-timeacornclassespropertyindicatorsafedayjs
5.7.112

11 months ago

5.7.113

11 months ago

5.7.111

11 months ago

5.7.110

11 months ago

5.7.109

11 months ago

5.7.108

11 months ago

5.7.107

11 months ago

5.7.106

11 months ago

5.7.105

11 months ago

5.7.104

11 months ago

5.7.103

11 months ago

5.7.102

11 months ago

5.7.101

11 months ago

5.7.100

11 months ago

5.7.99

11 months ago

5.7.98

11 months ago

5.7.97

11 months ago

5.6.97

11 months ago

5.6.96

11 months ago

5.6.95

11 months ago

5.5.95

11 months ago

5.5.94

11 months ago

5.5.93

11 months ago

5.5.92

11 months ago

5.5.91

12 months ago

5.5.90

12 months ago

5.5.89

12 months ago

5.5.88

12 months ago

5.5.87

12 months ago

5.5.86

12 months ago

5.5.85

12 months ago

5.5.84

12 months ago

5.5.83

12 months ago

5.4.83

12 months ago

5.4.82

12 months ago

5.4.81

12 months ago

5.4.80

12 months ago

5.4.79

12 months ago

5.4.78

12 months ago

5.4.77

12 months ago

5.4.76

12 months ago

5.4.75

12 months ago

5.4.74

12 months ago

5.4.73

12 months ago

5.4.72

1 year ago

5.4.71

1 year ago

5.3.71

1 year ago

5.2.71

1 year ago

5.2.70

1 year ago

5.2.69

1 year ago

5.2.68

1 year ago

5.2.67

1 year ago

5.2.66

1 year ago

5.2.65

1 year ago

5.2.64

1 year ago

5.2.63

1 year ago

5.2.62

1 year ago

5.2.61

1 year ago

5.2.60

1 year ago

5.2.59

1 year ago

5.2.58

1 year ago

5.2.57

1 year ago

5.2.56

1 year ago

5.2.55

1 year ago

5.2.54

1 year ago

5.2.53

1 year ago

5.2.52

1 year ago

5.2.51

1 year ago

5.2.50

1 year ago

5.2.49

1 year ago

5.2.48

1 year ago

5.2.47

1 year ago

5.2.46

1 year ago

5.2.45

1 year ago

5.2.44

1 year ago

5.2.43

1 year ago

5.2.42

1 year ago

5.2.41

1 year ago

5.2.40

1 year ago

5.2.39

1 year ago

5.2.38

1 year ago

5.2.37

1 year ago

5.2.36

1 year ago

4.2.36

1 year ago

4.1.36

1 year ago

4.1.35

1 year ago

4.1.34

1 year ago

4.1.33

1 year ago

3.1.33

1 year ago

3.1.32

1 year ago

3.1.31

1 year ago

3.1.30

1 year ago

3.1.29

1 year ago

3.1.28

1 year ago

3.1.27

1 year ago

3.1.26

1 year ago

3.1.25

1 year ago

3.1.24

1 year ago

3.1.23

1 year ago

3.1.22

1 year ago

3.1.21

1 year ago

2.1.21

1 year ago

2.1.20

1 year ago

2.1.19

1 year ago

2.1.18

1 year ago

2.1.17

1 year ago

2.1.16

1 year ago

2.1.15

1 year ago

2.1.14

1 year ago

2.1.13

1 year ago

2.1.12

1 year ago

2.1.11

1 year ago

2.1.10

1 year ago

2.1.9

1 year ago

2.1.8

1 year ago

2.1.7

1 year ago

2.1.6

1 year ago

2.0.6

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.0.3

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago