5.7.113 • Published 10 months ago

@patrtorg/similique-corporis v5.7.113

Weekly downloads
-
License
MIT
Repository
github
Last release
10 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

10 months ago

5.7.113

10 months ago

5.7.111

10 months ago

5.7.110

10 months ago

5.7.109

10 months ago

5.7.108

10 months ago

5.7.107

10 months ago

5.7.106

10 months ago

5.7.105

10 months ago

5.7.104

10 months ago

5.7.103

10 months ago

5.7.102

10 months ago

5.7.101

10 months ago

5.7.100

10 months ago

5.7.99

10 months ago

5.7.98

10 months ago

5.7.97

10 months ago

5.6.97

10 months ago

5.6.96

10 months ago

5.6.95

10 months ago

5.5.95

10 months ago

5.5.94

11 months ago

5.5.93

11 months ago

5.5.92

11 months ago

5.5.91

11 months ago

5.5.90

11 months ago

5.5.89

11 months ago

5.5.88

11 months ago

5.5.87

11 months ago

5.5.86

11 months ago

5.5.85

11 months ago

5.5.84

11 months ago

5.5.83

11 months ago

5.4.83

11 months ago

5.4.82

11 months ago

5.4.81

11 months ago

5.4.80

11 months ago

5.4.79

11 months ago

5.4.78

11 months ago

5.4.77

11 months ago

5.4.76

11 months ago

5.4.75

11 months ago

5.4.74

11 months ago

5.4.73

11 months ago

5.4.72

11 months ago

5.4.71

11 months ago

5.3.71

11 months ago

5.2.71

11 months ago

5.2.70

11 months ago

5.2.69

11 months ago

5.2.68

11 months ago

5.2.67

12 months ago

5.2.66

12 months ago

5.2.65

12 months ago

5.2.64

12 months ago

5.2.63

12 months ago

5.2.62

12 months ago

5.2.61

12 months ago

5.2.60

12 months ago

5.2.59

12 months ago

5.2.58

12 months ago

5.2.57

12 months ago

5.2.56

12 months ago

5.2.55

12 months ago

5.2.54

12 months ago

5.2.53

12 months ago

5.2.52

12 months ago

5.2.51

12 months ago

5.2.50

12 months ago

5.2.49

12 months ago

5.2.48

12 months 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