@strimz/shared-config 0.1.0 → 0.2.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/README.md +50 -11
- package/dist/agents.cjs.map +1 -1
- package/dist/agents.d.cts +2 -2
- package/dist/agents.d.ts +2 -2
- package/dist/agents.js.map +1 -1
- package/dist/cctp.cjs +59 -6
- package/dist/cctp.cjs.map +1 -1
- package/dist/cctp.js +59 -6
- package/dist/cctp.js.map +1 -1
- package/dist/chains.cjs +54 -12
- package/dist/chains.cjs.map +1 -1
- package/dist/chains.d.cts +9 -2
- package/dist/chains.d.ts +9 -2
- package/dist/chains.js +48 -13
- package/dist/chains.js.map +1 -1
- package/dist/index.cjs +64 -22
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +58 -23
- package/dist/index.js.map +1 -1
- package/dist/tokens.cjs +34 -17
- package/dist/tokens.cjs.map +1 -1
- package/dist/tokens.d.cts +3 -3
- package/dist/tokens.d.ts +3 -3
- package/dist/tokens.js +34 -17
- package/dist/tokens.js.map +1 -1
- package/package.json +4 -2
- package/src/agents.ts +2 -2
- package/src/cctp.ts +7 -7
- package/src/chains.ts +54 -12
- package/src/tokens.ts +8 -8
package/src/tokens.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Token registry for Arc.
|
|
3
3
|
*
|
|
4
|
-
* USDC and EURC are first-class payment tokens
|
|
4
|
+
* USDC and EURC are first-class payment tokens. They can be requested in a
|
|
5
5
|
* payment session and used as a subscription currency.
|
|
6
6
|
*
|
|
7
|
-
* USYC is yield-bearing and is treated as a treasury asset only
|
|
8
|
-
* can hold and earn yield, but a payer cannot pay in USYC.
|
|
7
|
+
* USYC is yield-bearing and is treated as a treasury asset only. Merchants
|
|
8
|
+
* can hold it and earn yield, but a payer cannot pay in USYC.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
11
|
import type { Address } from 'viem'
|
|
12
|
-
import {
|
|
12
|
+
import { getArcChain, parseArcEnvironment, type ArcEnvironment } from './chains.js'
|
|
13
13
|
|
|
14
14
|
export type TokenSymbol = 'USDC' | 'EURC' | 'USYC'
|
|
15
15
|
|
|
@@ -74,13 +74,13 @@ export const TOKEN_ADDRESSES: Record<ArcEnvironment, Record<TokenSymbol, Address
|
|
|
74
74
|
// testnet for now and must be replaced when Circle publishes the canonical
|
|
75
75
|
// mainnet token registry.
|
|
76
76
|
USDC: '0x3600000000000000000000000000000000000000',
|
|
77
|
-
EURC: '
|
|
78
|
-
USYC: '
|
|
77
|
+
EURC: '0xbEf5f6d51CB62b58e6A8f77868681825C6fe21c1',
|
|
78
|
+
USYC: '0x8a5D989Bbb96929F689B0200f435f53dA42bF490',
|
|
79
79
|
},
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
export function getTokenAddress(env: ArcEnvironment, symbol: TokenSymbol): Address {
|
|
83
|
-
return TOKEN_ADDRESSES[env][symbol]
|
|
83
|
+
return TOKEN_ADDRESSES[parseArcEnvironment(env)][symbol]
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
export function getTokenBySymbol(symbol: string): TokenDescriptor | undefined {
|
|
@@ -92,5 +92,5 @@ export function isPaymentToken(symbol: string): symbol is PaymentToken {
|
|
|
92
92
|
}
|
|
93
93
|
|
|
94
94
|
export function chainIdFor(env: ArcEnvironment): number {
|
|
95
|
-
return env
|
|
95
|
+
return getArcChain(env).id
|
|
96
96
|
}
|