@strimz/shared-config 0.1.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/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/agents.cjs +65 -0
- package/dist/agents.cjs.map +1 -0
- package/dist/agents.d.cts +39 -0
- package/dist/agents.d.ts +39 -0
- package/dist/agents.js +60 -0
- package/dist/agents.js.map +1 -0
- package/dist/api-keys.cjs +37 -0
- package/dist/api-keys.cjs.map +1 -0
- package/dist/api-keys.d.cts +28 -0
- package/dist/api-keys.d.ts +28 -0
- package/dist/api-keys.js +30 -0
- package/dist/api-keys.js.map +1 -0
- package/dist/cctp.cjs +51 -0
- package/dist/cctp.cjs.map +1 -0
- package/dist/cctp.d.cts +38 -0
- package/dist/cctp.d.ts +38 -0
- package/dist/cctp.js +46 -0
- package/dist/cctp.js.map +1 -0
- package/dist/chains.cjs +64 -0
- package/dist/chains.cjs.map +1 -0
- package/dist/chains.d.cts +23 -0
- package/dist/chains.d.ts +23 -0
- package/dist/chains.js +56 -0
- package/dist/chains.js.map +1 -0
- package/dist/index.cjs +403 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +8 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.js +363 -0
- package/dist/index.js.map +1 -0
- package/dist/tiers.cjs +73 -0
- package/dist/tiers.cjs.map +1 -0
- package/dist/tiers.d.cts +34 -0
- package/dist/tiers.d.ts +34 -0
- package/dist/tiers.js +68 -0
- package/dist/tiers.js.map +1 -0
- package/dist/tokens.cjs +107 -0
- package/dist/tokens.cjs.map +1 -0
- package/dist/tokens.d.cts +44 -0
- package/dist/tokens.d.ts +44 -0
- package/dist/tokens.js +99 -0
- package/dist/tokens.js.map +1 -0
- package/dist/webhooks.cjs +73 -0
- package/dist/webhooks.cjs.map +1 -0
- package/dist/webhooks.d.cts +55 -0
- package/dist/webhooks.d.ts +55 -0
- package/dist/webhooks.js +65 -0
- package/dist/webhooks.js.map +1 -0
- package/package.json +96 -0
- package/src/agents.ts +102 -0
- package/src/api-keys.ts +43 -0
- package/src/cctp.ts +68 -0
- package/src/chains.ts +70 -0
- package/src/index.ts +17 -0
- package/src/tiers.ts +89 -0
- package/src/tokens.ts +96 -0
- package/src/webhooks.ts +80 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Strimz
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# @strimz/shared-config
|
|
2
|
+
|
|
3
|
+
Single source of truth for the Strimz platform's environment-independent constants. If a value (chain id, token address, fee tier, webhook event name, agent flag, CCTP contract) needs to be referenced by more than one app or package, it lives here.
|
|
4
|
+
|
|
5
|
+
## Modules
|
|
6
|
+
|
|
7
|
+
| Subpath | Exports |
|
|
8
|
+
| -------------------------------- | ------------------------------------------------------------------------------------- |
|
|
9
|
+
| `@strimz/shared-config/chains` | `arcTestnet`, `arcMainnet`, `getArcChain`, `isArcChain`, chain id constants |
|
|
10
|
+
| `@strimz/shared-config/tokens` | `TOKENS`, `TOKEN_ADDRESSES`, `getTokenAddress`, `isPaymentToken`, `PaymentToken` type |
|
|
11
|
+
| `@strimz/shared-config/tiers` | `TIERS`, `effectiveFeeBps`, `getTier`, `MerchantTier` type |
|
|
12
|
+
| `@strimz/shared-config/webhooks` | `WEBHOOK_EVENTS`, retry schedule, signature header constants |
|
|
13
|
+
| `@strimz/shared-config/api-keys` | `API_KEY_PREFIXES`, `prefixFor`, `modeFromKey`, `kindFromKey` |
|
|
14
|
+
| `@strimz/shared-config/agents` | `AGENT_CAPABILITIES`, `AGENT_DEFAULTS`, capability metadata |
|
|
15
|
+
| `@strimz/shared-config/cctp` | CCTP V2 contract addresses, domain ids, source chain registry |
|
|
16
|
+
|
|
17
|
+
The package root (`@strimz/shared-config`) re-exports everything.
|
|
18
|
+
|
|
19
|
+
## Usage
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { arcTestnet, getTokenAddress, effectiveFeeBps } from '@strimz/shared-config'
|
|
23
|
+
|
|
24
|
+
const usdcOnTestnet = getTokenAddress('testnet', 'USDC')
|
|
25
|
+
const recurringFeeBps = effectiveFeeBps('growth', 'subscription') // 100 bps (0.8% + 0.2% premium)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Boundaries
|
|
29
|
+
|
|
30
|
+
- **No environment reads.** This package never touches `process.env`. Apps wire env values into typed config; this package supplies the constants those values key into.
|
|
31
|
+
- **No I/O.** Pure data and pure functions only.
|
|
32
|
+
- **Cross-language sync.** The Go indexer does not consume this package. Constants the indexer needs (chain id, contract addresses) are passed via env. The TS source of truth here is mirrored through deployment configuration, never through duplicated code.
|
package/dist/agents.cjs
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/agents.ts
|
|
4
|
+
var AGENT_CAPABILITIES = {
|
|
5
|
+
identity: {
|
|
6
|
+
id: "identity",
|
|
7
|
+
name: "Agent Identity (ERC-8004)",
|
|
8
|
+
valueMoving: false,
|
|
9
|
+
defaultEnabled: true
|
|
10
|
+
},
|
|
11
|
+
recovery: {
|
|
12
|
+
id: "recovery",
|
|
13
|
+
name: "Subscription Recovery",
|
|
14
|
+
valueMoving: true,
|
|
15
|
+
defaultEnabled: false
|
|
16
|
+
},
|
|
17
|
+
routing: {
|
|
18
|
+
id: "routing",
|
|
19
|
+
name: "Cross-Chain Payment Routing",
|
|
20
|
+
valueMoving: true,
|
|
21
|
+
defaultEnabled: false
|
|
22
|
+
},
|
|
23
|
+
cashflow: {
|
|
24
|
+
id: "cashflow",
|
|
25
|
+
name: "Treasury Cash Flow Insights",
|
|
26
|
+
valueMoving: false,
|
|
27
|
+
defaultEnabled: false
|
|
28
|
+
},
|
|
29
|
+
commerce: {
|
|
30
|
+
id: "commerce",
|
|
31
|
+
name: "Agentic B2B Commerce (ERC-8183)",
|
|
32
|
+
valueMoving: true,
|
|
33
|
+
defaultEnabled: false
|
|
34
|
+
},
|
|
35
|
+
pricing_intelligence: {
|
|
36
|
+
id: "pricing_intelligence",
|
|
37
|
+
name: "Subscription Pricing Intelligence",
|
|
38
|
+
valueMoving: false,
|
|
39
|
+
defaultEnabled: false
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var RECOVERY_GRACE_PERIODS = [24, 48, 72];
|
|
43
|
+
var AGENT_DEFAULTS = {
|
|
44
|
+
recovery: {
|
|
45
|
+
gracePeriodHours: 48,
|
|
46
|
+
strategy: "twice"
|
|
47
|
+
},
|
|
48
|
+
cashflow: {
|
|
49
|
+
digestEnabled: false,
|
|
50
|
+
anomalySensitivity: "medium",
|
|
51
|
+
autoConvertToYield: false
|
|
52
|
+
},
|
|
53
|
+
commerce: {
|
|
54
|
+
requireHumanApprovalAboveUsdCents: 1e5
|
|
55
|
+
// $1,000
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
var AGENT_ACTIVITY_LOG_RETENTION_DAYS = 90;
|
|
59
|
+
|
|
60
|
+
exports.AGENT_ACTIVITY_LOG_RETENTION_DAYS = AGENT_ACTIVITY_LOG_RETENTION_DAYS;
|
|
61
|
+
exports.AGENT_CAPABILITIES = AGENT_CAPABILITIES;
|
|
62
|
+
exports.AGENT_DEFAULTS = AGENT_DEFAULTS;
|
|
63
|
+
exports.RECOVERY_GRACE_PERIODS = RECOVERY_GRACE_PERIODS;
|
|
64
|
+
//# sourceMappingURL=agents.cjs.map
|
|
65
|
+
//# sourceMappingURL=agents.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agents.ts"],"names":[],"mappings":";;;AAyBO,IAAM,kBAAA,GAAyE;AAAA,EACpF,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,UAAA;AAAA,IACJ,IAAA,EAAM,2BAAA;AAAA,IACN,WAAA,EAAa,KAAA;AAAA,IACb,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,UAAA;AAAA,IACJ,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa,IAAA;AAAA,IACb,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,OAAA,EAAS;AAAA,IACP,EAAA,EAAI,SAAA;AAAA,IACJ,IAAA,EAAM,6BAAA;AAAA,IACN,WAAA,EAAa,IAAA;AAAA,IACb,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,UAAA;AAAA,IACJ,IAAA,EAAM,6BAAA;AAAA,IACN,WAAA,EAAa,KAAA;AAAA,IACb,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,UAAA;AAAA,IACJ,IAAA,EAAM,iCAAA;AAAA,IACN,WAAA,EAAa,IAAA;AAAA,IACb,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,oBAAA,EAAsB;AAAA,IACpB,EAAA,EAAI,sBAAA;AAAA,IACJ,IAAA,EAAM,mCAAA;AAAA,IACN,WAAA,EAAa,KAAA;AAAA,IACb,cAAA,EAAgB;AAAA;AAEpB;AAIO,IAAM,sBAAA,GAAsD,CAAC,EAAA,EAAI,EAAA,EAAI,EAAE;AAmBvE,IAAM,cAAA,GAAqC;AAAA,EAChD,QAAA,EAAU;AAAA,IACR,gBAAA,EAAkB,EAAA;AAAA,IAClB,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,QAAA,EAAU;AAAA,IACR,aAAA,EAAe,KAAA;AAAA,IACf,kBAAA,EAAoB,QAAA;AAAA,IACpB,kBAAA,EAAoB;AAAA,GACtB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,iCAAA,EAAmC;AAAA;AAAA;AAEvC;AAGO,IAAM,iCAAA,GAAoC","file":"agents.cjs","sourcesContent":["/**\n * Strimz AutoPay Agent — feature flags and defaults.\n *\n * The agent is composed of independent capabilities that can be enabled or\n * disabled per merchant. Defaults are conservative; merchants opt in to\n * value-moving capabilities (recovery retries, treasury auto-convert).\n */\n\nexport type AgentCapability =\n | 'identity'\n | 'recovery'\n | 'routing'\n | 'cashflow'\n | 'commerce'\n | 'pricing_intelligence'\n\nexport interface AgentCapabilityDescriptor {\n id: AgentCapability\n name: string\n /** Whether the capability moves money or signs transactions. */\n valueMoving: boolean\n /** Default enabled state for a newly created merchant. */\n defaultEnabled: boolean\n}\n\nexport const AGENT_CAPABILITIES: Record<AgentCapability, AgentCapabilityDescriptor> = {\n identity: {\n id: 'identity',\n name: 'Agent Identity (ERC-8004)',\n valueMoving: false,\n defaultEnabled: true,\n },\n recovery: {\n id: 'recovery',\n name: 'Subscription Recovery',\n valueMoving: true,\n defaultEnabled: false,\n },\n routing: {\n id: 'routing',\n name: 'Cross-Chain Payment Routing',\n valueMoving: true,\n defaultEnabled: false,\n },\n cashflow: {\n id: 'cashflow',\n name: 'Treasury Cash Flow Insights',\n valueMoving: false,\n defaultEnabled: false,\n },\n commerce: {\n id: 'commerce',\n name: 'Agentic B2B Commerce (ERC-8183)',\n valueMoving: true,\n defaultEnabled: false,\n },\n pricing_intelligence: {\n id: 'pricing_intelligence',\n name: 'Subscription Pricing Intelligence',\n valueMoving: false,\n defaultEnabled: false,\n },\n}\n\nexport type GracePeriodHours = 24 | 48 | 72\n\nexport const RECOVERY_GRACE_PERIODS: readonly GracePeriodHours[] = [24, 48, 72] as const\n\nexport type RecoveryRetryStrategy = 'once' | 'twice' | 'until_grace_ends'\n\nexport interface AgentDefaultConfig {\n recovery: {\n gracePeriodHours: GracePeriodHours\n strategy: RecoveryRetryStrategy\n }\n cashflow: {\n digestEnabled: boolean\n anomalySensitivity: 'low' | 'medium' | 'high'\n autoConvertToYield: boolean\n }\n commerce: {\n requireHumanApprovalAboveUsdCents: number\n }\n}\n\nexport const AGENT_DEFAULTS: AgentDefaultConfig = {\n recovery: {\n gracePeriodHours: 48,\n strategy: 'twice',\n },\n cashflow: {\n digestEnabled: false,\n anomalySensitivity: 'medium',\n autoConvertToYield: false,\n },\n commerce: {\n requireHumanApprovalAboveUsdCents: 100_000, // $1,000\n },\n}\n\n/** Time-to-live for the agent activity log, in days. */\nexport const AGENT_ACTIVITY_LOG_RETENTION_DAYS = 90\n"]}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strimz AutoPay Agent — feature flags and defaults.
|
|
3
|
+
*
|
|
4
|
+
* The agent is composed of independent capabilities that can be enabled or
|
|
5
|
+
* disabled per merchant. Defaults are conservative; merchants opt in to
|
|
6
|
+
* value-moving capabilities (recovery retries, treasury auto-convert).
|
|
7
|
+
*/
|
|
8
|
+
type AgentCapability = 'identity' | 'recovery' | 'routing' | 'cashflow' | 'commerce' | 'pricing_intelligence';
|
|
9
|
+
interface AgentCapabilityDescriptor {
|
|
10
|
+
id: AgentCapability;
|
|
11
|
+
name: string;
|
|
12
|
+
/** Whether the capability moves money or signs transactions. */
|
|
13
|
+
valueMoving: boolean;
|
|
14
|
+
/** Default enabled state for a newly created merchant. */
|
|
15
|
+
defaultEnabled: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const AGENT_CAPABILITIES: Record<AgentCapability, AgentCapabilityDescriptor>;
|
|
18
|
+
type GracePeriodHours = 24 | 48 | 72;
|
|
19
|
+
declare const RECOVERY_GRACE_PERIODS: readonly GracePeriodHours[];
|
|
20
|
+
type RecoveryRetryStrategy = 'once' | 'twice' | 'until_grace_ends';
|
|
21
|
+
interface AgentDefaultConfig {
|
|
22
|
+
recovery: {
|
|
23
|
+
gracePeriodHours: GracePeriodHours;
|
|
24
|
+
strategy: RecoveryRetryStrategy;
|
|
25
|
+
};
|
|
26
|
+
cashflow: {
|
|
27
|
+
digestEnabled: boolean;
|
|
28
|
+
anomalySensitivity: 'low' | 'medium' | 'high';
|
|
29
|
+
autoConvertToYield: boolean;
|
|
30
|
+
};
|
|
31
|
+
commerce: {
|
|
32
|
+
requireHumanApprovalAboveUsdCents: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
declare const AGENT_DEFAULTS: AgentDefaultConfig;
|
|
36
|
+
/** Time-to-live for the agent activity log, in days. */
|
|
37
|
+
declare const AGENT_ACTIVITY_LOG_RETENTION_DAYS = 90;
|
|
38
|
+
|
|
39
|
+
export { AGENT_ACTIVITY_LOG_RETENTION_DAYS, AGENT_CAPABILITIES, AGENT_DEFAULTS, type AgentCapability, type AgentCapabilityDescriptor, type AgentDefaultConfig, type GracePeriodHours, RECOVERY_GRACE_PERIODS, type RecoveryRetryStrategy };
|
package/dist/agents.d.ts
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Strimz AutoPay Agent — feature flags and defaults.
|
|
3
|
+
*
|
|
4
|
+
* The agent is composed of independent capabilities that can be enabled or
|
|
5
|
+
* disabled per merchant. Defaults are conservative; merchants opt in to
|
|
6
|
+
* value-moving capabilities (recovery retries, treasury auto-convert).
|
|
7
|
+
*/
|
|
8
|
+
type AgentCapability = 'identity' | 'recovery' | 'routing' | 'cashflow' | 'commerce' | 'pricing_intelligence';
|
|
9
|
+
interface AgentCapabilityDescriptor {
|
|
10
|
+
id: AgentCapability;
|
|
11
|
+
name: string;
|
|
12
|
+
/** Whether the capability moves money or signs transactions. */
|
|
13
|
+
valueMoving: boolean;
|
|
14
|
+
/** Default enabled state for a newly created merchant. */
|
|
15
|
+
defaultEnabled: boolean;
|
|
16
|
+
}
|
|
17
|
+
declare const AGENT_CAPABILITIES: Record<AgentCapability, AgentCapabilityDescriptor>;
|
|
18
|
+
type GracePeriodHours = 24 | 48 | 72;
|
|
19
|
+
declare const RECOVERY_GRACE_PERIODS: readonly GracePeriodHours[];
|
|
20
|
+
type RecoveryRetryStrategy = 'once' | 'twice' | 'until_grace_ends';
|
|
21
|
+
interface AgentDefaultConfig {
|
|
22
|
+
recovery: {
|
|
23
|
+
gracePeriodHours: GracePeriodHours;
|
|
24
|
+
strategy: RecoveryRetryStrategy;
|
|
25
|
+
};
|
|
26
|
+
cashflow: {
|
|
27
|
+
digestEnabled: boolean;
|
|
28
|
+
anomalySensitivity: 'low' | 'medium' | 'high';
|
|
29
|
+
autoConvertToYield: boolean;
|
|
30
|
+
};
|
|
31
|
+
commerce: {
|
|
32
|
+
requireHumanApprovalAboveUsdCents: number;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
declare const AGENT_DEFAULTS: AgentDefaultConfig;
|
|
36
|
+
/** Time-to-live for the agent activity log, in days. */
|
|
37
|
+
declare const AGENT_ACTIVITY_LOG_RETENTION_DAYS = 90;
|
|
38
|
+
|
|
39
|
+
export { AGENT_ACTIVITY_LOG_RETENTION_DAYS, AGENT_CAPABILITIES, AGENT_DEFAULTS, type AgentCapability, type AgentCapabilityDescriptor, type AgentDefaultConfig, type GracePeriodHours, RECOVERY_GRACE_PERIODS, type RecoveryRetryStrategy };
|
package/dist/agents.js
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
// src/agents.ts
|
|
2
|
+
var AGENT_CAPABILITIES = {
|
|
3
|
+
identity: {
|
|
4
|
+
id: "identity",
|
|
5
|
+
name: "Agent Identity (ERC-8004)",
|
|
6
|
+
valueMoving: false,
|
|
7
|
+
defaultEnabled: true
|
|
8
|
+
},
|
|
9
|
+
recovery: {
|
|
10
|
+
id: "recovery",
|
|
11
|
+
name: "Subscription Recovery",
|
|
12
|
+
valueMoving: true,
|
|
13
|
+
defaultEnabled: false
|
|
14
|
+
},
|
|
15
|
+
routing: {
|
|
16
|
+
id: "routing",
|
|
17
|
+
name: "Cross-Chain Payment Routing",
|
|
18
|
+
valueMoving: true,
|
|
19
|
+
defaultEnabled: false
|
|
20
|
+
},
|
|
21
|
+
cashflow: {
|
|
22
|
+
id: "cashflow",
|
|
23
|
+
name: "Treasury Cash Flow Insights",
|
|
24
|
+
valueMoving: false,
|
|
25
|
+
defaultEnabled: false
|
|
26
|
+
},
|
|
27
|
+
commerce: {
|
|
28
|
+
id: "commerce",
|
|
29
|
+
name: "Agentic B2B Commerce (ERC-8183)",
|
|
30
|
+
valueMoving: true,
|
|
31
|
+
defaultEnabled: false
|
|
32
|
+
},
|
|
33
|
+
pricing_intelligence: {
|
|
34
|
+
id: "pricing_intelligence",
|
|
35
|
+
name: "Subscription Pricing Intelligence",
|
|
36
|
+
valueMoving: false,
|
|
37
|
+
defaultEnabled: false
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
var RECOVERY_GRACE_PERIODS = [24, 48, 72];
|
|
41
|
+
var AGENT_DEFAULTS = {
|
|
42
|
+
recovery: {
|
|
43
|
+
gracePeriodHours: 48,
|
|
44
|
+
strategy: "twice"
|
|
45
|
+
},
|
|
46
|
+
cashflow: {
|
|
47
|
+
digestEnabled: false,
|
|
48
|
+
anomalySensitivity: "medium",
|
|
49
|
+
autoConvertToYield: false
|
|
50
|
+
},
|
|
51
|
+
commerce: {
|
|
52
|
+
requireHumanApprovalAboveUsdCents: 1e5
|
|
53
|
+
// $1,000
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
var AGENT_ACTIVITY_LOG_RETENTION_DAYS = 90;
|
|
57
|
+
|
|
58
|
+
export { AGENT_ACTIVITY_LOG_RETENTION_DAYS, AGENT_CAPABILITIES, AGENT_DEFAULTS, RECOVERY_GRACE_PERIODS };
|
|
59
|
+
//# sourceMappingURL=agents.js.map
|
|
60
|
+
//# sourceMappingURL=agents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/agents.ts"],"names":[],"mappings":";AAyBO,IAAM,kBAAA,GAAyE;AAAA,EACpF,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,UAAA;AAAA,IACJ,IAAA,EAAM,2BAAA;AAAA,IACN,WAAA,EAAa,KAAA;AAAA,IACb,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,UAAA;AAAA,IACJ,IAAA,EAAM,uBAAA;AAAA,IACN,WAAA,EAAa,IAAA;AAAA,IACb,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,OAAA,EAAS;AAAA,IACP,EAAA,EAAI,SAAA;AAAA,IACJ,IAAA,EAAM,6BAAA;AAAA,IACN,WAAA,EAAa,IAAA;AAAA,IACb,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,UAAA;AAAA,IACJ,IAAA,EAAM,6BAAA;AAAA,IACN,WAAA,EAAa,KAAA;AAAA,IACb,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,EAAA,EAAI,UAAA;AAAA,IACJ,IAAA,EAAM,iCAAA;AAAA,IACN,WAAA,EAAa,IAAA;AAAA,IACb,cAAA,EAAgB;AAAA,GAClB;AAAA,EACA,oBAAA,EAAsB;AAAA,IACpB,EAAA,EAAI,sBAAA;AAAA,IACJ,IAAA,EAAM,mCAAA;AAAA,IACN,WAAA,EAAa,KAAA;AAAA,IACb,cAAA,EAAgB;AAAA;AAEpB;AAIO,IAAM,sBAAA,GAAsD,CAAC,EAAA,EAAI,EAAA,EAAI,EAAE;AAmBvE,IAAM,cAAA,GAAqC;AAAA,EAChD,QAAA,EAAU;AAAA,IACR,gBAAA,EAAkB,EAAA;AAAA,IAClB,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,QAAA,EAAU;AAAA,IACR,aAAA,EAAe,KAAA;AAAA,IACf,kBAAA,EAAoB,QAAA;AAAA,IACpB,kBAAA,EAAoB;AAAA,GACtB;AAAA,EACA,QAAA,EAAU;AAAA,IACR,iCAAA,EAAmC;AAAA;AAAA;AAEvC;AAGO,IAAM,iCAAA,GAAoC","file":"agents.js","sourcesContent":["/**\n * Strimz AutoPay Agent — feature flags and defaults.\n *\n * The agent is composed of independent capabilities that can be enabled or\n * disabled per merchant. Defaults are conservative; merchants opt in to\n * value-moving capabilities (recovery retries, treasury auto-convert).\n */\n\nexport type AgentCapability =\n | 'identity'\n | 'recovery'\n | 'routing'\n | 'cashflow'\n | 'commerce'\n | 'pricing_intelligence'\n\nexport interface AgentCapabilityDescriptor {\n id: AgentCapability\n name: string\n /** Whether the capability moves money or signs transactions. */\n valueMoving: boolean\n /** Default enabled state for a newly created merchant. */\n defaultEnabled: boolean\n}\n\nexport const AGENT_CAPABILITIES: Record<AgentCapability, AgentCapabilityDescriptor> = {\n identity: {\n id: 'identity',\n name: 'Agent Identity (ERC-8004)',\n valueMoving: false,\n defaultEnabled: true,\n },\n recovery: {\n id: 'recovery',\n name: 'Subscription Recovery',\n valueMoving: true,\n defaultEnabled: false,\n },\n routing: {\n id: 'routing',\n name: 'Cross-Chain Payment Routing',\n valueMoving: true,\n defaultEnabled: false,\n },\n cashflow: {\n id: 'cashflow',\n name: 'Treasury Cash Flow Insights',\n valueMoving: false,\n defaultEnabled: false,\n },\n commerce: {\n id: 'commerce',\n name: 'Agentic B2B Commerce (ERC-8183)',\n valueMoving: true,\n defaultEnabled: false,\n },\n pricing_intelligence: {\n id: 'pricing_intelligence',\n name: 'Subscription Pricing Intelligence',\n valueMoving: false,\n defaultEnabled: false,\n },\n}\n\nexport type GracePeriodHours = 24 | 48 | 72\n\nexport const RECOVERY_GRACE_PERIODS: readonly GracePeriodHours[] = [24, 48, 72] as const\n\nexport type RecoveryRetryStrategy = 'once' | 'twice' | 'until_grace_ends'\n\nexport interface AgentDefaultConfig {\n recovery: {\n gracePeriodHours: GracePeriodHours\n strategy: RecoveryRetryStrategy\n }\n cashflow: {\n digestEnabled: boolean\n anomalySensitivity: 'low' | 'medium' | 'high'\n autoConvertToYield: boolean\n }\n commerce: {\n requireHumanApprovalAboveUsdCents: number\n }\n}\n\nexport const AGENT_DEFAULTS: AgentDefaultConfig = {\n recovery: {\n gracePeriodHours: 48,\n strategy: 'twice',\n },\n cashflow: {\n digestEnabled: false,\n anomalySensitivity: 'medium',\n autoConvertToYield: false,\n },\n commerce: {\n requireHumanApprovalAboveUsdCents: 100_000, // $1,000\n },\n}\n\n/** Time-to-live for the agent activity log, in days. */\nexport const AGENT_ACTIVITY_LOG_RETENTION_DAYS = 90\n"]}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/api-keys.ts
|
|
4
|
+
var API_KEY_PREFIXES = {
|
|
5
|
+
secret: {
|
|
6
|
+
test: "sk_test_",
|
|
7
|
+
live: "sk_live_"
|
|
8
|
+
},
|
|
9
|
+
publishable: {
|
|
10
|
+
test: "pk_test_",
|
|
11
|
+
live: "pk_live_"
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
var API_KEY_RANDOM_BYTES = 32;
|
|
15
|
+
function prefixFor(kind, mode) {
|
|
16
|
+
return API_KEY_PREFIXES[kind][mode];
|
|
17
|
+
}
|
|
18
|
+
function modeFromKey(key) {
|
|
19
|
+
if (key.startsWith("sk_test_") || key.startsWith("pk_test_")) return "test";
|
|
20
|
+
if (key.startsWith("sk_live_") || key.startsWith("pk_live_")) return "live";
|
|
21
|
+
return null;
|
|
22
|
+
}
|
|
23
|
+
function kindFromKey(key) {
|
|
24
|
+
if (key.startsWith("sk_")) return "secret";
|
|
25
|
+
if (key.startsWith("pk_")) return "publishable";
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
var API_KEY_PREFIX_DISPLAY_LENGTH = 12;
|
|
29
|
+
|
|
30
|
+
exports.API_KEY_PREFIXES = API_KEY_PREFIXES;
|
|
31
|
+
exports.API_KEY_PREFIX_DISPLAY_LENGTH = API_KEY_PREFIX_DISPLAY_LENGTH;
|
|
32
|
+
exports.API_KEY_RANDOM_BYTES = API_KEY_RANDOM_BYTES;
|
|
33
|
+
exports.kindFromKey = kindFromKey;
|
|
34
|
+
exports.modeFromKey = modeFromKey;
|
|
35
|
+
exports.prefixFor = prefixFor;
|
|
36
|
+
//# sourceMappingURL=api-keys.cjs.map
|
|
37
|
+
//# sourceMappingURL=api-keys.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/api-keys.ts"],"names":[],"mappings":";;;AAWO,IAAM,gBAAA,GAAmB;AAAA,EAC9B,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,UAAA;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,WAAA,EAAa;AAAA,IACX,IAAA,EAAM,UAAA;AAAA,IACN,IAAA,EAAM;AAAA;AAEV;AAGO,IAAM,oBAAA,GAAuB;AAE7B,SAAS,SAAA,CAAU,MAAkB,IAAA,EAA0B;AACpE,EAAA,OAAO,gBAAA,CAAiB,IAAI,CAAA,CAAE,IAAI,CAAA;AACpC;AAEO,SAAS,YAAY,GAAA,EAAgC;AAC1D,EAAA,IAAI,GAAA,CAAI,WAAW,UAAU,CAAA,IAAK,IAAI,UAAA,CAAW,UAAU,GAAG,OAAO,MAAA;AACrE,EAAA,IAAI,GAAA,CAAI,WAAW,UAAU,CAAA,IAAK,IAAI,UAAA,CAAW,UAAU,GAAG,OAAO,MAAA;AACrE,EAAA,OAAO,IAAA;AACT;AAEO,SAAS,YAAY,GAAA,EAAgC;AAC1D,EAAA,IAAI,GAAA,CAAI,UAAA,CAAW,KAAK,CAAA,EAAG,OAAO,QAAA;AAClC,EAAA,IAAI,GAAA,CAAI,UAAA,CAAW,KAAK,CAAA,EAAG,OAAO,aAAA;AAClC,EAAA,OAAO,IAAA;AACT;AAGO,IAAM,6BAAA,GAAgC","file":"api-keys.cjs","sourcesContent":["/**\n * API key prefix conventions.\n *\n * Prefix tells you immediately which environment a key targets and whether it\n * is safe to expose to the client. Secret keys are server-side only; publishable\n * keys can ship in browser bundles.\n */\n\nexport type ApiKeyMode = 'test' | 'live'\nexport type ApiKeyKind = 'secret' | 'publishable'\n\nexport const API_KEY_PREFIXES = {\n secret: {\n test: 'sk_test_',\n live: 'sk_live_',\n },\n publishable: {\n test: 'pk_test_',\n live: 'pk_live_',\n },\n} as const satisfies Record<ApiKeyKind, Record<ApiKeyMode, string>>\n\n/** Length of the random portion of a key, before prefix. Base62, 256 bits of entropy. */\nexport const API_KEY_RANDOM_BYTES = 32\n\nexport function prefixFor(kind: ApiKeyKind, mode: ApiKeyMode): string {\n return API_KEY_PREFIXES[kind][mode]\n}\n\nexport function modeFromKey(key: string): ApiKeyMode | null {\n if (key.startsWith('sk_test_') || key.startsWith('pk_test_')) return 'test'\n if (key.startsWith('sk_live_') || key.startsWith('pk_live_')) return 'live'\n return null\n}\n\nexport function kindFromKey(key: string): ApiKeyKind | null {\n if (key.startsWith('sk_')) return 'secret'\n if (key.startsWith('pk_')) return 'publishable'\n return null\n}\n\n/** Number of leading characters of a key safe to display in dashboards/logs. */\nexport const API_KEY_PREFIX_DISPLAY_LENGTH = 12\n"]}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API key prefix conventions.
|
|
3
|
+
*
|
|
4
|
+
* Prefix tells you immediately which environment a key targets and whether it
|
|
5
|
+
* is safe to expose to the client. Secret keys are server-side only; publishable
|
|
6
|
+
* keys can ship in browser bundles.
|
|
7
|
+
*/
|
|
8
|
+
type ApiKeyMode = 'test' | 'live';
|
|
9
|
+
type ApiKeyKind = 'secret' | 'publishable';
|
|
10
|
+
declare const API_KEY_PREFIXES: {
|
|
11
|
+
readonly secret: {
|
|
12
|
+
readonly test: "sk_test_";
|
|
13
|
+
readonly live: "sk_live_";
|
|
14
|
+
};
|
|
15
|
+
readonly publishable: {
|
|
16
|
+
readonly test: "pk_test_";
|
|
17
|
+
readonly live: "pk_live_";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/** Length of the random portion of a key, before prefix. Base62, 256 bits of entropy. */
|
|
21
|
+
declare const API_KEY_RANDOM_BYTES = 32;
|
|
22
|
+
declare function prefixFor(kind: ApiKeyKind, mode: ApiKeyMode): string;
|
|
23
|
+
declare function modeFromKey(key: string): ApiKeyMode | null;
|
|
24
|
+
declare function kindFromKey(key: string): ApiKeyKind | null;
|
|
25
|
+
/** Number of leading characters of a key safe to display in dashboards/logs. */
|
|
26
|
+
declare const API_KEY_PREFIX_DISPLAY_LENGTH = 12;
|
|
27
|
+
|
|
28
|
+
export { API_KEY_PREFIXES, API_KEY_PREFIX_DISPLAY_LENGTH, API_KEY_RANDOM_BYTES, type ApiKeyKind, type ApiKeyMode, kindFromKey, modeFromKey, prefixFor };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API key prefix conventions.
|
|
3
|
+
*
|
|
4
|
+
* Prefix tells you immediately which environment a key targets and whether it
|
|
5
|
+
* is safe to expose to the client. Secret keys are server-side only; publishable
|
|
6
|
+
* keys can ship in browser bundles.
|
|
7
|
+
*/
|
|
8
|
+
type ApiKeyMode = 'test' | 'live';
|
|
9
|
+
type ApiKeyKind = 'secret' | 'publishable';
|
|
10
|
+
declare const API_KEY_PREFIXES: {
|
|
11
|
+
readonly secret: {
|
|
12
|
+
readonly test: "sk_test_";
|
|
13
|
+
readonly live: "sk_live_";
|
|
14
|
+
};
|
|
15
|
+
readonly publishable: {
|
|
16
|
+
readonly test: "pk_test_";
|
|
17
|
+
readonly live: "pk_live_";
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
/** Length of the random portion of a key, before prefix. Base62, 256 bits of entropy. */
|
|
21
|
+
declare const API_KEY_RANDOM_BYTES = 32;
|
|
22
|
+
declare function prefixFor(kind: ApiKeyKind, mode: ApiKeyMode): string;
|
|
23
|
+
declare function modeFromKey(key: string): ApiKeyMode | null;
|
|
24
|
+
declare function kindFromKey(key: string): ApiKeyKind | null;
|
|
25
|
+
/** Number of leading characters of a key safe to display in dashboards/logs. */
|
|
26
|
+
declare const API_KEY_PREFIX_DISPLAY_LENGTH = 12;
|
|
27
|
+
|
|
28
|
+
export { API_KEY_PREFIXES, API_KEY_PREFIX_DISPLAY_LENGTH, API_KEY_RANDOM_BYTES, type ApiKeyKind, type ApiKeyMode, kindFromKey, modeFromKey, prefixFor };
|
package/dist/api-keys.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
// src/api-keys.ts
|
|
2
|
+
var API_KEY_PREFIXES = {
|
|
3
|
+
secret: {
|
|
4
|
+
test: "sk_test_",
|
|
5
|
+
live: "sk_live_"
|
|
6
|
+
},
|
|
7
|
+
publishable: {
|
|
8
|
+
test: "pk_test_",
|
|
9
|
+
live: "pk_live_"
|
|
10
|
+
}
|
|
11
|
+
};
|
|
12
|
+
var API_KEY_RANDOM_BYTES = 32;
|
|
13
|
+
function prefixFor(kind, mode) {
|
|
14
|
+
return API_KEY_PREFIXES[kind][mode];
|
|
15
|
+
}
|
|
16
|
+
function modeFromKey(key) {
|
|
17
|
+
if (key.startsWith("sk_test_") || key.startsWith("pk_test_")) return "test";
|
|
18
|
+
if (key.startsWith("sk_live_") || key.startsWith("pk_live_")) return "live";
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
function kindFromKey(key) {
|
|
22
|
+
if (key.startsWith("sk_")) return "secret";
|
|
23
|
+
if (key.startsWith("pk_")) return "publishable";
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
var API_KEY_PREFIX_DISPLAY_LENGTH = 12;
|
|
27
|
+
|
|
28
|
+
export { API_KEY_PREFIXES, API_KEY_PREFIX_DISPLAY_LENGTH, API_KEY_RANDOM_BYTES, kindFromKey, modeFromKey, prefixFor };
|
|
29
|
+
//# sourceMappingURL=api-keys.js.map
|
|
30
|
+
//# sourceMappingURL=api-keys.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/api-keys.ts"],"names":[],"mappings":";AAWO,IAAM,gBAAA,GAAmB;AAAA,EAC9B,MAAA,EAAQ;AAAA,IACN,IAAA,EAAM,UAAA;AAAA,IACN,IAAA,EAAM;AAAA,GACR;AAAA,EACA,WAAA,EAAa;AAAA,IACX,IAAA,EAAM,UAAA;AAAA,IACN,IAAA,EAAM;AAAA;AAEV;AAGO,IAAM,oBAAA,GAAuB;AAE7B,SAAS,SAAA,CAAU,MAAkB,IAAA,EAA0B;AACpE,EAAA,OAAO,gBAAA,CAAiB,IAAI,CAAA,CAAE,IAAI,CAAA;AACpC;AAEO,SAAS,YAAY,GAAA,EAAgC;AAC1D,EAAA,IAAI,GAAA,CAAI,WAAW,UAAU,CAAA,IAAK,IAAI,UAAA,CAAW,UAAU,GAAG,OAAO,MAAA;AACrE,EAAA,IAAI,GAAA,CAAI,WAAW,UAAU,CAAA,IAAK,IAAI,UAAA,CAAW,UAAU,GAAG,OAAO,MAAA;AACrE,EAAA,OAAO,IAAA;AACT;AAEO,SAAS,YAAY,GAAA,EAAgC;AAC1D,EAAA,IAAI,GAAA,CAAI,UAAA,CAAW,KAAK,CAAA,EAAG,OAAO,QAAA;AAClC,EAAA,IAAI,GAAA,CAAI,UAAA,CAAW,KAAK,CAAA,EAAG,OAAO,aAAA;AAClC,EAAA,OAAO,IAAA;AACT;AAGO,IAAM,6BAAA,GAAgC","file":"api-keys.js","sourcesContent":["/**\n * API key prefix conventions.\n *\n * Prefix tells you immediately which environment a key targets and whether it\n * is safe to expose to the client. Secret keys are server-side only; publishable\n * keys can ship in browser bundles.\n */\n\nexport type ApiKeyMode = 'test' | 'live'\nexport type ApiKeyKind = 'secret' | 'publishable'\n\nexport const API_KEY_PREFIXES = {\n secret: {\n test: 'sk_test_',\n live: 'sk_live_',\n },\n publishable: {\n test: 'pk_test_',\n live: 'pk_live_',\n },\n} as const satisfies Record<ApiKeyKind, Record<ApiKeyMode, string>>\n\n/** Length of the random portion of a key, before prefix. Base62, 256 bits of entropy. */\nexport const API_KEY_RANDOM_BYTES = 32\n\nexport function prefixFor(kind: ApiKeyKind, mode: ApiKeyMode): string {\n return API_KEY_PREFIXES[kind][mode]\n}\n\nexport function modeFromKey(key: string): ApiKeyMode | null {\n if (key.startsWith('sk_test_') || key.startsWith('pk_test_')) return 'test'\n if (key.startsWith('sk_live_') || key.startsWith('pk_live_')) return 'live'\n return null\n}\n\nexport function kindFromKey(key: string): ApiKeyKind | null {\n if (key.startsWith('sk_')) return 'secret'\n if (key.startsWith('pk_')) return 'publishable'\n return null\n}\n\n/** Number of leading characters of a key safe to display in dashboards/logs. */\nexport const API_KEY_PREFIX_DISPLAY_LENGTH = 12\n"]}
|
package/dist/cctp.cjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
// src/cctp.ts
|
|
4
|
+
var CCTP_CONTRACTS = {
|
|
5
|
+
testnet: {
|
|
6
|
+
tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
|
|
7
|
+
messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275",
|
|
8
|
+
gatewayWallet: "0x0077777d7EBA4688BDeF3E311b846F25870A19B9",
|
|
9
|
+
gatewayMinter: "0x0022222ABE238Cc2C7Bb1f21003F0a260052475B",
|
|
10
|
+
domainId: 26
|
|
11
|
+
},
|
|
12
|
+
mainnet: {
|
|
13
|
+
// Pending Circle's mainnet publication of CCTP V2 addresses for Arc.
|
|
14
|
+
// Mirror testnet as a placeholder so type signatures stay non-null.
|
|
15
|
+
tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
|
|
16
|
+
messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275",
|
|
17
|
+
gatewayWallet: "0x0077777d7EBA4688BDeF3E311b846F25870A19B9",
|
|
18
|
+
gatewayMinter: "0x0022222ABE238Cc2C7Bb1f21003F0a260052475B",
|
|
19
|
+
domainId: 26
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
var CCTP_DOMAIN_IDS = {
|
|
23
|
+
ethereum: 0,
|
|
24
|
+
avalanche: 1,
|
|
25
|
+
optimism: 2,
|
|
26
|
+
arbitrum: 3,
|
|
27
|
+
noble: 4,
|
|
28
|
+
solana: 5,
|
|
29
|
+
base: 6,
|
|
30
|
+
polygon: 7,
|
|
31
|
+
arc: 26
|
|
32
|
+
};
|
|
33
|
+
var CCTP_SUPPORTED_SOURCE_CHAINS = [
|
|
34
|
+
"ethereum",
|
|
35
|
+
"avalanche",
|
|
36
|
+
"optimism",
|
|
37
|
+
"arbitrum",
|
|
38
|
+
"base",
|
|
39
|
+
"polygon",
|
|
40
|
+
"solana"
|
|
41
|
+
];
|
|
42
|
+
function getCctpContracts(env) {
|
|
43
|
+
return CCTP_CONTRACTS[env];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
exports.CCTP_CONTRACTS = CCTP_CONTRACTS;
|
|
47
|
+
exports.CCTP_DOMAIN_IDS = CCTP_DOMAIN_IDS;
|
|
48
|
+
exports.CCTP_SUPPORTED_SOURCE_CHAINS = CCTP_SUPPORTED_SOURCE_CHAINS;
|
|
49
|
+
exports.getCctpContracts = getCctpContracts;
|
|
50
|
+
//# sourceMappingURL=cctp.cjs.map
|
|
51
|
+
//# sourceMappingURL=cctp.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cctp.ts"],"names":[],"mappings":";;;AAqBO,IAAM,cAAA,GAA0D;AAAA,EACrE,OAAA,EAAS;AAAA,IACP,gBAAA,EAAkB,4CAAA;AAAA,IAClB,oBAAA,EAAsB,4CAAA;AAAA,IACtB,aAAA,EAAe,4CAAA;AAAA,IACf,aAAA,EAAe,4CAAA;AAAA,IACf,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,OAAA,EAAS;AAAA;AAAA;AAAA,IAGP,gBAAA,EAAkB,4CAAA;AAAA,IAClB,oBAAA,EAAsB,4CAAA;AAAA,IACtB,aAAA,EAAe,4CAAA;AAAA,IACf,aAAA,EAAe,4CAAA;AAAA,IACf,QAAA,EAAU;AAAA;AAEd;AAGO,IAAM,eAAA,GAAkB;AAAA,EAC7B,QAAA,EAAU,CAAA;AAAA,EACV,SAAA,EAAW,CAAA;AAAA,EACX,QAAA,EAAU,CAAA;AAAA,EACV,QAAA,EAAU,CAAA;AAAA,EACV,KAAA,EAAO,CAAA;AAAA,EACP,MAAA,EAAQ,CAAA;AAAA,EACR,IAAA,EAAM,CAAA;AAAA,EACN,OAAA,EAAS,CAAA;AAAA,EACT,GAAA,EAAK;AACP;AAIO,IAAM,4BAAA,GAA2D;AAAA,EACtE,UAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF;AAEO,SAAS,iBAAiB,GAAA,EAAsC;AACrE,EAAA,OAAO,eAAe,GAAG,CAAA;AAC3B","file":"cctp.cjs","sourcesContent":["/**\n * Circle CCTP V2 contract addresses for Arc.\n *\n * CCTP lets a payer hold USDC on any supported chain (Ethereum, Base, Polygon,\n * Arbitrum, Solana, etc.) and pay a Strimz merchant who receives Arc USDC.\n *\n * @see https://developers.circle.com/stablecoins/cctp-getting-started\n */\n\nimport type { Address } from 'viem'\nimport type { ArcEnvironment } from './chains.js'\n\nexport interface CCTPContractSet {\n tokenMessengerV2: Address\n messageTransmitterV2: Address\n gatewayWallet: Address\n gatewayMinter: Address\n /** CCTP domain identifier for the destination chain. */\n domainId: number\n}\n\nexport const CCTP_CONTRACTS: Record<ArcEnvironment, CCTPContractSet> = {\n testnet: {\n tokenMessengerV2: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',\n messageTransmitterV2: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',\n gatewayWallet: '0x0077777d7EBA4688BDeF3E311b846F25870A19B9',\n gatewayMinter: '0x0022222ABE238Cc2C7Bb1f21003F0a260052475B',\n domainId: 26,\n },\n mainnet: {\n // Pending Circle's mainnet publication of CCTP V2 addresses for Arc.\n // Mirror testnet as a placeholder so type signatures stay non-null.\n tokenMessengerV2: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',\n messageTransmitterV2: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',\n gatewayWallet: '0x0077777d7EBA4688BDeF3E311b846F25870A19B9',\n gatewayMinter: '0x0022222ABE238Cc2C7Bb1f21003F0a260052475B',\n domainId: 26,\n },\n}\n\n/** CCTP domain ids for source chains a payer can bridge from. */\nexport const CCTP_DOMAIN_IDS = {\n ethereum: 0,\n avalanche: 1,\n optimism: 2,\n arbitrum: 3,\n noble: 4,\n solana: 5,\n base: 6,\n polygon: 7,\n arc: 26,\n} as const\n\nexport type CCTPSourceChain = keyof typeof CCTP_DOMAIN_IDS\n\nexport const CCTP_SUPPORTED_SOURCE_CHAINS: readonly CCTPSourceChain[] = [\n 'ethereum',\n 'avalanche',\n 'optimism',\n 'arbitrum',\n 'base',\n 'polygon',\n 'solana',\n] as const\n\nexport function getCctpContracts(env: ArcEnvironment): CCTPContractSet {\n return CCTP_CONTRACTS[env]\n}\n"]}
|
package/dist/cctp.d.cts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { ArcEnvironment } from './chains.cjs';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Circle CCTP V2 contract addresses for Arc.
|
|
6
|
+
*
|
|
7
|
+
* CCTP lets a payer hold USDC on any supported chain (Ethereum, Base, Polygon,
|
|
8
|
+
* Arbitrum, Solana, etc.) and pay a Strimz merchant who receives Arc USDC.
|
|
9
|
+
*
|
|
10
|
+
* @see https://developers.circle.com/stablecoins/cctp-getting-started
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface CCTPContractSet {
|
|
14
|
+
tokenMessengerV2: Address;
|
|
15
|
+
messageTransmitterV2: Address;
|
|
16
|
+
gatewayWallet: Address;
|
|
17
|
+
gatewayMinter: Address;
|
|
18
|
+
/** CCTP domain identifier for the destination chain. */
|
|
19
|
+
domainId: number;
|
|
20
|
+
}
|
|
21
|
+
declare const CCTP_CONTRACTS: Record<ArcEnvironment, CCTPContractSet>;
|
|
22
|
+
/** CCTP domain ids for source chains a payer can bridge from. */
|
|
23
|
+
declare const CCTP_DOMAIN_IDS: {
|
|
24
|
+
readonly ethereum: 0;
|
|
25
|
+
readonly avalanche: 1;
|
|
26
|
+
readonly optimism: 2;
|
|
27
|
+
readonly arbitrum: 3;
|
|
28
|
+
readonly noble: 4;
|
|
29
|
+
readonly solana: 5;
|
|
30
|
+
readonly base: 6;
|
|
31
|
+
readonly polygon: 7;
|
|
32
|
+
readonly arc: 26;
|
|
33
|
+
};
|
|
34
|
+
type CCTPSourceChain = keyof typeof CCTP_DOMAIN_IDS;
|
|
35
|
+
declare const CCTP_SUPPORTED_SOURCE_CHAINS: readonly CCTPSourceChain[];
|
|
36
|
+
declare function getCctpContracts(env: ArcEnvironment): CCTPContractSet;
|
|
37
|
+
|
|
38
|
+
export { type CCTPContractSet, type CCTPSourceChain, CCTP_CONTRACTS, CCTP_DOMAIN_IDS, CCTP_SUPPORTED_SOURCE_CHAINS, getCctpContracts };
|
package/dist/cctp.d.ts
ADDED
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Address } from 'viem';
|
|
2
|
+
import { ArcEnvironment } from './chains.js';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Circle CCTP V2 contract addresses for Arc.
|
|
6
|
+
*
|
|
7
|
+
* CCTP lets a payer hold USDC on any supported chain (Ethereum, Base, Polygon,
|
|
8
|
+
* Arbitrum, Solana, etc.) and pay a Strimz merchant who receives Arc USDC.
|
|
9
|
+
*
|
|
10
|
+
* @see https://developers.circle.com/stablecoins/cctp-getting-started
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
interface CCTPContractSet {
|
|
14
|
+
tokenMessengerV2: Address;
|
|
15
|
+
messageTransmitterV2: Address;
|
|
16
|
+
gatewayWallet: Address;
|
|
17
|
+
gatewayMinter: Address;
|
|
18
|
+
/** CCTP domain identifier for the destination chain. */
|
|
19
|
+
domainId: number;
|
|
20
|
+
}
|
|
21
|
+
declare const CCTP_CONTRACTS: Record<ArcEnvironment, CCTPContractSet>;
|
|
22
|
+
/** CCTP domain ids for source chains a payer can bridge from. */
|
|
23
|
+
declare const CCTP_DOMAIN_IDS: {
|
|
24
|
+
readonly ethereum: 0;
|
|
25
|
+
readonly avalanche: 1;
|
|
26
|
+
readonly optimism: 2;
|
|
27
|
+
readonly arbitrum: 3;
|
|
28
|
+
readonly noble: 4;
|
|
29
|
+
readonly solana: 5;
|
|
30
|
+
readonly base: 6;
|
|
31
|
+
readonly polygon: 7;
|
|
32
|
+
readonly arc: 26;
|
|
33
|
+
};
|
|
34
|
+
type CCTPSourceChain = keyof typeof CCTP_DOMAIN_IDS;
|
|
35
|
+
declare const CCTP_SUPPORTED_SOURCE_CHAINS: readonly CCTPSourceChain[];
|
|
36
|
+
declare function getCctpContracts(env: ArcEnvironment): CCTPContractSet;
|
|
37
|
+
|
|
38
|
+
export { type CCTPContractSet, type CCTPSourceChain, CCTP_CONTRACTS, CCTP_DOMAIN_IDS, CCTP_SUPPORTED_SOURCE_CHAINS, getCctpContracts };
|
package/dist/cctp.js
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// src/cctp.ts
|
|
2
|
+
var CCTP_CONTRACTS = {
|
|
3
|
+
testnet: {
|
|
4
|
+
tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
|
|
5
|
+
messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275",
|
|
6
|
+
gatewayWallet: "0x0077777d7EBA4688BDeF3E311b846F25870A19B9",
|
|
7
|
+
gatewayMinter: "0x0022222ABE238Cc2C7Bb1f21003F0a260052475B",
|
|
8
|
+
domainId: 26
|
|
9
|
+
},
|
|
10
|
+
mainnet: {
|
|
11
|
+
// Pending Circle's mainnet publication of CCTP V2 addresses for Arc.
|
|
12
|
+
// Mirror testnet as a placeholder so type signatures stay non-null.
|
|
13
|
+
tokenMessengerV2: "0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA",
|
|
14
|
+
messageTransmitterV2: "0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275",
|
|
15
|
+
gatewayWallet: "0x0077777d7EBA4688BDeF3E311b846F25870A19B9",
|
|
16
|
+
gatewayMinter: "0x0022222ABE238Cc2C7Bb1f21003F0a260052475B",
|
|
17
|
+
domainId: 26
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
var CCTP_DOMAIN_IDS = {
|
|
21
|
+
ethereum: 0,
|
|
22
|
+
avalanche: 1,
|
|
23
|
+
optimism: 2,
|
|
24
|
+
arbitrum: 3,
|
|
25
|
+
noble: 4,
|
|
26
|
+
solana: 5,
|
|
27
|
+
base: 6,
|
|
28
|
+
polygon: 7,
|
|
29
|
+
arc: 26
|
|
30
|
+
};
|
|
31
|
+
var CCTP_SUPPORTED_SOURCE_CHAINS = [
|
|
32
|
+
"ethereum",
|
|
33
|
+
"avalanche",
|
|
34
|
+
"optimism",
|
|
35
|
+
"arbitrum",
|
|
36
|
+
"base",
|
|
37
|
+
"polygon",
|
|
38
|
+
"solana"
|
|
39
|
+
];
|
|
40
|
+
function getCctpContracts(env) {
|
|
41
|
+
return CCTP_CONTRACTS[env];
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export { CCTP_CONTRACTS, CCTP_DOMAIN_IDS, CCTP_SUPPORTED_SOURCE_CHAINS, getCctpContracts };
|
|
45
|
+
//# sourceMappingURL=cctp.js.map
|
|
46
|
+
//# sourceMappingURL=cctp.js.map
|
package/dist/cctp.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/cctp.ts"],"names":[],"mappings":";AAqBO,IAAM,cAAA,GAA0D;AAAA,EACrE,OAAA,EAAS;AAAA,IACP,gBAAA,EAAkB,4CAAA;AAAA,IAClB,oBAAA,EAAsB,4CAAA;AAAA,IACtB,aAAA,EAAe,4CAAA;AAAA,IACf,aAAA,EAAe,4CAAA;AAAA,IACf,QAAA,EAAU;AAAA,GACZ;AAAA,EACA,OAAA,EAAS;AAAA;AAAA;AAAA,IAGP,gBAAA,EAAkB,4CAAA;AAAA,IAClB,oBAAA,EAAsB,4CAAA;AAAA,IACtB,aAAA,EAAe,4CAAA;AAAA,IACf,aAAA,EAAe,4CAAA;AAAA,IACf,QAAA,EAAU;AAAA;AAEd;AAGO,IAAM,eAAA,GAAkB;AAAA,EAC7B,QAAA,EAAU,CAAA;AAAA,EACV,SAAA,EAAW,CAAA;AAAA,EACX,QAAA,EAAU,CAAA;AAAA,EACV,QAAA,EAAU,CAAA;AAAA,EACV,KAAA,EAAO,CAAA;AAAA,EACP,MAAA,EAAQ,CAAA;AAAA,EACR,IAAA,EAAM,CAAA;AAAA,EACN,OAAA,EAAS,CAAA;AAAA,EACT,GAAA,EAAK;AACP;AAIO,IAAM,4BAAA,GAA2D;AAAA,EACtE,UAAA;AAAA,EACA,WAAA;AAAA,EACA,UAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,SAAA;AAAA,EACA;AACF;AAEO,SAAS,iBAAiB,GAAA,EAAsC;AACrE,EAAA,OAAO,eAAe,GAAG,CAAA;AAC3B","file":"cctp.js","sourcesContent":["/**\n * Circle CCTP V2 contract addresses for Arc.\n *\n * CCTP lets a payer hold USDC on any supported chain (Ethereum, Base, Polygon,\n * Arbitrum, Solana, etc.) and pay a Strimz merchant who receives Arc USDC.\n *\n * @see https://developers.circle.com/stablecoins/cctp-getting-started\n */\n\nimport type { Address } from 'viem'\nimport type { ArcEnvironment } from './chains.js'\n\nexport interface CCTPContractSet {\n tokenMessengerV2: Address\n messageTransmitterV2: Address\n gatewayWallet: Address\n gatewayMinter: Address\n /** CCTP domain identifier for the destination chain. */\n domainId: number\n}\n\nexport const CCTP_CONTRACTS: Record<ArcEnvironment, CCTPContractSet> = {\n testnet: {\n tokenMessengerV2: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',\n messageTransmitterV2: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',\n gatewayWallet: '0x0077777d7EBA4688BDeF3E311b846F25870A19B9',\n gatewayMinter: '0x0022222ABE238Cc2C7Bb1f21003F0a260052475B',\n domainId: 26,\n },\n mainnet: {\n // Pending Circle's mainnet publication of CCTP V2 addresses for Arc.\n // Mirror testnet as a placeholder so type signatures stay non-null.\n tokenMessengerV2: '0x8FE6B999Dc680CcFDD5Bf7EB0974218be2542DAA',\n messageTransmitterV2: '0xE737e5cEBEEBa77EFE34D4aa090756590b1CE275',\n gatewayWallet: '0x0077777d7EBA4688BDeF3E311b846F25870A19B9',\n gatewayMinter: '0x0022222ABE238Cc2C7Bb1f21003F0a260052475B',\n domainId: 26,\n },\n}\n\n/** CCTP domain ids for source chains a payer can bridge from. */\nexport const CCTP_DOMAIN_IDS = {\n ethereum: 0,\n avalanche: 1,\n optimism: 2,\n arbitrum: 3,\n noble: 4,\n solana: 5,\n base: 6,\n polygon: 7,\n arc: 26,\n} as const\n\nexport type CCTPSourceChain = keyof typeof CCTP_DOMAIN_IDS\n\nexport const CCTP_SUPPORTED_SOURCE_CHAINS: readonly CCTPSourceChain[] = [\n 'ethereum',\n 'avalanche',\n 'optimism',\n 'arbitrum',\n 'base',\n 'polygon',\n 'solana',\n] as const\n\nexport function getCctpContracts(env: ArcEnvironment): CCTPContractSet {\n return CCTP_CONTRACTS[env]\n}\n"]}
|