sushi 6.6.11 → 6.7.1
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/_cjs/evm/abi/selfPermitAbi/index.js +0 -2
- package/_cjs/evm/abi/selfPermitAbi/index.js.map +1 -1
- package/_cjs/evm/validate/zod.js +4 -3
- package/_cjs/evm/validate/zod.js.map +1 -1
- package/_cjs/generic/currency/price.js +23 -2
- package/_cjs/generic/currency/price.js.map +1 -1
- package/_cjs/generic/format/number.js +5 -1
- package/_cjs/generic/format/number.js.map +1 -1
- package/_cjs/generic/math/fraction.js +70 -3
- package/_cjs/generic/math/fraction.js.map +1 -1
- package/_cjs/generic/utils/id.js.map +1 -1
- package/_cjs/generic/utils/native-address.js.map +1 -1
- package/_cjs/generic/validate/zod.js +6 -0
- package/_cjs/generic/validate/zod.js.map +1 -1
- package/_cjs/mvm/index.js +1 -0
- package/_cjs/mvm/index.js.map +1 -1
- package/_cjs/mvm/validate/index.js +18 -0
- package/_cjs/mvm/validate/index.js.map +1 -0
- package/_cjs/mvm/validate/zod.js +48 -0
- package/_cjs/mvm/validate/zod.js.map +1 -0
- package/_cjs/stellar/config/simple-constants.js +1 -1
- package/_cjs/stellar/config/simple-constants.js.map +1 -1
- package/_cjs/stellar/index.js +1 -0
- package/_cjs/stellar/index.js.map +1 -1
- package/_cjs/stellar/validate/index.js +18 -0
- package/_cjs/stellar/validate/index.js.map +1 -0
- package/_cjs/stellar/validate/zod.js +60 -0
- package/_cjs/stellar/validate/zod.js.map +1 -0
- package/_cjs/svm/currency/token.js +1 -1
- package/_cjs/svm/currency/token.js.map +1 -1
- package/_cjs/svm/index.js +1 -0
- package/_cjs/svm/index.js.map +1 -1
- package/_cjs/svm/validate/index.js +18 -0
- package/_cjs/svm/validate/index.js.map +1 -0
- package/_cjs/svm/validate/zod.js +48 -0
- package/_cjs/svm/validate/zod.js.map +1 -0
- package/_cjs/version.js +1 -1
- package/_cjs/version.js.map +1 -1
- package/_esm/evm/abi/selfPermitAbi/index.js +0 -2
- package/_esm/evm/abi/selfPermitAbi/index.js.map +1 -1
- package/_esm/evm/validate/zod.js +4 -3
- package/_esm/evm/validate/zod.js.map +1 -1
- package/_esm/generic/currency/price.js +29 -2
- package/_esm/generic/currency/price.js.map +1 -1
- package/_esm/generic/format/number.js +5 -1
- package/_esm/generic/format/number.js.map +1 -1
- package/_esm/generic/math/fraction.js +70 -3
- package/_esm/generic/math/fraction.js.map +1 -1
- package/_esm/generic/utils/id.js.map +1 -1
- package/_esm/generic/utils/native-address.js.map +1 -1
- package/_esm/generic/validate/zod.js +6 -0
- package/_esm/generic/validate/zod.js.map +1 -1
- package/_esm/mvm/index.js +1 -0
- package/_esm/mvm/index.js.map +1 -1
- package/_esm/mvm/validate/index.js +2 -0
- package/_esm/mvm/validate/index.js.map +1 -0
- package/_esm/mvm/validate/zod.js +11 -0
- package/_esm/mvm/validate/zod.js.map +1 -0
- package/_esm/stellar/config/simple-constants.js +1 -1
- package/_esm/stellar/config/simple-constants.js.map +1 -1
- package/_esm/stellar/index.js +1 -0
- package/_esm/stellar/index.js.map +1 -1
- package/_esm/stellar/validate/index.js +2 -0
- package/_esm/stellar/validate/index.js.map +1 -0
- package/_esm/stellar/validate/zod.js +21 -0
- package/_esm/stellar/validate/zod.js.map +1 -0
- package/_esm/svm/currency/token.js +1 -1
- package/_esm/svm/currency/token.js.map +1 -1
- package/_esm/svm/index.js +1 -0
- package/_esm/svm/index.js.map +1 -1
- package/_esm/svm/validate/index.js +2 -0
- package/_esm/svm/validate/index.js.map +1 -0
- package/_esm/svm/validate/zod.js +11 -0
- package/_esm/svm/validate/zod.js.map +1 -0
- package/_esm/version.js +1 -1
- package/_esm/version.js.map +1 -1
- package/_types/evm/abi/selfPermitAbi/index.d.ts +0 -2
- package/_types/evm/abi/selfPermitAbi/index.d.ts.map +1 -1
- package/_types/evm/chain/chains.d.ts +10 -10
- package/_types/evm/validate/zod.d.ts.map +1 -1
- package/_types/generic/currency/price.d.ts +9 -2
- package/_types/generic/currency/price.d.ts.map +1 -1
- package/_types/generic/currency/serialized-currency.d.ts +1 -1
- package/_types/generic/math/fraction.d.ts +3 -1
- package/_types/generic/math/fraction.d.ts.map +1 -1
- package/_types/generic/types/for-chain.d.ts +2 -1
- package/_types/generic/types/for-chain.d.ts.map +1 -1
- package/_types/generic/utils/id.d.ts +4 -1
- package/_types/generic/utils/id.d.ts.map +1 -1
- package/_types/generic/utils/native-address.d.ts +2 -2
- package/_types/generic/utils/native-address.d.ts.map +1 -1
- package/_types/generic/validate/zod.d.ts +11 -0
- package/_types/generic/validate/zod.d.ts.map +1 -1
- package/_types/mvm/index.d.ts +1 -0
- package/_types/mvm/index.d.ts.map +1 -1
- package/_types/mvm/validate/index.d.ts +2 -0
- package/_types/mvm/validate/index.d.ts.map +1 -0
- package/_types/mvm/validate/zod.d.ts +6 -0
- package/_types/mvm/validate/zod.d.ts.map +1 -0
- package/_types/stellar/config/simple-constants.d.ts +1 -1
- package/_types/stellar/config/simple-constants.d.ts.map +1 -1
- package/_types/stellar/index.d.ts +1 -0
- package/_types/stellar/index.d.ts.map +1 -1
- package/_types/stellar/validate/index.d.ts +2 -0
- package/_types/stellar/validate/index.d.ts.map +1 -0
- package/_types/stellar/validate/zod.d.ts +10 -0
- package/_types/stellar/validate/zod.d.ts.map +1 -0
- package/_types/svm/config/tokens/tokens/USDC.d.ts +1 -1
- package/_types/svm/config/tokens/tokens/USDT.d.ts +1 -1
- package/_types/svm/config/tokens/tokens/WBTC.d.ts +1 -1
- package/_types/svm/config/tokens/tokens/WETH.d.ts +1 -1
- package/_types/svm/config/tokens/tokens/WSOL.d.ts +1 -1
- package/_types/svm/currency/currency.d.ts +2 -2
- package/_types/svm/currency/currency.d.ts.map +1 -1
- package/_types/svm/currency/token.d.ts +1 -1
- package/_types/svm/currency/token.d.ts.map +1 -1
- package/_types/svm/index.d.ts +1 -0
- package/_types/svm/index.d.ts.map +1 -1
- package/_types/svm/validate/index.d.ts +2 -0
- package/_types/svm/validate/index.d.ts.map +1 -0
- package/_types/svm/validate/zod.d.ts +7 -0
- package/_types/svm/validate/zod.d.ts.map +1 -0
- package/_types/version.d.ts +1 -1
- package/_types/version.d.ts.map +1 -1
- package/evm/abi/selfPermitAbi/index.ts +0 -2
- package/evm/pool/sushiswap-v3/entities/TickDataProvider.test.ts +4 -4
- package/evm/validate/zod.ts +4 -3
- package/generic/currency/price.test-d.ts +59 -0
- package/generic/currency/price.test.ts +132 -0
- package/generic/currency/price.ts +41 -3
- package/generic/format/number.test.ts +101 -1
- package/generic/format/number.ts +13 -6
- package/generic/math/fraction.test.ts +97 -0
- package/generic/math/fraction.ts +106 -3
- package/generic/types/for-chain.ts +16 -1
- package/generic/utils/id.test-d.ts +35 -0
- package/generic/utils/id.ts +8 -2
- package/generic/utils/native-address.test-d.ts +25 -0
- package/generic/utils/native-address.ts +6 -6
- package/generic/validate/zod.test.ts +44 -0
- package/generic/validate/zod.ts +6 -0
- package/mvm/index.ts +1 -0
- package/mvm/validate/index.ts +1 -0
- package/mvm/validate/zod.ts +13 -0
- package/package.json +3 -4
- package/stellar/config/simple-constants.ts +2 -5
- package/stellar/index.ts +1 -0
- package/stellar/validate/index.ts +1 -0
- package/stellar/validate/zod.ts +38 -0
- package/svm/currency/token.ts +1 -1
- package/svm/index.ts +1 -0
- package/svm/validate/index.ts +1 -0
- package/svm/validate/zod.ts +13 -0
- package/_cjs/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitAllowedIfNecessary.js +0 -20
- package/_cjs/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitAllowedIfNecessary.js.map +0 -1
- package/_cjs/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitIfNecessary.js +0 -20
- package/_cjs/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitIfNecessary.js.map +0 -1
- package/_cjs/evm/abi/splitter.js +0 -68
- package/_cjs/evm/abi/splitter.js.map +0 -1
- package/_cjs/evm/api/config.js +0 -20
- package/_cjs/evm/api/config.js.map +0 -1
- package/_cjs/evm/config/drpc.js +0 -83
- package/_cjs/evm/config/drpc.js.map +0 -1
- package/_cjs/evm/config/tokens/tokens/SGUSDC.js +0 -18
- package/_cjs/evm/config/tokens/tokens/SGUSDC.js.map +0 -1
- package/_esm/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitAllowedIfNecessary.js +0 -17
- package/_esm/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitAllowedIfNecessary.js.map +0 -1
- package/_esm/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitIfNecessary.js +0 -17
- package/_esm/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitIfNecessary.js.map +0 -1
- package/_esm/evm/abi/splitter.js +0 -34
- package/_esm/evm/abi/splitter.js.map +0 -1
- package/_esm/evm/api/config.js +0 -17
- package/_esm/evm/api/config.js.map +0 -1
- package/_esm/evm/config/drpc.js +0 -78
- package/_esm/evm/config/drpc.js.map +0 -1
- package/_esm/evm/config/tokens/tokens/SGUSDC.js +0 -15
- package/_esm/evm/config/tokens/tokens/SGUSDC.js.map +0 -1
- package/_types/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitAllowedIfNecessary.d.ts +0 -32
- package/_types/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitAllowedIfNecessary.d.ts.map +0 -1
- package/_types/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitIfNecessary.d.ts +0 -32
- package/_types/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitIfNecessary.d.ts.map +0 -1
- package/_types/evm/abi/splitter.d.ts +0 -2
- package/_types/evm/abi/splitter.d.ts.map +0 -1
- package/_types/evm/api/config.d.ts +0 -11
- package/_types/evm/api/config.d.ts.map +0 -1
- package/_types/evm/config/drpc.d.ts +0 -9
- package/_types/evm/config/drpc.d.ts.map +0 -1
- package/_types/evm/config/tokens/tokens/SGUSDC.d.ts +0 -9
- package/_types/evm/config/tokens/tokens/SGUSDC.d.ts.map +0 -1
- package/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitAllowedIfNecessary.ts +0 -16
- package/evm/abi/selfPermitAbi/selfPermitAbi_selfPermitIfNecessary.ts +0 -16
- package/evm/abi/splitter.ts +0 -53
- package/evm/api/config.ts +0 -23
- package/evm/config/drpc.ts +0 -92
- package/evm/config/tokens/tokens/SGUSDC.ts +0 -19
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { describe, expectTypeOf, it } from 'vitest'
|
|
2
|
+
import { EvmChainId } from '../../evm/chain/chains.js'
|
|
3
|
+
import type { EvmAddress } from '../../evm/currency/token.js'
|
|
4
|
+
import type {
|
|
5
|
+
StellarAccountAddress,
|
|
6
|
+
StellarContractAddress,
|
|
7
|
+
} from '../../stellar/address.js'
|
|
8
|
+
import { StellarChainId } from '../../stellar/chain/chains.js'
|
|
9
|
+
import { getNativeAddress } from './native-address.js'
|
|
10
|
+
|
|
11
|
+
describe('getNativeAddress', () => {
|
|
12
|
+
it('returns contract address types', () => {
|
|
13
|
+
expectTypeOf(
|
|
14
|
+
getNativeAddress(EvmChainId.ETHEREUM),
|
|
15
|
+
).toEqualTypeOf<EvmAddress>()
|
|
16
|
+
|
|
17
|
+
expectTypeOf(
|
|
18
|
+
getNativeAddress(StellarChainId.STELLAR),
|
|
19
|
+
).toEqualTypeOf<StellarContractAddress>()
|
|
20
|
+
|
|
21
|
+
expectTypeOf(
|
|
22
|
+
getNativeAddress(StellarChainId.STELLAR),
|
|
23
|
+
).not.toEqualTypeOf<StellarAccountAddress>()
|
|
24
|
+
})
|
|
25
|
+
})
|
|
@@ -7,26 +7,26 @@ import { stellarNativeAddress } from '../../stellar/config/simple-constants.js'
|
|
|
7
7
|
import { isSvmChainId } from '../../svm/chain/chains.js'
|
|
8
8
|
import { svmNativeAddress } from '../../svm/config/simple-constants.js'
|
|
9
9
|
import type { ChainId } from '../chain/chains.js'
|
|
10
|
-
import type {
|
|
10
|
+
import type { ContractAddressFor } from '../types/for-chain.js'
|
|
11
11
|
import { assertNever } from './assert-never.js'
|
|
12
12
|
|
|
13
13
|
export function getNativeAddress<TChainId extends ChainId>(
|
|
14
14
|
chainId: TChainId,
|
|
15
|
-
):
|
|
15
|
+
): ContractAddressFor<TChainId> {
|
|
16
16
|
if (isEvmChainId(chainId)) {
|
|
17
|
-
return evmNativeAddress as
|
|
17
|
+
return evmNativeAddress as ContractAddressFor<TChainId>
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
if (isMvmChainId(chainId)) {
|
|
21
|
-
return mvmNativeAddress as
|
|
21
|
+
return mvmNativeAddress as ContractAddressFor<TChainId>
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
if (isSvmChainId(chainId)) {
|
|
25
|
-
return svmNativeAddress as
|
|
25
|
+
return svmNativeAddress as ContractAddressFor<TChainId>
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
if (isStellarChainId(chainId)) {
|
|
29
|
-
return stellarNativeAddress as
|
|
29
|
+
return stellarNativeAddress as ContractAddressFor<TChainId>
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
assertNever(chainId, `getNativeAddress, unsupported chainId: ${chainId}`)
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { describe, expect, it } from 'vitest'
|
|
2
|
+
import { sz } from './zod.js'
|
|
3
|
+
|
|
4
|
+
describe('sz address validators', () => {
|
|
5
|
+
it('validates, casts, and normalizes EVM addresses', () => {
|
|
6
|
+
const address = '0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48'
|
|
7
|
+
|
|
8
|
+
expect(sz.evm.address().parse(address)).toBe(
|
|
9
|
+
'0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
10
|
+
)
|
|
11
|
+
expect(sz.evm.address().safeParse('0x1234').success).toBe(false)
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
it('validates and casts SVM addresses', () => {
|
|
15
|
+
const address = 'So11111111111111111111111111111111111111112'
|
|
16
|
+
|
|
17
|
+
expect(sz.svm.address().parse(address)).toBe(address)
|
|
18
|
+
expect(sz.svm.address().safeParse('0x1234').success).toBe(false)
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
it('validates and casts MVM addresses', () => {
|
|
22
|
+
const address = '0x2::sui::SUI'
|
|
23
|
+
|
|
24
|
+
expect(sz.mvm.address().parse(address)).toBe(address)
|
|
25
|
+
expect(sz.mvm.address().safeParse('0x2::sui').success).toBe(false)
|
|
26
|
+
})
|
|
27
|
+
|
|
28
|
+
it('validates, casts, and normalizes Stellar addresses', () => {
|
|
29
|
+
const accountAddress =
|
|
30
|
+
'GAAZI4TCR3TY5OJHCTJC2A4QSY6CJWJH5IAJTGKIN2ER7LBNVKOCCWN7'
|
|
31
|
+
const contractAddress =
|
|
32
|
+
'CCRSMJDITH3VK5QOGYCVZDAKIY5GL3RCG4TCVLIAVB662IW2V5KJGZGF'
|
|
33
|
+
|
|
34
|
+
expect(sz.stellar.address().parse(accountAddress.toLowerCase())).toBe(
|
|
35
|
+
accountAddress,
|
|
36
|
+
)
|
|
37
|
+
expect(
|
|
38
|
+
sz.stellar.contractAddress().parse(contractAddress.toLowerCase()),
|
|
39
|
+
).toBe(contractAddress)
|
|
40
|
+
expect(sz.stellar.accountAddress().safeParse(contractAddress).success).toBe(
|
|
41
|
+
false,
|
|
42
|
+
)
|
|
43
|
+
})
|
|
44
|
+
})
|
package/generic/validate/zod.ts
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import type { Hex } from 'viem'
|
|
2
2
|
import * as z from 'zod'
|
|
3
3
|
import { szevm } from '../../evm/validate/zod.js'
|
|
4
|
+
import { szmvm } from '../../mvm/validate/zod.js'
|
|
5
|
+
import { szstellar } from '../../stellar/validate/zod.js'
|
|
6
|
+
import { szsvm } from '../../svm/validate/zod.js'
|
|
4
7
|
|
|
5
8
|
export const hex = () =>
|
|
6
9
|
z
|
|
@@ -13,4 +16,7 @@ export const hex = () =>
|
|
|
13
16
|
export const sz = {
|
|
14
17
|
evm: szevm,
|
|
15
18
|
hex,
|
|
19
|
+
mvm: szmvm,
|
|
20
|
+
stellar: szstellar,
|
|
21
|
+
svm: szsvm,
|
|
16
22
|
}
|
package/mvm/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './zod.js'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as z from 'zod'
|
|
2
|
+
import { isMvmAddress, type MvmAddress } from '../currency/token.js'
|
|
3
|
+
import { normalizeMvmAddress } from '../utils/normalize-address.js'
|
|
4
|
+
|
|
5
|
+
export const mvmAddress = () =>
|
|
6
|
+
z
|
|
7
|
+
.string()
|
|
8
|
+
.refine(isMvmAddress, { message: 'Invalid address' })
|
|
9
|
+
.transform((value) => normalizeMvmAddress(value as MvmAddress))
|
|
10
|
+
|
|
11
|
+
export const szmvm = {
|
|
12
|
+
address: mvmAddress,
|
|
13
|
+
}
|
package/package.json
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "sushi",
|
|
3
3
|
"description": "Sushi",
|
|
4
|
-
"version": "6.
|
|
5
|
-
"type": "module",
|
|
4
|
+
"version": "6.7.1",
|
|
6
5
|
"main": "./_cjs/generic/index.js",
|
|
7
6
|
"module": "./_esm/generic/index.js",
|
|
8
7
|
"types": "./_types/generic/index.d.ts",
|
|
@@ -68,13 +67,13 @@
|
|
|
68
67
|
}
|
|
69
68
|
},
|
|
70
69
|
"dependencies": {
|
|
71
|
-
"@solana/addresses": "
|
|
70
|
+
"@solana/addresses": "6.9.0",
|
|
72
71
|
"@uniswap/token-lists": "1.0.0-beta.33",
|
|
73
72
|
"tiny-invariant": "1.3.3"
|
|
74
73
|
},
|
|
75
74
|
"peerDependencies": {
|
|
76
75
|
"@solana/addresses": ">=5",
|
|
77
|
-
"typescript": ">= 5.8.3 <
|
|
76
|
+
"typescript": ">= 5.8.3 < 7",
|
|
78
77
|
"viem": "*",
|
|
79
78
|
"zod": ">=4"
|
|
80
79
|
},
|
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
StellarAccountAddress,
|
|
3
|
-
StellarContractAddress,
|
|
4
|
-
} from '../address.js'
|
|
1
|
+
import type { StellarContractAddress } from '../address.js'
|
|
5
2
|
import { StellarChainId } from '../chain/chains.js'
|
|
6
3
|
|
|
7
4
|
export const stellarNativeAddress =
|
|
8
|
-
'
|
|
5
|
+
'CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA' as const satisfies StellarContractAddress
|
|
9
6
|
|
|
10
7
|
export const SUSHISWAP_V3_FACTORY_ADDRESS: Record<
|
|
11
8
|
StellarChainId,
|
package/stellar/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './zod.js'
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import * as z from 'zod'
|
|
2
|
+
import {
|
|
3
|
+
isStellarAccountAddress,
|
|
4
|
+
isStellarAddress,
|
|
5
|
+
isStellarContractAddress,
|
|
6
|
+
type StellarAccountAddress,
|
|
7
|
+
type StellarAddress,
|
|
8
|
+
type StellarContractAddress,
|
|
9
|
+
} from '../address.js'
|
|
10
|
+
import { normalizeStellarAddress } from '../utils/normalize-address.js'
|
|
11
|
+
|
|
12
|
+
export const stellarAddress = () =>
|
|
13
|
+
z
|
|
14
|
+
.string()
|
|
15
|
+
.transform((value) => normalizeStellarAddress(value as StellarAddress))
|
|
16
|
+
.refine(isStellarAddress, { message: 'Invalid address' })
|
|
17
|
+
|
|
18
|
+
export const stellarAccountAddress = () =>
|
|
19
|
+
z
|
|
20
|
+
.string()
|
|
21
|
+
.transform((value) =>
|
|
22
|
+
normalizeStellarAddress(value as StellarAccountAddress),
|
|
23
|
+
)
|
|
24
|
+
.refine(isStellarAccountAddress, { message: 'Invalid address' })
|
|
25
|
+
|
|
26
|
+
export const stellarContractAddress = () =>
|
|
27
|
+
z
|
|
28
|
+
.string()
|
|
29
|
+
.transform((value) =>
|
|
30
|
+
normalizeStellarAddress(value as StellarContractAddress),
|
|
31
|
+
)
|
|
32
|
+
.refine(isStellarContractAddress, { message: 'Invalid address' })
|
|
33
|
+
|
|
34
|
+
export const szstellar = {
|
|
35
|
+
accountAddress: stellarAccountAddress,
|
|
36
|
+
address: stellarAddress,
|
|
37
|
+
contractAddress: stellarContractAddress,
|
|
38
|
+
}
|
package/svm/currency/token.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Token } from '../../generic/currency/token.js'
|
|
|
9
9
|
import { isSvmChainId, type SvmChainId } from '../chain/chains.js'
|
|
10
10
|
import { normalizeSvmAddress } from '../utils/normalize-address.js'
|
|
11
11
|
|
|
12
|
-
export { type SvmAddress, svmAddress
|
|
12
|
+
export { isSvmAddress, type SvmAddress, svmAddress }
|
|
13
13
|
export type SvmTxHash = string
|
|
14
14
|
|
|
15
15
|
export type SvmTokenOrigin = 'native' | 'native-bridge'
|
package/svm/index.ts
CHANGED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './zod.js'
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import * as z from 'zod'
|
|
2
|
+
import { isSvmAddress, type SvmAddress } from '../currency/token.js'
|
|
3
|
+
import { normalizeSvmAddress } from '../utils/normalize-address.js'
|
|
4
|
+
|
|
5
|
+
export const svmAddressSchema = () =>
|
|
6
|
+
z
|
|
7
|
+
.string()
|
|
8
|
+
.refine(isSvmAddress, { message: 'Invalid address' })
|
|
9
|
+
.transform((value) => normalizeSvmAddress(value as SvmAddress))
|
|
10
|
+
|
|
11
|
+
export const szsvm = {
|
|
12
|
+
address: svmAddressSchema,
|
|
13
|
+
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.selfPermitAbi_selfPermitAllowedIfNecessary = void 0;
|
|
4
|
-
exports.selfPermitAbi_selfPermitAllowedIfNecessary = [
|
|
5
|
-
{
|
|
6
|
-
inputs: [
|
|
7
|
-
{ internalType: 'address', name: 'token', type: 'address' },
|
|
8
|
-
{ internalType: 'uint256', name: 'nonce', type: 'uint256' },
|
|
9
|
-
{ internalType: 'uint256', name: 'expiry', type: 'uint256' },
|
|
10
|
-
{ internalType: 'uint8', name: 'v', type: 'uint8' },
|
|
11
|
-
{ internalType: 'bytes32', name: 'r', type: 'bytes32' },
|
|
12
|
-
{ internalType: 'bytes32', name: 's', type: 'bytes32' },
|
|
13
|
-
],
|
|
14
|
-
name: 'selfPermitAllowedIfNecessary',
|
|
15
|
-
outputs: [],
|
|
16
|
-
stateMutability: 'payable',
|
|
17
|
-
type: 'function',
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
//# sourceMappingURL=selfPermitAbi_selfPermitAllowedIfNecessary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selfPermitAbi_selfPermitAllowedIfNecessary.js","sourceRoot":"","sources":["../../../../evm/abi/selfPermitAbi/selfPermitAbi_selfPermitAllowedIfNecessary.ts"],"names":[],"mappings":";;;AAAa,QAAA,0CAA0C,GAAG;IACxD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5D,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE;YACnD,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;YACvD,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;SACxD;QACD,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACjB;CACO,CAAA"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.selfPermitAbi_selfPermitIfNecessary = void 0;
|
|
4
|
-
exports.selfPermitAbi_selfPermitIfNecessary = [
|
|
5
|
-
{
|
|
6
|
-
inputs: [
|
|
7
|
-
{ internalType: 'address', name: 'token', type: 'address' },
|
|
8
|
-
{ internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
9
|
-
{ internalType: 'uint256', name: 'deadline', type: 'uint256' },
|
|
10
|
-
{ internalType: 'uint8', name: 'v', type: 'uint8' },
|
|
11
|
-
{ internalType: 'bytes32', name: 'r', type: 'bytes32' },
|
|
12
|
-
{ internalType: 'bytes32', name: 's', type: 'bytes32' },
|
|
13
|
-
],
|
|
14
|
-
name: 'selfPermitIfNecessary',
|
|
15
|
-
outputs: [],
|
|
16
|
-
stateMutability: 'payable',
|
|
17
|
-
type: 'function',
|
|
18
|
-
},
|
|
19
|
-
];
|
|
20
|
-
//# sourceMappingURL=selfPermitAbi_selfPermitIfNecessary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selfPermitAbi_selfPermitIfNecessary.js","sourceRoot":"","sources":["../../../../evm/abi/selfPermitAbi/selfPermitAbi_selfPermitIfNecessary.ts"],"names":[],"mappings":";;;AAAa,QAAA,mCAAmC,GAAG;IACjD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YAC9D,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE;YACnD,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;YACvD,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;SACxD;QACD,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACjB;CACO,CAAA"}
|
package/_cjs/evm/abi/splitter.js
DELETED
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
const node_child_process_1 = require("node:child_process");
|
|
37
|
-
const node_fs_1 = require("node:fs");
|
|
38
|
-
const abiDirPath = new URL(import.meta.url).pathname
|
|
39
|
-
.split('/')
|
|
40
|
-
.slice(0, -1)
|
|
41
|
-
.join('/');
|
|
42
|
-
const abiDirContent = (0, node_fs_1.readdirSync)(abiDirPath);
|
|
43
|
-
const abiDirTsFiles = abiDirContent.filter((file) => file.endsWith('.ts'));
|
|
44
|
-
for (const file of abiDirTsFiles) {
|
|
45
|
-
if (file === 'index.ts')
|
|
46
|
-
continue;
|
|
47
|
-
if (file === 'splitter.ts')
|
|
48
|
-
continue;
|
|
49
|
-
const mod = await Promise.resolve(`${`./${file}`}`).then(s => __importStar(require(s)));
|
|
50
|
-
const [abiName, abiContent] = Object.entries(mod)[0];
|
|
51
|
-
const functions = abiContent.filter((item) => item.type === 'function');
|
|
52
|
-
(0, node_fs_1.mkdirSync)(`${abiDirPath}/${abiName}`, { recursive: true });
|
|
53
|
-
const indexFileContent = [];
|
|
54
|
-
for (const func of functions) {
|
|
55
|
-
const fileName = `${abiName}_${func.name}.ts`;
|
|
56
|
-
(0, node_fs_1.writeFileSync)(`${abiDirPath}/${abiName}/${fileName}`, `export const ${abiName}_${func.name} = [${JSON.stringify(func)}] as const`);
|
|
57
|
-
indexFileContent.push(`export * from './${fileName.replace('.ts', '.js')}'`);
|
|
58
|
-
}
|
|
59
|
-
(0, node_fs_1.writeFileSync)(`${abiDirPath}/${abiName}/index.ts`, indexFileContent.join('\n'));
|
|
60
|
-
(0, node_fs_1.rmSync)(`${abiDirPath}/${file}`);
|
|
61
|
-
try {
|
|
62
|
-
(0, node_child_process_1.exec)(`pnpm biome format ${abiDirPath}/${abiName} --write`);
|
|
63
|
-
}
|
|
64
|
-
catch {
|
|
65
|
-
console.log("Couldn't format", abiName);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
//# sourceMappingURL=splitter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"splitter.js","sourceRoot":"","sources":["../../../evm/abi/splitter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2DAAyC;AACzC,qCAAuE;AAGvE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ;KACjD,KAAK,CAAC,GAAG,CAAC;KACV,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KACZ,IAAI,CAAC,GAAG,CAAC,CAAA;AACZ,MAAM,aAAa,GAAG,IAAA,qBAAW,EAAC,UAAU,CAAC,CAAA;AAE7C,MAAM,aAAa,GAAG,aAAa,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAA;AAE1E,KAAK,MAAM,IAAI,IAAI,aAAa,EAAE,CAAC;IACjC,IAAI,IAAI,KAAK,UAAU;QAAE,SAAQ;IACjC,IAAI,IAAI,KAAK,aAAa;QAAE,SAAQ;IAEpC,MAAM,GAAG,GAAG,yBAAa,KAAK,IAAI,EAAE,uCAAC,CAAA;IACrC,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,CAAkB,CAAA;IAErE,MAAM,SAAS,GAAG,UAAU,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,UAAU,CAAC,CAAA;IAEvE,IAAA,mBAAS,EAAC,GAAG,UAAU,IAAI,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAA;IAE1D,MAAM,gBAAgB,GAAG,EAAE,CAAA;IAE3B,KAAK,MAAM,IAAI,IAAI,SAAS,EAAE,CAAC;QAC7B,MAAM,QAAQ,GAAG,GAAG,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,CAAA;QAE7C,IAAA,uBAAa,EACX,GAAG,UAAU,IAAI,OAAO,IAAI,QAAQ,EAAE,EACtC,gBAAgB,OAAO,IAAI,IAAI,CAAC,IAAI,OAAO,IAAI,CAAC,SAAS,CACvD,IAAI,CACL,YAAY,CACd,CAAA;QAED,gBAAgB,CAAC,IAAI,CAAC,oBAAoB,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,KAAK,CAAC,GAAG,CAAC,CAAA;IAC9E,CAAC;IAED,IAAA,uBAAa,EACX,GAAG,UAAU,IAAI,OAAO,WAAW,EACnC,gBAAgB,CAAC,IAAI,CAAC,IAAI,CAAC,CAC5B,CAAA;IAED,IAAA,gBAAM,EAAC,GAAG,UAAU,IAAI,IAAI,EAAE,CAAC,CAAA;IAE/B,IAAI,CAAC;QACH,IAAA,yBAAI,EAAC,qBAAqB,UAAU,IAAI,OAAO,UAAU,CAAC,CAAA;IAC5D,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,CAAC,GAAG,CAAC,iBAAiB,EAAE,OAAO,CAAC,CAAA;IACzC,CAAC;AACH,CAAC"}
|
package/_cjs/evm/api/config.js
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.config = void 0;
|
|
4
|
-
exports.config = (() => {
|
|
5
|
-
const _config = {
|
|
6
|
-
integrator: 'sushi-sdk',
|
|
7
|
-
apiUrl: 'https://api.sushi.com',
|
|
8
|
-
};
|
|
9
|
-
return {
|
|
10
|
-
get() {
|
|
11
|
-
return _config;
|
|
12
|
-
},
|
|
13
|
-
set(options) {
|
|
14
|
-
const { ...otherOptions } = options;
|
|
15
|
-
Object.assign(_config, otherOptions);
|
|
16
|
-
return _config;
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
})();
|
|
20
|
-
//# sourceMappingURL=config.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../evm/api/config.ts"],"names":[],"mappings":";;;AAOa,QAAA,MAAM,GAAG,CAAC,GAAG,EAAE;IAC1B,MAAM,OAAO,GAAc;QACzB,UAAU,EAAE,WAAW;QACvB,MAAM,EAAE,uBAAuB;KAChC,CAAA;IACD,OAAO;QACL,GAAG;YACD,OAAO,OAAO,CAAA;QAChB,CAAC;QACD,GAAG,CAAC,OAAkB;YACpB,MAAM,EAAE,GAAG,YAAY,EAAE,GAAG,OAAO,CAAA;YACnC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,YAAY,CAAC,CAAA;YACpC,OAAO,OAAO,CAAA;QAChB,CAAC;KACF,CAAA;AACH,CAAC,CAAC,EAAE,CAAA"}
|
package/_cjs/evm/config/drpc.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDrpcRpcUrl = exports.isDrpcChainId = exports.DRPC_CHAIN_IDS = void 0;
|
|
4
|
-
const index_js_1 = require("../chain/index.js");
|
|
5
|
-
exports.DRPC_CHAIN_IDS = [
|
|
6
|
-
index_js_1.EvmChainId.APE,
|
|
7
|
-
index_js_1.EvmChainId.ARBITRUM,
|
|
8
|
-
index_js_1.EvmChainId.ARBITRUM_NOVA,
|
|
9
|
-
index_js_1.EvmChainId.AVALANCHE,
|
|
10
|
-
index_js_1.EvmChainId.BASE,
|
|
11
|
-
index_js_1.EvmChainId.BLAST,
|
|
12
|
-
index_js_1.EvmChainId.BOBA,
|
|
13
|
-
index_js_1.EvmChainId.BOBA_BNB,
|
|
14
|
-
index_js_1.EvmChainId.BSC,
|
|
15
|
-
index_js_1.EvmChainId.CELO,
|
|
16
|
-
index_js_1.EvmChainId.CORE,
|
|
17
|
-
index_js_1.EvmChainId.CRONOS,
|
|
18
|
-
index_js_1.EvmChainId.ETHEREUM,
|
|
19
|
-
index_js_1.EvmChainId.FANTOM,
|
|
20
|
-
index_js_1.EvmChainId.FILECOIN,
|
|
21
|
-
index_js_1.EvmChainId.GNOSIS,
|
|
22
|
-
index_js_1.EvmChainId.HAQQ,
|
|
23
|
-
index_js_1.EvmChainId.HARMONY,
|
|
24
|
-
index_js_1.EvmChainId.KAVA,
|
|
25
|
-
index_js_1.EvmChainId.LINEA,
|
|
26
|
-
index_js_1.EvmChainId.MANTA,
|
|
27
|
-
index_js_1.EvmChainId.MANTLE,
|
|
28
|
-
index_js_1.EvmChainId.METIS,
|
|
29
|
-
index_js_1.EvmChainId.MODE,
|
|
30
|
-
index_js_1.EvmChainId.OPTIMISM,
|
|
31
|
-
index_js_1.EvmChainId.POLYGON,
|
|
32
|
-
index_js_1.EvmChainId.POLYGON_ZKEVM,
|
|
33
|
-
index_js_1.EvmChainId.ROOTSTOCK,
|
|
34
|
-
index_js_1.EvmChainId.SCROLL,
|
|
35
|
-
index_js_1.EvmChainId.SONIC,
|
|
36
|
-
index_js_1.EvmChainId.TAIKO,
|
|
37
|
-
index_js_1.EvmChainId.THUNDERCORE,
|
|
38
|
-
index_js_1.EvmChainId.ZETACHAIN,
|
|
39
|
-
index_js_1.EvmChainId.ZKSYNC_ERA,
|
|
40
|
-
];
|
|
41
|
-
const isDrpcChainId = (chainId) => exports.DRPC_CHAIN_IDS.includes(chainId);
|
|
42
|
-
exports.isDrpcChainId = isDrpcChainId;
|
|
43
|
-
const drpcNetworkMapping = {
|
|
44
|
-
[index_js_1.EvmChainId.APE]: 'apechain',
|
|
45
|
-
[index_js_1.EvmChainId.ARBITRUM]: 'arbitrum',
|
|
46
|
-
[index_js_1.EvmChainId.ARBITRUM_NOVA]: 'arbitrum-nova',
|
|
47
|
-
[index_js_1.EvmChainId.AVALANCHE]: 'avalanche',
|
|
48
|
-
[index_js_1.EvmChainId.BASE]: 'base',
|
|
49
|
-
[index_js_1.EvmChainId.BLAST]: 'blast',
|
|
50
|
-
[index_js_1.EvmChainId.BOBA]: 'boba-eth',
|
|
51
|
-
[index_js_1.EvmChainId.BOBA_BNB]: 'boba-bnb',
|
|
52
|
-
[index_js_1.EvmChainId.BSC]: 'bsc',
|
|
53
|
-
[index_js_1.EvmChainId.CELO]: 'celo',
|
|
54
|
-
[index_js_1.EvmChainId.CORE]: 'core',
|
|
55
|
-
[index_js_1.EvmChainId.CRONOS]: 'cronos',
|
|
56
|
-
[index_js_1.EvmChainId.ETHEREUM]: 'ethereum',
|
|
57
|
-
[index_js_1.EvmChainId.FANTOM]: 'fantom',
|
|
58
|
-
[index_js_1.EvmChainId.FILECOIN]: 'filecoin',
|
|
59
|
-
[index_js_1.EvmChainId.GNOSIS]: 'gnosis',
|
|
60
|
-
[index_js_1.EvmChainId.HAQQ]: 'haqq',
|
|
61
|
-
[index_js_1.EvmChainId.HARMONY]: 'harmony-0',
|
|
62
|
-
[index_js_1.EvmChainId.KAVA]: 'kava',
|
|
63
|
-
[index_js_1.EvmChainId.LINEA]: 'linea',
|
|
64
|
-
[index_js_1.EvmChainId.MANTA]: 'manta-pacific',
|
|
65
|
-
[index_js_1.EvmChainId.MANTLE]: 'mantle',
|
|
66
|
-
[index_js_1.EvmChainId.METIS]: 'metis',
|
|
67
|
-
[index_js_1.EvmChainId.MODE]: 'mode',
|
|
68
|
-
[index_js_1.EvmChainId.OPTIMISM]: 'optimism',
|
|
69
|
-
[index_js_1.EvmChainId.POLYGON]: 'polygon',
|
|
70
|
-
[index_js_1.EvmChainId.POLYGON_ZKEVM]: 'polygon-zkevm',
|
|
71
|
-
[index_js_1.EvmChainId.ROOTSTOCK]: 'rootstock',
|
|
72
|
-
[index_js_1.EvmChainId.SCROLL]: 'scroll',
|
|
73
|
-
[index_js_1.EvmChainId.SONIC]: 'sonic',
|
|
74
|
-
[index_js_1.EvmChainId.TAIKO]: 'taiko',
|
|
75
|
-
[index_js_1.EvmChainId.THUNDERCORE]: 'thundercore',
|
|
76
|
-
[index_js_1.EvmChainId.ZETACHAIN]: 'zeta-chain',
|
|
77
|
-
[index_js_1.EvmChainId.ZKSYNC_ERA]: 'zksync',
|
|
78
|
-
};
|
|
79
|
-
const getDrpcRpcUrl = ({ chainId, key, subdomain = 'lb', }) => {
|
|
80
|
-
return `https://${subdomain}.drpc.${subdomain === 'lb' ? 'live' : 'org'}$/ogrpc?network=${drpcNetworkMapping[chainId]}&dkey=${key}`;
|
|
81
|
-
};
|
|
82
|
-
exports.getDrpcRpcUrl = getDrpcRpcUrl;
|
|
83
|
-
//# sourceMappingURL=drpc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"drpc.js","sourceRoot":"","sources":["../../../evm/config/drpc.ts"],"names":[],"mappings":";;;AAAA,gDAA8C;AAEjC,QAAA,cAAc,GAAG;IAC5B,qBAAU,CAAC,GAAG;IACd,qBAAU,CAAC,QAAQ;IACnB,qBAAU,CAAC,aAAa;IACxB,qBAAU,CAAC,SAAS;IACpB,qBAAU,CAAC,IAAI;IACf,qBAAU,CAAC,KAAK;IAChB,qBAAU,CAAC,IAAI;IACf,qBAAU,CAAC,QAAQ;IACnB,qBAAU,CAAC,GAAG;IACd,qBAAU,CAAC,IAAI;IACf,qBAAU,CAAC,IAAI;IACf,qBAAU,CAAC,MAAM;IACjB,qBAAU,CAAC,QAAQ;IACnB,qBAAU,CAAC,MAAM;IACjB,qBAAU,CAAC,QAAQ;IACnB,qBAAU,CAAC,MAAM;IACjB,qBAAU,CAAC,IAAI;IACf,qBAAU,CAAC,OAAO;IAClB,qB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,KAAK,mBAAmB,kBAAkB,CAAC,OAAO,CAAC,SAAS,GAAG,EAAE,CAAA;AACrI,CAAC,CAAA;AAVY,QAAA,aAAa,iBAUzB"}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SGUSDC = exports.SGUSDC_ADDRESS = void 0;
|
|
4
|
-
const chains_js_1 = require("../../../chain/chains.js");
|
|
5
|
-
const address_map_to_token_map_js_1 = require("../address-map-to-token-map.js");
|
|
6
|
-
exports.SGUSDC_ADDRESS = {
|
|
7
|
-
[chains_js_1.EvmChainId.ETHEREUM]: '0x72e2f4830b9e45d52f80ac08cb2bec0fef72ed9c',
|
|
8
|
-
[chains_js_1.EvmChainId.ARBITRUM]: '0x82cbecf39bee528b5476fe6d1550af59a9db6fc0',
|
|
9
|
-
[chains_js_1.EvmChainId.OPTIMISM]: '0xb69c8cbcd90a39d8d3d3ccf0a3e968511c3856a0',
|
|
10
|
-
[chains_js_1.EvmChainId.BASE]: '0x224d8fd7ab6ad4c6eb4611ce56ef35dec2277f03',
|
|
11
|
-
[chains_js_1.EvmChainId.LINEA]: '0x224d8fd7ab6ad4c6eb4611ce56ef35dec2277f03',
|
|
12
|
-
};
|
|
13
|
-
exports.SGUSDC = (0, address_map_to_token_map_js_1.addressMapToTokenMap)({
|
|
14
|
-
decimals: 18,
|
|
15
|
-
symbol: 'SGUSDC',
|
|
16
|
-
name: 'Stargate ETH',
|
|
17
|
-
}, exports.SGUSDC_ADDRESS);
|
|
18
|
-
//# sourceMappingURL=SGUSDC.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SGUSDC.js","sourceRoot":"","sources":["../../../../../evm/config/tokens/tokens/SGUSDC.ts"],"names":[],"mappings":";;;AAAA,wDAAqD;AACrD,gFAAqE;AAExD,QAAA,cAAc,GAAG;IAC5B,CAAC,sBAAU,CAAC,QAAQ,CAAC,EAAE,4CAA4C;IACnE,CAAC,sBAAU,CAAC,QAAQ,CAAC,EAAE,4CAA4C;IACnE,CAAC,sBAAU,CAAC,QAAQ,CAAC,EAAE,4CAA4C;IACnE,CAAC,sBAAU,CAAC,IAAI,CAAC,EAAE,4CAA4C;IAC/D,CAAC,sBAAU,CAAC,KAAK,CAAC,EAAE,4CAA4C;CACxD,CAAA;AAEG,QAAA,MAAM,GAAG,IAAA,kDAAoB,EACxC;IACE,QAAQ,EAAE,EAAE;IACZ,MAAM,EAAE,QAAQ;IAChB,IAAI,EAAE,cAAc;CACrB,EACD,sBAAc,CACf,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const selfPermitAbi_selfPermitAllowedIfNecessary = [
|
|
2
|
-
{
|
|
3
|
-
inputs: [
|
|
4
|
-
{ internalType: 'address', name: 'token', type: 'address' },
|
|
5
|
-
{ internalType: 'uint256', name: 'nonce', type: 'uint256' },
|
|
6
|
-
{ internalType: 'uint256', name: 'expiry', type: 'uint256' },
|
|
7
|
-
{ internalType: 'uint8', name: 'v', type: 'uint8' },
|
|
8
|
-
{ internalType: 'bytes32', name: 'r', type: 'bytes32' },
|
|
9
|
-
{ internalType: 'bytes32', name: 's', type: 'bytes32' },
|
|
10
|
-
],
|
|
11
|
-
name: 'selfPermitAllowedIfNecessary',
|
|
12
|
-
outputs: [],
|
|
13
|
-
stateMutability: 'payable',
|
|
14
|
-
type: 'function',
|
|
15
|
-
},
|
|
16
|
-
];
|
|
17
|
-
//# sourceMappingURL=selfPermitAbi_selfPermitAllowedIfNecessary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selfPermitAbi_selfPermitAllowedIfNecessary.js","sourceRoot":"","sources":["../../../../evm/abi/selfPermitAbi/selfPermitAbi_selfPermitAllowedIfNecessary.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,0CAA0C,GAAG;IACxD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,SAAS,EAAE;YAC5D,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE;YACnD,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;YACvD,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;SACxD;QACD,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACjB;CACO,CAAA"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export const selfPermitAbi_selfPermitIfNecessary = [
|
|
2
|
-
{
|
|
3
|
-
inputs: [
|
|
4
|
-
{ internalType: 'address', name: 'token', type: 'address' },
|
|
5
|
-
{ internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
6
|
-
{ internalType: 'uint256', name: 'deadline', type: 'uint256' },
|
|
7
|
-
{ internalType: 'uint8', name: 'v', type: 'uint8' },
|
|
8
|
-
{ internalType: 'bytes32', name: 'r', type: 'bytes32' },
|
|
9
|
-
{ internalType: 'bytes32', name: 's', type: 'bytes32' },
|
|
10
|
-
],
|
|
11
|
-
name: 'selfPermitIfNecessary',
|
|
12
|
-
outputs: [],
|
|
13
|
-
stateMutability: 'payable',
|
|
14
|
-
type: 'function',
|
|
15
|
-
},
|
|
16
|
-
];
|
|
17
|
-
//# sourceMappingURL=selfPermitAbi_selfPermitIfNecessary.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"selfPermitAbi_selfPermitIfNecessary.js","sourceRoot":"","sources":["../../../../evm/abi/selfPermitAbi/selfPermitAbi_selfPermitIfNecessary.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,mCAAmC,GAAG;IACjD;QACE,MAAM,EAAE;YACN,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE;YAC3D,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAE;YAC9D,EAAE,YAAY,EAAE,OAAO,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,OAAO,EAAE;YACnD,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;YACvD,EAAE,YAAY,EAAE,SAAS,EAAE,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,SAAS,EAAE;SACxD;QACD,IAAI,EAAE,uBAAuB;QAC7B,OAAO,EAAE,EAAE;QACX,eAAe,EAAE,SAAS;QAC1B,IAAI,EAAE,UAAU;KACjB;CACO,CAAA"}
|
package/_esm/evm/abi/splitter.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// @ts-nocheck
|
|
2
|
-
import { exec } from 'node:child_process';
|
|
3
|
-
import { mkdirSync, readdirSync, rmSync, writeFileSync } from 'node:fs';
|
|
4
|
-
const abiDirPath = new URL(import.meta.url).pathname
|
|
5
|
-
.split('/')
|
|
6
|
-
.slice(0, -1)
|
|
7
|
-
.join('/');
|
|
8
|
-
const abiDirContent = readdirSync(abiDirPath);
|
|
9
|
-
const abiDirTsFiles = abiDirContent.filter((file) => file.endsWith('.ts'));
|
|
10
|
-
for (const file of abiDirTsFiles) {
|
|
11
|
-
if (file === 'index.ts')
|
|
12
|
-
continue;
|
|
13
|
-
if (file === 'splitter.ts')
|
|
14
|
-
continue;
|
|
15
|
-
const mod = await import(`./${file}`);
|
|
16
|
-
const [abiName, abiContent] = Object.entries(mod)[0];
|
|
17
|
-
const functions = abiContent.filter((item) => item.type === 'function');
|
|
18
|
-
mkdirSync(`${abiDirPath}/${abiName}`, { recursive: true });
|
|
19
|
-
const indexFileContent = [];
|
|
20
|
-
for (const func of functions) {
|
|
21
|
-
const fileName = `${abiName}_${func.name}.ts`;
|
|
22
|
-
writeFileSync(`${abiDirPath}/${abiName}/${fileName}`, `export const ${abiName}_${func.name} = [${JSON.stringify(func)}] as const`);
|
|
23
|
-
indexFileContent.push(`export * from './${fileName.replace('.ts', '.js')}'`);
|
|
24
|
-
}
|
|
25
|
-
writeFileSync(`${abiDirPath}/${abiName}/index.ts`, indexFileContent.join('\n'));
|
|
26
|
-
rmSync(`${abiDirPath}/${file}`);
|
|
27
|
-
try {
|
|
28
|
-
exec(`pnpm biome format ${abiDirPath}/${abiName} --write`);
|
|
29
|
-
}
|
|
30
|
-
catch {
|
|
31
|
-
console.log("Couldn't format", abiName);
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
//# sourceMappingURL=splitter.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"splitter.js","sourceRoot":"","sources":["../../../evm/abi/splitter.ts"],"names":[],"mappings":"AAAA,cAAc;AAEd,OAAO,EAAE,IAAI,EAAE,MAAM,oBAAoB,CAAA;AACzC,OAAO,EAAE,SAAS,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAGvE,MAAM,UAAU,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,QAAQ;KACjD,KAAK,CAAC,GAAG,CAAC;KACV,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;KACZ,IAAI,CAAC,GAAG,CAAC,CAAA;AACZ,MAAM,aAAa,GAAG,W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