@sodax/types 0.0.1-rc.3 → 0.0.1-rc.5

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.
@@ -11,7 +11,7 @@ export declare const POLYGON_MAINNET_CHAIN_ID = "0x89.polygon";
11
11
  export declare const SOLANA_MAINNET_CHAIN_ID = "solana";
12
12
  export declare const STELLAR_MAINNET_CHAIN_ID = "stellar";
13
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"];
14
+ export declare const SPOKE_CHAIN_IDS: readonly ["sonic", "0xa86a.avax", "0xa4b1.arbitrum", "0x2105.base", "0x38.bsc", "injective-1", "sui", "0xa.optimism", "0x89.polygon", "solana", "0x1.icon", "stellar", "nibiru"];
15
15
  export declare const HUB_CHAIN_IDS: readonly ["sonic"];
16
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
17
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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,kLAclB,CAAC;AAEX,eAAO,MAAM,aAAa,oBAAoC,CAAC;AAE/D,eAAO,MAAM,SAAS,kLAcZ,CAAC"}
@@ -14,6 +14,7 @@ export const STELLAR_MAINNET_CHAIN_ID = 'stellar';
14
14
  export const NIBIRU_MAINNET_CHAIN_ID = 'nibiru';
15
15
  // currently supported spoke chains
16
16
  export const SPOKE_CHAIN_IDS = [
17
+ SONIC_MAINNET_CHAIN_ID,
17
18
  AVALANCHE_MAINNET_CH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M,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,78 @@
1
+ import type { Hex, WalletAddressProvider } from '../common/index.js';
2
+ export type CosmosNetworkEnv = 'TestNet' | 'DevNet' | 'Mainnet';
3
+ export type JsonObject = unknown;
4
+ export interface CWCoin {
5
+ readonly denom: string;
6
+ readonly amount: string;
7
+ }
8
+ export interface CWStdFee {
9
+ readonly amount: readonly CWCoin[];
10
+ readonly gas: string;
11
+ /** The granter address that is used for paying with feegrants */
12
+ readonly granter?: string;
13
+ /** The fee payer address. The payer must have signed the transaction. */
14
+ readonly payer?: string;
15
+ }
16
+ export interface CWExecuteResult {
17
+ readonly logs: readonly unknown[];
18
+ /** Block height in which the transaction is included */
19
+ readonly height: number;
20
+ /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
21
+ readonly transactionHash: string;
22
+ readonly events: readonly unknown[];
23
+ readonly gasWanted: bigint;
24
+ readonly gasUsed: bigint;
25
+ }
26
+ export interface CWTxResponse {
27
+ height: number;
28
+ txHash: string;
29
+ codespace: string;
30
+ code: number;
31
+ data?: string;
32
+ rawLog: string;
33
+ logs?: unknown[];
34
+ info?: string;
35
+ gasWanted: number;
36
+ gasUsed: number;
37
+ timestamp: string;
38
+ events?: unknown[];
39
+ }
40
+ export interface SignDoc {
41
+ /**
42
+ * body_bytes is protobuf serialization of a TxBody that matches the
43
+ * representation in TxRaw.
44
+ */
45
+ bodyBytes: Uint8Array;
46
+ /**
47
+ * auth_info_bytes is a protobuf serialization of an AuthInfo that matches the
48
+ * representation in TxRaw.
49
+ */
50
+ authInfoBytes: Uint8Array;
51
+ /**
52
+ * chain_id is the unique identifier of the chain this transaction targets.
53
+ * It prevents signed transactions from being used on another chain by an
54
+ * attacker
55
+ */
56
+ chainId: string;
57
+ /** account_number is the account number of the account in state */
58
+ accountNumber: bigint;
59
+ }
60
+ export type CWRawTransaction = {
61
+ from: Hex;
62
+ to: Hex;
63
+ signedDoc: SignDoc;
64
+ };
65
+ export declare class CWExecuteResponse {
66
+ height: number | undefined;
67
+ transactionHash: string;
68
+ static fromExecResult(res: CWExecuteResult): CWExecuteResponse;
69
+ static fromTxResponse(res: CWTxResponse): CWExecuteResponse;
70
+ }
71
+ export interface ICWWalletProvider extends WalletAddressProvider {
72
+ getWalletAddress: () => Promise<string>;
73
+ getWalletAddressBytes: () => Promise<Hex>;
74
+ execute(senderAddress: string, contractAddress: string, msg: JsonObject, fee: CWStdFee | 'auto' | number, memo?: string, funds?: CWCoin[]): Promise<CWExecuteResponse>;
75
+ getRawTransaction(chainId: string, prefix: string, senderAddress: string, contractAddress: string, msg: JsonObject, memo?: string): CWRawTransaction;
76
+ queryContractSmart(address: string, queryMsg: JsonObject): Promise<JsonObject>;
77
+ }
78
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cosmos/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAErE,MAAM,MAAM,gBAAgB,GAAG,SAAS,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEhE,MAAM,MAAM,UAAU,GAAG,OAAO,CAAC;AAEjC,MAAM,WAAW,MAAM;IACrB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,QAAQ;IACvB,QAAQ,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC;IACnC,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,iEAAiE;IACjE,QAAQ,CAAC,OAAO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,EAAE,MAAM,GAAG,SAAS,CAAC;IAE3B,eAAe,EAAG,MAAM,CAAC;WAElB,cAAc,CAAC,GAAG,EAAE,eAAe,GAAG,iBAAiB;WAOvD,cAAc,CAAC,GAAG,EAAE,YAAY,GAAG,iBAAiB;CAMnE;AAED,MAAM,WAAW,iBAAkB,SAAQ,qBAAqB;IAC9D,gBAAgB,EAAE,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IACxC,qBAAqB,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;IAE1C,OAAO,CACL,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,EACvB,GAAG,EAAE,UAAU,EACf,GAAG,EAAE,QAAQ,GAAG,MAAM,GAAG,MAAM,EAC/B,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,EAAE,GACf,OAAO,CAAC,iBAAiB,CAAC,CAAC;IAC9B,iBAAiB,CACf,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,MAAM,EACrB,eAAe,EAAE,MAAM,EACvB,GAAG,EAAE,UAAU,EACf,IAAI,CAAC,EAAE,MAAM,GACZ,gBAAgB,CAAC;IACpB,kBAAkB,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CAChF"}
@@ -0,0 +1,17 @@
1
+ export class CWExecuteResponse {
2
+ height;
3
+ transactionHash;
4
+ static fromExecResult(res) {
5
+ const response = new CWExecuteResponse();
6
+ response.height = res.height;
7
+ response.transactionHash = res.transactionHash;
8
+ return response;
9
+ }
10
+ static fromTxResponse(res) {
11
+ const response = new CWExecuteResponse();
12
+ response.height = res.height;
13
+ response.transactionHash = res.txHash;
14
+ return response;
15
+ }
16
+ }
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cosmos/index.ts"],"names":[],"mappings":"AAyEA,MAAM,OAAO,iBAAiB;IACrB,MAAM,CAAqB;IAE3B,eAAe,CAAU;IAEzB,MAAM,CAAC,cAAc,CAAC,GAAoB;QAC/C,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACzC,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAC7B,QAAQ,CAAC,eAAe,GAAG,GAAG,CAAC,eAAe,CAAC;QAC/C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,cAAc,CAAC,GAAiB;QAC5C,MAAM,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAC;QACzC,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAC7B,QAAQ,CAAC,eAAe,GAAG,GAAG,CAAC,MAAM,CAAC;QACtC,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
package/dist/index.d.ts CHANGED
@@ -4,4 +4,7 @@ export * from './sui/index.js';
4
4
  export * from './icon/index.js';
5
5
  export * from './constants/index.js';
6
6
  export * from './common/index.js';
7
+ export * from './injective/index.js';
8
+ export * from './cosmos/index.js';
9
+ export * from './solana/index.js';
7
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +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"}
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;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
package/dist/index.js CHANGED
@@ -4,4 +4,7 @@ export * from './sui/index.js';
4
4
  export * from './icon/index.js';
5
5
  export * from './constants/index.js';
6
6
  export * from './common/index.js';
7
+ export * from './injective/index.js';
8
+ export * from './cosmos/index.js';
9
+ export * from './solana/index.js';
7
10
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +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"}
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;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC"}
@@ -0,0 +1,45 @@
1
+ import type { Hex, WalletAddressProvider } from '../common/index.js';
2
+ import type { JsonObject, CWRawTransaction } from '../cosmos/index.js';
3
+ export type InjectiveEoaAddress = string;
4
+ export interface InjectiveCoin {
5
+ readonly denom: string;
6
+ readonly amount: string;
7
+ }
8
+ export interface InjectiveExecuteResult {
9
+ readonly logs: readonly unknown[];
10
+ /** Block height in which the transaction is included */
11
+ readonly height: number;
12
+ /** Transaction hash (might be used as transaction ID). Guaranteed to be non-empty upper-case hex */
13
+ readonly transactionHash: string;
14
+ readonly events: readonly unknown[];
15
+ readonly gasWanted: bigint;
16
+ readonly gasUsed: bigint;
17
+ }
18
+ export interface InjectiveTxResponse {
19
+ height: number;
20
+ txHash: string;
21
+ codespace: string;
22
+ code: number;
23
+ data?: string;
24
+ rawLog: string;
25
+ logs?: unknown[];
26
+ info?: string;
27
+ gasWanted: number;
28
+ gasUsed: number;
29
+ timestamp: string;
30
+ events?: unknown[];
31
+ }
32
+ export declare class InjectiveExecuteResponse {
33
+ height: number | undefined;
34
+ transactionHash: string;
35
+ static fromExecResult(res: InjectiveExecuteResult): InjectiveExecuteResponse;
36
+ static fromTxResponse(res: InjectiveTxResponse): InjectiveExecuteResponse;
37
+ }
38
+ export interface IInjectiveWalletProvider extends WalletAddressProvider {
39
+ getRawTransaction(chainId: string, _: string, senderAddress: string, contractAddress: string, msg: JsonObject, memo?: string): CWRawTransaction;
40
+ getWalletAddress: () => Promise<InjectiveEoaAddress>;
41
+ getWalletAddressBytes: () => Promise<Hex>;
42
+ execute: (senderAddress: InjectiveEoaAddress, contractAddress: string, msg: JsonObject, fee: 'auto' | number, memo?: string, funds?: InjectiveCoin[]) => Promise<InjectiveExecuteResponse>;
43
+ queryContractSmart: (address: string, queryMsg: JsonObject) => Promise<JsonObject>;
44
+ }
45
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/injective/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AACrE,OAAO,KAAK,EAAE,UAAU,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEvE,MAAM,MAAM,mBAAmB,GAAG,MAAM,CAAC;AAEzC,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,sBAAsB;IACrC,QAAQ,CAAC,IAAI,EAAE,SAAS,OAAO,EAAE,CAAC;IA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AC1C,OAAO,EAAE,CACP,aAAa,EAAE,mBAAmB,EAClC,eAAe,EAAE,MAAM,EACvB,GAAG,EAAE,UAAU,EACf,GAAG,EAAE,MAAM,GAAG,MAAM,EACpB,IAAI,CAAC,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,aAAa,EAAE,KACpB,OAAO,CAAC,wBAAwB,CAAC,CAAC;IACvC,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,KAAK,OAAO,CAAC,UAAU,CAAC,CAAC;CACpF"}
@@ -0,0 +1,17 @@
1
+ export class InjectiveExecuteResponse {
2
+ height;
3
+ transactionHash;
4
+ static fromExecResult(res) {
5
+ const response = new InjectiveExecuteResponse();
6
+ response.height = res.height;
7
+ response.transactionHash = res.transactionHash;
8
+ return response;
9
+ }
10
+ static fromTxResponse(res) {
11
+ const response = new InjectiveExecuteResponse();
12
+ response.height = res.height;
13
+ response.transactionHash = res.txHash;
14
+ return response;
15
+ }
16
+ }
17
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/injective/index.ts"],"names":[],"mappings":"AAoCA,MAAM,OAAO,wBAAwB;IAC5B,MAAM,CAAqB;IAE3B,eAAe,CAAU;IAEzB,MAAM,CAAC,cAAc,CAAC,GAA2B;QACtD,MAAM,QAAQ,GAAG,IAAI,wBAAwB,EAAE,CAAC;QAChD,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAC7B,QAAQ,CAAC,eAAe,GAAG,GAAG,CAAC,eAAe,CAAC;QAC/C,OAAO,QAAQ,CAAC;IAClB,CAAC;IAEM,MAAM,CAAC,cAAc,CAAC,GAAwB;QACnD,MAAM,QAAQ,GAAG,IAAI,wBAAwB,EAAE,CAAC;QAChD,QAAQ,CAAC,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC;QAC7B,QAAQ,CAAC,eAAe,GAAG,GAAG,CAAC,MAAM,CAAC;QACtC,OAAO,QAAQ,CAAC;IAClB,CAAC;CACF"}
@@ -0,0 +1,91 @@
1
+ import type { WalletAddressProvider } from '../common/index.js';
2
+ export type SolanaEoaAddress = string;
3
+ export type TransactionSignature = string;
4
+ export type SolanaSerializedTransaction = Uint8Array;
5
+ export type SolanaBase58PublicKey = string;
6
+ type Context = {
7
+ slot: number;
8
+ };
9
+ export type SolanaAccountMeta = {
10
+ /** An account's public key */
11
+ pubkey: SolanaBase58PublicKey;
12
+ /** True if an instruction requires a transaction signature matching `pubkey` */
13
+ isSigner: boolean;
14
+ /** True if the `pubkey` can be loaded as a read-write account. */
15
+ isWritable: boolean;
16
+ };
17
+ export type SolanaRawTransactionInstruction = {
18
+ /**
19
+ * Public keys to include in this transaction
20
+ * Boolean represents whether this pubkey needs to sign the transaction
21
+ */
22
+ keys: Array<SolanaAccountMeta>;
23
+ /**
24
+ * Program Id to execute
25
+ */
26
+ programId: SolanaBase58PublicKey;
27
+ /**
28
+ * Program input
29
+ */
30
+ data: Uint8Array;
31
+ };
32
+ type TokenAmount = {
33
+ /** Raw amount of tokens as string ignoring decimals */
34
+ amount: string;
35
+ /** Number of decimals configured for token's mint */
36
+ decimals: number;
37
+ /** Token amount as float, accounts for decimals */
38
+ uiAmount: number | null;
39
+ /** Token amount as string, accounts for decimals */
40
+ uiAmountString?: string;
41
+ };
42
+ export type SolanaRpcResponseAndContext<T> = {
43
+ /** response context */
44
+ context: Context;
45
+ /** response value */
46
+ value: T;
47
+ };
48
+ export type SolanaSignatureResult = {
49
+ err: TransactionError | null;
50
+ };
51
+ type RpcResponseAndContext<T> = {
52
+ /** response context */
53
+ context: Context;
54
+ /** response value */
55
+ value: T;
56
+ };
57
+ export type Commitment = 'processed' | 'confirmed' | 'finalized' | 'recent' | 'single' | 'singleGossip' | 'root' | 'max';
58
+ type TransactionError = {} | string;
59
+ export type RawTransaction = {
60
+ signatures: {
61
+ publicKey: string;
62
+ signature: string | null;
63
+ }[];
64
+ message: {
65
+ header: {
66
+ numRequiredSignatures: number;
67
+ numReadonlySignedAccounts: number;
68
+ numReadonlyUnsignedAccounts: number;
69
+ };
70
+ accountKeys: string[];
71
+ recentBlockhash: string;
72
+ instructions: {
73
+ programIdIndex: number;
74
+ accounts: number[];
75
+ data: string;
76
+ }[];
77
+ };
78
+ };
79
+ export interface ISolanaWalletProvider extends WalletAddressProvider {
80
+ getWalletAddress: () => Promise<string>;
81
+ getWalletAddressBytes: () => Promise<`0x${string}`>;
82
+ sendTransaction: (rawTransaction: Uint8Array | Array<number>) => Promise<TransactionSignature>;
83
+ waitForConfirmation: (signature: TransactionSignature, commitment: Commitment) => Promise<SolanaRpcResponseAndContext<SolanaSignatureResult>>;
84
+ buildV0Txn: (instructions: SolanaRawTransactionInstruction[]) => Promise<SolanaSerializedTransaction>;
85
+ getWalletBase58PublicKey: () => SolanaBase58PublicKey;
86
+ getAssociatedTokenAddress: (mint: SolanaBase58PublicKey) => Promise<SolanaBase58PublicKey>;
87
+ getBalance: (publicKey: SolanaBase58PublicKey) => Promise<number>;
88
+ getTokenAccountBalance: (publicKey: SolanaBase58PublicKey) => Promise<RpcResponseAndContext<TokenAmount>>;
89
+ }
90
+ export {};
91
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/solana/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAEhE,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC;AACtC,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAC;AAC1C,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAAC;AACrD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAC;AAE3C,KAAK,OAAO,GAAG;IACb,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAKF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,8BAA8B;IAC9B,MAAM,EAAE,qB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=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/solana/index.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.0.1-rc.3",
7
+ "version": "0.0.1-rc.5",
8
8
  "description": "Sodax Types",
9
9
  "main": "dist/index.js",
10
10
  "homepage": "https://github.com/icon-project/sodax-frontend/tree/main/packages/types",