@sodax/types 1.5.6-beta → 2.0.0-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/README.md +49 -21
- package/dist/backend/backendApi.d.ts +75 -0
- package/dist/backend/backendApi.d.ts.map +1 -0
- package/dist/backend/backendApi.js +2 -0
- package/dist/backend/backendApi.js.map +1 -0
- package/dist/backend/index.d.ts +1 -80
- package/dist/backend/index.d.ts.map +1 -1
- package/dist/backend/index.js +1 -1
- package/dist/backend/index.js.map +1 -1
- package/dist/{btc/index.d.ts → bitcoin/bitcoin.d.ts} +31 -31
- package/dist/bitcoin/bitcoin.d.ts.map +1 -0
- package/dist/{btc/index.js → bitcoin/bitcoin.js} +5 -4
- package/dist/bitcoin/bitcoin.js.map +1 -0
- package/dist/bitcoin/index.d.ts +2 -0
- package/dist/bitcoin/index.d.ts.map +1 -0
- package/dist/bitcoin/index.js +2 -0
- package/dist/bitcoin/index.js.map +1 -0
- package/dist/chains/chain-keys.d.ts +31 -0
- package/dist/chains/chain-keys.d.ts.map +1 -0
- package/dist/chains/chain-keys.js +39 -0
- package/dist/chains/chain-keys.js.map +1 -0
- package/dist/chains/chains.d.ts +3491 -0
- package/dist/chains/chains.d.ts.map +1 -0
- package/dist/chains/chains.js +712 -0
- package/dist/chains/chains.js.map +1 -0
- package/dist/chains/index.d.ts +3 -0
- package/dist/chains/index.d.ts.map +1 -0
- package/dist/chains/index.js +3 -0
- package/dist/chains/index.js.map +1 -0
- package/dist/chains/tokens.d.ts +4390 -0
- package/dist/chains/tokens.d.ts.map +1 -0
- package/dist/chains/tokens.js +2139 -0
- package/dist/chains/tokens.js.map +1 -0
- package/dist/common/common.d.ts +282 -0
- package/dist/common/common.d.ts.map +1 -0
- package/dist/common/common.js +30 -0
- package/dist/common/common.js.map +1 -0
- package/dist/common/constants.d.ts +70 -0
- package/dist/common/constants.d.ts.map +1 -0
- package/dist/common/constants.js +31 -0
- package/dist/common/constants.js.map +1 -0
- package/dist/common/index.d.ts +2 -274
- package/dist/common/index.d.ts.map +1 -1
- package/dist/common/index.js +2 -1
- package/dist/common/index.js.map +1 -1
- package/dist/dex/dex.d.ts +268 -0
- package/dist/dex/dex.d.ts.map +1 -0
- package/dist/dex/dex.js +128 -0
- package/dist/dex/dex.js.map +1 -0
- package/dist/dex/index.d.ts +2 -0
- package/dist/dex/index.d.ts.map +1 -0
- package/dist/dex/index.js +2 -0
- package/dist/dex/index.js.map +1 -0
- package/dist/dex/pancakeswap-infinity.d.ts +539 -0
- package/dist/dex/pancakeswap-infinity.d.ts.map +1 -0
- package/dist/dex/pancakeswap-infinity.js +3 -0
- package/dist/dex/pancakeswap-infinity.js.map +1 -0
- package/dist/evm/evm.d.ts +48 -0
- package/dist/evm/evm.d.ts.map +1 -0
- package/dist/evm/evm.js +2 -0
- package/dist/evm/evm.js.map +1 -0
- package/dist/evm/index.d.ts +1 -39
- package/dist/evm/index.d.ts.map +1 -1
- package/dist/evm/index.js +1 -1
- package/dist/evm/index.js.map +1 -1
- package/dist/icon/icon.d.ts +55 -0
- package/dist/icon/icon.d.ts.map +1 -0
- package/dist/icon/icon.js +2 -0
- package/dist/icon/icon.js.map +1 -0
- package/dist/icon/index.d.ts +1 -35
- package/dist/icon/index.d.ts.map +1 -1
- package/dist/icon/index.js +1 -1
- package/dist/icon/index.js.map +1 -1
- package/dist/index.d.ts +15 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +15 -7
- package/dist/index.js.map +1 -1
- package/dist/injective/index.d.ts +1 -67
- package/dist/injective/index.d.ts.map +1 -1
- package/dist/injective/index.js +1 -16
- package/dist/injective/index.js.map +1 -1
- package/dist/injective/injective.d.ts +103 -0
- package/dist/injective/injective.d.ts.map +1 -0
- package/dist/injective/injective.js +2 -0
- package/dist/injective/injective.js.map +1 -0
- package/dist/moneyMarket/index.d.ts +2 -0
- package/dist/moneyMarket/index.d.ts.map +1 -0
- package/dist/moneyMarket/index.js +2 -0
- package/dist/moneyMarket/index.js.map +1 -0
- package/dist/moneyMarket/moneyMarket.d.ts +2440 -0
- package/dist/moneyMarket/moneyMarket.d.ts.map +1 -0
- package/dist/moneyMarket/moneyMarket.js +194 -0
- package/dist/moneyMarket/moneyMarket.js.map +1 -0
- package/dist/near/index.d.ts +1 -69
- package/dist/near/index.d.ts.map +1 -1
- package/dist/near/index.js +1 -1
- package/dist/near/index.js.map +1 -1
- package/dist/near/near-api-js.d.ts +6119 -0
- package/dist/near/near-api-js.d.ts.map +1 -0
- package/dist/near/near-api-js.js +2 -0
- package/dist/near/near-api-js.js.map +1 -0
- package/dist/near/near.d.ts +75 -0
- package/dist/near/near.d.ts.map +1 -0
- package/dist/near/near.js +2 -0
- package/dist/near/near.js.map +1 -0
- package/dist/shared/index.d.ts +2 -0
- package/dist/shared/index.d.ts.map +1 -0
- package/dist/shared/index.js +2 -0
- package/dist/shared/index.js.map +1 -0
- package/dist/shared/shared.d.ts +17 -0
- package/dist/shared/shared.d.ts.map +1 -0
- package/dist/shared/shared.js +6 -0
- package/dist/shared/shared.js.map +1 -0
- package/dist/sodax-config/index.d.ts +2 -0
- package/dist/sodax-config/index.d.ts.map +1 -0
- package/dist/sodax-config/index.js +2 -0
- package/dist/sodax-config/index.js.map +1 -0
- package/dist/sodax-config/sodax-config.d.ts +6070 -0
- package/dist/{constants/index.d.ts.map → sodax-config/sodax-config.d.ts.map} +1 -1
- package/dist/sodax-config/sodax-config.js +22 -0
- package/dist/sodax-config/sodax-config.js.map +1 -0
- package/dist/solana/index.d.ts +1 -99
- package/dist/solana/index.d.ts.map +1 -1
- package/dist/solana/index.js +1 -1
- package/dist/solana/index.js.map +1 -1
- package/dist/solana/solana-web3.d.ts +390 -0
- package/dist/solana/solana-web3.d.ts.map +1 -0
- package/dist/solana/solana-web3.js +2 -0
- package/dist/solana/solana-web3.js.map +1 -0
- package/dist/solana/solana.d.ts +111 -0
- package/dist/solana/solana.d.ts.map +1 -0
- package/dist/solana/solana.js +2 -0
- package/dist/solana/solana.js.map +1 -0
- package/dist/stacks/index.d.ts +1 -16
- package/dist/stacks/index.d.ts.map +1 -1
- package/dist/stacks/index.js +1 -1
- package/dist/stacks/index.js.map +1 -1
- package/dist/stacks/stacks.d.ts +211 -0
- package/dist/stacks/stacks.d.ts.map +1 -0
- package/dist/stacks/stacks.js +2 -0
- package/dist/stacks/stacks.js.map +1 -0
- package/dist/stellar/index.d.ts +1 -69
- package/dist/stellar/index.d.ts.map +1 -1
- package/dist/stellar/index.js +1 -1
- package/dist/stellar/index.js.map +1 -1
- package/dist/stellar/stellar.d.ts +97 -0
- package/dist/stellar/stellar.d.ts.map +1 -0
- package/dist/stellar/stellar.js +2 -0
- package/dist/stellar/stellar.js.map +1 -0
- package/dist/sui/index.d.ts +1 -32
- package/dist/sui/index.d.ts.map +1 -1
- package/dist/sui/index.js +1 -1
- package/dist/sui/index.js.map +1 -1
- package/dist/sui/sui.d.ts +312 -0
- package/dist/sui/sui.d.ts.map +1 -0
- package/dist/sui/sui.js +2 -0
- package/dist/sui/sui.js.map +1 -0
- package/dist/swap/index.d.ts +2 -0
- package/dist/swap/index.d.ts.map +1 -0
- package/dist/swap/index.js +2 -0
- package/dist/swap/index.js.map +1 -0
- package/dist/swap/swap.d.ts +3369 -0
- package/dist/swap/swap.d.ts.map +1 -0
- package/dist/swap/swap.js +242 -0
- package/dist/swap/swap.js.map +1 -0
- package/dist/utils/deep-partial.d.ts +9 -0
- package/dist/utils/deep-partial.d.ts.map +1 -0
- package/dist/utils/deep-partial.js +2 -0
- package/dist/utils/deep-partial.js.map +1 -0
- package/dist/utils/index.d.ts +3 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +3 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/utils.d.ts +61 -0
- package/dist/utils/utils.d.ts.map +1 -0
- package/dist/utils/utils.js +144 -0
- package/dist/utils/utils.js.map +1 -0
- package/dist/wallet/index.d.ts +3 -0
- package/dist/wallet/index.d.ts.map +1 -0
- package/dist/wallet/index.js +3 -0
- package/dist/wallet/index.js.map +1 -0
- package/dist/wallet/providers.d.ts +24 -0
- package/dist/wallet/providers.d.ts.map +1 -0
- package/dist/wallet/providers.js +2 -0
- package/dist/wallet/providers.js.map +1 -0
- package/dist/wallet/wallet.d.ts +19 -0
- package/dist/wallet/wallet.d.ts.map +1 -0
- package/dist/wallet/wallet.js +2 -0
- package/dist/wallet/wallet.js.map +1 -0
- package/package.json +17 -9
- package/dist/btc/index.d.ts.map +0 -1
- package/dist/btc/index.js.map +0 -1
- package/dist/constants/index.d.ts +0 -7228
- package/dist/constants/index.js +0 -3204
- package/dist/constants/index.js.map +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import type { Base64String } from '../shared/shared.js';
|
|
2
|
+
import type { ICoreWallet } from '../wallet/wallet.js';
|
|
3
|
+
import type { VersionedTransactionResponse } from './solana-web3.js';
|
|
4
|
+
export type SolanaEoaAddress = string;
|
|
5
|
+
export type TransactionSignature = string;
|
|
6
|
+
export type SolanaSerializedTransaction = Uint8Array;
|
|
7
|
+
export type SolanaBase58PublicKey = string;
|
|
8
|
+
export type SolanaRawTransaction = {
|
|
9
|
+
from: SolanaBase58PublicKey;
|
|
10
|
+
to: SolanaBase58PublicKey;
|
|
11
|
+
value: bigint;
|
|
12
|
+
data: Base64String;
|
|
13
|
+
};
|
|
14
|
+
export type SolanaReturnType<Raw extends boolean> = Raw extends true ? SolanaRawTransaction : Raw extends false ? string : SolanaRawTransaction | string;
|
|
15
|
+
type Context = {
|
|
16
|
+
slot: number;
|
|
17
|
+
};
|
|
18
|
+
export type SolanaAccountMeta = {
|
|
19
|
+
/** An account's public key */
|
|
20
|
+
pubkey: SolanaBase58PublicKey;
|
|
21
|
+
/** True if an instruction requires a transaction signature matching `pubkey` */
|
|
22
|
+
isSigner: boolean;
|
|
23
|
+
/** True if the `pubkey` can be loaded as a read-write account. */
|
|
24
|
+
isWritable: boolean;
|
|
25
|
+
};
|
|
26
|
+
export type SolanaRawTransactionInstruction = {
|
|
27
|
+
/**
|
|
28
|
+
* Public keys to include in this transaction
|
|
29
|
+
* Boolean represents whether this pubkey needs to sign the transaction
|
|
30
|
+
*/
|
|
31
|
+
keys: Array<SolanaAccountMeta>;
|
|
32
|
+
/**
|
|
33
|
+
* Program Id to execute
|
|
34
|
+
*/
|
|
35
|
+
programId: SolanaBase58PublicKey;
|
|
36
|
+
/**
|
|
37
|
+
* Program input
|
|
38
|
+
*/
|
|
39
|
+
data: Uint8Array;
|
|
40
|
+
};
|
|
41
|
+
export type SolanaTokenAmount = {
|
|
42
|
+
/** Raw amount of tokens as string ignoring decimals */
|
|
43
|
+
amount: string;
|
|
44
|
+
/** Number of decimals configured for token's mint */
|
|
45
|
+
decimals: number;
|
|
46
|
+
/** Token amount as float, accounts for decimals */
|
|
47
|
+
uiAmount: number | null;
|
|
48
|
+
/** Token amount as string, accounts for decimals */
|
|
49
|
+
uiAmountString?: string;
|
|
50
|
+
};
|
|
51
|
+
type TokenAmount = {
|
|
52
|
+
/** Raw amount of tokens as string ignoring decimals */
|
|
53
|
+
amount: string;
|
|
54
|
+
/** Number of decimals configured for token's mint */
|
|
55
|
+
decimals: number;
|
|
56
|
+
/** Token amount as float, accounts for decimals */
|
|
57
|
+
uiAmount: number | null;
|
|
58
|
+
/** Token amount as string, accounts for decimals */
|
|
59
|
+
uiAmountString?: string;
|
|
60
|
+
};
|
|
61
|
+
export type SolanaRpcResponseAndContext<T> = {
|
|
62
|
+
/** response context */
|
|
63
|
+
context: Context;
|
|
64
|
+
/** response value */
|
|
65
|
+
value: T;
|
|
66
|
+
};
|
|
67
|
+
export type SolanaSignatureResult = {
|
|
68
|
+
err: TransactionError | null;
|
|
69
|
+
};
|
|
70
|
+
type RpcResponseAndContext<T> = {
|
|
71
|
+
/** response context */
|
|
72
|
+
context: Context;
|
|
73
|
+
/** response value */
|
|
74
|
+
value: T;
|
|
75
|
+
};
|
|
76
|
+
export type Commitment = 'processed' | 'confirmed' | 'finalized' | 'recent' | 'single' | 'singleGossip' | 'root' | 'max';
|
|
77
|
+
type TransactionError = {} | string;
|
|
78
|
+
export type RawTransaction = {
|
|
79
|
+
signatures: {
|
|
80
|
+
publicKey: string;
|
|
81
|
+
signature: string | null;
|
|
82
|
+
}[];
|
|
83
|
+
message: {
|
|
84
|
+
header: {
|
|
85
|
+
numRequiredSignatures: number;
|
|
86
|
+
numReadonlySignedAccounts: number;
|
|
87
|
+
numReadonlyUnsignedAccounts: number;
|
|
88
|
+
};
|
|
89
|
+
accountKeys: string[];
|
|
90
|
+
recentBlockhash: string;
|
|
91
|
+
instructions: {
|
|
92
|
+
programIdIndex: number;
|
|
93
|
+
accounts: number[];
|
|
94
|
+
data: string;
|
|
95
|
+
}[];
|
|
96
|
+
};
|
|
97
|
+
};
|
|
98
|
+
export type SolanaRawTransactionReceipt = VersionedTransactionResponse;
|
|
99
|
+
export interface ISolanaWalletProvider extends ICoreWallet {
|
|
100
|
+
readonly chainType: 'SOLANA';
|
|
101
|
+
getWalletAddress: () => Promise<string>;
|
|
102
|
+
sendTransaction: (rawTransaction: Uint8Array | Array<number>) => Promise<TransactionSignature>;
|
|
103
|
+
waitForConfirmation: (signature: TransactionSignature, commitment: Commitment) => Promise<SolanaRpcResponseAndContext<SolanaSignatureResult>>;
|
|
104
|
+
buildV0Txn: (instructions: SolanaRawTransactionInstruction[]) => Promise<SolanaSerializedTransaction>;
|
|
105
|
+
getWalletBase58PublicKey: () => SolanaBase58PublicKey;
|
|
106
|
+
getAssociatedTokenAddress: (mint: SolanaBase58PublicKey) => Promise<SolanaBase58PublicKey>;
|
|
107
|
+
getBalance: (publicKey: SolanaBase58PublicKey) => Promise<number>;
|
|
108
|
+
getTokenAccountBalance: (publicKey: SolanaBase58PublicKey) => Promise<RpcResponseAndContext<TokenAmount>>;
|
|
109
|
+
}
|
|
110
|
+
export {};
|
|
111
|
+
//# sourceMappingURL=solana.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3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-1,17 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
import type { WalletAddressProvider } from '../common/index.js';
|
|
3
|
-
export type StacksTransactionParams = {
|
|
4
|
-
contractAddress: string;
|
|
5
|
-
contractName: string;
|
|
6
|
-
functionName: string;
|
|
7
|
-
functionArgs: ClarityValue[];
|
|
8
|
-
postConditionMode?: PostConditionMode;
|
|
9
|
-
postConditions?: PostCondition[];
|
|
10
|
-
};
|
|
11
|
-
export interface IStacksWalletProvider extends WalletAddressProvider {
|
|
12
|
-
getWalletAddress: () => Promise<string>;
|
|
13
|
-
getBalance: (address: string) => Promise<bigint>;
|
|
14
|
-
sendTransaction: (txParams: StacksTransactionParams) => Promise<string>;
|
|
15
|
-
readContract: (txParams: StacksTransactionParams) => Promise<ClarityValue>;
|
|
16
|
-
}
|
|
1
|
+
export * from './stacks.js';
|
|
17
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stacks/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stacks/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
package/dist/stacks/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './stacks.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/stacks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stacks/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stacks/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC"}
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
import type { ICoreWallet } from '../wallet/wallet.js';
|
|
2
|
+
export type StacksRawTransaction = {
|
|
3
|
+
payload: string;
|
|
4
|
+
estimatedLength?: number;
|
|
5
|
+
};
|
|
6
|
+
export type StacksReturnType<Raw extends boolean> = Raw extends true ? StacksRawTransaction : Raw extends false ? string : StacksRawTransaction | string;
|
|
7
|
+
export declare enum PostConditionMode {
|
|
8
|
+
Allow = 1,
|
|
9
|
+
Deny = 2
|
|
10
|
+
}
|
|
11
|
+
export type AssetString = `${ContractIdString}::${string}`;
|
|
12
|
+
export type FungibleComparator = 'eq' | 'gt' | 'gte' | 'lt' | 'lte';
|
|
13
|
+
export interface StxPostCondition {
|
|
14
|
+
type: 'stx-postcondition';
|
|
15
|
+
address: string;
|
|
16
|
+
condition: `${FungibleComparator}`;
|
|
17
|
+
amount: string | bigint | number;
|
|
18
|
+
}
|
|
19
|
+
export type FungiblePostCondition = {
|
|
20
|
+
type: 'ft-postcondition';
|
|
21
|
+
address: string;
|
|
22
|
+
condition: `${FungibleComparator}`;
|
|
23
|
+
asset: AssetString;
|
|
24
|
+
amount: string | bigint | number;
|
|
25
|
+
};
|
|
26
|
+
export type NonFungibleComparator = 'sent' | 'not-sent';
|
|
27
|
+
export type NonFungiblePostCondition = {
|
|
28
|
+
type: 'nft-postcondition';
|
|
29
|
+
address: string;
|
|
30
|
+
condition: `${NonFungibleComparator}`;
|
|
31
|
+
asset: AssetString;
|
|
32
|
+
assetId: ClarityValue;
|
|
33
|
+
};
|
|
34
|
+
export type PostCondition = StxPostCondition | FungiblePostCondition | NonFungiblePostCondition;
|
|
35
|
+
export type PostConditionModeName = 'allow' | 'deny';
|
|
36
|
+
export type ContractIdString = `${string}.${string}`;
|
|
37
|
+
export declare enum ClarityType {
|
|
38
|
+
Int = "int",
|
|
39
|
+
UInt = "uint",
|
|
40
|
+
Buffer = "buffer",
|
|
41
|
+
BoolTrue = "true",
|
|
42
|
+
BoolFalse = "false",
|
|
43
|
+
PrincipalStandard = "address",
|
|
44
|
+
PrincipalContract = "contract",
|
|
45
|
+
ResponseOk = "ok",
|
|
46
|
+
ResponseErr = "err",
|
|
47
|
+
OptionalNone = "none",
|
|
48
|
+
OptionalSome = "some",
|
|
49
|
+
List = "list",
|
|
50
|
+
Tuple = "tuple",
|
|
51
|
+
StringASCII = "ascii",
|
|
52
|
+
StringUTF8 = "utf8"
|
|
53
|
+
}
|
|
54
|
+
export declare enum ClarityWireType {
|
|
55
|
+
int = 0,
|
|
56
|
+
uint = 1,
|
|
57
|
+
buffer = 2,
|
|
58
|
+
true = 3,
|
|
59
|
+
false = 4,
|
|
60
|
+
address = 5,
|
|
61
|
+
contract = 6,
|
|
62
|
+
ok = 7,
|
|
63
|
+
err = 8,
|
|
64
|
+
none = 9,
|
|
65
|
+
some = 10,
|
|
66
|
+
list = 11,
|
|
67
|
+
tuple = 12,
|
|
68
|
+
ascii = 13,
|
|
69
|
+
utf8 = 14
|
|
70
|
+
}
|
|
71
|
+
export type BooleanCV = TrueCV | FalseCV;
|
|
72
|
+
export interface TrueCV {
|
|
73
|
+
type: ClarityType.BoolTrue;
|
|
74
|
+
}
|
|
75
|
+
export interface FalseCV {
|
|
76
|
+
type: ClarityType.BoolFalse;
|
|
77
|
+
}
|
|
78
|
+
export interface BufferCV {
|
|
79
|
+
readonly type: ClarityType.Buffer;
|
|
80
|
+
readonly value: string;
|
|
81
|
+
}
|
|
82
|
+
export interface IntCV {
|
|
83
|
+
readonly type: ClarityType.Int;
|
|
84
|
+
readonly value: bigint | number | string;
|
|
85
|
+
}
|
|
86
|
+
export interface UIntCV {
|
|
87
|
+
readonly type: ClarityType.UInt;
|
|
88
|
+
readonly value: bigint | number | string;
|
|
89
|
+
}
|
|
90
|
+
export interface ListCV<T extends ClarityValue = ClarityValue> {
|
|
91
|
+
type: ClarityType.List;
|
|
92
|
+
value: T[];
|
|
93
|
+
}
|
|
94
|
+
export type OptionalCV<T extends ClarityValue = ClarityValue> = NoneCV | SomeCV<T>;
|
|
95
|
+
export interface NoneCV {
|
|
96
|
+
readonly type: ClarityType.OptionalNone;
|
|
97
|
+
}
|
|
98
|
+
export interface SomeCV<T extends ClarityValue = ClarityValue> {
|
|
99
|
+
readonly type: ClarityType.OptionalSome;
|
|
100
|
+
readonly value: T;
|
|
101
|
+
}
|
|
102
|
+
export type PrincipalCV = StandardPrincipalCV | ContractPrincipalCV;
|
|
103
|
+
export interface StandardPrincipalCV {
|
|
104
|
+
readonly type: ClarityType.PrincipalStandard;
|
|
105
|
+
readonly value: string;
|
|
106
|
+
}
|
|
107
|
+
export interface ContractPrincipalCV {
|
|
108
|
+
readonly type: ClarityType.PrincipalContract;
|
|
109
|
+
readonly value: ContractIdString;
|
|
110
|
+
}
|
|
111
|
+
export type ResponseCV = ResponseErrorCV | ResponseOkCV;
|
|
112
|
+
export interface ResponseErrorCV<T extends ClarityValue = ClarityValue> {
|
|
113
|
+
readonly type: ClarityType.ResponseErr;
|
|
114
|
+
readonly value: T;
|
|
115
|
+
}
|
|
116
|
+
export interface ResponseOkCV<T extends ClarityValue = ClarityValue> {
|
|
117
|
+
readonly type: ClarityType.ResponseOk;
|
|
118
|
+
readonly value: T;
|
|
119
|
+
}
|
|
120
|
+
export interface StringAsciiCV {
|
|
121
|
+
readonly type: ClarityType.StringASCII;
|
|
122
|
+
readonly value: string;
|
|
123
|
+
}
|
|
124
|
+
export interface StringUtf8CV {
|
|
125
|
+
readonly type: ClarityType.StringUTF8;
|
|
126
|
+
readonly value: string;
|
|
127
|
+
}
|
|
128
|
+
export type TupleData<T extends ClarityValue = ClarityValue> = {
|
|
129
|
+
[key: string]: T;
|
|
130
|
+
};
|
|
131
|
+
export interface TupleCV<T extends TupleData = TupleData> {
|
|
132
|
+
type: ClarityType.Tuple;
|
|
133
|
+
value: T;
|
|
134
|
+
}
|
|
135
|
+
export type ClarityValue = BooleanCV | BufferCV | IntCV | UIntCV | StandardPrincipalCV | ContractPrincipalCV | ResponseErrorCV | ResponseOkCV | NoneCV | SomeCV | ListCV | TupleCV | StringAsciiCV | StringUtf8CV;
|
|
136
|
+
export type StacksTransactionParams = {
|
|
137
|
+
contractAddress: string;
|
|
138
|
+
contractName: string;
|
|
139
|
+
functionName: string;
|
|
140
|
+
functionArgs: ClarityValue[];
|
|
141
|
+
postConditionMode?: PostConditionMode;
|
|
142
|
+
postConditions?: PostCondition[];
|
|
143
|
+
};
|
|
144
|
+
export type StacksTransactionEventType = 'smart_contract_log' | 'stx_asset' | 'fungible_token_asset' | 'non_fungible_token_asset' | 'stx_lock';
|
|
145
|
+
export type StacksTransactionEvent = {
|
|
146
|
+
event_index: number;
|
|
147
|
+
event_type: StacksTransactionEventType;
|
|
148
|
+
tx_id: string;
|
|
149
|
+
contract_log?: {
|
|
150
|
+
contract_id: string;
|
|
151
|
+
topic: string;
|
|
152
|
+
value: {
|
|
153
|
+
hex: string;
|
|
154
|
+
repr: string;
|
|
155
|
+
};
|
|
156
|
+
};
|
|
157
|
+
asset?: {
|
|
158
|
+
asset_event_type: string;
|
|
159
|
+
asset_id?: string;
|
|
160
|
+
sender?: string;
|
|
161
|
+
recipient?: string;
|
|
162
|
+
amount?: string;
|
|
163
|
+
value?: {
|
|
164
|
+
hex: string;
|
|
165
|
+
repr: string;
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
};
|
|
169
|
+
export type StacksRawTransactionReceipt = {
|
|
170
|
+
tx_id: string;
|
|
171
|
+
tx_status: 'success' | 'abort_by_response' | 'abort_by_post_condition' | 'pending';
|
|
172
|
+
tx_type: 'token_transfer' | 'smart_contract' | 'contract_call' | 'poison_microblock' | 'coinbase' | 'tenure_change';
|
|
173
|
+
nonce: number;
|
|
174
|
+
fee_rate: string;
|
|
175
|
+
sender_address: string;
|
|
176
|
+
sponsor_address?: string;
|
|
177
|
+
sponsored: boolean;
|
|
178
|
+
block_hash?: string;
|
|
179
|
+
block_height?: number;
|
|
180
|
+
block_time?: number;
|
|
181
|
+
block_time_iso?: string;
|
|
182
|
+
burn_block_time?: number;
|
|
183
|
+
burn_block_time_iso?: string;
|
|
184
|
+
burn_block_height?: number;
|
|
185
|
+
parent_burn_block_time?: number;
|
|
186
|
+
canonical?: boolean;
|
|
187
|
+
tx_index?: number;
|
|
188
|
+
tx_result?: {
|
|
189
|
+
hex: string;
|
|
190
|
+
repr: string;
|
|
191
|
+
};
|
|
192
|
+
event_count?: number;
|
|
193
|
+
events?: StacksTransactionEvent[];
|
|
194
|
+
is_unanchored?: boolean;
|
|
195
|
+
microblock_hash?: string;
|
|
196
|
+
microblock_sequence?: number;
|
|
197
|
+
microblock_canonical?: boolean;
|
|
198
|
+
execution_cost_read_count?: number;
|
|
199
|
+
execution_cost_read_length?: number;
|
|
200
|
+
execution_cost_runtime?: number;
|
|
201
|
+
execution_cost_write_count?: number;
|
|
202
|
+
execution_cost_write_length?: number;
|
|
203
|
+
};
|
|
204
|
+
export interface IStacksWalletProvider extends ICoreWallet {
|
|
205
|
+
readonly chainType: 'STACKS';
|
|
206
|
+
getWalletAddress: () => Promise<string>;
|
|
207
|
+
getPublicKey: () => Promise<string>;
|
|
208
|
+
getBalance: (address: string) => Promise<bigint>;
|
|
209
|
+
sendTransaction: (txParams: StacksTransactionParams) => Promise<string>;
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=stacks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stacks.d.ts","sourceRoot":"","sources":["../../src/stacks/stacks.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,MAAM,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B,CAAC;AAEF,MAAM,MAAM,gBAAgB,CAAC,GAAG,SAAS,OAAO,IAAI,GAAG,SAAS,IAAI,GAChE,oBAAoB,GACpB,GAAG,SAAS,KAAK,GACf,MAAM,GACN,oBAAoB,GAAG,MAAM,CAAC;AAEpC,MAAM,CAAC,OAAO,MAAM,iBAAiB;IACnC,KAAK,IAAI;IACT,IAAI,IAAI;CACT;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a,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,CAAC,EAAE,OAAO,CAAC;IAC/B,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,0BAA0B,CAAC,EAAE,MAAM,CAAC;IACpC,2BAA2B,CAAC,EAAE,MAAM,CAAC;CACtC,CAAC;AAEF,MAAM,WAAW,qBAAsB,SAAQ,WAAW;IACxD,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC;IAC7B,gBAAgB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,YAAY,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACpC,UAAU,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IACjD,eAAe,EAAE,CAAC,QAAQ,EAAE,uBAAuB,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;CACzE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stacks.js","sourceRoot":"","sources":["../../src/stacks/stacks.ts"],"names":[],"mappings":""}
|
package/dist/stellar/index.d.ts
CHANGED
|
@@ -1,70 +1,2 @@
|
|
|
1
|
-
|
|
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 | string;
|
|
57
|
-
max_fee: number | string;
|
|
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
|
-
}
|
|
1
|
+
export * from './stellar.js';
|
|
70
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stellar/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/stellar/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
package/dist/stellar/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './stellar.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stellar/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/stellar/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import type { ICoreWallet } from '../wallet/wallet.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 | string;
|
|
57
|
+
max_fee: number | string;
|
|
58
|
+
operation_count: number;
|
|
59
|
+
};
|
|
60
|
+
type StellarSorobanBaseResponse = {
|
|
61
|
+
latestLedger: number;
|
|
62
|
+
latestLedgerCloseTime: number;
|
|
63
|
+
oldestLedger: number;
|
|
64
|
+
oldestLedgerCloseTime: number;
|
|
65
|
+
};
|
|
66
|
+
export type StellarSorobanSuccessfulTransactionReceipt = StellarSorobanBaseResponse & {
|
|
67
|
+
status: 'SUCCESS';
|
|
68
|
+
ledger: number;
|
|
69
|
+
createdAt: number;
|
|
70
|
+
applicationOrder: number;
|
|
71
|
+
feeBump: boolean;
|
|
72
|
+
};
|
|
73
|
+
export type StellarSorobanFailedTransactionReceipt = StellarSorobanBaseResponse & {
|
|
74
|
+
status: 'FAILED';
|
|
75
|
+
ledger: number;
|
|
76
|
+
createdAt: number;
|
|
77
|
+
applicationOrder: number;
|
|
78
|
+
feeBump: boolean;
|
|
79
|
+
};
|
|
80
|
+
export type StellarSorobanMissingTransactionReceipt = StellarSorobanBaseResponse & {
|
|
81
|
+
status: 'NOT_FOUND';
|
|
82
|
+
};
|
|
83
|
+
export type StellarSorobanTransactionReceipt = StellarSorobanSuccessfulTransactionReceipt | StellarSorobanFailedTransactionReceipt | StellarSorobanMissingTransactionReceipt;
|
|
84
|
+
export type StellarRawTransaction = {
|
|
85
|
+
from: string;
|
|
86
|
+
to: string;
|
|
87
|
+
value: bigint;
|
|
88
|
+
data: string;
|
|
89
|
+
};
|
|
90
|
+
export type StellarReturnType<Raw extends boolean> = Raw extends true ? StellarRawTransaction : Raw extends false ? string : StellarRawTransaction | string;
|
|
91
|
+
export interface IStellarWalletProvider extends ICoreWallet {
|
|
92
|
+
readonly chainType: 'STELLAR';
|
|
93
|
+
signTransaction: (tx: XDR) => Promise<XDR>;
|
|
94
|
+
waitForTransactionReceipt: (txHash: string) => Promise<StellarRawTransactionReceipt>;
|
|
95
|
+
}
|
|
96
|
+
export {};
|
|
97
|
+
//# sourceMappingURL=stellar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"stellar.d.ts","sourceRoot":"","sources":["../../src/stellar/stellar.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AAGzB,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE;QACN,IAAI,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QACvB,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC1B,MAAM,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QACzB,UAAU,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC7B,OAAO,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC1B,QAAQ,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC3B,QAAQ,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC3B,WAAW,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KAC/B,CAAC;IACF,EAAE,EAAE,MAAM,CAAC;IACX,YAAY,EAAE,MAAM,CAAC;IACrB,UA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CAAsC,GAAG,0BAA0B,GAAG;IAChF,MAAM,EAAE,QAAQ,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,OAAO,CAAC;CAKlB,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG,0BAA0B,GAAG;IACjF,MAAM,EAAE,WAAW,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,gCAAgC,GACxC,0CAA0C,GAC1C,sCAAsC,GACtC,uCAAuC,CAAC;AAE5C,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,MAAM,iBAAiB,CAAC,GAAG,SAAS,OAAO,IAAI,GAAG,SAAS,IAAI,GACjE,qBAAqB,GACrB,GAAG,SAAS,KAAK,GACf,MAAM,GACN,qBAAqB,GAAG,MAAM,CAAC;AAErC,MAAM,WAAW,sBAAuB,SAAQ,WAAW;IACzD,QAAQ,CAAC,SAAS,EAAE,SAAS,CAAC;IAC9B,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":"stellar.js","sourceRoot":"","sources":["../../src/stellar/stellar.ts"],"names":[],"mappings":""}
|
package/dist/sui/index.d.ts
CHANGED
|
@@ -1,33 +1,2 @@
|
|
|
1
|
-
|
|
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<string>;
|
|
29
|
-
signAndExecuteTxn: (txn: SuiTransaction) => Promise<string>;
|
|
30
|
-
viewContract(tx: SuiTransaction, packageId: string, module: string, functionName: string, args: unknown[], typeArgs: string[]): Promise<SuiExecutionResult>;
|
|
31
|
-
getCoins: (address: string, token: string) => Promise<SuiPaginatedCoins>;
|
|
32
|
-
}
|
|
1
|
+
export * from './sui.js';
|
|
33
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/sui/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sui/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
package/dist/sui/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from './sui.js';
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/sui/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sui/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/sui/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|