@cancore/contracts 0.2.0-rc.19 → 0.2.0-rc.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/dist/{chunk-IAPV7XWJ.js → chunk-ZCQZ34HG.js} +20 -2
- package/dist/chunk-ZCQZ34HG.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +12 -5
- package/dist/index.js.map +1 -1
- package/dist/networks.js +1 -1
- package/package.json +29 -11
- package/spec/protocol/asyncapi.json +1 -0
- package/spec/protocol/messages.schema.json +1 -1
- package/spec/protocol/vectors/messages.json +1 -0
- package/dist/chunk-IAPV7XWJ.js.map +0 -1
package/dist/networks.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { NETWORKS, NETWORK_ALIASES, networkByChainId, networkKindOf, networkOf } from './chunk-
|
|
1
|
+
export { NETWORKS, NETWORK_ALIASES, networkByChainId, networkKindOf, networkOf } from './chunk-ZCQZ34HG.js';
|
|
2
2
|
//# sourceMappingURL=networks.js.map
|
|
3
3
|
//# sourceMappingURL=networks.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cancore/contracts",
|
|
3
|
-
"version": "0.2.0-rc.
|
|
3
|
+
"version": "0.2.0-rc.21",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "The Cancore EVM contracts as data: the ABIs of the Cancore EVM contracts and their custom-error selectors, the EIP-712 FeeClaim voucher and FillProof, the network registry; and the filler protocol v1: EIP-712 types and domains, hashing helpers, JSON Schemas, AsyncAPI, golden vectors.",
|
|
6
6
|
"exports": {
|
|
@@ -34,18 +34,36 @@
|
|
|
34
34
|
"bugs": {
|
|
35
35
|
"url": "https://github.com/Cancore-io/sdk/issues"
|
|
36
36
|
},
|
|
37
|
-
"keywords": [
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
37
|
+
"keywords": [
|
|
38
|
+
"canton",
|
|
39
|
+
"cancore",
|
|
40
|
+
"abi",
|
|
41
|
+
"htlc",
|
|
42
|
+
"evm",
|
|
43
|
+
"eip-712",
|
|
44
|
+
"contracts",
|
|
45
|
+
"filler-protocol",
|
|
46
|
+
"asyncapi",
|
|
47
|
+
"json-schema"
|
|
48
|
+
],
|
|
49
|
+
"files": [
|
|
50
|
+
"dist",
|
|
51
|
+
"spec",
|
|
52
|
+
"README.md",
|
|
53
|
+
"LICENSE"
|
|
54
|
+
],
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
},
|
|
58
|
+
"engines": {
|
|
59
|
+
"node": ">=26"
|
|
60
|
+
},
|
|
61
|
+
"dependencies": {
|
|
62
|
+
"@noble/hashes": "^1.8.0"
|
|
63
|
+
},
|
|
41
64
|
"scripts": {
|
|
42
65
|
"build": "tsup",
|
|
43
|
-
"prepack": "tsup --silent",
|
|
44
|
-
"prepublishOnly": "npm run build",
|
|
45
66
|
"sync": "node scripts/sync.mjs && node scripts/sync-typed-data.mjs",
|
|
46
67
|
"vectors": "node scripts/gen-protocol-vectors.mjs && node scripts/gen-settle-attestations.mjs && node scripts/gen-protocol-docs.mjs && node scripts/gen-router-vectors.mjs"
|
|
47
|
-
},
|
|
48
|
-
"dependencies": {
|
|
49
|
-
"@noble/hashes": "^1.8.0"
|
|
50
68
|
}
|
|
51
|
-
}
|
|
69
|
+
}
|
|
@@ -1048,6 +1048,7 @@
|
|
|
1048
1048
|
"orderHash": "0x65f9010d612499d381eefba1a2385b76982c9bdaf9ed15bedbafd7b09fb3b73b",
|
|
1049
1049
|
"attempt": 2,
|
|
1050
1050
|
"deliveryOrderCid": "00a1b2c3d4e5f6#fixture-delivery-order",
|
|
1051
|
+
"validFrom": "1790000040",
|
|
1051
1052
|
"validUntil": "1790000400",
|
|
1052
1053
|
"repayTo": "0x0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bc"
|
|
1053
1054
|
}
|
|
@@ -397,7 +397,7 @@
|
|
|
397
397
|
},
|
|
398
398
|
{
|
|
399
399
|
"if": { "type": "object", "properties": { "form": { "const": "canton" } }, "required": ["form"] },
|
|
400
|
-
"then": { "type": "object", "required": ["deliveryOrderCid", "validUntil", "repayTo"], "properties": { "deliveryOrderCid": { "type": "string", "minLength": 1 }, "validUntil": { "$ref": "#/$defs/timeS" }, "repayTo": { "$ref": "#/$defs/repayTo", "description": "the repayTo of the DeliveryOrder, = the filler's signed ticket.intent (S-22); fillerId is the envelope's" } } }
|
|
400
|
+
"then": { "type": "object", "required": ["deliveryOrderCid", "validUntil", "repayTo"], "properties": { "deliveryOrderCid": { "type": "string", "minLength": 1 }, "validFrom": { "$ref": "#/$defs/timeS", "description": "DeliveryOrder.validFrom, the order's floor: DeliveryOrder_Fill refuses before it, because the EVM source repays only filledAt >= openedAt (CAN-3026); the offered validFrom" }, "validUntil": { "$ref": "#/$defs/timeS" }, "repayTo": { "$ref": "#/$defs/repayTo", "description": "the repayTo of the DeliveryOrder, = the filler's signed ticket.intent (S-22); fillerId is the envelope's" } } }
|
|
401
401
|
}
|
|
402
402
|
]
|
|
403
403
|
},
|
|
@@ -367,6 +367,7 @@
|
|
|
367
367
|
"orderHash": "0x65f9010d612499d381eefba1a2385b76982c9bdaf9ed15bedbafd7b09fb3b73b",
|
|
368
368
|
"attempt": 2,
|
|
369
369
|
"deliveryOrderCid": "00a1b2c3d4e5f6#fixture-delivery-order",
|
|
370
|
+
"validFrom": "1790000040",
|
|
370
371
|
"validUntil": "1790000400",
|
|
371
372
|
"repayTo": "0x0000000000000000000000003c44cdddb6a900fa2b585dd299e03d12fa4293bc"
|
|
372
373
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/networks.ts"],"names":[],"mappings":";AA6BO,IAAM,QAAA,GAA8C;AAAA,EACzD,MAAA,EAAQ,EAAE,EAAA,EAAI,QAAA,EAAU,MAAM,QAAA,EAAU,IAAA,EAAM,QAAA,EAAU,O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,EAAA,EAAI,WAAA,EAAa,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,WAAA,EAAa,WAAA,EAAa,2BAAA,EAA6B,OAAA,EAAS,IAAA,EAAK;AAAA,EACvH,WAAA,EAAa,EAAE,EAAA,EAAI,aAAA,EAAe,IAAA,EAAM,MAAA,EAAQ,IAAA,EAAM,aAAA,EAAe,WAAA,EAAa,6BAAA,EAA+B,OAAA,EAAS,IAAA;AAC5H;AAGO,IAAM,eAAA,GAAoD,EAAE,GAAA,EAAK,UAAA;AAEjE,SAAS,UAAU,EAAA,EAAiC;AACzD,EAAA,OAAO,QAAA,CAAS,eAAA,CAAgB,EAAE,CAAA,IAAK,EAAE,CAAA;AAC3C;AAEO,SAAS,cAAc,EAAA,EAAqC;AACjE,EAAA,OAAO,SAAA,CAAU,EAAE,CAAA,EAAG,IAAA;AACxB;AAGO,SAAS,iBAAiB,OAAA,EAAsC;AACrE,EAAA,OAAO,MAAA,CAAO,OAAO,QAAQ,CAAA,CAAE,KAAK,CAAC,CAAA,KAAM,CAAA,CAAE,OAAA,KAAY,OAAO,CAAA;AAClE","file":"chunk-IAPV7XWJ.js","sourcesContent":["/**\n * `@cancore/contracts/networks` — the chains Cancore settles on, by the ids the\n * API uses (`sourceNetwork`, `targetNetwork` in an order are these keys).\n *\n * Three kinds, because three address formats and three signing models:\n * `evm` (0x…, EIP-155 chain id), `tron` (base58, same Solidity, no chain id in\n * the EVM sense), `canton` (party ids, no addresses at all). A caller that\n * branches on `kind` instead of on the id keeps working when a chain is added.\n *\n * Contract addresses live next door in `DEPLOYMENTS`, keyed by environment —\n * dev, testnet and mainnet each have their own HTLC. `BUILD_HASHES` (from `.`)\n * pins the build of a release, not what an address runs (see `DEPLOYMENTS`).\n */\n\nexport type NetworkKind = 'evm' | 'tron' | 'canton';\n\nexport interface Network {\n /** The id the Cancore API uses for this chain. */\n id: string;\n kind: NetworkKind;\n name: string;\n /** EIP-155 chain id; absent for Tron and Canton. */\n chainId?: number;\n /** Where a transaction or address of this chain can be looked at. */\n explorerUrl?: string;\n nativeCurrency?: { name: string; symbol: string; decimals: number };\n testnet: boolean;\n}\n\nexport const NETWORKS: Readonly<Record<string, Network>> = {\n canton: { id: 'canton', kind: 'canton', name: 'Canton', testnet: false },\n ethereum: {\n id: 'ethereum', kind: 'evm', name: 'Ethereum', chainId: 1, explorerUrl: 'https://etherscan.io',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, testnet: false,\n },\n sepolia: {\n id: 'sepolia', kind: 'evm', name: 'Sepolia', chainId: 11155111, explorerUrl: 'https://sepolia.etherscan.io',\n nativeCurrency: { name: 'Sepolia ETH', symbol: 'ETH', decimals: 18 }, testnet: true,\n },\n bnb: {\n id: 'bnb', kind: 'evm', name: 'BNB Chain', chainId: 56, explorerUrl: 'https://bscscan.com',\n nativeCurrency: { name: 'BNB', symbol: 'BNB', decimals: 18 }, testnet: false,\n },\n bnb_testnet: {\n id: 'bnb_testnet', kind: 'evm', name: 'BNB Testnet', chainId: 97, explorerUrl: 'https://testnet.bscscan.com',\n nativeCurrency: { name: 'Test BNB', symbol: 'tBNB', decimals: 18 }, testnet: true,\n },\n arbitrum: {\n id: 'arbitrum', kind: 'evm', name: 'Arbitrum One', chainId: 42161, explorerUrl: 'https://arbiscan.io',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, testnet: false,\n },\n arbitrum_sepolia: {\n id: 'arbitrum_sepolia', kind: 'evm', name: 'Arbitrum Sepolia', chainId: 421614, explorerUrl: 'https://sepolia.arbiscan.io',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, testnet: true,\n },\n robinhood: {\n id: 'robinhood', kind: 'evm', name: 'Robinhood Chain', chainId: 4663, explorerUrl: 'https://robinhoodchain.blockscout.com',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, testnet: false,\n },\n robinhood_testnet: {\n id: 'robinhood_testnet', kind: 'evm', name: 'Robinhood Testnet', chainId: 46630, explorerUrl: 'https://explorer.testnet.chain.robinhood.com',\n nativeCurrency: { name: 'Ether', symbol: 'ETH', decimals: 18 }, testnet: true,\n },\n tron_nile: { id: 'tron_nile', kind: 'tron', name: 'Tron Nile', explorerUrl: 'https://nile.tronscan.org', testnet: true },\n tron_shasta: { id: 'tron_shasta', kind: 'tron', name: 'Tron Shasta', explorerUrl: 'https://shasta.tronscan.org', testnet: true },\n};\n\n/** `eth` is an older alias of `ethereum` still seen in order payloads. */\nexport const NETWORK_ALIASES: Readonly<Record<string, string>> = { eth: 'ethereum' };\n\nexport function networkOf(id: string): Network | undefined {\n return NETWORKS[NETWORK_ALIASES[id] ?? id];\n}\n\nexport function networkKindOf(id: string): NetworkKind | undefined {\n return networkOf(id)?.kind;\n}\n\n/** The network for an EIP-155 chain id, e.g. from a wallet's `eth_chainId`. */\nexport function networkByChainId(chainId: number): Network | undefined {\n return Object.values(NETWORKS).find((n) => n.chainId === chainId);\n}\n"]}
|