@sodax/types 0.0.1-rc.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/dist/common/index.d.ts +34 -0
- package/dist/common/index.d.ts.map +1 -0
- package/dist/common/index.js +2 -0
- package/dist/common/index.js.map +1 -0
- package/dist/constants/index.d.ts +17 -0
- package/dist/constants/index.d.ts.map +1 -0
- package/dist/constants/index.js +46 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/evm/index.d.ts +41 -0
- package/dist/evm/index.d.ts.map +1 -0
- package/dist/evm/index.js +2 -0
- package/dist/evm/index.js.map +1 -0
- package/dist/icon/index.d.ts +37 -0
- package/dist/icon/index.d.ts.map +1 -0
- package/dist/icon/index.js +2 -0
- package/dist/icon/index.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/stellar/index.d.ts +70 -0
- package/dist/stellar/index.d.ts.map +1 -0
- package/dist/stellar/index.js +2 -0
- package/dist/stellar/index.js.map +1 -0
- package/dist/sui/index.d.ts +34 -0
- package/dist/sui/index.d.ts.map +1 -0
- package/dist/sui/index.js +2 -0
- package/dist/sui/index.js.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { HUB_CHAIN_IDS, SPOKE_CHAIN_IDS, CHAIN_IDS } from '../constants/index.js';
|
|
2
|
+
export type HubChainId = (typeof HUB_CHAIN_IDS)[number];
|
|
3
|
+
export type SpokeChainId = (typeof SPOKE_CHAIN_IDS)[number];
|
|
4
|
+
export type ChainId = (typeof CHAIN_IDS)[number];
|
|
5
|
+
export type ChainType = 'ICON' | 'EVM' | 'HAVAH' | 'INJECTIVE' | 'SUI' | 'STELLAR' | 'SOLANA';
|
|
6
|
+
export type Chain = {
|
|
7
|
+
id: string | number;
|
|
8
|
+
name: string;
|
|
9
|
+
testnet: boolean;
|
|
10
|
+
};
|
|
11
|
+
export type XChain = Chain & {
|
|
12
|
+
xChainId: ChainId;
|
|
13
|
+
xChainType: ChainType;
|
|
14
|
+
};
|
|
15
|
+
export type Token = {
|
|
16
|
+
symbol: string;
|
|
17
|
+
name: string;
|
|
18
|
+
decimals: number;
|
|
19
|
+
address: string;
|
|
20
|
+
};
|
|
21
|
+
export type XToken = Token & {
|
|
22
|
+
xChainId: ChainId;
|
|
23
|
+
};
|
|
24
|
+
export type ByteArray = Uint8Array;
|
|
25
|
+
export type Hex = `0x${string}`;
|
|
26
|
+
export type Hash = `0x${string}`;
|
|
27
|
+
export type Address = `0x${string}`;
|
|
28
|
+
export type HubAddress = Address;
|
|
29
|
+
export type OriginalAssetAddress = string;
|
|
30
|
+
export interface WalletAddressProvider {
|
|
31
|
+
getWalletAddress(): Promise<string>;
|
|
32
|
+
getWalletAddressBytes(): Promise<Hex>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEvF,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,aAAa,CAAC,CAAC,MAAM,CAAC,CAAC;AAExD,MAAM,MAAM,YAAY,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5D,MAAM,MAAM,OAAO,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEjD,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,GAAG,WAAW,GAAG,KAAK,GAAG,SAAS,GAAG,QAAQ,CAAC;AAE9F,MAAM,MAAM,KAAK,GAAG;IAClB,EAAE,EAAE,MAAM,GAAG,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,OAAO,CAAC;CAClB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG;IAC3B,QAAQ,EAAE,OAAO,CAAC;IAClB,UAAU,EAAE,SAAS,CAAC;CACvB,CAAC;AAEF,MAAM,MAAM,KAAK,GAAG;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,MAAM,MAAM,MAAM,GAAG,KAAK,GAAG;IAC3B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,UAAU,CAAC;AACnC,MAAM,MAAM,GAAG,GAAG,KAAK,MAAM,EAAE,CAAC;AAChC,MAAM,MAAM,IAAI,GAAG,KAAK,MAAM,EAAE,CAAC;AACjC,MAAM,MAAM,OAAO,GAAG,KAAK,MAAM,EAAE,CAAC;AACpC,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC;AACjC,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAE1C,MAAM,WAAW,qBAAqB;IACpC,gBAAgB,IAAI,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,qBAAqB,IAAI,OAAO,CAAC,GAAG,CAAC,CAAC;CACvC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/common/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export declare const AVALANCHE_MAINNET_CHAIN_ID = "0xa86a.avax";
|
|
2
|
+
export declare const ARBITRUM_MAINNET_CHAIN_ID = "0xa4b1.arbitrum";
|
|
3
|
+
export declare const BASE_MAINNET_CHAIN_ID = "0x2105.base";
|
|
4
|
+
export declare const BSC_MAINNET_CHAIN_ID = "0x38.bsc";
|
|
5
|
+
export declare const INJECTIVE_MAINNET_CHAIN_ID = "injective-1";
|
|
6
|
+
export declare const SONIC_MAINNET_CHAIN_ID = "sonic";
|
|
7
|
+
export declare const ICON_MAINNET_CHAIN_ID = "0x1.icon";
|
|
8
|
+
export declare const SUI_MAINNET_CHAIN_ID = "sui";
|
|
9
|
+
export declare const OPTIMISM_MAINNET_CHAIN_ID = "0xa.optimism";
|
|
10
|
+
export declare const POLYGON_MAINNET_CHAIN_ID = "0x89.polygon";
|
|
11
|
+
export declare const SOLANA_MAINNET_CHAIN_ID = "solana";
|
|
12
|
+
export declare const STELLAR_MAINNET_CHAIN_ID = "stellar";
|
|
13
|
+
export declare const NIBIRU_MAINNET_CHAIN_ID = "nibiru";
|
|
14
|
+
export declare const SPOKE_CHAIN_IDS: readonly ["0xa86a.avax", "0xa4b1.arbitrum", "0x2105.base", "0x38.bsc", "injective-1", "sui", "0xa.optimism", "0x89.polygon", "solana", "0x1.icon", "stellar", "nibiru"];
|
|
15
|
+
export declare const HUB_CHAIN_IDS: readonly ["sonic"];
|
|
16
|
+
export declare const CHAIN_IDS: readonly ["0xa86a.avax", "0xa4b1.arbitrum", "0x2105.base", "0x38.bsc", "injective-1", "sonic", "sui", "0xa.optimism", "0x89.polygon", "solana", "0x1.icon", "stellar", "nibiru"];
|
|
17
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,0BAA0B,gBAAgB,CAAC;AACxD,eAAO,MAAM,yBAAyB,oBAAoB,CAAC;AAC3D,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AACnD,eAAO,MAAM,oBAAoB,aAAa,CAAC;AAC/C,eAAO,MAAM,0BAA0B,gBAAgB,CAAC;AACxD,eAAO,MAAM,sBAAsB,UAAU,CAAC;AAC9C,eAAO,MAAM,qBAAqB,aAAa,CAAC;AAChD,eAAO,MAAM,oBAAoB,QAAQ,CAAC;AAC1C,eAAO,MAAM,yBAAyB,iBAAiB,CAAC;AACxD,eAAO,MAAM,wBAAwB,iBAAiB,CAAC;AACvD,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAChD,eAAO,MAAM,wBAAwB,YAAY,CAAC;AAClD,eAAO,MAAM,uBAAuB,WAAW,CAAC;AAGhD,eAAO,MAAM,eAAe,yKAalB,CAAC;AAEX,eAAO,MAAM,aAAa,oBAAoC,CAAC;AAE/D,eAAO,MAAM,SAAS,kLAcZ,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// chain ids (actual for evm chains), custom for other chains not having native ids
|
|
2
|
+
export const AVALANCHE_MAINNET_CHAIN_ID = '0xa86a.avax';
|
|
3
|
+
export const ARBITRUM_MAINNET_CHAIN_ID = '0xa4b1.arbitrum';
|
|
4
|
+
export const BASE_MAINNET_CHAIN_ID = '0x2105.base';
|
|
5
|
+
export const BSC_MAINNET_CHAIN_ID = '0x38.bsc';
|
|
6
|
+
export const INJECTIVE_MAINNET_CHAIN_ID = 'injective-1';
|
|
7
|
+
export const SONIC_MAINNET_CHAIN_ID = 'sonic';
|
|
8
|
+
export const ICON_MAINNET_CHAIN_ID = '0x1.icon';
|
|
9
|
+
export const SUI_MAINNET_CHAIN_ID = 'sui';
|
|
10
|
+
export const OPTIMISM_MAINNET_CHAIN_ID = '0xa.optimism';
|
|
11
|
+
export const POLYGON_MAINNET_CHAIN_ID = '0x89.polygon';
|
|
12
|
+
export const SOLANA_MAINNET_CHAIN_ID = 'solana';
|
|
13
|
+
export const STELLAR_MAINNET_CHAIN_ID = 'stellar';
|
|
14
|
+
export const NIBIRU_MAINNET_CHAIN_ID = 'nibiru';
|
|
15
|
+
// currently supported spoke chains
|
|
16
|
+
export const SPOKE_CHAIN_IDS = [
|
|
17
|
+
AVALANCHE_MAINNET_CHAIN_ID,
|
|
18
|
+
ARBITRUM_MAINNET_CHAIN_ID,
|
|
19
|
+
BASE_MAINNET_CHAIN_ID,
|
|
20
|
+
BSC_MAINNET_CHAIN_ID,
|
|
21
|
+
INJECTIVE_MAINNET_CHAIN_ID,
|
|
22
|
+
SUI_MAINNET_CHAIN_ID,
|
|
23
|
+
OPTIMISM_MAINNET_CHAIN_ID,
|
|
24
|
+
POLYGON_MAINNET_CHAIN_ID,
|
|
25
|
+
SOLANA_MAINNET_CHAIN_ID,
|
|
26
|
+
ICON_MAINNET_CHAIN_ID,
|
|
27
|
+
STELLAR_MAINNET_CHAIN_ID,
|
|
28
|
+
NIBIRU_MAINNET_CHAIN_ID,
|
|
29
|
+
];
|
|
30
|
+
export const HUB_CHAIN_IDS = [SONIC_MAINNET_CHAIN_ID];
|
|
31
|
+
export const CHAIN_IDS = [
|
|
32
|
+
AVALANCHE_MAINNET_CHAIN_ID,
|
|
33
|
+
ARBITRUM_MAINNET_CHAIN_ID,
|
|
34
|
+
BASE_MAINNET_CHAIN_ID,
|
|
35
|
+
BSC_MAINNET_CHAIN_ID,
|
|
36
|
+
INJECTIVE_MAINNET_CHAIN_ID,
|
|
37
|
+
SONIC_MAINNET_CHAIN_ID,
|
|
38
|
+
SUI_MAINNET_CHAIN_ID,
|
|
39
|
+
OPTIMISM_MAINNET_CHAIN_ID,
|
|
40
|
+
POLYGON_MAINNET_CHAIN_ID,
|
|
41
|
+
SOLANA_MAINNET_CHAIN_ID,
|
|
42
|
+
ICON_MAINNET_CHAIN_ID,
|
|
43
|
+
STELLAR_MAINNET_CHAIN_ID,
|
|
44
|
+
NIBIRU_MAINNET_CHAIN_ID,
|
|
45
|
+
];
|
|
46
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":"AAAA,mFAAmF;AACnF,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAC;AACxD,MAAM,CAAC,MAAM,yBAAyB,GAAG,iBAAiB,CAAC;AAC3D,MAAM,CAAC,MAAM,qBAAqB,GAAG,aAAa,CAAC;AACnD,MAAM,CAAC,MAAM,oBAAoB,GAAG,UAAU,CAAC;AAC/C,MAAM,CAAC,MAAM,0BAA0B,GAAG,aAAa,CAAC;AACxD,MAAM,CAAC,MAAM,sBAAsB,GAAG,OAAO,CAAC;AAC9C,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAAC;AAChD,MAAM,CAAC,MAAM,oBAAoB,GAAG,KAAK,CAAC;AAC1C,MAAM,CAAC,MAAM,yBAAyB,GAAG,cAAc,CAAC;AACxD,MAAM,CAAC,MAAM,wBAAwB,GAAG,cAAc,CAAC;AACvD,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AAChD,MAAM,CAAC,MAAM,wBAAwB,GAAG,SAAS,CAAC;AAClD,MAAM,CAAC,MAAM,uBAAuB,GAAG,QAAQ,CAAC;AAEhD,mCAAmC;AACnC,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,0BAA0B;IAC1B,yBAAyB;IACzB,qBAAqB;IACrB,oBAAoB;IACpB,0BAA0B;IAC1B,oBAAoB;IACpB,yBAAyB;IACzB,wBAAwB;IACxB,uBAAuB;IACvB,qBAAqB;IACrB,wBAAwB;IACxB,uBAAuB;CACf,CAAC;AAEX,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,sBAAsB,CAAU,CAAC;AAE/D,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,0BAA0B;IAC1B,yBAAyB;IACzB,qBAAqB;IACrB,oBAAoB;IACpB,0BAA0B;IAC1B,sBAAsB;IACtB,oBAAoB;IACpB,yBAAyB;IACzB,wBAAwB;IACxB,uBAAuB;IACvB,qBAAqB;IACrB,wBAAwB;IACxB,uBAAuB;CACf,CAAC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import type { Address, Hex, Hash, WalletAddressProvider } from '../common/index.js';
|
|
2
|
+
export type EvmRawTransaction = {
|
|
3
|
+
from: Address;
|
|
4
|
+
to: Address;
|
|
5
|
+
value: bigint;
|
|
6
|
+
data: Hex;
|
|
7
|
+
};
|
|
8
|
+
export type EvmRawLog = {
|
|
9
|
+
address: Address;
|
|
10
|
+
topics: [Hex, ...Hex[]] | [];
|
|
11
|
+
data: Hex;
|
|
12
|
+
blockHash: Hash | null;
|
|
13
|
+
blockNumber: Address | null;
|
|
14
|
+
logIndex: Hex | null;
|
|
15
|
+
transactionHash: Hash | null;
|
|
16
|
+
transactionIndex: Hex | null;
|
|
17
|
+
removed: boolean;
|
|
18
|
+
};
|
|
19
|
+
export type EvmRawTransactionReceipt = {
|
|
20
|
+
transactionHash: string;
|
|
21
|
+
transactionIndex: string;
|
|
22
|
+
blockHash: string;
|
|
23
|
+
blockNumber: string;
|
|
24
|
+
from: string;
|
|
25
|
+
to: string | null;
|
|
26
|
+
cumulativeGasUsed: string;
|
|
27
|
+
gasUsed: string;
|
|
28
|
+
contractAddress: string | null;
|
|
29
|
+
logs: EvmRawLog[];
|
|
30
|
+
logsBloom: string;
|
|
31
|
+
status?: string;
|
|
32
|
+
type?: string;
|
|
33
|
+
effectiveGasPrice?: string;
|
|
34
|
+
};
|
|
35
|
+
export interface IEvmWalletProvider extends WalletAddressProvider {
|
|
36
|
+
getWalletAddress: () => Promise<Address>;
|
|
37
|
+
getWalletAddressBytes: () => Promise<Hex>;
|
|
38
|
+
sendTransaction: (evmRawTx: EvmRawTransaction) => Promise<Hash>;
|
|
39
|
+
waitForTransactionReceipt: (txHash: Hash) => Promise<EvmRawTransactionReceipt>;
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/evm/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,IAAI,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEpF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,IAAI,EAAE,OAAO,CAAC;IACd,EAA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AE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAChE,yBAAyB,EAAE,CAAC,MAAM,EAAE,IAAI,KAAK,OAAO,CAAC,wBAAwB,CAAC,CAAC;CAChF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/evm/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type { Hex, WalletAddressProvider, Hash } from '../common/index.js';
|
|
2
|
+
export type IconEoaAddress = `hx${string}`;
|
|
3
|
+
export type IcxCallTransaction = {
|
|
4
|
+
to: string;
|
|
5
|
+
from: string;
|
|
6
|
+
nid: Hex;
|
|
7
|
+
value: Hex;
|
|
8
|
+
method: string;
|
|
9
|
+
params: object;
|
|
10
|
+
version?: Hex;
|
|
11
|
+
timestamp?: number;
|
|
12
|
+
};
|
|
13
|
+
export type IconTransactionResult = {
|
|
14
|
+
status: number;
|
|
15
|
+
to: string;
|
|
16
|
+
txHash: string;
|
|
17
|
+
txIndex: number;
|
|
18
|
+
blockHeight: number;
|
|
19
|
+
blockHash: string;
|
|
20
|
+
cumulativeStepUsed: bigint;
|
|
21
|
+
stepUsed: bigint;
|
|
22
|
+
stepPrice: bigint;
|
|
23
|
+
scoreAddress?: string;
|
|
24
|
+
eventLogs?: unknown;
|
|
25
|
+
logsBloom?: unknown;
|
|
26
|
+
failure?: {
|
|
27
|
+
code: string;
|
|
28
|
+
message: string;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export interface IIconWalletProvider extends WalletAddressProvider {
|
|
32
|
+
getWalletAddress: () => Promise<IconEoaAddress>;
|
|
33
|
+
getWalletAddressBytes: () => Promise<Hex>;
|
|
34
|
+
sendTransaction: (iconRawTx: IcxCallTransaction) => Promise<Hash>;
|
|
35
|
+
waitForTransactionReceipt: (txHash: Hash) => Promise<IconTransactionResult>;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=index.d.ts.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AAS,EAAE,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IAClE,yBAAyB,EAAE,CAAC,MAAM,EAAE,IAAI,KAAK,OAAO,CAAC,qBAAqB,CAAC,CAAC;CAC7E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/icon/index.ts"],"names":[],"mappings":""}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,iBAAiB,CAAC;AAChC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { WalletAddressProvider } from '../common/index.js';
|
|
2
|
+
export type XDR = string;
|
|
3
|
+
export type StellarRawTransactionReceipt = {
|
|
4
|
+
_links: {
|
|
5
|
+
self: {
|
|
6
|
+
href: string;
|
|
7
|
+
};
|
|
8
|
+
account: {
|
|
9
|
+
href: string;
|
|
10
|
+
};
|
|
11
|
+
ledger: {
|
|
12
|
+
href: string;
|
|
13
|
+
};
|
|
14
|
+
operations: {
|
|
15
|
+
href: string;
|
|
16
|
+
};
|
|
17
|
+
effects: {
|
|
18
|
+
href: string;
|
|
19
|
+
};
|
|
20
|
+
precedes: {
|
|
21
|
+
href: string;
|
|
22
|
+
};
|
|
23
|
+
succeeds: {
|
|
24
|
+
href: string;
|
|
25
|
+
};
|
|
26
|
+
transaction: {
|
|
27
|
+
href: string;
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
id: string;
|
|
31
|
+
paging_token: string;
|
|
32
|
+
successful: boolean;
|
|
33
|
+
hash: string;
|
|
34
|
+
ledger_attr: number;
|
|
35
|
+
created_at: string;
|
|
36
|
+
source_account: string;
|
|
37
|
+
source_account_sequence: string;
|
|
38
|
+
fee_account: string;
|
|
39
|
+
fee_bump_transaction?: {
|
|
40
|
+
hash: string;
|
|
41
|
+
signatures: string[];
|
|
42
|
+
};
|
|
43
|
+
inner_transaction?: {
|
|
44
|
+
hash: string;
|
|
45
|
+
signatures: string[];
|
|
46
|
+
};
|
|
47
|
+
envelope_xdr: XDR;
|
|
48
|
+
result_xdr: XDR;
|
|
49
|
+
result_meta_xdr: XDR;
|
|
50
|
+
fee_meta_xdr: XDR;
|
|
51
|
+
memo?: string;
|
|
52
|
+
memo_type?: string;
|
|
53
|
+
signatures: XDR[];
|
|
54
|
+
valid_after?: string;
|
|
55
|
+
valid_before?: string;
|
|
56
|
+
fee_charged: number;
|
|
57
|
+
max_fee: number;
|
|
58
|
+
operation_count: number;
|
|
59
|
+
};
|
|
60
|
+
export type StellarRawTransaction = {
|
|
61
|
+
from: string;
|
|
62
|
+
to: string;
|
|
63
|
+
value: bigint;
|
|
64
|
+
data: string;
|
|
65
|
+
};
|
|
66
|
+
export interface IStellarWalletProvider extends WalletAddressProvider {
|
|
67
|
+
signTransaction: (tx: XDR) => Promise<XDR>;
|
|
68
|
+
waitForTransactionReceipt: (txHash: string) => Promise<StellarRawTransactionReceipt>;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stellar/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE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,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,GAAG,EAAE,CAAC;IAClB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;CACzB,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,IAAI,EAAE,MAAM,CAAC;IACb,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,MAAM,WAAW,sBAAuB,SAAQ,qBAAqB;IACnE,eAAe,EAAE,CAAC,EAAE,EAAE,GAAG,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IAC3C,yBAAyB,EAAE,CAAC,MAAM,EAAE,MAAM,KAAK,OAAO,CAAC,4BAA4B,CAAC,CAAC;CACtF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stellar/index.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { WalletAddressProvider, Address, Hex } from '../common/index.js';
|
|
2
|
+
export type SuiTransaction = {
|
|
3
|
+
toJSON: () => Promise<string>;
|
|
4
|
+
};
|
|
5
|
+
export type SuiArgument = 'GasCoin' | {
|
|
6
|
+
Input: number;
|
|
7
|
+
} | {
|
|
8
|
+
Result: number;
|
|
9
|
+
};
|
|
10
|
+
export interface SuiExecutionResult {
|
|
11
|
+
mutableReferenceOutputs?: [SuiArgument, number[], string][];
|
|
12
|
+
returnValues?: [number[], string][];
|
|
13
|
+
}
|
|
14
|
+
export interface SuiCoinStruct {
|
|
15
|
+
balance: string;
|
|
16
|
+
coinObjectId: string;
|
|
17
|
+
coinType: string;
|
|
18
|
+
digest: string;
|
|
19
|
+
previousTransaction: string;
|
|
20
|
+
version: string;
|
|
21
|
+
}
|
|
22
|
+
export interface SuiPaginatedCoins {
|
|
23
|
+
data: SuiCoinStruct[];
|
|
24
|
+
hasNextPage: boolean;
|
|
25
|
+
nextCursor?: string | null;
|
|
26
|
+
}
|
|
27
|
+
export interface ISuiWalletProvider extends WalletAddressProvider {
|
|
28
|
+
getWalletAddress: () => Promise<Address>;
|
|
29
|
+
getWalletAddressBytes: () => Promise<Hex>;
|
|
30
|
+
signAndExecuteTxn: (txn: SuiTransaction) => Promise<Hex>;
|
|
31
|
+
viewContract(tx: SuiTransaction, packageId: string, module: string, functionName: string, args: unknown[], typeArgs: string[]): Promise<SuiExecutionResult>;
|
|
32
|
+
getCoins: (address: string, token: string) => Promise<SuiPaginatedCoins>;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sui/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAC;AAE9E,MAAM,MAAM,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,WAAW,GACnB,SAAS,GACT;IACE,KAAK,EAAE,MAAM,CAAC;CACf,GACD;IACE,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEN,MAAM,WAAW,kBAAkB;IACjC,uBAAuB,CAAC,EAAE,CAAC,WAAW,EAAE,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;IAC5D,YAAY,CAAC,EAAE,CAAC,MAAM,EAAE,EAAE,MAAM,CAAC,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,EAAE,MAAM,CAAC;IAC5B,OAAO,EAAE,MAAM,CAAC;CACjB;AACD,MAAM,WAAW,iBAAiB;IAChC,IAAI,EAAE,aAAa,EAAE,CAAC;IACtB,WAAW,EAAE,OAAO,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,kBAAmB,SAAQ,qBAAqB;IAC/D,gBAAgB,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,CAAC;IACzC,qBAAqB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAC1C,iBAAiB,EAAE,CAAC,GAAG,EAAE,cAAc,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;IACzD,YAAY,CACV,EAAE,EAAE,cAAc,EAClB,SAAS,EAAE,MAAM,EACjB,MAAM,EAAE,MAAM,EACd,YAAY,EAAE,MAAM,EACpB,IAAI,EAAE,OAAO,EAAE,EACf,QAAQ,EAAE,MAAM,EAAE,GACjB,OAAO,CAAC,kBAAkB,CAAC,CAAC;IAC/B,QAAQ,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,iBAAiB,CAAC,CAAC;CAC1E"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sui/index.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sodax/types",
|
|
3
|
+
"private": false,
|
|
4
|
+
"publishConfig": {
|
|
5
|
+
"access": "public"
|
|
6
|
+
},
|
|
7
|
+
"version": "0.0.1-rc.1",
|
|
8
|
+
"description": "Sodax Types",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"homepage": "https://github.com/icon-project/sodax-frontend/tree/main/packages/types",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/icon-project/sodax-frontend/issues"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/icon-project/sodax-frontend"
|
|
17
|
+
},
|
|
18
|
+
"files": [
|
|
19
|
+
"dist"
|
|
20
|
+
],
|
|
21
|
+
"type": "module",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"types": "./dist/index.d.ts",
|
|
25
|
+
"import": "./dist/index.js",
|
|
26
|
+
"default": "./dist/index.js"
|
|
27
|
+
},
|
|
28
|
+
"./package.json": "./package.json"
|
|
29
|
+
},
|
|
30
|
+
"devDependencies": {
|
|
31
|
+
"typescript": "5.5.4",
|
|
32
|
+
"@repo/typescript-config": "0.0.0"
|
|
33
|
+
},
|
|
34
|
+
"keywords": [],
|
|
35
|
+
"author": "",
|
|
36
|
+
"license": "ISC",
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "tsc",
|
|
39
|
+
"dev": "tsc --watch",
|
|
40
|
+
"ci": "pnpm run pretty && pnpm run build && pnpm run test",
|
|
41
|
+
"checkTs": "tsc",
|
|
42
|
+
"pretty": "biome format . --write",
|
|
43
|
+
"lint": "biome lint . --write",
|
|
44
|
+
"check-exports": "attw $(pnpm pack) --ignore-rules=cjs-resolves-to-esm",
|
|
45
|
+
"clean": "rm -rf node_modules && rm -rf dist && rm -rf .turbo"
|
|
46
|
+
}
|
|
47
|
+
}
|