sablier 3.8.0 → 3.9.0
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/CHANGELOG.md +8 -0
- package/dist/cjs/evm/helpers.js +2 -1
- package/dist/cjs/evm/helpers.js.map +1 -1
- package/dist/cjs/evm/index.js +2 -1
- package/dist/cjs/evm/index.js.map +1 -1
- package/dist/cjs/evm/releases/features.js +4 -0
- package/dist/cjs/evm/releases/features.js.map +1 -1
- package/dist/esm/evm/helpers.js +1 -1
- package/dist/esm/evm/helpers.js.map +1 -1
- package/dist/esm/evm/index.js +1 -1
- package/dist/esm/evm/index.js.map +1 -1
- package/dist/esm/evm/releases/features.js +3 -0
- package/dist/esm/evm/releases/features.js.map +1 -1
- package/dist/types/evm/helpers.d.ts +1 -1
- package/dist/types/evm/helpers.d.ts.map +1 -1
- package/dist/types/evm/index.d.ts +1 -1
- package/dist/types/evm/index.d.ts.map +1 -1
- package/dist/types/evm/releases/features.d.ts +1 -0
- package/dist/types/evm/releases/features.d.ts.map +1 -1
- package/package.json +1 -2
package/CHANGELOG.md
CHANGED
|
@@ -9,6 +9,7 @@ The format is based on [Common Changelog](https://common-changelog.org/).
|
|
|
9
9
|
> Starting with v2.0.0, this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). In v1.x, it
|
|
10
10
|
> did not always follow Semantic Versioning.
|
|
11
11
|
|
|
12
|
+
[3.9.0]: https://github.com/sablier-labs/sdk/releases/tag/v3.9.0
|
|
12
13
|
[3.8.0]: https://github.com/sablier-labs/sdk/releases/tag/v3.8.0
|
|
13
14
|
[3.7.5]: https://github.com/sablier-labs/sdk/releases/tag/v3.7.5
|
|
14
15
|
[3.7.4]: https://github.com/sablier-labs/sdk/releases/tag/v3.7.4
|
|
@@ -49,6 +50,13 @@ The format is based on [Common Changelog](https://common-changelog.org/).
|
|
|
49
50
|
[1.1.0]: https://github.com/sablier-labs/sdk/releases/tag/v1.1.0
|
|
50
51
|
[1.0.0]: https://github.com/sablier-labs/sdk/releases/tag/v1.0.0
|
|
51
52
|
|
|
53
|
+
## [3.9.0] - 2026-04-16
|
|
54
|
+
|
|
55
|
+
### Added
|
|
56
|
+
|
|
57
|
+
- Add `hasSimpleTransfer` helper that reports whether a Flow release exposes the `transferTokens` ERC-20 wrapper
|
|
58
|
+
([`59530a2`](https://github.com/sablier-labs/sdk/commit/59530a2))
|
|
59
|
+
|
|
52
60
|
## [3.8.0] - 2026-04-16
|
|
53
61
|
|
|
54
62
|
### Added
|
package/dist/cjs/evm/helpers.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.usesLockupSplit = exports.supportsLockupShape = exports.supportsLockupPrbProxy = exports.supportsLockupBatch = exports.isEvmReleasePayable = exports.hasSponsor = exports.hasSplitLockupArchitecture = exports.hasOnchainMinFee = exports.hasClaimTo = exports.getLockupReleaseFeatures = exports.getFlowReleaseFeatures = exports.getEvmReleaseFeatures = exports.getAirdropsReleaseFeatures = exports.evmReleaseFeatures = void 0;
|
|
3
|
+
exports.usesLockupSplit = exports.supportsLockupShape = exports.supportsLockupPrbProxy = exports.supportsLockupBatch = exports.isEvmReleasePayable = exports.hasSponsor = exports.hasSplitLockupArchitecture = exports.hasSimpleTransfer = exports.hasOnchainMinFee = exports.hasClaimTo = exports.getLockupReleaseFeatures = exports.getFlowReleaseFeatures = exports.getEvmReleaseFeatures = exports.getAirdropsReleaseFeatures = exports.evmReleaseFeatures = void 0;
|
|
4
4
|
exports.getContractExplorerURL = getContractExplorerURL;
|
|
5
5
|
exports.resolveEvmStreamId = resolveEvmStreamId;
|
|
6
6
|
exports.resolveEvmContractByAlias = resolveEvmContractByAlias;
|
|
@@ -16,6 +16,7 @@ Object.defineProperty(exports, "getFlowReleaseFeatures", { enumerable: true, get
|
|
|
16
16
|
Object.defineProperty(exports, "getLockupReleaseFeatures", { enumerable: true, get: function () { return features_js_1.getLockupReleaseFeatures; } });
|
|
17
17
|
Object.defineProperty(exports, "hasClaimTo", { enumerable: true, get: function () { return features_js_1.hasClaimTo; } });
|
|
18
18
|
Object.defineProperty(exports, "hasOnchainMinFee", { enumerable: true, get: function () { return features_js_1.hasOnchainMinFee; } });
|
|
19
|
+
Object.defineProperty(exports, "hasSimpleTransfer", { enumerable: true, get: function () { return features_js_1.hasSimpleTransfer; } });
|
|
19
20
|
Object.defineProperty(exports, "hasSplitLockupArchitecture", { enumerable: true, get: function () { return features_js_1.hasSplitLockupArchitecture; } });
|
|
20
21
|
Object.defineProperty(exports, "hasSponsor", { enumerable: true, get: function () { return features_js_1.hasSponsor; } });
|
|
21
22
|
Object.defineProperty(exports, "isEvmReleasePayable", { enumerable: true, get: function () { return features_js_1.isEvmReleasePayable; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/evm/helpers.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/evm/helpers.ts"],"names":[],"mappings":";;;AAuCA,wDAEC;AAkBD,gDAUC;AAeD,8DAyCC;AAaD,gDAoBC;AA1JD,0EAAgH;AAEhH,mEAA+D;AAC/D,yCAAsC;AAQtC,sDAgBgC;AAf9B,iHAAA,kBAAkB,OAAA;AAClB,yHAAA,0BAA0B,OAAA;AAC1B,oHAAA,qBAAqB,OAAA;AACrB,qHAAA,sBAAsB,OAAA;AACtB,uHAAA,wBAAwB,OAAA;AACxB,yGAAA,UAAU,OAAA;AACV,+GAAA,gBAAgB,OAAA;AAChB,gHAAA,iBAAiB,OAAA;AACjB,yHAAA,0BAA0B,OAAA;AAC1B,yGAAA,UAAU,OAAA;AACV,kHAAA,mBAAmB,OAAA;AACnB,kHAAA,mBAAmB,OAAA;AACnB,qHAAA,sBAAsB,OAAA;AACtB,kHAAA,mBAAmB,OAAA;AACnB,8GAAA,eAAe,OAAA;AASj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SAC/C,MAAM,CAAC,OAAO,CAA2B,CAAC;IAE7C,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,4CAA4C,KAAK,cAAc,OAAO,EAAE,CAAC,CAAC;IAC5F,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CACb,8CAA8C,KAAK,cAAc,OAAO,oBAAoB,CAC7F,CAAC;IACJ,CAAC;IAED,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAaD,SAAgB,kBAAkB,CAChC,OAA4B,EAC5B,OAAgC;IAEhC,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,KAAK,GAAG,OAAO,EAAE,KAAK,IAAI,CAAC,CAAC;IAClC,MAAM,GAAG,GAAG,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAC9B,MAAM,SAAS,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC;IAElC,IAAI,OAAO,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;QAChC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;IAEpD,OAAO,GAAG,MAAM,MAAM,MAAM,EAAE,CAAC;AACjC,CAAC","sourcesContent":["// NOTE: evm/index.ts uses explicit named re-exports instead of `export *` for\n// this module. When adding or removing a public export here, mirror the change\n// in evm/index.ts. The \"barrel re-exports every helpers symbol\" test in\n// tests/package-exports.test.ts will catch any drift.\nimport { getContractExplorerURL as getContractExplorerURLInternal } from \"@/src/internal/utils/explorer-url.js\";\nimport type { Sablier, TruncateAddressOptions } from \"@/src/types.js\";\nimport { getAliasCatalog } from \"./contracts/alias-catalog.js\";\nimport { Protocol } from \"./enums.js\";\n\nexport type {\n EvmReleaseFeatureSetByProtocol,\n EvmReleaseVersionByProtocol,\n PayableEvmProtocol,\n ReleaseFeaturesForProtocol,\n} from \"./releases/features.js\";\nexport {\n evmReleaseFeatures,\n getAirdropsReleaseFeatures,\n getEvmReleaseFeatures,\n getFlowReleaseFeatures,\n getLockupReleaseFeatures,\n hasClaimTo,\n hasOnchainMinFee,\n hasSimpleTransfer,\n hasSplitLockupArchitecture,\n hasSponsor,\n isEvmReleasePayable,\n supportsLockupBatch,\n supportsLockupPrbProxy,\n supportsLockupShape,\n usesLockupSplit,\n} from \"./releases/features.js\";\n\n/**\n * Get the explorer URL for a contract. Compatible with Etherscan, Blockscout, etc.\n * @param explorerURL - The base explorer URL, e.g. https://etherscan.io\n * @param contractAddress - The contract object\n * @returns The explorer URL for the contract, e.g. https://etherscan.io/address/0x123...\n */\nexport function getContractExplorerURL(explorerURL: string, contractAddress: Sablier.EVM.Address) {\n return getContractExplorerURLInternal(explorerURL, contractAddress);\n}\n\n/**\n * Constructs a stream/airdrop entity ID for EVM chains in the format used by Sablier indexers.\n * Format: `{contractAddress}-{chainId}-{tokenId}`\n *\n * The contract address is lowercased for normalization, as EVM addresses are case-insensitive.\n *\n * @param opts - Configuration object\n * @param opts.alias - Contract alias (e.g., \"LL2\", \"LK2\", \"FL2\")\n * @param opts.chainId - Chain ID where the contract is deployed\n * @param opts.tokenId - Stream/airdrop token ID\n * @param opts.protocol - Optional protocol to disambiguate aliases\n * @returns Stream ID in format \"0xabc...-1-123\"\n * @example\n * resolveEvmStreamId({ alias: \"LL2\", chainId: 1, tokenId: 123n })\n * // => \"0xabc...-1-123\"\n */\nexport function resolveEvmStreamId(opts: {\n alias: string;\n chainId: number;\n tokenId: bigint | string | number;\n protocol?: Sablier.EVM.Protocol;\n}): string {\n const { alias, chainId, tokenId, protocol } = opts;\n\n const contract = resolveEvmContractByAlias({ alias, chainId, protocol });\n return `${contract.address.toLowerCase()}-${chainId}-${tokenId}`;\n}\n\n/**\n * Resolves an EVM contract by its alias from the alias catalog.\n *\n * @param opts - Configuration object\n * @param opts.alias - Contract alias (e.g., \"LL2\", \"LK2\", \"FL2\")\n * @param opts.chainId - Chain ID where the contract is deployed\n * @param opts.protocol - Optional protocol to disambiguate aliases that exist in multiple protocols\n * @returns The resolved contract\n * @throws Error if alias is not found or is ambiguous without protocol specified\n * @example\n * resolveEvmContractByAlias({ alias: \"LL2\", chainId: 1 })\n * // => { address: \"0x...\", name: \"SablierLockupLinear\", ... }\n */\nexport function resolveEvmContractByAlias(opts: {\n alias: string;\n chainId: number;\n protocol?: Sablier.EVM.Protocol;\n}): Sablier.EVM.Contract {\n const { alias, chainId, protocol } = opts;\n const aliasCatalog = getAliasCatalog();\n\n if (protocol) {\n const contract = aliasCatalog[protocol]?.[chainId]?.[alias];\n if (!contract) {\n throw new Error(\n `Sablier SDK: Unknown EVM contract alias \"${alias}\" on chain ${chainId} for protocol \"${protocol}\"`\n );\n }\n return contract;\n }\n\n const protocols: Sablier.EVM.Protocol[] = [\n Protocol.Airdrops,\n Protocol.Bob,\n Protocol.Flow,\n Protocol.Legacy,\n Protocol.Lockup,\n ];\n\n const matches = protocols\n .map((p) => aliasCatalog[p]?.[chainId]?.[alias])\n .filter(Boolean) as Sablier.EVM.Contract[];\n\n if (matches.length === 0) {\n throw new Error(`Sablier SDK: Unknown EVM contract alias \"${alias}\" on chain ${chainId}`);\n }\n\n if (matches.length > 1) {\n throw new Error(\n `Sablier SDK: Ambiguous EVM contract alias \"${alias}\" on chain ${chainId}; specify protocol`\n );\n }\n\n return matches[0];\n}\n\n/**\n * Truncate an Ethereum address for display purposes.\n * @param address - The Ethereum address to truncate (0x-prefixed)\n * @param options - Truncation options with start/end character counts (default: 4 each, must be >= 1)\n * @returns Truncated address in format \"0xcafe...beef\" or original if too short\n * @example\n * truncateEvmAddress(\"0x1234567890abcdef1234567890abcdef12345678\") // \"0x1234...5678\"\n * truncateEvmAddress(\"0x1234567890abcdef1234567890abcdef12345678\", { start: 6, end: 6 }) // \"0x123456...345678\"\n * truncateEvmAddress(\"0x1234567890abcdef1234567890abcdef12345678\", { start: 2, end: 6 }) // \"0x12...345678\"\n * truncateEvmAddress(\"0x123\") // \"0x123\" (too short, returns original)\n */\nexport function truncateEvmAddress(\n address: Sablier.EVM.Address,\n options?: TruncateAddressOptions\n): string {\n if (!address) {\n return address;\n }\n\n const start = options?.start ?? 4;\n const end = options?.end ?? 4;\n const minLength = 2 + start + end;\n\n if (address.length <= minLength) {\n return address;\n }\n\n const prefix = address.slice(0, 2 + start);\n const suffix = end === 0 ? \"\" : address.slice(-end);\n\n return `${prefix}...${suffix}`;\n}\n"]}
|
package/dist/cjs/evm/index.js
CHANGED
|
@@ -36,7 +36,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.usesLockupSplit = exports.truncateEvmAddress = exports.supportsLockupShape = exports.supportsLockupPrbProxy = exports.supportsLockupBatch = exports.resolveEvmStreamId = exports.resolveEvmContractByAlias = exports.isEvmReleasePayable = exports.hasSponsor = exports.hasSplitLockupArchitecture = exports.hasOnchainMinFee = exports.hasClaimTo = exports.getLockupReleaseFeatures = exports.getFlowReleaseFeatures = exports.getEvmReleaseFeatures = exports.getContractExplorerURL = exports.getAirdropsReleaseFeatures = exports.evmReleaseFeatures = exports.csv = exports.comptroller = exports.chains = void 0;
|
|
39
|
+
exports.usesLockupSplit = exports.truncateEvmAddress = exports.supportsLockupShape = exports.supportsLockupPrbProxy = exports.supportsLockupBatch = exports.resolveEvmStreamId = exports.resolveEvmContractByAlias = exports.isEvmReleasePayable = exports.hasSponsor = exports.hasSplitLockupArchitecture = exports.hasSimpleTransfer = exports.hasOnchainMinFee = exports.hasClaimTo = exports.getLockupReleaseFeatures = exports.getFlowReleaseFeatures = exports.getEvmReleaseFeatures = exports.getContractExplorerURL = exports.getAirdropsReleaseFeatures = exports.evmReleaseFeatures = exports.csv = exports.comptroller = exports.chains = void 0;
|
|
40
40
|
var index_js_1 = require("./chains/index.js");
|
|
41
41
|
Object.defineProperty(exports, "chains", { enumerable: true, get: function () { return index_js_1.chains; } });
|
|
42
42
|
__exportStar(require("./compatibility.js"), exports);
|
|
@@ -54,6 +54,7 @@ Object.defineProperty(exports, "getFlowReleaseFeatures", { enumerable: true, get
|
|
|
54
54
|
Object.defineProperty(exports, "getLockupReleaseFeatures", { enumerable: true, get: function () { return helpers_js_1.getLockupReleaseFeatures; } });
|
|
55
55
|
Object.defineProperty(exports, "hasClaimTo", { enumerable: true, get: function () { return helpers_js_1.hasClaimTo; } });
|
|
56
56
|
Object.defineProperty(exports, "hasOnchainMinFee", { enumerable: true, get: function () { return helpers_js_1.hasOnchainMinFee; } });
|
|
57
|
+
Object.defineProperty(exports, "hasSimpleTransfer", { enumerable: true, get: function () { return helpers_js_1.hasSimpleTransfer; } });
|
|
57
58
|
Object.defineProperty(exports, "hasSplitLockupArchitecture", { enumerable: true, get: function () { return helpers_js_1.hasSplitLockupArchitecture; } });
|
|
58
59
|
Object.defineProperty(exports, "hasSponsor", { enumerable: true, get: function () { return helpers_js_1.hasSponsor; } });
|
|
59
60
|
Object.defineProperty(exports, "isEvmReleasePayable", { enumerable: true, get: function () { return helpers_js_1.isEvmReleasePayable; } });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/evm/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAA2C;AAAlC,kGAAA,MAAM,OAAA;AACf,qDAAmC;AACnC,mDAAqD;AAA5C,uGAAA,WAAW,OAAA;AACpB,uDAAqC;AACrC,sDAAsC;AACtC,6CAA2B;AAe3B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/evm/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAA2C;AAAlC,kGAAA,MAAM,OAAA;AACf,qDAAmC;AACnC,mDAAqD;AAA5C,uGAAA,WAAW,OAAA;AACpB,uDAAqC;AACrC,sDAAsC;AACtC,6CAA2B;AAe3B,2CAoBsB;AAnBpB,gHAAA,kBAAkB,OAAA;AAClB,wHAAA,0BAA0B,OAAA;AAC1B,oHAAA,sBAAsB,OAAA;AACtB,mHAAA,qBAAqB,OAAA;AACrB,oHAAA,sBAAsB,OAAA;AACtB,sHAAA,wBAAwB,OAAA;AACxB,wGAAA,UAAU,OAAA;AACV,8GAAA,gBAAgB,OAAA;AAChB,+GAAA,iBAAiB,OAAA;AACjB,wHAAA,0BAA0B,OAAA;AAC1B,wGAAA,UAAU,OAAA;AACV,iHAAA,mBAAmB,OAAA;AACnB,uHAAA,yBAAyB,OAAA;AACzB,gHAAA,kBAAkB,OAAA;AAClB,iHAAA,mBAAmB,OAAA;AACnB,oHAAA,sBAAsB,OAAA;AACtB,iHAAA,mBAAmB,OAAA;AACnB,gHAAA,kBAAkB,OAAA;AAClB,6GAAA,eAAe,OAAA;AAEjB,sDAAoC","sourcesContent":["export { chains } from \"./chains/index.js\";\nexport * from \"./compatibility.js\";\nexport { comptroller } from \"./comptroller/index.js\";\nexport * from \"./contracts/index.js\";\nexport * as csv from \"./csv/index.js\";\nexport * from \"./enums.js\";\n// Re-export the release-feature helpers explicitly from the `sablier/evm`\n// entrypoint instead of relying only on `export * from \"./helpers.js\"`.\n//\n// Some downstream type-checkers were able to see simple barrel exports such as\n// `enums`, but failed to resolve these helper names through the extra\n// `evm -> helpers -> releases/features` re-export hop. Listing them here keeps\n// the generated `dist/types/evm/index.d.ts` surface direct and easier for\n// consumers to resolve.\nexport type {\n EvmReleaseFeatureSetByProtocol,\n EvmReleaseVersionByProtocol,\n PayableEvmProtocol,\n ReleaseFeaturesForProtocol,\n} from \"./helpers.js\";\nexport {\n evmReleaseFeatures,\n getAirdropsReleaseFeatures,\n getContractExplorerURL,\n getEvmReleaseFeatures,\n getFlowReleaseFeatures,\n getLockupReleaseFeatures,\n hasClaimTo,\n hasOnchainMinFee,\n hasSimpleTransfer,\n hasSplitLockupArchitecture,\n hasSponsor,\n isEvmReleasePayable,\n resolveEvmContractByAlias,\n resolveEvmStreamId,\n supportsLockupBatch,\n supportsLockupPrbProxy,\n supportsLockupShape,\n truncateEvmAddress,\n usesLockupSplit,\n} from \"./helpers.js\";\nexport * from \"./releases/index.js\";\n"]}
|
|
@@ -8,6 +8,7 @@ exports.getLockupReleaseFeatures = getLockupReleaseFeatures;
|
|
|
8
8
|
exports.hasClaimTo = hasClaimTo;
|
|
9
9
|
exports.hasSponsor = hasSponsor;
|
|
10
10
|
exports.hasOnchainMinFee = hasOnchainMinFee;
|
|
11
|
+
exports.hasSimpleTransfer = hasSimpleTransfer;
|
|
11
12
|
exports.hasSplitLockupArchitecture = hasSplitLockupArchitecture;
|
|
12
13
|
exports.isEvmReleasePayable = isEvmReleasePayable;
|
|
13
14
|
exports.supportsLockupBatch = supportsLockupBatch;
|
|
@@ -167,6 +168,9 @@ function hasOnchainMinFee(releaseOrProtocol, version) {
|
|
|
167
168
|
return false;
|
|
168
169
|
}
|
|
169
170
|
}
|
|
171
|
+
function hasSimpleTransfer(version) {
|
|
172
|
+
return getFlowReleaseFeatures(version)?.simpleTransfer ?? false;
|
|
173
|
+
}
|
|
170
174
|
function hasSplitLockupArchitecture(version) {
|
|
171
175
|
return getLockupReleaseFeatures(version)?.legacyAbi ?? false;
|
|
172
176
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../../../src/evm/releases/features.ts"],"names":[],"mappings":";;;AA+OA,gEAQC;AAKD,sDAKC;AAMD,wDAQC;AAMD,4DAQC;AAMD,gCAE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,CAAC;AACH,CAAC;AAMD,SAAgB,0BAA0B,CAAC,OAA4B;IACrE,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,SAAS,IAAI,KAAK,CAAC;AAC/D,CAAC;AAGY,QAAA,eAAe,GAAG,0BAA0B,CAAC;AAa1D,SAAgB,mBAAmB,CACjC,iBAA6D,EAC7D,OAA6B;IAE7B,MAAM,OAAO,GAAG,4BAA4B,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAEzE,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,QAAQ,GAAG,0BAAkB,CAAC,OAAO,CAAC,QAAQ,CAAyC,CAAC;IAC9F,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;AAC3C,CAAC;AAMD,SAAgB,mBAAmB,CAAC,OAA4B;IAC9D,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC;AAC3D,CAAC;AAMD,SAAgB,sBAAsB,CAAC,OAA4B;IACjE,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,QAAQ,IAAI,KAAK,CAAC;AAC9D,CAAC;AAMD,SAAgB,mBAAmB,CAAC,OAA4B;IAC9D,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC;AAC3D,CAAC","sourcesContent":["/**\n * @file Canonical capability registry for every shipped EVM release.\n *\n * Release builders attach these feature bags to exported release objects, and\n * helper functions read from the same registry so version-dependent behavior\n * stays defined in one place.\n */\nimport { Protocol, Version } from \"@/src/evm/enums.js\";\nimport type { Sablier } from \"@/src/types.js\";\n\n/* -------------------------------------------------------------------------- */\n/* TYPES */\n/* -------------------------------------------------------------------------- */\n\nexport type EvmReleaseVersionByProtocol = {\n airdrops: Sablier.EVM.Version.Airdrops;\n bob: Sablier.EVM.Version.Bob;\n flow: Sablier.EVM.Version.Flow;\n legacy: Sablier.EVM.Version.Legacy;\n lockup: Sablier.EVM.Version.Lockup;\n};\n\nexport type EvmReleaseFeatureSetByProtocol = {\n airdrops: Sablier.EVM.AirdropsReleaseFeatures;\n bob: Sablier.EVM.EmptyReleaseFeatures;\n flow: Sablier.EVM.FlowReleaseFeatures;\n legacy: Sablier.EVM.EmptyReleaseFeatures;\n lockup: Sablier.EVM.LockupReleaseFeatures;\n};\n\ntype EvmReleaseFeatureRegistry = {\n [TProtocol in keyof EvmReleaseVersionByProtocol]: Record<\n EvmReleaseVersionByProtocol[TProtocol],\n EvmReleaseFeatureSetByProtocol[TProtocol]\n >;\n};\n\nexport type ReleaseFeaturesForProtocol<TProtocol extends keyof EvmReleaseFeatureSetByProtocol> =\n EvmReleaseFeatureSetByProtocol[TProtocol];\n\ntype ProtocolFeatureSet<TProtocol extends keyof EvmReleaseFeatureSetByProtocol> =\n EvmReleaseFeatureSetByProtocol[TProtocol];\n\ntype ProtocolWithBooleanFeature<TFeature extends PropertyKey> = {\n [TProtocol in keyof EvmReleaseFeatureSetByProtocol]: ProtocolFeatureSet<TProtocol> extends Record<\n TFeature,\n boolean\n >\n ? TProtocol\n : never;\n}[keyof EvmReleaseFeatureSetByProtocol];\n\ntype EvmReleaseReference = Pick<Sablier.EVM.Release, \"protocol\" | \"version\">;\ntype PayableEvmReleaseReference = {\n [TProtocol in PayableEvmProtocol]: {\n protocol: TProtocol;\n version: EvmReleaseVersionByProtocol[TProtocol];\n };\n}[PayableEvmProtocol];\n\nfunction deepFreeze<T>(value: T): T {\n if (typeof value !== \"object\" || value === null || Object.isFrozen(value)) {\n return value;\n }\n\n for (const nestedValue of Object.values(value as Record<string, unknown>)) {\n deepFreeze(nestedValue);\n }\n\n return Object.freeze(value);\n}\n\nconst emptyReleaseFeatures = deepFreeze({} as const satisfies Sablier.EVM.EmptyReleaseFeatures);\n\n/**\n * Protocol/version feature matrix used by both release resolvers and public helpers.\n *\n * Feature glossary:\n * - `claimTo`: Airdrops campaigns can redirect claims to a third-party recipient; introduced in `airdrops@v2.0`\n *\n * - `sponsor`: Airdrops campaigns expose the `sponsor` function; introduced in `airdrops@v3.0`\n *\n * - `payable`: Release entrypoints accept native-token value for protocol fees. This first appears in\n * `airdrops@v1.3`, `flow@v1.1`, and `lockup@v2.0`\n *\n * - `contractMinFee`: Contracts expose an onchain minimum-fee calculation; introduced in `flow@v2.0` and adopted by\n * Lockup in `lockup@v3.0`\n *\n * - `batch`: Lockup releases support batched execution helpers; introduced in `lockup@v2.0`\n *\n * - `shape`: Lockup create flows emit and consume canonical shape identifiers; introduced in `lockup@v2.0`\n *\n * - `simpleTransfer`: Flow releases expose a `transferTokens` wrapper that lets the contract forward an ERC-20 transfer\n * on behalf of the caller; introduced in `flow@v2.0`\n *\n * - `legacyAbi`: Lockup still uses the pre-`lockup@v1.2` split ABI layout and old hook interface; cleared when\n * `lockup@v1.2` shipped the new hook system\n *\n * - `prbProxy`: Lockup still uses the original `prbProxy` deployment wiring from `lockup@v1.0`; this is only true for\n * that initial release and is cleared from `lockup@v1.1` onward\n *\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/airdrops@v3.0/airdrops/CHANGELOG.md}\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/flow@v3.0/flow/CHANGELOG.md}\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/lockup@v4.0/lockup/CHANGELOG.md}\n */\nexport const evmReleaseFeatures = deepFreeze({\n [Protocol.Airdrops]: {\n [Version.Airdrops.V1_1]: { claimTo: false, payable: false, sponsor: false },\n [Version.Airdrops.V1_2]: { claimTo: false, payable: false, sponsor: false },\n [Version.Airdrops.V1_3]: { claimTo: false, payable: true, sponsor: false },\n [Version.Airdrops.V2_0]: { claimTo: true, payable: true, sponsor: false },\n [Version.Airdrops.V3_0]: { claimTo: true, payable: true, sponsor: true },\n },\n [Protocol.Bob]: {\n [Version.Bob.V1_0]: emptyReleaseFeatures,\n },\n [Protocol.Flow]: {\n [Version.Flow.V1_0]: { minFee: false, payable: false, simpleTransfer: false },\n [Version.Flow.V1_1]: { minFee: false, payable: true, simpleTransfer: false },\n [Version.Flow.V2_0]: { minFee: true, payable: true, simpleTransfer: true },\n [Version.Flow.V3_0]: { minFee: true, payable: true, simpleTransfer: true },\n },\n [Protocol.Legacy]: {\n [Version.Legacy.V1_0]: emptyReleaseFeatures,\n [Version.Legacy.V1_1]: emptyReleaseFeatures,\n },\n [Protocol.Lockup]: {\n [Version.Lockup.V1_0]: {\n batch: false,\n legacyAbi: true,\n minFee: false,\n payable: false,\n prbProxy: true,\n shape: false,\n },\n [Version.Lockup.V1_1]: {\n batch: false,\n legacyAbi: true,\n minFee: false,\n payable: false,\n prbProxy: false,\n shape: false,\n },\n [Version.Lockup.V1_2]: {\n batch: false,\n legacyAbi: false,\n minFee: false,\n payable: false,\n prbProxy: false,\n shape: false,\n },\n [Version.Lockup.V2_0]: {\n batch: true,\n legacyAbi: false,\n minFee: false,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n [Version.Lockup.V3_0]: {\n batch: true,\n legacyAbi: false,\n minFee: true,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n [Version.Lockup.V4_0]: {\n batch: true,\n legacyAbi: false,\n minFee: true,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n },\n} as const satisfies EvmReleaseFeatureRegistry);\n\nexport type PayableEvmProtocol = ProtocolWithBooleanFeature<\"payable\">;\n\n/* -------------------------------------------------------------------------- */\n/* PRIVATE HELPERS */\n/* -------------------------------------------------------------------------- */\n\nconst evmReleaseFeatureRegistry: EvmReleaseFeatureRegistry = evmReleaseFeatures;\n\ntype PayableReleaseFeatureRegistry = {\n [TProtocol in PayableEvmProtocol]: Record<\n EvmReleaseVersionByProtocol[TProtocol],\n Pick<ProtocolFeatureSet<TProtocol>, \"payable\">\n >;\n};\n\nconst payableReleaseFeatureRegistry = deepFreeze({\n [Protocol.Airdrops]: evmReleaseFeatures[Protocol.Airdrops],\n [Protocol.Flow]: evmReleaseFeatures[Protocol.Flow],\n [Protocol.Lockup]: evmReleaseFeatures[Protocol.Lockup],\n} satisfies PayableReleaseFeatureRegistry);\n\n/**\n * Narrows protocol checks for helpers that only apply to fee-charging releases.\n */\nfunction isPayableEvmProtocol(protocol: Sablier.EVM.Protocol): protocol is PayableEvmProtocol {\n return protocol in payableReleaseFeatureRegistry;\n}\n\n/**\n * Narrows a release descriptor to protocols whose feature bag includes a payable flag.\n */\nfunction isPayableEvmRelease(release: EvmReleaseReference): release is PayableEvmReleaseReference {\n return isPayableEvmProtocol(release.protocol);\n}\n\n/**\n * Normalizes the supported payable helper overloads to the canonical release shape.\n */\nfunction normalizePayableReleaseInput(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): EvmReleaseReference {\n if (typeof releaseOrProtocol !== \"string\") {\n return releaseOrProtocol;\n }\n\n if (!version) {\n throw new Error('Sablier SDK: Missing \"version\" for isEvmReleasePayable(protocol, version)');\n }\n\n return { protocol: releaseOrProtocol, version };\n}\n\n/* -------------------------------------------------------------------------- */\n/* FEATURES */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Reads the airdrops capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Airdrops protocol.\n */\nexport function getAirdropsReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.AirdropsReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Airdrops];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Airdrops];\n}\n\n/**\n * Returns the protocol-specific feature bag for a single EVM release.\n */\nexport function getEvmReleaseFeatures<TProtocol extends keyof EvmReleaseFeatureSetByProtocol>(\n protocol: TProtocol,\n version: EvmReleaseVersionByProtocol[TProtocol]\n): ReleaseFeaturesForProtocol<TProtocol> {\n return evmReleaseFeatureRegistry[protocol][version] as ReleaseFeaturesForProtocol<TProtocol>;\n}\n\n/**\n * Reads the flow capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Flow protocol.\n */\nexport function getFlowReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.FlowReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Flow];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Flow];\n}\n\n/**\n * Reads the lockup capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Lockup protocol.\n */\nexport function getLockupReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.LockupReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Lockup];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Lockup];\n}\n\n/**\n * Returns whether the airdrops release supports the `claimTo` function for claiming to a third-party address.\n * Returns `false` for non-Airdrops versions.\n */\nexport function hasClaimTo(version: Sablier.EVM.Version): boolean {\n return getAirdropsReleaseFeatures(version)?.claimTo ?? false;\n}\n\n/**\n * Returns whether the airdrops release supports sponsor-driven claims.\n * Returns `false` for non-Airdrops versions.\n */\nexport function hasSponsor(version: Sablier.EVM.Version): boolean {\n return getAirdropsReleaseFeatures(version)?.sponsor ?? false;\n}\n\n/**\n * Returns whether a Flow or Lockup release exposes an on-chain minimum fee in wei.\n */\nexport function hasOnchainMinFee(release: EvmReleaseReference): boolean;\n/**\n * @deprecated Pass a release object instead. This overload will be removed in the next major version (v4).\n */\nexport function hasOnchainMinFee(\n protocol: Sablier.EVM.Protocol,\n version: Sablier.EVM.Version\n): boolean;\nexport function hasOnchainMinFee(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): boolean {\n let release: EvmReleaseReference;\n\n if (typeof releaseOrProtocol === \"string\") {\n if (!version) {\n throw new Error('Sablier SDK: Missing \"version\" for hasOnchainMinFee(protocol, version)');\n }\n\n release = { protocol: releaseOrProtocol, version };\n } else {\n release = releaseOrProtocol;\n }\n\n switch (release.protocol) {\n case Protocol.Flow:\n return getFlowReleaseFeatures(release.version)?.minFee ?? false;\n case Protocol.Lockup:\n return getLockupReleaseFeatures(release.version)?.minFee ?? false;\n default:\n return false;\n }\n}\n\n/**\n * Returns whether the lockup release uses the split ABI layout.\n * Returns `false` for non-Lockup versions.\n */\nexport function hasSplitLockupArchitecture(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.legacyAbi ?? false;\n}\n\n/** @deprecated Use {@link hasSplitLockupArchitecture} instead. */\nexport const usesLockupSplit = hasSplitLockupArchitecture;\n\n/**\n * Returns whether a release charges native-token fees on claim or withdraw operations.\n */\nexport function isEvmReleasePayable(release: EvmReleaseReference): boolean;\n/**\n * @deprecated Pass a release object instead. This overload will be removed in the next major version (v4).\n */\nexport function isEvmReleasePayable(\n protocol: Sablier.EVM.Protocol,\n version: Sablier.EVM.Version\n): boolean;\nexport function isEvmReleasePayable(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): boolean {\n const release = normalizePayableReleaseInput(releaseOrProtocol, version);\n\n if (!isPayableEvmRelease(release)) {\n return false;\n }\n\n const registry = evmReleaseFeatures[release.protocol] as Record<string, { payable: boolean }>;\n if (!(release.version in registry)) {\n return false;\n }\n\n return registry[release.version].payable;\n}\n\n/**\n * Returns whether the lockup release exposes batch create or withdraw flows.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupBatch(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.batch ?? false;\n}\n\n/**\n * Returns whether the lockup release integrates with PRBProxy.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupPrbProxy(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.prbProxy ?? false;\n}\n\n/**\n * Returns whether the lockup release stores shape as an on-chain parameter.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupShape(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.shape ?? false;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../../../src/evm/releases/features.ts"],"names":[],"mappings":";;;AA+OA,gEAQC;AAKD,sDAKC;AAMD,wDAQC;AAMD,4DAQC;AAMD,gCAEC;AAMD,gCAEC;AAaD,4CAwBC;AAMD,8CAEC;AAMD,gEAEC;AAgBD,kDAgBC;AAMD,kDAEC;AAMD,wDAEC;AAMD,kDAEC;AAnZD,iDAAuD;AAqDvD,SAAS,UAAU,CAAI,KAAQ;IAC7B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,KAAgC,CAAC,EAAE,CAAC;QAC1E,UAAU,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,oBAAoB,GAAG,UAAU,CAAC,EAAsD,CAAC,CAAC;AAiCnF,QAAA,kBAAkB,GAAG,UAAU,CAAC;IAC3C,CAAC,mBAAQ,CAAC,QAAQ,CAAC,EAAE;QACnB,CAAC,kBAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3E,CAAC,kBAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3E,CAAC,kBAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EA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AAC;AAC9D,CAAC;AAMD,SAAgB,mBAAmB,CAAC,OAA4B;IAC9D,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC;AAC3D,CAAC","sourcesContent":["/**\n * @file Canonical capability registry for every shipped EVM release.\n *\n * Release builders attach these feature bags to exported release objects, and\n * helper functions read from the same registry so version-dependent behavior\n * stays defined in one place.\n */\nimport { Protocol, Version } from \"@/src/evm/enums.js\";\nimport type { Sablier } from \"@/src/types.js\";\n\n/* -------------------------------------------------------------------------- */\n/* TYPES */\n/* -------------------------------------------------------------------------- */\n\nexport type EvmReleaseVersionByProtocol = {\n airdrops: Sablier.EVM.Version.Airdrops;\n bob: Sablier.EVM.Version.Bob;\n flow: Sablier.EVM.Version.Flow;\n legacy: Sablier.EVM.Version.Legacy;\n lockup: Sablier.EVM.Version.Lockup;\n};\n\nexport type EvmReleaseFeatureSetByProtocol = {\n airdrops: Sablier.EVM.AirdropsReleaseFeatures;\n bob: Sablier.EVM.EmptyReleaseFeatures;\n flow: Sablier.EVM.FlowReleaseFeatures;\n legacy: Sablier.EVM.EmptyReleaseFeatures;\n lockup: Sablier.EVM.LockupReleaseFeatures;\n};\n\ntype EvmReleaseFeatureRegistry = {\n [TProtocol in keyof EvmReleaseVersionByProtocol]: Record<\n EvmReleaseVersionByProtocol[TProtocol],\n EvmReleaseFeatureSetByProtocol[TProtocol]\n >;\n};\n\nexport type ReleaseFeaturesForProtocol<TProtocol extends keyof EvmReleaseFeatureSetByProtocol> =\n EvmReleaseFeatureSetByProtocol[TProtocol];\n\ntype ProtocolFeatureSet<TProtocol extends keyof EvmReleaseFeatureSetByProtocol> =\n EvmReleaseFeatureSetByProtocol[TProtocol];\n\ntype ProtocolWithBooleanFeature<TFeature extends PropertyKey> = {\n [TProtocol in keyof EvmReleaseFeatureSetByProtocol]: ProtocolFeatureSet<TProtocol> extends Record<\n TFeature,\n boolean\n >\n ? TProtocol\n : never;\n}[keyof EvmReleaseFeatureSetByProtocol];\n\ntype EvmReleaseReference = Pick<Sablier.EVM.Release, \"protocol\" | \"version\">;\ntype PayableEvmReleaseReference = {\n [TProtocol in PayableEvmProtocol]: {\n protocol: TProtocol;\n version: EvmReleaseVersionByProtocol[TProtocol];\n };\n}[PayableEvmProtocol];\n\nfunction deepFreeze<T>(value: T): T {\n if (typeof value !== \"object\" || value === null || Object.isFrozen(value)) {\n return value;\n }\n\n for (const nestedValue of Object.values(value as Record<string, unknown>)) {\n deepFreeze(nestedValue);\n }\n\n return Object.freeze(value);\n}\n\nconst emptyReleaseFeatures = deepFreeze({} as const satisfies Sablier.EVM.EmptyReleaseFeatures);\n\n/**\n * Protocol/version feature matrix used by both release resolvers and public helpers.\n *\n * Feature glossary:\n * - `claimTo`: Airdrops campaigns can redirect claims to a third-party recipient; introduced in `airdrops@v2.0`\n *\n * - `sponsor`: Airdrops campaigns expose the `sponsor` function; introduced in `airdrops@v3.0`\n *\n * - `payable`: Release entrypoints accept native-token value for protocol fees. This first appears in\n * `airdrops@v1.3`, `flow@v1.1`, and `lockup@v2.0`\n *\n * - `contractMinFee`: Contracts expose an onchain minimum-fee calculation; introduced in `flow@v2.0` and adopted by\n * Lockup in `lockup@v3.0`\n *\n * - `batch`: Lockup releases support batched execution helpers; introduced in `lockup@v2.0`\n *\n * - `shape`: Lockup create flows emit and consume canonical shape identifiers; introduced in `lockup@v2.0`\n *\n * - `simpleTransfer`: Flow releases expose a `transferTokens` wrapper that lets the contract forward an ERC-20 transfer\n * on behalf of the caller; introduced in `flow@v2.0`\n *\n * - `legacyAbi`: Lockup still uses the pre-`lockup@v1.2` split ABI layout and old hook interface; cleared when\n * `lockup@v1.2` shipped the new hook system\n *\n * - `prbProxy`: Lockup still uses the original `prbProxy` deployment wiring from `lockup@v1.0`; this is only true for\n * that initial release and is cleared from `lockup@v1.1` onward\n *\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/airdrops@v3.0/airdrops/CHANGELOG.md}\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/flow@v3.0/flow/CHANGELOG.md}\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/lockup@v4.0/lockup/CHANGELOG.md}\n */\nexport const evmReleaseFeatures = deepFreeze({\n [Protocol.Airdrops]: {\n [Version.Airdrops.V1_1]: { claimTo: false, payable: false, sponsor: false },\n [Version.Airdrops.V1_2]: { claimTo: false, payable: false, sponsor: false },\n [Version.Airdrops.V1_3]: { claimTo: false, payable: true, sponsor: false },\n [Version.Airdrops.V2_0]: { claimTo: true, payable: true, sponsor: false },\n [Version.Airdrops.V3_0]: { claimTo: true, payable: true, sponsor: true },\n },\n [Protocol.Bob]: {\n [Version.Bob.V1_0]: emptyReleaseFeatures,\n },\n [Protocol.Flow]: {\n [Version.Flow.V1_0]: { minFee: false, payable: false, simpleTransfer: false },\n [Version.Flow.V1_1]: { minFee: false, payable: true, simpleTransfer: false },\n [Version.Flow.V2_0]: { minFee: true, payable: true, simpleTransfer: true },\n [Version.Flow.V3_0]: { minFee: true, payable: true, simpleTransfer: true },\n },\n [Protocol.Legacy]: {\n [Version.Legacy.V1_0]: emptyReleaseFeatures,\n [Version.Legacy.V1_1]: emptyReleaseFeatures,\n },\n [Protocol.Lockup]: {\n [Version.Lockup.V1_0]: {\n batch: false,\n legacyAbi: true,\n minFee: false,\n payable: false,\n prbProxy: true,\n shape: false,\n },\n [Version.Lockup.V1_1]: {\n batch: false,\n legacyAbi: true,\n minFee: false,\n payable: false,\n prbProxy: false,\n shape: false,\n },\n [Version.Lockup.V1_2]: {\n batch: false,\n legacyAbi: false,\n minFee: false,\n payable: false,\n prbProxy: false,\n shape: false,\n },\n [Version.Lockup.V2_0]: {\n batch: true,\n legacyAbi: false,\n minFee: false,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n [Version.Lockup.V3_0]: {\n batch: true,\n legacyAbi: false,\n minFee: true,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n [Version.Lockup.V4_0]: {\n batch: true,\n legacyAbi: false,\n minFee: true,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n },\n} as const satisfies EvmReleaseFeatureRegistry);\n\nexport type PayableEvmProtocol = ProtocolWithBooleanFeature<\"payable\">;\n\n/* -------------------------------------------------------------------------- */\n/* PRIVATE HELPERS */\n/* -------------------------------------------------------------------------- */\n\nconst evmReleaseFeatureRegistry: EvmReleaseFeatureRegistry = evmReleaseFeatures;\n\ntype PayableReleaseFeatureRegistry = {\n [TProtocol in PayableEvmProtocol]: Record<\n EvmReleaseVersionByProtocol[TProtocol],\n Pick<ProtocolFeatureSet<TProtocol>, \"payable\">\n >;\n};\n\nconst payableReleaseFeatureRegistry = deepFreeze({\n [Protocol.Airdrops]: evmReleaseFeatures[Protocol.Airdrops],\n [Protocol.Flow]: evmReleaseFeatures[Protocol.Flow],\n [Protocol.Lockup]: evmReleaseFeatures[Protocol.Lockup],\n} satisfies PayableReleaseFeatureRegistry);\n\n/**\n * Narrows protocol checks for helpers that only apply to fee-charging releases.\n */\nfunction isPayableEvmProtocol(protocol: Sablier.EVM.Protocol): protocol is PayableEvmProtocol {\n return protocol in payableReleaseFeatureRegistry;\n}\n\n/**\n * Narrows a release descriptor to protocols whose feature bag includes a payable flag.\n */\nfunction isPayableEvmRelease(release: EvmReleaseReference): release is PayableEvmReleaseReference {\n return isPayableEvmProtocol(release.protocol);\n}\n\n/**\n * Normalizes the supported payable helper overloads to the canonical release shape.\n */\nfunction normalizePayableReleaseInput(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): EvmReleaseReference {\n if (typeof releaseOrProtocol !== \"string\") {\n return releaseOrProtocol;\n }\n\n if (!version) {\n throw new Error('Sablier SDK: Missing \"version\" for isEvmReleasePayable(protocol, version)');\n }\n\n return { protocol: releaseOrProtocol, version };\n}\n\n/* -------------------------------------------------------------------------- */\n/* FEATURES */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Reads the airdrops capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Airdrops protocol.\n */\nexport function getAirdropsReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.AirdropsReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Airdrops];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Airdrops];\n}\n\n/**\n * Returns the protocol-specific feature bag for a single EVM release.\n */\nexport function getEvmReleaseFeatures<TProtocol extends keyof EvmReleaseFeatureSetByProtocol>(\n protocol: TProtocol,\n version: EvmReleaseVersionByProtocol[TProtocol]\n): ReleaseFeaturesForProtocol<TProtocol> {\n return evmReleaseFeatureRegistry[protocol][version] as ReleaseFeaturesForProtocol<TProtocol>;\n}\n\n/**\n * Reads the flow capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Flow protocol.\n */\nexport function getFlowReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.FlowReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Flow];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Flow];\n}\n\n/**\n * Reads the lockup capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Lockup protocol.\n */\nexport function getLockupReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.LockupReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Lockup];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Lockup];\n}\n\n/**\n * Returns whether the airdrops release supports the `claimTo` function for claiming to a third-party address.\n * Returns `false` for non-Airdrops versions.\n */\nexport function hasClaimTo(version: Sablier.EVM.Version): boolean {\n return getAirdropsReleaseFeatures(version)?.claimTo ?? false;\n}\n\n/**\n * Returns whether the airdrops release supports sponsor-driven claims.\n * Returns `false` for non-Airdrops versions.\n */\nexport function hasSponsor(version: Sablier.EVM.Version): boolean {\n return getAirdropsReleaseFeatures(version)?.sponsor ?? false;\n}\n\n/**\n * Returns whether a Flow or Lockup release exposes an on-chain minimum fee in wei.\n */\nexport function hasOnchainMinFee(release: EvmReleaseReference): boolean;\n/**\n * @deprecated Pass a release object instead. This overload will be removed in the next major version (v4).\n */\nexport function hasOnchainMinFee(\n protocol: Sablier.EVM.Protocol,\n version: Sablier.EVM.Version\n): boolean;\nexport function hasOnchainMinFee(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): boolean {\n let release: EvmReleaseReference;\n\n if (typeof releaseOrProtocol === \"string\") {\n if (!version) {\n throw new Error('Sablier SDK: Missing \"version\" for hasOnchainMinFee(protocol, version)');\n }\n\n release = { protocol: releaseOrProtocol, version };\n } else {\n release = releaseOrProtocol;\n }\n\n switch (release.protocol) {\n case Protocol.Flow:\n return getFlowReleaseFeatures(release.version)?.minFee ?? false;\n case Protocol.Lockup:\n return getLockupReleaseFeatures(release.version)?.minFee ?? false;\n default:\n return false;\n }\n}\n\n/**\n * Returns whether the flow release exposes the `transferTokens` wrapper for forwarding an ERC-20 transfer on behalf of\n * the caller. Returns `false` for non-Flow versions.\n */\nexport function hasSimpleTransfer(version: Sablier.EVM.Version): boolean {\n return getFlowReleaseFeatures(version)?.simpleTransfer ?? false;\n}\n\n/**\n * Returns whether the lockup release uses the split ABI layout.\n * Returns `false` for non-Lockup versions.\n */\nexport function hasSplitLockupArchitecture(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.legacyAbi ?? false;\n}\n\n/** @deprecated Use {@link hasSplitLockupArchitecture} instead. */\nexport const usesLockupSplit = hasSplitLockupArchitecture;\n\n/**\n * Returns whether a release charges native-token fees on claim or withdraw operations.\n */\nexport function isEvmReleasePayable(release: EvmReleaseReference): boolean;\n/**\n * @deprecated Pass a release object instead. This overload will be removed in the next major version (v4).\n */\nexport function isEvmReleasePayable(\n protocol: Sablier.EVM.Protocol,\n version: Sablier.EVM.Version\n): boolean;\nexport function isEvmReleasePayable(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): boolean {\n const release = normalizePayableReleaseInput(releaseOrProtocol, version);\n\n if (!isPayableEvmRelease(release)) {\n return false;\n }\n\n const registry = evmReleaseFeatures[release.protocol] as Record<string, { payable: boolean }>;\n if (!(release.version in registry)) {\n return false;\n }\n\n return registry[release.version].payable;\n}\n\n/**\n * Returns whether the lockup release exposes batch create or withdraw flows.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupBatch(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.batch ?? false;\n}\n\n/**\n * Returns whether the lockup release integrates with PRBProxy.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupPrbProxy(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.prbProxy ?? false;\n}\n\n/**\n * Returns whether the lockup release stores shape as an on-chain parameter.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupShape(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.shape ?? false;\n}\n"]}
|
package/dist/esm/evm/helpers.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getContractExplorerURL as getContractExplorerURLInternal } from "../internal/utils/explorer-url.js";
|
|
2
2
|
import { getAliasCatalog } from "./contracts/alias-catalog.js";
|
|
3
3
|
import { Protocol } from "./enums.js";
|
|
4
|
-
export { evmReleaseFeatures, getAirdropsReleaseFeatures, getEvmReleaseFeatures, getFlowReleaseFeatures, getLockupReleaseFeatures, hasClaimTo, hasOnchainMinFee, hasSplitLockupArchitecture, hasSponsor, isEvmReleasePayable, supportsLockupBatch, supportsLockupPrbProxy, supportsLockupShape, usesLockupSplit, } from "./releases/features.js";
|
|
4
|
+
export { evmReleaseFeatures, getAirdropsReleaseFeatures, getEvmReleaseFeatures, getFlowReleaseFeatures, getLockupReleaseFeatures, hasClaimTo, hasOnchainMinFee, hasSimpleTransfer, hasSplitLockupArchitecture, hasSponsor, isEvmReleasePayable, supportsLockupBatch, supportsLockupPrbProxy, supportsLockupShape, usesLockupSplit, } from "./releases/features.js";
|
|
5
5
|
export function getContractExplorerURL(explorerURL, contractAddress) {
|
|
6
6
|
return getContractExplorerURLInternal(explorerURL, contractAddress);
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/evm/helpers.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,IAAI,8BAA8B,EAAE,MAAM,sCAAsC,CAAC;AAEhH,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAQtC,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAQhC,MAAM,UAAU,sBAAsB,CAAC,WAAmB,EAAE,eAAoC;IAC9F,OAAO,8BAA8B,CAAC,WAAW,EAAE,eAAe,CAAC,CAAC;AACtE,CAAC;AAkBD,MAAM,UAAU,kBAAkB,CAAC,IAKlC;IACC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAEnD,MAAM,QAAQ,GAAG,yBAAyB,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,CAAC,CAAC;IACzE,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC,WAAW,EAAE,IAAI,OAAO,IAAI,OAAO,EAAE,CAAC;AACnE,CAAC;AAeD,MAAM,UAAU,yBAAyB,CAAC,IAIzC;IACC,MAAM,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,GAAG,IAAI,CAAC;IAC1C,MAAM,YAAY,GAAG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,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;IAC9B,MAAM,SAAS,GAAG,CAAC,GAAG,KAAK,GAAG,GAAG,CAAC;IAElC,IAAI,OAAO,CAAC,MAAM,IAAI,SAAS,EAAE,CAAC;QAChC,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,MAAM,MAAM,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;IAEpD,OAAO,GAAG,MAAM,MAAM,MAAM,EAAE,CAAC;AACjC,CAAC","sourcesContent":["// NOTE: evm/index.ts uses explicit named re-exports instead of `export *` for\n// this module. When adding or removing a public export here, mirror the change\n// in evm/index.ts. The \"barrel re-exports every helpers symbol\" test in\n// tests/package-exports.test.ts will catch any drift.\nimport { getContractExplorerURL as getContractExplorerURLInternal } from \"@/src/internal/utils/explorer-url.js\";\nimport type { Sablier, TruncateAddressOptions } from \"@/src/types.js\";\nimport { getAliasCatalog } from \"./contracts/alias-catalog.js\";\nimport { Protocol } from \"./enums.js\";\n\nexport type {\n EvmReleaseFeatureSetByProtocol,\n EvmReleaseVersionByProtocol,\n PayableEvmProtocol,\n ReleaseFeaturesForProtocol,\n} from \"./releases/features.js\";\nexport {\n evmReleaseFeatures,\n getAirdropsReleaseFeatures,\n getEvmReleaseFeatures,\n getFlowReleaseFeatures,\n getLockupReleaseFeatures,\n hasClaimTo,\n hasOnchainMinFee,\n hasSplitLockupArchitecture,\n hasSponsor,\n isEvmReleasePayable,\n supportsLockupBatch,\n supportsLockupPrbProxy,\n supportsLockupShape,\n usesLockupSplit,\n} from \"./releases/features.js\";\n\n/**\n * Get the explorer URL for a contract. Compatible with Etherscan, Blockscout, etc.\n * @param explorerURL - The base explorer URL, e.g. https://etherscan.io\n * @param contractAddress - The contract object\n * @returns The explorer URL for the contract, e.g. https://etherscan.io/address/0x123...\n */\nexport function getContractExplorerURL(explorerURL: string, contractAddress: Sablier.EVM.Address) {\n return getContractExplorerURLInternal(explorerURL, contractAddress);\n}\n\n/**\n * Constructs a stream/airdrop entity ID for EVM chains in the format used by Sablier indexers.\n * Format: `{contractAddress}-{chainId}-{tokenId}`\n *\n * The contract address is lowercased for normalization, as EVM addresses are case-insensitive.\n *\n * @param opts - Configuration object\n * @param opts.alias - Contract alias (e.g., \"LL2\", \"LK2\", \"FL2\")\n * @param opts.chainId - Chain ID where the contract is deployed\n * @param opts.tokenId - Stream/airdrop token ID\n * @param opts.protocol - Optional protocol to disambiguate aliases\n * @returns Stream ID in format \"0xabc...-1-123\"\n * @example\n * resolveEvmStreamId({ alias: \"LL2\", chainId: 1, tokenId: 123n })\n * // => \"0xabc...-1-123\"\n */\nexport function resolveEvmStreamId(opts: {\n alias: string;\n chainId: number;\n tokenId: bigint | string | number;\n protocol?: Sablier.EVM.Protocol;\n}): string {\n const { alias, chainId, tokenId, protocol } = opts;\n\n const contract = resolveEvmContractByAlias({ alias, chainId, protocol });\n return `${contract.address.toLowerCase()}-${chainId}-${tokenId}`;\n}\n\n/**\n * Resolves an EVM contract by its alias from the alias catalog.\n *\n * @param opts - Configuration object\n * @param opts.alias - Contract alias (e.g., \"LL2\", \"LK2\", \"FL2\")\n * @param opts.chainId - Chain ID where the contract is deployed\n * @param opts.protocol - Optional protocol to disambiguate aliases that exist in multiple protocols\n * @returns The resolved contract\n * @throws Error if alias is not found or is ambiguous without protocol specified\n * @example\n * resolveEvmContractByAlias({ alias: \"LL2\", chainId: 1 })\n * // => { address: \"0x...\", name: \"SablierLockupLinear\", ... }\n */\nexport function resolveEvmContractByAlias(opts: {\n alias: string;\n chainId: number;\n protocol?: Sablier.EVM.Protocol;\n}): Sablier.EVM.Contract {\n const { alias, chainId, protocol } = opts;\n const aliasCatalog = getAliasCatalog();\n\n if (protocol) {\n const contract = aliasCatalog[protocol]?.[chainId]?.[alias];\n if (!contract) {\n throw new Error(\n `Sablier SDK: Unknown EVM contract alias \"${alias}\" on chain ${chainId} for protocol \"${protocol}\"`\n );\n }\n return contract;\n }\n\n const protocols: Sablier.EVM.Protocol[] = [\n Protocol.Airdrops,\n Protocol.Bob,\n Protocol.Flow,\n Protocol.Legacy,\n Protocol.Lockup,\n ];\n\n const matches = protocols\n .map((p) => aliasCatalog[p]?.[chainId]?.[alias])\n .filter(Boolean) as Sablier.EVM.Contract[];\n\n if (matches.length === 0) {\n throw new Error(`Sablier SDK: Unknown EVM contract alias \"${alias}\" on chain ${chainId}`);\n }\n\n if (matches.length > 1) {\n throw new Error(\n `Sablier SDK: Ambiguous EVM contract alias \"${alias}\" on chain ${chainId}; specify protocol`\n );\n }\n\n return matches[0];\n}\n\n/**\n * Truncate an Ethereum address for display purposes.\n * @param address - The Ethereum address to truncate (0x-prefixed)\n * @param options - Truncation options with start/end character counts (default: 4 each, must be >= 1)\n * @returns Truncated address in format \"0xcafe...beef\" or original if too short\n * @example\n * truncateEvmAddress(\"0x1234567890abcdef1234567890abcdef12345678\") // \"0x1234...5678\"\n * truncateEvmAddress(\"0x1234567890abcdef1234567890abcdef12345678\", { start: 6, end: 6 }) // \"0x123456...345678\"\n * truncateEvmAddress(\"0x1234567890abcdef1234567890abcdef12345678\", { start: 2, end: 6 }) // \"0x12...345678\"\n * truncateEvmAddress(\"0x123\") // \"0x123\" (too short, returns original)\n */\nexport function truncateEvmAddress(\n address: Sablier.EVM.Address,\n options?: TruncateAddressOptions\n): string {\n if (!address) {\n return address;\n }\n\n const start = options?.start ?? 4;\n const end = options?.end ?? 4;\n const minLength = 2 + start + end;\n\n if (address.length <= minLength) {\n return address;\n }\n\n const prefix = address.slice(0, 2 + start);\n const suffix = end === 0 ? \"\" : address.slice(-end);\n\n return `${prefix}...${suffix}`;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/evm/helpers.ts"],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,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,CAAC;IAC3C,MAAM,MAAM,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,CAAC;IAEpD,OAAO,GAAG,MAAM,MAAM,MAAM,EAAE,CAAC;AACjC,CAAC","sourcesContent":["// NOTE: evm/index.ts uses explicit named re-exports instead of `export *` for\n// this module. When adding or removing a public export here, mirror the change\n// in evm/index.ts. The \"barrel re-exports every helpers symbol\" test in\n// tests/package-exports.test.ts will catch any drift.\nimport { getContractExplorerURL as getContractExplorerURLInternal } from \"@/src/internal/utils/explorer-url.js\";\nimport type { Sablier, TruncateAddressOptions } from \"@/src/types.js\";\nimport { getAliasCatalog } from \"./contracts/alias-catalog.js\";\nimport { Protocol } from \"./enums.js\";\n\nexport type {\n EvmReleaseFeatureSetByProtocol,\n EvmReleaseVersionByProtocol,\n PayableEvmProtocol,\n ReleaseFeaturesForProtocol,\n} from \"./releases/features.js\";\nexport {\n evmReleaseFeatures,\n getAirdropsReleaseFeatures,\n getEvmReleaseFeatures,\n getFlowReleaseFeatures,\n getLockupReleaseFeatures,\n hasClaimTo,\n hasOnchainMinFee,\n hasSimpleTransfer,\n hasSplitLockupArchitecture,\n hasSponsor,\n isEvmReleasePayable,\n supportsLockupBatch,\n supportsLockupPrbProxy,\n supportsLockupShape,\n usesLockupSplit,\n} from \"./releases/features.js\";\n\n/**\n * Get the explorer URL for a contract. Compatible with Etherscan, Blockscout, etc.\n * @param explorerURL - The base explorer URL, e.g. https://etherscan.io\n * @param contractAddress - The contract object\n * @returns The explorer URL for the contract, e.g. https://etherscan.io/address/0x123...\n */\nexport function getContractExplorerURL(explorerURL: string, contractAddress: Sablier.EVM.Address) {\n return getContractExplorerURLInternal(explorerURL, contractAddress);\n}\n\n/**\n * Constructs a stream/airdrop entity ID for EVM chains in the format used by Sablier indexers.\n * Format: `{contractAddress}-{chainId}-{tokenId}`\n *\n * The contract address is lowercased for normalization, as EVM addresses are case-insensitive.\n *\n * @param opts - Configuration object\n * @param opts.alias - Contract alias (e.g., \"LL2\", \"LK2\", \"FL2\")\n * @param opts.chainId - Chain ID where the contract is deployed\n * @param opts.tokenId - Stream/airdrop token ID\n * @param opts.protocol - Optional protocol to disambiguate aliases\n * @returns Stream ID in format \"0xabc...-1-123\"\n * @example\n * resolveEvmStreamId({ alias: \"LL2\", chainId: 1, tokenId: 123n })\n * // => \"0xabc...-1-123\"\n */\nexport function resolveEvmStreamId(opts: {\n alias: string;\n chainId: number;\n tokenId: bigint | string | number;\n protocol?: Sablier.EVM.Protocol;\n}): string {\n const { alias, chainId, tokenId, protocol } = opts;\n\n const contract = resolveEvmContractByAlias({ alias, chainId, protocol });\n return `${contract.address.toLowerCase()}-${chainId}-${tokenId}`;\n}\n\n/**\n * Resolves an EVM contract by its alias from the alias catalog.\n *\n * @param opts - Configuration object\n * @param opts.alias - Contract alias (e.g., \"LL2\", \"LK2\", \"FL2\")\n * @param opts.chainId - Chain ID where the contract is deployed\n * @param opts.protocol - Optional protocol to disambiguate aliases that exist in multiple protocols\n * @returns The resolved contract\n * @throws Error if alias is not found or is ambiguous without protocol specified\n * @example\n * resolveEvmContractByAlias({ alias: \"LL2\", chainId: 1 })\n * // => { address: \"0x...\", name: \"SablierLockupLinear\", ... }\n */\nexport function resolveEvmContractByAlias(opts: {\n alias: string;\n chainId: number;\n protocol?: Sablier.EVM.Protocol;\n}): Sablier.EVM.Contract {\n const { alias, chainId, protocol } = opts;\n const aliasCatalog = getAliasCatalog();\n\n if (protocol) {\n const contract = aliasCatalog[protocol]?.[chainId]?.[alias];\n if (!contract) {\n throw new Error(\n `Sablier SDK: Unknown EVM contract alias \"${alias}\" on chain ${chainId} for protocol \"${protocol}\"`\n );\n }\n return contract;\n }\n\n const protocols: Sablier.EVM.Protocol[] = [\n Protocol.Airdrops,\n Protocol.Bob,\n Protocol.Flow,\n Protocol.Legacy,\n Protocol.Lockup,\n ];\n\n const matches = protocols\n .map((p) => aliasCatalog[p]?.[chainId]?.[alias])\n .filter(Boolean) as Sablier.EVM.Contract[];\n\n if (matches.length === 0) {\n throw new Error(`Sablier SDK: Unknown EVM contract alias \"${alias}\" on chain ${chainId}`);\n }\n\n if (matches.length > 1) {\n throw new Error(\n `Sablier SDK: Ambiguous EVM contract alias \"${alias}\" on chain ${chainId}; specify protocol`\n );\n }\n\n return matches[0];\n}\n\n/**\n * Truncate an Ethereum address for display purposes.\n * @param address - The Ethereum address to truncate (0x-prefixed)\n * @param options - Truncation options with start/end character counts (default: 4 each, must be >= 1)\n * @returns Truncated address in format \"0xcafe...beef\" or original if too short\n * @example\n * truncateEvmAddress(\"0x1234567890abcdef1234567890abcdef12345678\") // \"0x1234...5678\"\n * truncateEvmAddress(\"0x1234567890abcdef1234567890abcdef12345678\", { start: 6, end: 6 }) // \"0x123456...345678\"\n * truncateEvmAddress(\"0x1234567890abcdef1234567890abcdef12345678\", { start: 2, end: 6 }) // \"0x12...345678\"\n * truncateEvmAddress(\"0x123\") // \"0x123\" (too short, returns original)\n */\nexport function truncateEvmAddress(\n address: Sablier.EVM.Address,\n options?: TruncateAddressOptions\n): string {\n if (!address) {\n return address;\n }\n\n const start = options?.start ?? 4;\n const end = options?.end ?? 4;\n const minLength = 2 + start + end;\n\n if (address.length <= minLength) {\n return address;\n }\n\n const prefix = address.slice(0, 2 + start);\n const suffix = end === 0 ? \"\" : address.slice(-end);\n\n return `${prefix}...${suffix}`;\n}\n"]}
|
package/dist/esm/evm/index.js
CHANGED
|
@@ -4,6 +4,6 @@ export { comptroller } from "./comptroller/index.js";
|
|
|
4
4
|
export * from "./contracts/index.js";
|
|
5
5
|
export * as csv from "./csv/index.js";
|
|
6
6
|
export * from "./enums.js";
|
|
7
|
-
export { evmReleaseFeatures, getAirdropsReleaseFeatures, getContractExplorerURL, getEvmReleaseFeatures, getFlowReleaseFeatures, getLockupReleaseFeatures, hasClaimTo, hasOnchainMinFee, hasSplitLockupArchitecture, hasSponsor, isEvmReleasePayable, resolveEvmContractByAlias, resolveEvmStreamId, supportsLockupBatch, supportsLockupPrbProxy, supportsLockupShape, truncateEvmAddress, usesLockupSplit, } from "./helpers.js";
|
|
7
|
+
export { evmReleaseFeatures, getAirdropsReleaseFeatures, getContractExplorerURL, getEvmReleaseFeatures, getFlowReleaseFeatures, getLockupReleaseFeatures, hasClaimTo, hasOnchainMinFee, hasSimpleTransfer, hasSplitLockupArchitecture, hasSponsor, isEvmReleasePayable, resolveEvmContractByAlias, resolveEvmStreamId, supportsLockupBatch, supportsLockupPrbProxy, supportsLockupShape, truncateEvmAddress, usesLockupSplit, } from "./helpers.js";
|
|
8
8
|
export * from "./releases/index.js";
|
|
9
9
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,cAAc,YAAY,CAAC;AAe3B,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,cAAc,qBAAqB,CAAC","sourcesContent":["export { chains } from \"./chains/index.js\";\nexport * from \"./compatibility.js\";\nexport { comptroller } from \"./comptroller/index.js\";\nexport * from \"./contracts/index.js\";\nexport * as csv from \"./csv/index.js\";\nexport * from \"./enums.js\";\n// Re-export the release-feature helpers explicitly from the `sablier/evm`\n// entrypoint instead of relying only on `export * from \"./helpers.js\"`.\n//\n// Some downstream type-checkers were able to see simple barrel exports such as\n// `enums`, but failed to resolve these helper names through the extra\n// `evm -> helpers -> releases/features` re-export hop. Listing them here keeps\n// the generated `dist/types/evm/index.d.ts` surface direct and easier for\n// consumers to resolve.\nexport type {\n EvmReleaseFeatureSetByProtocol,\n EvmReleaseVersionByProtocol,\n PayableEvmProtocol,\n ReleaseFeaturesForProtocol,\n} from \"./helpers.js\";\nexport {\n evmReleaseFeatures,\n getAirdropsReleaseFeatures,\n getContractExplorerURL,\n getEvmReleaseFeatures,\n getFlowReleaseFeatures,\n getLockupReleaseFeatures,\n hasClaimTo,\n hasOnchainMinFee,\n hasSplitLockupArchitecture,\n hasSponsor,\n isEvmReleasePayable,\n resolveEvmContractByAlias,\n resolveEvmStreamId,\n supportsLockupBatch,\n supportsLockupPrbProxy,\n supportsLockupShape,\n truncateEvmAddress,\n usesLockupSplit,\n} from \"./helpers.js\";\nexport * from \"./releases/index.js\";\n"]}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,cAAc,YAAY,CAAC;AAe3B,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,cAAc,qBAAqB,CAAC","sourcesContent":["export { chains } from \"./chains/index.js\";\nexport * from \"./compatibility.js\";\nexport { comptroller } from \"./comptroller/index.js\";\nexport * from \"./contracts/index.js\";\nexport * as csv from \"./csv/index.js\";\nexport * from \"./enums.js\";\n// Re-export the release-feature helpers explicitly from the `sablier/evm`\n// entrypoint instead of relying only on `export * from \"./helpers.js\"`.\n//\n// Some downstream type-checkers were able to see simple barrel exports such as\n// `enums`, but failed to resolve these helper names through the extra\n// `evm -> helpers -> releases/features` re-export hop. Listing them here keeps\n// the generated `dist/types/evm/index.d.ts` surface direct and easier for\n// consumers to resolve.\nexport type {\n EvmReleaseFeatureSetByProtocol,\n EvmReleaseVersionByProtocol,\n PayableEvmProtocol,\n ReleaseFeaturesForProtocol,\n} from \"./helpers.js\";\nexport {\n evmReleaseFeatures,\n getAirdropsReleaseFeatures,\n getContractExplorerURL,\n getEvmReleaseFeatures,\n getFlowReleaseFeatures,\n getLockupReleaseFeatures,\n hasClaimTo,\n hasOnchainMinFee,\n hasSimpleTransfer,\n hasSplitLockupArchitecture,\n hasSponsor,\n isEvmReleasePayable,\n resolveEvmContractByAlias,\n resolveEvmStreamId,\n supportsLockupBatch,\n supportsLockupPrbProxy,\n supportsLockupShape,\n truncateEvmAddress,\n usesLockupSplit,\n} from \"./helpers.js\";\nexport * from \"./releases/index.js\";\n"]}
|
|
@@ -152,6 +152,9 @@ export function hasOnchainMinFee(releaseOrProtocol, version) {
|
|
|
152
152
|
return false;
|
|
153
153
|
}
|
|
154
154
|
}
|
|
155
|
+
export function hasSimpleTransfer(version) {
|
|
156
|
+
return getFlowReleaseFeatures(version)?.simpleTransfer ?? false;
|
|
157
|
+
}
|
|
155
158
|
export function hasSplitLockupArchitecture(version) {
|
|
156
159
|
return getLockupReleaseFeatures(version)?.legacyAbi ?? false;
|
|
157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AAE,MAAM,IAAI,KAAK,CAAC;QACpE;YACE,OAAO,KAAK,CAAC;IACjB,CAAC;AACH,CAAC;AAMD,MAAM,UAAU,0BAA0B,CAAC,OAA4B;IACrE,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,SAAS,IAAI,KAAK,CAAC;AAC/D,CAAC;AAGD,MAAM,CAAC,MAAM,eAAe,GAAG,0BAA0B,CAAC;AAa1D,MAAM,UAAU,mBAAmB,CACjC,iBAA6D,EAC7D,OAA6B;IAE7B,MAAM,OAAO,GAAG,4BAA4B,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAC;IAEzE,IAAI,CAAC,mBAAmB,CAAC,OAAO,CAAC,EAAE,CAAC;QAClC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,MAAM,QAAQ,GAAG,kBAAkB,CAAC,OAAO,CAAC,QAAQ,CAAyC,CAAC;IAC9F,IAAI,CAAC,CAAC,OAAO,CAAC,OAAO,IAAI,QAAQ,CAAC,EAAE,CAAC;QACnC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,OAAO,CAAC;AAC3C,CAAC;AAMD,MAAM,UAAU,mBAAmB,CAAC,OAA4B;IAC9D,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC;AAC3D,CAAC;AAMD,MAAM,UAAU,sBAAsB,CAAC,OAA4B;IACjE,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,QAAQ,IAAI,KAAK,CAAC;AAC9D,CAAC;AAMD,MAAM,UAAU,mBAAmB,CAAC,OAA4B;IAC9D,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC;AAC3D,CAAC","sourcesContent":["/**\n * @file Canonical capability registry for every shipped EVM release.\n *\n * Release builders attach these feature bags to exported release objects, and\n * helper functions read from the same registry so version-dependent behavior\n * stays defined in one place.\n */\nimport { Protocol, Version } from \"@/src/evm/enums.js\";\nimport type { Sablier } from \"@/src/types.js\";\n\n/* -------------------------------------------------------------------------- */\n/* TYPES */\n/* -------------------------------------------------------------------------- */\n\nexport type EvmReleaseVersionByProtocol = {\n airdrops: Sablier.EVM.Version.Airdrops;\n bob: Sablier.EVM.Version.Bob;\n flow: Sablier.EVM.Version.Flow;\n legacy: Sablier.EVM.Version.Legacy;\n lockup: Sablier.EVM.Version.Lockup;\n};\n\nexport type EvmReleaseFeatureSetByProtocol = {\n airdrops: Sablier.EVM.AirdropsReleaseFeatures;\n bob: Sablier.EVM.EmptyReleaseFeatures;\n flow: Sablier.EVM.FlowReleaseFeatures;\n legacy: Sablier.EVM.EmptyReleaseFeatures;\n lockup: Sablier.EVM.LockupReleaseFeatures;\n};\n\ntype EvmReleaseFeatureRegistry = {\n [TProtocol in keyof EvmReleaseVersionByProtocol]: Record<\n EvmReleaseVersionByProtocol[TProtocol],\n EvmReleaseFeatureSetByProtocol[TProtocol]\n >;\n};\n\nexport type ReleaseFeaturesForProtocol<TProtocol extends keyof EvmReleaseFeatureSetByProtocol> =\n EvmReleaseFeatureSetByProtocol[TProtocol];\n\ntype ProtocolFeatureSet<TProtocol extends keyof EvmReleaseFeatureSetByProtocol> =\n EvmReleaseFeatureSetByProtocol[TProtocol];\n\ntype ProtocolWithBooleanFeature<TFeature extends PropertyKey> = {\n [TProtocol in keyof EvmReleaseFeatureSetByProtocol]: ProtocolFeatureSet<TProtocol> extends Record<\n TFeature,\n boolean\n >\n ? TProtocol\n : never;\n}[keyof EvmReleaseFeatureSetByProtocol];\n\ntype EvmReleaseReference = Pick<Sablier.EVM.Release, \"protocol\" | \"version\">;\ntype PayableEvmReleaseReference = {\n [TProtocol in PayableEvmProtocol]: {\n protocol: TProtocol;\n version: EvmReleaseVersionByProtocol[TProtocol];\n };\n}[PayableEvmProtocol];\n\nfunction deepFreeze<T>(value: T): T {\n if (typeof value !== \"object\" || value === null || Object.isFrozen(value)) {\n return value;\n }\n\n for (const nestedValue of Object.values(value as Record<string, unknown>)) {\n deepFreeze(nestedValue);\n }\n\n return Object.freeze(value);\n}\n\nconst emptyReleaseFeatures = deepFreeze({} as const satisfies Sablier.EVM.EmptyReleaseFeatures);\n\n/**\n * Protocol/version feature matrix used by both release resolvers and public helpers.\n *\n * Feature glossary:\n * - `claimTo`: Airdrops campaigns can redirect claims to a third-party recipient; introduced in `airdrops@v2.0`\n *\n * - `sponsor`: Airdrops campaigns expose the `sponsor` function; introduced in `airdrops@v3.0`\n *\n * - `payable`: Release entrypoints accept native-token value for protocol fees. This first appears in\n * `airdrops@v1.3`, `flow@v1.1`, and `lockup@v2.0`\n *\n * - `contractMinFee`: Contracts expose an onchain minimum-fee calculation; introduced in `flow@v2.0` and adopted by\n * Lockup in `lockup@v3.0`\n *\n * - `batch`: Lockup releases support batched execution helpers; introduced in `lockup@v2.0`\n *\n * - `shape`: Lockup create flows emit and consume canonical shape identifiers; introduced in `lockup@v2.0`\n *\n * - `simpleTransfer`: Flow releases expose a `transferTokens` wrapper that lets the contract forward an ERC-20 transfer\n * on behalf of the caller; introduced in `flow@v2.0`\n *\n * - `legacyAbi`: Lockup still uses the pre-`lockup@v1.2` split ABI layout and old hook interface; cleared when\n * `lockup@v1.2` shipped the new hook system\n *\n * - `prbProxy`: Lockup still uses the original `prbProxy` deployment wiring from `lockup@v1.0`; this is only true for\n * that initial release and is cleared from `lockup@v1.1` onward\n *\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/airdrops@v3.0/airdrops/CHANGELOG.md}\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/flow@v3.0/flow/CHANGELOG.md}\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/lockup@v4.0/lockup/CHANGELOG.md}\n */\nexport const evmReleaseFeatures = deepFreeze({\n [Protocol.Airdrops]: {\n [Version.Airdrops.V1_1]: { claimTo: false, payable: false, sponsor: false },\n [Version.Airdrops.V1_2]: { claimTo: false, payable: false, sponsor: false },\n [Version.Airdrops.V1_3]: { claimTo: false, payable: true, sponsor: false },\n [Version.Airdrops.V2_0]: { claimTo: true, payable: true, sponsor: false },\n [Version.Airdrops.V3_0]: { claimTo: true, payable: true, sponsor: true },\n },\n [Protocol.Bob]: {\n [Version.Bob.V1_0]: emptyReleaseFeatures,\n },\n [Protocol.Flow]: {\n [Version.Flow.V1_0]: { minFee: false, payable: false, simpleTransfer: false },\n [Version.Flow.V1_1]: { minFee: false, payable: true, simpleTransfer: false },\n [Version.Flow.V2_0]: { minFee: true, payable: true, simpleTransfer: true },\n [Version.Flow.V3_0]: { minFee: true, payable: true, simpleTransfer: true },\n },\n [Protocol.Legacy]: {\n [Version.Legacy.V1_0]: emptyReleaseFeatures,\n [Version.Legacy.V1_1]: emptyReleaseFeatures,\n },\n [Protocol.Lockup]: {\n [Version.Lockup.V1_0]: {\n batch: false,\n legacyAbi: true,\n minFee: false,\n payable: false,\n prbProxy: true,\n shape: false,\n },\n [Version.Lockup.V1_1]: {\n batch: false,\n legacyAbi: true,\n minFee: false,\n payable: false,\n prbProxy: false,\n shape: false,\n },\n [Version.Lockup.V1_2]: {\n batch: false,\n legacyAbi: false,\n minFee: false,\n payable: false,\n prbProxy: false,\n shape: false,\n },\n [Version.Lockup.V2_0]: {\n batch: true,\n legacyAbi: false,\n minFee: false,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n [Version.Lockup.V3_0]: {\n batch: true,\n legacyAbi: false,\n minFee: true,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n [Version.Lockup.V4_0]: {\n batch: true,\n legacyAbi: false,\n minFee: true,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n },\n} as const satisfies EvmReleaseFeatureRegistry);\n\nexport type PayableEvmProtocol = ProtocolWithBooleanFeature<\"payable\">;\n\n/* -------------------------------------------------------------------------- */\n/* PRIVATE HELPERS */\n/* -------------------------------------------------------------------------- */\n\nconst evmReleaseFeatureRegistry: EvmReleaseFeatureRegistry = evmReleaseFeatures;\n\ntype PayableReleaseFeatureRegistry = {\n [TProtocol in PayableEvmProtocol]: Record<\n EvmReleaseVersionByProtocol[TProtocol],\n Pick<ProtocolFeatureSet<TProtocol>, \"payable\">\n >;\n};\n\nconst payableReleaseFeatureRegistry = deepFreeze({\n [Protocol.Airdrops]: evmReleaseFeatures[Protocol.Airdrops],\n [Protocol.Flow]: evmReleaseFeatures[Protocol.Flow],\n [Protocol.Lockup]: evmReleaseFeatures[Protocol.Lockup],\n} satisfies PayableReleaseFeatureRegistry);\n\n/**\n * Narrows protocol checks for helpers that only apply to fee-charging releases.\n */\nfunction isPayableEvmProtocol(protocol: Sablier.EVM.Protocol): protocol is PayableEvmProtocol {\n return protocol in payableReleaseFeatureRegistry;\n}\n\n/**\n * Narrows a release descriptor to protocols whose feature bag includes a payable flag.\n */\nfunction isPayableEvmRelease(release: EvmReleaseReference): release is PayableEvmReleaseReference {\n return isPayableEvmProtocol(release.protocol);\n}\n\n/**\n * Normalizes the supported payable helper overloads to the canonical release shape.\n */\nfunction normalizePayableReleaseInput(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): EvmReleaseReference {\n if (typeof releaseOrProtocol !== \"string\") {\n return releaseOrProtocol;\n }\n\n if (!version) {\n throw new Error('Sablier SDK: Missing \"version\" for isEvmReleasePayable(protocol, version)');\n }\n\n return { protocol: releaseOrProtocol, version };\n}\n\n/* -------------------------------------------------------------------------- */\n/* FEATURES */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Reads the airdrops capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Airdrops protocol.\n */\nexport function getAirdropsReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.AirdropsReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Airdrops];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Airdrops];\n}\n\n/**\n * Returns the protocol-specific feature bag for a single EVM release.\n */\nexport function getEvmReleaseFeatures<TProtocol extends keyof EvmReleaseFeatureSetByProtocol>(\n protocol: TProtocol,\n version: EvmReleaseVersionByProtocol[TProtocol]\n): ReleaseFeaturesForProtocol<TProtocol> {\n return evmReleaseFeatureRegistry[protocol][version] as ReleaseFeaturesForProtocol<TProtocol>;\n}\n\n/**\n * Reads the flow capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Flow protocol.\n */\nexport function getFlowReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.FlowReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Flow];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Flow];\n}\n\n/**\n * Reads the lockup capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Lockup protocol.\n */\nexport function getLockupReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.LockupReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Lockup];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Lockup];\n}\n\n/**\n * Returns whether the airdrops release supports the `claimTo` function for claiming to a third-party address.\n * Returns `false` for non-Airdrops versions.\n */\nexport function hasClaimTo(version: Sablier.EVM.Version): boolean {\n return getAirdropsReleaseFeatures(version)?.claimTo ?? false;\n}\n\n/**\n * Returns whether the airdrops release supports sponsor-driven claims.\n * Returns `false` for non-Airdrops versions.\n */\nexport function hasSponsor(version: Sablier.EVM.Version): boolean {\n return getAirdropsReleaseFeatures(version)?.sponsor ?? false;\n}\n\n/**\n * Returns whether a Flow or Lockup release exposes an on-chain minimum fee in wei.\n */\nexport function hasOnchainMinFee(release: EvmReleaseReference): boolean;\n/**\n * @deprecated Pass a release object instead. This overload will be removed in the next major version (v4).\n */\nexport function hasOnchainMinFee(\n protocol: Sablier.EVM.Protocol,\n version: Sablier.EVM.Version\n): boolean;\nexport function hasOnchainMinFee(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): boolean {\n let release: EvmReleaseReference;\n\n if (typeof releaseOrProtocol === \"string\") {\n if (!version) {\n throw new Error('Sablier SDK: Missing \"version\" for hasOnchainMinFee(protocol, version)');\n }\n\n release = { protocol: releaseOrProtocol, version };\n } else {\n release = releaseOrProtocol;\n }\n\n switch (release.protocol) {\n case Protocol.Flow:\n return getFlowReleaseFeatures(release.version)?.minFee ?? false;\n case Protocol.Lockup:\n return getLockupReleaseFeatures(release.version)?.minFee ?? false;\n default:\n return false;\n }\n}\n\n/**\n * Returns whether the lockup release uses the split ABI layout.\n * Returns `false` for non-Lockup versions.\n */\nexport function hasSplitLockupArchitecture(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.legacyAbi ?? false;\n}\n\n/** @deprecated Use {@link hasSplitLockupArchitecture} instead. */\nexport const usesLockupSplit = hasSplitLockupArchitecture;\n\n/**\n * Returns whether a release charges native-token fees on claim or withdraw operations.\n */\nexport function isEvmReleasePayable(release: EvmReleaseReference): boolean;\n/**\n * @deprecated Pass a release object instead. This overload will be removed in the next major version (v4).\n */\nexport function isEvmReleasePayable(\n protocol: Sablier.EVM.Protocol,\n version: Sablier.EVM.Version\n): boolean;\nexport function isEvmReleasePayable(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): boolean {\n const release = normalizePayableReleaseInput(releaseOrProtocol, version);\n\n if (!isPayableEvmRelease(release)) {\n return false;\n }\n\n const registry = evmReleaseFeatures[release.protocol] as Record<string, { payable: boolean }>;\n if (!(release.version in registry)) {\n return false;\n }\n\n return registry[release.version].payable;\n}\n\n/**\n * Returns whether the lockup release exposes batch create or withdraw flows.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupBatch(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.batch ?? false;\n}\n\n/**\n * Returns whether the lockup release integrates with PRBProxy.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupPrbProxy(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.prbProxy ?? false;\n}\n\n/**\n * Returns whether the lockup release stores shape as an on-chain parameter.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupShape(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.shape ?? false;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"features.js","sourceRoot":"","sources":["../../../../src/evm/releases/features.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAqDvD,SAAS,UAAU,CAAI,KAAQ;IAC7B,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAE,CAAC;QAC1E,OAAO,KAAK,CAAC;IACf,CAAC;IAED,KAAK,MAAM,WAAW,IAAI,MAAM,CAAC,MAAM,CAAC,KAAgC,CAAC,EAAE,CAAC;QAC1E,UAAU,CAAC,WAAW,CAAC,CAAC;IAC1B,CAAC;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC9B,CAAC;AAED,MAAM,oBAAoB,GAAG,UAAU,CAAC,EAAsD,CAAC,CAAC;AAiChG,MAAM,CAAC,MAAM,kBAAkB,GAAG,UAAU,CAAC;IAC3C,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE;QACnB,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3E,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE;QAC3E,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE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KAAK,CAAC;AAC9D,CAAC;AAMD,MAAM,UAAU,mBAAmB,CAAC,OAA4B;IAC9D,OAAO,wBAAwB,CAAC,OAAO,CAAC,EAAE,KAAK,IAAI,KAAK,CAAC;AAC3D,CAAC","sourcesContent":["/**\n * @file Canonical capability registry for every shipped EVM release.\n *\n * Release builders attach these feature bags to exported release objects, and\n * helper functions read from the same registry so version-dependent behavior\n * stays defined in one place.\n */\nimport { Protocol, Version } from \"@/src/evm/enums.js\";\nimport type { Sablier } from \"@/src/types.js\";\n\n/* -------------------------------------------------------------------------- */\n/* TYPES */\n/* -------------------------------------------------------------------------- */\n\nexport type EvmReleaseVersionByProtocol = {\n airdrops: Sablier.EVM.Version.Airdrops;\n bob: Sablier.EVM.Version.Bob;\n flow: Sablier.EVM.Version.Flow;\n legacy: Sablier.EVM.Version.Legacy;\n lockup: Sablier.EVM.Version.Lockup;\n};\n\nexport type EvmReleaseFeatureSetByProtocol = {\n airdrops: Sablier.EVM.AirdropsReleaseFeatures;\n bob: Sablier.EVM.EmptyReleaseFeatures;\n flow: Sablier.EVM.FlowReleaseFeatures;\n legacy: Sablier.EVM.EmptyReleaseFeatures;\n lockup: Sablier.EVM.LockupReleaseFeatures;\n};\n\ntype EvmReleaseFeatureRegistry = {\n [TProtocol in keyof EvmReleaseVersionByProtocol]: Record<\n EvmReleaseVersionByProtocol[TProtocol],\n EvmReleaseFeatureSetByProtocol[TProtocol]\n >;\n};\n\nexport type ReleaseFeaturesForProtocol<TProtocol extends keyof EvmReleaseFeatureSetByProtocol> =\n EvmReleaseFeatureSetByProtocol[TProtocol];\n\ntype ProtocolFeatureSet<TProtocol extends keyof EvmReleaseFeatureSetByProtocol> =\n EvmReleaseFeatureSetByProtocol[TProtocol];\n\ntype ProtocolWithBooleanFeature<TFeature extends PropertyKey> = {\n [TProtocol in keyof EvmReleaseFeatureSetByProtocol]: ProtocolFeatureSet<TProtocol> extends Record<\n TFeature,\n boolean\n >\n ? TProtocol\n : never;\n}[keyof EvmReleaseFeatureSetByProtocol];\n\ntype EvmReleaseReference = Pick<Sablier.EVM.Release, \"protocol\" | \"version\">;\ntype PayableEvmReleaseReference = {\n [TProtocol in PayableEvmProtocol]: {\n protocol: TProtocol;\n version: EvmReleaseVersionByProtocol[TProtocol];\n };\n}[PayableEvmProtocol];\n\nfunction deepFreeze<T>(value: T): T {\n if (typeof value !== \"object\" || value === null || Object.isFrozen(value)) {\n return value;\n }\n\n for (const nestedValue of Object.values(value as Record<string, unknown>)) {\n deepFreeze(nestedValue);\n }\n\n return Object.freeze(value);\n}\n\nconst emptyReleaseFeatures = deepFreeze({} as const satisfies Sablier.EVM.EmptyReleaseFeatures);\n\n/**\n * Protocol/version feature matrix used by both release resolvers and public helpers.\n *\n * Feature glossary:\n * - `claimTo`: Airdrops campaigns can redirect claims to a third-party recipient; introduced in `airdrops@v2.0`\n *\n * - `sponsor`: Airdrops campaigns expose the `sponsor` function; introduced in `airdrops@v3.0`\n *\n * - `payable`: Release entrypoints accept native-token value for protocol fees. This first appears in\n * `airdrops@v1.3`, `flow@v1.1`, and `lockup@v2.0`\n *\n * - `contractMinFee`: Contracts expose an onchain minimum-fee calculation; introduced in `flow@v2.0` and adopted by\n * Lockup in `lockup@v3.0`\n *\n * - `batch`: Lockup releases support batched execution helpers; introduced in `lockup@v2.0`\n *\n * - `shape`: Lockup create flows emit and consume canonical shape identifiers; introduced in `lockup@v2.0`\n *\n * - `simpleTransfer`: Flow releases expose a `transferTokens` wrapper that lets the contract forward an ERC-20 transfer\n * on behalf of the caller; introduced in `flow@v2.0`\n *\n * - `legacyAbi`: Lockup still uses the pre-`lockup@v1.2` split ABI layout and old hook interface; cleared when\n * `lockup@v1.2` shipped the new hook system\n *\n * - `prbProxy`: Lockup still uses the original `prbProxy` deployment wiring from `lockup@v1.0`; this is only true for\n * that initial release and is cleared from `lockup@v1.1` onward\n *\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/airdrops@v3.0/airdrops/CHANGELOG.md}\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/flow@v3.0/flow/CHANGELOG.md}\n * @see {@link https://github.com/sablier-labs/evm-monorepo/blob/lockup@v4.0/lockup/CHANGELOG.md}\n */\nexport const evmReleaseFeatures = deepFreeze({\n [Protocol.Airdrops]: {\n [Version.Airdrops.V1_1]: { claimTo: false, payable: false, sponsor: false },\n [Version.Airdrops.V1_2]: { claimTo: false, payable: false, sponsor: false },\n [Version.Airdrops.V1_3]: { claimTo: false, payable: true, sponsor: false },\n [Version.Airdrops.V2_0]: { claimTo: true, payable: true, sponsor: false },\n [Version.Airdrops.V3_0]: { claimTo: true, payable: true, sponsor: true },\n },\n [Protocol.Bob]: {\n [Version.Bob.V1_0]: emptyReleaseFeatures,\n },\n [Protocol.Flow]: {\n [Version.Flow.V1_0]: { minFee: false, payable: false, simpleTransfer: false },\n [Version.Flow.V1_1]: { minFee: false, payable: true, simpleTransfer: false },\n [Version.Flow.V2_0]: { minFee: true, payable: true, simpleTransfer: true },\n [Version.Flow.V3_0]: { minFee: true, payable: true, simpleTransfer: true },\n },\n [Protocol.Legacy]: {\n [Version.Legacy.V1_0]: emptyReleaseFeatures,\n [Version.Legacy.V1_1]: emptyReleaseFeatures,\n },\n [Protocol.Lockup]: {\n [Version.Lockup.V1_0]: {\n batch: false,\n legacyAbi: true,\n minFee: false,\n payable: false,\n prbProxy: true,\n shape: false,\n },\n [Version.Lockup.V1_1]: {\n batch: false,\n legacyAbi: true,\n minFee: false,\n payable: false,\n prbProxy: false,\n shape: false,\n },\n [Version.Lockup.V1_2]: {\n batch: false,\n legacyAbi: false,\n minFee: false,\n payable: false,\n prbProxy: false,\n shape: false,\n },\n [Version.Lockup.V2_0]: {\n batch: true,\n legacyAbi: false,\n minFee: false,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n [Version.Lockup.V3_0]: {\n batch: true,\n legacyAbi: false,\n minFee: true,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n [Version.Lockup.V4_0]: {\n batch: true,\n legacyAbi: false,\n minFee: true,\n payable: true,\n prbProxy: false,\n shape: true,\n },\n },\n} as const satisfies EvmReleaseFeatureRegistry);\n\nexport type PayableEvmProtocol = ProtocolWithBooleanFeature<\"payable\">;\n\n/* -------------------------------------------------------------------------- */\n/* PRIVATE HELPERS */\n/* -------------------------------------------------------------------------- */\n\nconst evmReleaseFeatureRegistry: EvmReleaseFeatureRegistry = evmReleaseFeatures;\n\ntype PayableReleaseFeatureRegistry = {\n [TProtocol in PayableEvmProtocol]: Record<\n EvmReleaseVersionByProtocol[TProtocol],\n Pick<ProtocolFeatureSet<TProtocol>, \"payable\">\n >;\n};\n\nconst payableReleaseFeatureRegistry = deepFreeze({\n [Protocol.Airdrops]: evmReleaseFeatures[Protocol.Airdrops],\n [Protocol.Flow]: evmReleaseFeatures[Protocol.Flow],\n [Protocol.Lockup]: evmReleaseFeatures[Protocol.Lockup],\n} satisfies PayableReleaseFeatureRegistry);\n\n/**\n * Narrows protocol checks for helpers that only apply to fee-charging releases.\n */\nfunction isPayableEvmProtocol(protocol: Sablier.EVM.Protocol): protocol is PayableEvmProtocol {\n return protocol in payableReleaseFeatureRegistry;\n}\n\n/**\n * Narrows a release descriptor to protocols whose feature bag includes a payable flag.\n */\nfunction isPayableEvmRelease(release: EvmReleaseReference): release is PayableEvmReleaseReference {\n return isPayableEvmProtocol(release.protocol);\n}\n\n/**\n * Normalizes the supported payable helper overloads to the canonical release shape.\n */\nfunction normalizePayableReleaseInput(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): EvmReleaseReference {\n if (typeof releaseOrProtocol !== \"string\") {\n return releaseOrProtocol;\n }\n\n if (!version) {\n throw new Error('Sablier SDK: Missing \"version\" for isEvmReleasePayable(protocol, version)');\n }\n\n return { protocol: releaseOrProtocol, version };\n}\n\n/* -------------------------------------------------------------------------- */\n/* FEATURES */\n/* -------------------------------------------------------------------------- */\n\n/**\n * Reads the airdrops capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Airdrops protocol.\n */\nexport function getAirdropsReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.AirdropsReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Airdrops];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Airdrops];\n}\n\n/**\n * Returns the protocol-specific feature bag for a single EVM release.\n */\nexport function getEvmReleaseFeatures<TProtocol extends keyof EvmReleaseFeatureSetByProtocol>(\n protocol: TProtocol,\n version: EvmReleaseVersionByProtocol[TProtocol]\n): ReleaseFeaturesForProtocol<TProtocol> {\n return evmReleaseFeatureRegistry[protocol][version] as ReleaseFeaturesForProtocol<TProtocol>;\n}\n\n/**\n * Reads the flow capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Flow protocol.\n */\nexport function getFlowReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.FlowReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Flow];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Flow];\n}\n\n/**\n * Reads the lockup capability matrix for one released version.\n * Returns `undefined` when the version does not belong to the Lockup protocol.\n */\nexport function getLockupReleaseFeatures(\n version: Sablier.EVM.Version\n): Sablier.EVM.LockupReleaseFeatures | undefined {\n const registry = evmReleaseFeatures[Protocol.Lockup];\n if (!(version in registry)) {\n return undefined;\n }\n return registry[version as Sablier.EVM.Version.Lockup];\n}\n\n/**\n * Returns whether the airdrops release supports the `claimTo` function for claiming to a third-party address.\n * Returns `false` for non-Airdrops versions.\n */\nexport function hasClaimTo(version: Sablier.EVM.Version): boolean {\n return getAirdropsReleaseFeatures(version)?.claimTo ?? false;\n}\n\n/**\n * Returns whether the airdrops release supports sponsor-driven claims.\n * Returns `false` for non-Airdrops versions.\n */\nexport function hasSponsor(version: Sablier.EVM.Version): boolean {\n return getAirdropsReleaseFeatures(version)?.sponsor ?? false;\n}\n\n/**\n * Returns whether a Flow or Lockup release exposes an on-chain minimum fee in wei.\n */\nexport function hasOnchainMinFee(release: EvmReleaseReference): boolean;\n/**\n * @deprecated Pass a release object instead. This overload will be removed in the next major version (v4).\n */\nexport function hasOnchainMinFee(\n protocol: Sablier.EVM.Protocol,\n version: Sablier.EVM.Version\n): boolean;\nexport function hasOnchainMinFee(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): boolean {\n let release: EvmReleaseReference;\n\n if (typeof releaseOrProtocol === \"string\") {\n if (!version) {\n throw new Error('Sablier SDK: Missing \"version\" for hasOnchainMinFee(protocol, version)');\n }\n\n release = { protocol: releaseOrProtocol, version };\n } else {\n release = releaseOrProtocol;\n }\n\n switch (release.protocol) {\n case Protocol.Flow:\n return getFlowReleaseFeatures(release.version)?.minFee ?? false;\n case Protocol.Lockup:\n return getLockupReleaseFeatures(release.version)?.minFee ?? false;\n default:\n return false;\n }\n}\n\n/**\n * Returns whether the flow release exposes the `transferTokens` wrapper for forwarding an ERC-20 transfer on behalf of\n * the caller. Returns `false` for non-Flow versions.\n */\nexport function hasSimpleTransfer(version: Sablier.EVM.Version): boolean {\n return getFlowReleaseFeatures(version)?.simpleTransfer ?? false;\n}\n\n/**\n * Returns whether the lockup release uses the split ABI layout.\n * Returns `false` for non-Lockup versions.\n */\nexport function hasSplitLockupArchitecture(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.legacyAbi ?? false;\n}\n\n/** @deprecated Use {@link hasSplitLockupArchitecture} instead. */\nexport const usesLockupSplit = hasSplitLockupArchitecture;\n\n/**\n * Returns whether a release charges native-token fees on claim or withdraw operations.\n */\nexport function isEvmReleasePayable(release: EvmReleaseReference): boolean;\n/**\n * @deprecated Pass a release object instead. This overload will be removed in the next major version (v4).\n */\nexport function isEvmReleasePayable(\n protocol: Sablier.EVM.Protocol,\n version: Sablier.EVM.Version\n): boolean;\nexport function isEvmReleasePayable(\n releaseOrProtocol: EvmReleaseReference | Sablier.EVM.Protocol,\n version?: Sablier.EVM.Version\n): boolean {\n const release = normalizePayableReleaseInput(releaseOrProtocol, version);\n\n if (!isPayableEvmRelease(release)) {\n return false;\n }\n\n const registry = evmReleaseFeatures[release.protocol] as Record<string, { payable: boolean }>;\n if (!(release.version in registry)) {\n return false;\n }\n\n return registry[release.version].payable;\n}\n\n/**\n * Returns whether the lockup release exposes batch create or withdraw flows.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupBatch(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.batch ?? false;\n}\n\n/**\n * Returns whether the lockup release integrates with PRBProxy.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupPrbProxy(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.prbProxy ?? false;\n}\n\n/**\n * Returns whether the lockup release stores shape as an on-chain parameter.\n * Returns `false` for non-Lockup versions.\n */\nexport function supportsLockupShape(version: Sablier.EVM.Version): boolean {\n return getLockupReleaseFeatures(version)?.shape ?? false;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Sablier, TruncateAddressOptions } from "../types.js";
|
|
2
2
|
export type { EvmReleaseFeatureSetByProtocol, EvmReleaseVersionByProtocol, PayableEvmProtocol, ReleaseFeaturesForProtocol, } from "./releases/features.js";
|
|
3
|
-
export { evmReleaseFeatures, getAirdropsReleaseFeatures, getEvmReleaseFeatures, getFlowReleaseFeatures, getLockupReleaseFeatures, hasClaimTo, hasOnchainMinFee, hasSplitLockupArchitecture, hasSponsor, isEvmReleasePayable, supportsLockupBatch, supportsLockupPrbProxy, supportsLockupShape, usesLockupSplit, } from "./releases/features.js";
|
|
3
|
+
export { evmReleaseFeatures, getAirdropsReleaseFeatures, getEvmReleaseFeatures, getFlowReleaseFeatures, getLockupReleaseFeatures, hasClaimTo, hasOnchainMinFee, hasSimpleTransfer, hasSplitLockupArchitecture, hasSponsor, isEvmReleasePayable, supportsLockupBatch, supportsLockupPrbProxy, supportsLockupShape, usesLockupSplit, } from "./releases/features.js";
|
|
4
4
|
export declare function getContractExplorerURL(explorerURL: string, contractAddress: Sablier.EVM.Address): string;
|
|
5
5
|
export declare function resolveEvmStreamId(opts: {
|
|
6
6
|
alias: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["../../../src/evm/helpers.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAItE,YAAY,EACV,8BAA8B,EAC9B,2BAA2B,EAC3B,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,UAAU,EACV,mBAAmB,EACnB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,eAAe,GAChB,MAAM,wBAAwB,CAAC;AAQhC,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,EAAE,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,UAE/F;AAkBD,wBAAgB,kBAAkB,CAAC,IAAI,EAAE;IACvC,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;IAClC,QAAQ,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;CACjC,GAAG,MAAM,CAKT;AAeD,wBAAgB,yBAAyB,CAAC,IAAI,EAAE;IAC9C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,CAAC,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,CAAC;CACjC,GAAG,OAAO,CAAC,GAAG,CAAC,QAAQ,CAqCvB;AAaD,wBAAg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G,CAAC,OAAO,EAC5B,OAAO,CAAC,EAAE,sBAAsB,GAC/B,MAAM,CAiBR"}
|
|
@@ -5,6 +5,6 @@ export * from "./contracts/index.js";
|
|
|
5
5
|
export * as csv from "./csv/index.js";
|
|
6
6
|
export * from "./enums.js";
|
|
7
7
|
export type { EvmReleaseFeatureSetByProtocol, EvmReleaseVersionByProtocol, PayableEvmProtocol, ReleaseFeaturesForProtocol, } from "./helpers.js";
|
|
8
|
-
export { evmReleaseFeatures, getAirdropsReleaseFeatures, getContractExplorerURL, getEvmReleaseFeatures, getFlowReleaseFeatures, getLockupReleaseFeatures, hasClaimTo, hasOnchainMinFee, hasSplitLockupArchitecture, hasSponsor, isEvmReleasePayable, resolveEvmContractByAlias, resolveEvmStreamId, supportsLockupBatch, supportsLockupPrbProxy, supportsLockupShape, truncateEvmAddress, usesLockupSplit, } from "./helpers.js";
|
|
8
|
+
export { evmReleaseFeatures, getAirdropsReleaseFeatures, getContractExplorerURL, getEvmReleaseFeatures, getFlowReleaseFeatures, getLockupReleaseFeatures, hasClaimTo, hasOnchainMinFee, hasSimpleTransfer, hasSplitLockupArchitecture, hasSponsor, isEvmReleasePayable, resolveEvmContractByAlias, resolveEvmStreamId, supportsLockupBatch, supportsLockupPrbProxy, supportsLockupShape, truncateEvmAddress, usesLockupSplit, } from "./helpers.js";
|
|
9
9
|
export * from "./releases/index.js";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,cAAc,YAAY,CAAC;AAS3B,YAAY,EACV,8BAA8B,EAC9B,2BAA2B,EAC3B,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,0BAA0B,EAC1B,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,cAAc,qBAAqB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,cAAc,sBAAsB,CAAC;AACrC,OAAO,KAAK,GAAG,MAAM,gBAAgB,CAAC;AACtC,cAAc,YAAY,CAAC;AAS3B,YAAY,EACV,8BAA8B,EAC9B,2BAA2B,EAC3B,kBAAkB,EAClB,0BAA0B,GAC3B,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,sBAAsB,EACtB,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,iBAAiB,EACjB,0BAA0B,EAC1B,UAAU,EACV,mBAAmB,EACnB,yBAAyB,EACzB,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,kBAAkB,EAClB,eAAe,GAChB,MAAM,cAAc,CAAC;AACtB,cAAc,qBAAqB,CAAC"}
|
|
@@ -136,6 +136,7 @@ export declare function hasClaimTo(version: Sablier.EVM.Version): boolean;
|
|
|
136
136
|
export declare function hasSponsor(version: Sablier.EVM.Version): boolean;
|
|
137
137
|
export declare function hasOnchainMinFee(release: EvmReleaseReference): boolean;
|
|
138
138
|
export declare function hasOnchainMinFee(protocol: Sablier.EVM.Protocol, version: Sablier.EVM.Version): boolean;
|
|
139
|
+
export declare function hasSimpleTransfer(version: Sablier.EVM.Version): boolean;
|
|
139
140
|
export declare function hasSplitLockupArchitecture(version: Sablier.EVM.Version): boolean;
|
|
140
141
|
export declare const usesLockupSplit: typeof hasSplitLockupArchitecture;
|
|
141
142
|
export declare function isEvmReleasePayable(release: EvmReleaseReference): boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"features.d.ts","sourceRoot":"","sources":["../../../../src/evm/releases/features.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,gBAAgB,CAAC;AAM9C,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,QAAQ,CAAC;IACvC,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC;IAC7B,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,CAAC;IAC/B,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;IACnC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,MAAM,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,8BAA8B,GAAG;IAC3C,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAC9C,GAAG,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;IACtC,IAAI,EAAE,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IACtC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;IACzC,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,qBAAqB,CAAC;CAC3C,CAAC;AASF,MAAM,MAAM,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G,OAAO,CAEvE;AAMD,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,CAEhF;AAGD,eAAO,MAAM,eAAe,mCAA6B,CAAC;AAK1D,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,mBAAmB,GAAG,OAAO,CAAC;AAI3E,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,QAAQ,EAC9B,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,GAC3B,OAAO,CAAC;AAuBX,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,CAEzE;AAMD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,CAE5E;AAMD,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,OAAO,CAAC,GAAG,CAAC,OAAO,GAAG,OAAO,CAEzE"}
|
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
"sideEffects": false,
|
|
8
8
|
"types": "./dist/types/index.d.ts",
|
|
9
9
|
"typings": "./dist/types/index.d.ts",
|
|
10
|
-
"version": "3.
|
|
10
|
+
"version": "3.9.0",
|
|
11
11
|
"type": "module",
|
|
12
12
|
"author": {
|
|
13
13
|
"name": "Sablier Labs Ltd",
|
|
@@ -43,7 +43,6 @@
|
|
|
43
43
|
"tsx": "^4.21.0",
|
|
44
44
|
"typescript": "^5.9.3",
|
|
45
45
|
"ultracite": "^7.0.11",
|
|
46
|
-
"vite-tsconfig-paths": "^5.1.4",
|
|
47
46
|
"vitest": "^4.0.17",
|
|
48
47
|
"winston": "^3.19.0"
|
|
49
48
|
},
|