rango-sdk 0.0.4 → 0.0.7
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 +1 -7
- package/lib/types/api/meta.d.ts +98 -1
- package/lib/types/api/meta.d.ts.map +1 -1
- package/lib/types/api/transactions.d.ts +12 -1
- package/lib/types/api/transactions.d.ts.map +1 -1
- package/lib/types/api/transactions.js +1 -0
- package/lib/types/api/transactions.js.map +1 -1
- package/lib/types/api/txs/index.d.ts +1 -0
- package/lib/types/api/txs/index.d.ts.map +1 -1
- package/lib/types/api/txs/index.js +1 -0
- package/lib/types/api/txs/index.js.map +1 -1
- package/lib/types/api/txs/solana.d.ts +46 -0
- package/lib/types/api/txs/solana.d.ts.map +1 -0
- package/lib/types/api/txs/solana.js +3 -0
- package/lib/types/api/txs/solana.js.map +1 -0
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -1,16 +1,10 @@
|
|
|
1
|
-
# Rango Exchange SDK
|
|
1
|
+
# Rango Exchange SDK
|
|
2
2
|
|
|
3
3
|
[](https://badge.fury.io/js/rango-sdk)
|
|
4
4
|
[](https://github.com/rango-exchange/rango-sdk/blob/master/LICENSE)
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
This is the first phase of Rango SDK which only wraps Rest API calls. In the next phase, we will handle connecting to the wallet providers.
|
|
8
|
-
|
|
9
6
|
> **WARNING:** The Rango SDK is still beta. Please use it on your own risk.
|
|
10
7
|
|
|
11
|
-
> **WARNING:** The Rango SDK has not stabilized yet, and we might make some breaking changes.
|
|
12
|
-
|
|
13
|
-
|
|
14
8
|
## Installation
|
|
15
9
|
|
|
16
10
|
```shell
|
package/lib/types/api/meta.d.ts
CHANGED
|
@@ -1,19 +1,116 @@
|
|
|
1
1
|
import type { Asset } from './common';
|
|
2
|
+
import { TransactionType } from './transactions';
|
|
2
3
|
/**
|
|
3
|
-
*
|
|
4
|
+
* EVM Chain Info
|
|
5
|
+
*
|
|
6
|
+
* @property {string} chainName - Chain name, e.g. Polygon Mainnet
|
|
7
|
+
* @property {name: string, symbol: string, decimals: null} nativeCurrency
|
|
8
|
+
* @property {string[]} rpcUrls - e.g. "https://polygon-rpc.com"
|
|
9
|
+
* @property {string[]} blockExplorerUrls - e.g. "https://polygonscan.com"
|
|
10
|
+
* @property {string} addressUrl - Explorer address base url for this blockchain,
|
|
11
|
+
* e.g. "https://bscscan.com/address/{wallet}"
|
|
12
|
+
* @property {string} transactionUrl - Explorer transaction base url for this blockchain,
|
|
13
|
+
* e.g. "https://bscscan.com/tx/{txHash}"
|
|
14
|
+
*
|
|
15
|
+
*/
|
|
16
|
+
export declare type EVMChainInfo = {
|
|
17
|
+
chainName: string;
|
|
18
|
+
nativeCurrency: {
|
|
19
|
+
name: string;
|
|
20
|
+
symbol: string;
|
|
21
|
+
decimals: number;
|
|
22
|
+
};
|
|
23
|
+
rpcUrls: string[];
|
|
24
|
+
blockExplorerUrls: string[];
|
|
25
|
+
addressUrl: string;
|
|
26
|
+
transactionUrl: string;
|
|
27
|
+
};
|
|
28
|
+
/**
|
|
29
|
+
* Cosmos Chain Info - Used for adding experimental chains to keplr if needed
|
|
30
|
+
*
|
|
31
|
+
* @see https://github.com/osmosis-labs/osmosis-frontend/blob/0b88e39740cb087be576f464bfcd6cc2971ed2fd/packages/web/config/chain-infos.ts
|
|
32
|
+
*
|
|
33
|
+
*/
|
|
34
|
+
export declare type CosmosChainInfo = {
|
|
35
|
+
experimental: boolean;
|
|
36
|
+
rpc: string;
|
|
37
|
+
rest: string;
|
|
38
|
+
cosmostationLcdUrl: string | null;
|
|
39
|
+
cosmostationApiUrl: string | null;
|
|
40
|
+
cosmostationDenomTracePath: string;
|
|
41
|
+
mintScanName: string | null;
|
|
42
|
+
chainName: string;
|
|
43
|
+
stakeCurrency: {
|
|
44
|
+
coinDenom: string;
|
|
45
|
+
coinMinimalDenom: string;
|
|
46
|
+
coinDecimals: number;
|
|
47
|
+
coinGeckoId: string;
|
|
48
|
+
coinImageUrl: string;
|
|
49
|
+
};
|
|
50
|
+
bip44: {
|
|
51
|
+
coinType: number;
|
|
52
|
+
};
|
|
53
|
+
bech32Config: {
|
|
54
|
+
bech32PrefixAccAddr: string;
|
|
55
|
+
bech32PrefixAccPub: string;
|
|
56
|
+
bech32PrefixValAddr: string;
|
|
57
|
+
bech32PrefixValPub: string;
|
|
58
|
+
bech32PrefixConsAddr: string;
|
|
59
|
+
bech32PrefixConsPub: string;
|
|
60
|
+
};
|
|
61
|
+
currencies: {
|
|
62
|
+
coinDenom: string;
|
|
63
|
+
coinMinimalDenom: string;
|
|
64
|
+
coinDecimals: number;
|
|
65
|
+
coinGeckoId: string;
|
|
66
|
+
coinImageUrl: string;
|
|
67
|
+
}[];
|
|
68
|
+
feeCurrencies: {
|
|
69
|
+
coinDenom: string;
|
|
70
|
+
coinMinimalDenom: string;
|
|
71
|
+
coinDecimals: number;
|
|
72
|
+
coinGeckoId: string;
|
|
73
|
+
coinImageUrl: string;
|
|
74
|
+
}[];
|
|
75
|
+
features: string[];
|
|
76
|
+
explorerUrlToTx: string;
|
|
77
|
+
gasPriceStep: {
|
|
78
|
+
low: number;
|
|
79
|
+
average: number;
|
|
80
|
+
high: number;
|
|
81
|
+
} | null;
|
|
82
|
+
};
|
|
83
|
+
/**
|
|
84
|
+
* Blockchain Meta Information
|
|
4
85
|
*
|
|
5
86
|
* @property {string} name - Unique name of blockchain, this field is used in all endpoints as the identifier
|
|
6
87
|
* @property {number} defaultDecimals - The default decimals of blockchain, do not use it in computations, use Token.decimals instead
|
|
7
88
|
* @property {Asset[]} feeAssets - List of assets that can be used as fee in this blockchain
|
|
8
89
|
* @property {string[]} addressPatterns - List of all regex patterns for wallet addresses of this blockchain, can be
|
|
9
90
|
* used for input validation, example: [ "^(0x)[0-9A-Fa-f]{40}$" ]
|
|
91
|
+
* @property {string} logo - Logo of the blockchain
|
|
92
|
+
* @property {string} displayName - Display name for the blockchain
|
|
93
|
+
* @property {string} shortName - Short name for the blockchain
|
|
94
|
+
* @property {string} color - Suggested color for the blockchain
|
|
95
|
+
* @property {boolean} enabled - Is blockchain enabled or not in Rango
|
|
96
|
+
* @property {TransactionType} type - Type of the blockchain
|
|
97
|
+
* @property {string | null} chainId - e.g. "0xa86a" for Avax, "osmosis-1" for Osmosis, etc.
|
|
98
|
+
* @property {EVMChainInfo | CosmosChainInfo | null} info - Chain specific information
|
|
10
99
|
*
|
|
11
100
|
*/
|
|
12
101
|
export declare type BlockchainMeta = {
|
|
13
102
|
name: string;
|
|
103
|
+
shortName: string;
|
|
104
|
+
displayName: string;
|
|
14
105
|
defaultDecimals: number;
|
|
15
106
|
feeAssets: Asset[];
|
|
16
107
|
addressPatterns: string[];
|
|
108
|
+
logo: string;
|
|
109
|
+
color: string;
|
|
110
|
+
enabled: boolean;
|
|
111
|
+
type: TransactionType;
|
|
112
|
+
chainId: string | null;
|
|
113
|
+
info: EVMChainInfo | CosmosChainInfo | null;
|
|
17
114
|
};
|
|
18
115
|
/**
|
|
19
116
|
* Metadata of Swapper
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/types/api/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;
|
|
1
|
+
{"version":3,"file":"meta.d.ts","sourceRoot":"","sources":["../../../src/types/api/meta.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,UAAU,CAAA;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD;;;;;;;;;;;;GAYG;AACH,oBAAY,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE;QACd,IAAI,EAAE,MAAM,CAAA;QACZ,MAAM,EAAE,MAAM,CAAA;QACd,QAAQ,EAAE,MAAM,CAAA;KACjB,CAAA;IACD,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,iBAAiB,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AAa,EAAE,MAAM,GAAG,IAAI,CAAA;CAC7B,CAAA;AAED;;;;;;;;GAQG;AACH,oBAAY,YAAY,GAAG;IACzB,WAAW,EAAE,cAAc,EAAE,CAAA;IAC7B,MAAM,EAAE,KAAK,EAAE,CAAA;IACf,aAAa,EAAE,KAAK,EAAE,CAAA;IACtB,QAAQ,EAAE,cAAc,EAAE,CAAA;CAC3B,CAAA"}
|
|
@@ -4,7 +4,8 @@
|
|
|
4
4
|
export declare enum TransactionType {
|
|
5
5
|
EVM = "EVM",
|
|
6
6
|
TRANSFER = "TRANSFER",
|
|
7
|
-
COSMOS = "COSMOS"
|
|
7
|
+
COSMOS = "COSMOS",
|
|
8
|
+
SOLANA = "SOLANA"
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
11
|
* Parent model for all types of transactions
|
|
@@ -117,6 +118,14 @@ export declare enum TransactionStatus {
|
|
|
117
118
|
RUNNING = "running",
|
|
118
119
|
SUCCESS = "success"
|
|
119
120
|
}
|
|
121
|
+
/**
|
|
122
|
+
* The swapper details for a transaction step
|
|
123
|
+
*/
|
|
124
|
+
export declare type SwapperStatusStep = {
|
|
125
|
+
name: string;
|
|
126
|
+
state: 'PENDING' | 'CREATED' | 'WAITING' | 'SIGNED' | 'SUCCESSED' | 'FAILED';
|
|
127
|
+
current: boolean;
|
|
128
|
+
};
|
|
120
129
|
/**
|
|
121
130
|
* Response of check transaction status containing the latest status of transaction
|
|
122
131
|
*
|
|
@@ -132,6 +141,7 @@ export declare enum TransactionStatus {
|
|
|
132
141
|
* outside Rango to get its assets back (refund). You can show this link to the user to help him
|
|
133
142
|
* @property {SwapExplorerUrl[] | null} explorerUrl - List of explorer URLs for the transactions that happened in this step.
|
|
134
143
|
* @property {TransactionStatusReferral[] | null} referrals - List of referral reward for the dApp and Rango
|
|
144
|
+
* @property {SwapperStatusStep[] | null} steps - Internal steps details of a route step, used for solana
|
|
135
145
|
*
|
|
136
146
|
*/
|
|
137
147
|
export declare type TransactionStatusResponse = {
|
|
@@ -143,6 +153,7 @@ export declare type TransactionStatusResponse = {
|
|
|
143
153
|
diagnosisUrl: string | null;
|
|
144
154
|
explorerUrl: SwapExplorerUrl[] | null;
|
|
145
155
|
referrals: TransactionStatusReferral[] | null;
|
|
156
|
+
steps: SwapperStatusStep[] | null;
|
|
146
157
|
};
|
|
147
158
|
/**
|
|
148
159
|
* Response body of check-approval
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,eAAe;IACzB,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,eAAe,CAAA;CACtB,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;GAKG;AACH,oBAAY,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;GAMG;AACH,oBAAY,2BAA2B,GAAG;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,OAAO,CAAA;CACb,CAAA;AAED;;;;;;;GAOG;AACH,oBAAY,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED;;;;;;;GAOG;AACH,oBAAY,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,YAAY,CAAA;IAC1B,WAAW,EAAE,2BAA2B,CAAA;CACzC,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAChC,CAAA;AAED;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED
|
|
1
|
+
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,eAAe;IACzB,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,MAAM,WAAW;IACjB,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,eAAe,CAAA;CACtB,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;GAKG;AACH,oBAAY,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;GAMG;AACH,oBAAY,2BAA2B,GAAG;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,OAAO,CAAA;CACb,CAAA;AAED;;;;;;;GAOG;AACH,oBAAY,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,GAAG,IAA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AI,CAAA;IACrC,SAAS,EAAE,yBAAyB,EAAE,GAAG,IAAI,CAAA;IAC7C,KAAK,EAAE,iBAAiB,EAAE,GAAG,IAAI,CAAA;CAClC,CAAA;AAED;;;;;GAKG;AACH,oBAAY,qBAAqB,GAAG;IAClC,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;;GAQG;AACH,oBAAY,yBAAyB,GAAG;IACtC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,EAAE,EAAE,OAAO,CAAA;IACX,WAAW,EAAE,kBAAkB,GAAG,IAAI,CAAA;CACvC,CAAA"}
|
|
@@ -9,6 +9,7 @@ var TransactionType;
|
|
|
9
9
|
TransactionType["EVM"] = "EVM";
|
|
10
10
|
TransactionType["TRANSFER"] = "TRANSFER";
|
|
11
11
|
TransactionType["COSMOS"] = "COSMOS";
|
|
12
|
+
TransactionType["SOLANA"] = "SOLANA";
|
|
12
13
|
})(TransactionType = exports.TransactionType || (exports.TransactionType = {}));
|
|
13
14
|
/**
|
|
14
15
|
* The status of transaction in tracking
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":";;;AAAA;;GAEG;AACH,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;IACjB,oCAAiB,CAAA;AACnB,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B;AA+GD;;GAEG;AACH,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;AACrB,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA"}
|
|
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./evm"), exports);
|
|
18
18
|
__exportStar(require("./cosmos"), exports);
|
|
19
19
|
__exportStar(require("./transfer"), exports);
|
|
20
|
+
__exportStar(require("./solana"), exports);
|
|
20
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/api/txs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAqB;AACrB,2CAAwB;AACxB,6CAA0B"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/api/txs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAqB;AACrB,2CAAwB;AACxB,6CAA0B;AAC1B,2CAAwB"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { GenericTransaction } from '../transactions';
|
|
2
|
+
/**
|
|
3
|
+
* Account metadata used to define instructions
|
|
4
|
+
*/
|
|
5
|
+
export declare type SolanaInstructionKey = {
|
|
6
|
+
pubkey: string;
|
|
7
|
+
isSigner: boolean;
|
|
8
|
+
isWritable: boolean;
|
|
9
|
+
};
|
|
10
|
+
/**
|
|
11
|
+
* Transaction Instruction class
|
|
12
|
+
*/
|
|
13
|
+
export declare type SolanaInstruction = {
|
|
14
|
+
keys: SolanaInstructionKey[];
|
|
15
|
+
programId: string;
|
|
16
|
+
data: number[];
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Pair of signature and corresponding public key
|
|
20
|
+
*/
|
|
21
|
+
export declare type SolanaSignature = {
|
|
22
|
+
signature: number[];
|
|
23
|
+
publicKey: string;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* This type of transaction is used for all solana transactions
|
|
27
|
+
*
|
|
28
|
+
* @property {string} blockChain, equals to SOLANA
|
|
29
|
+
* @property {string} from, Source wallet address
|
|
30
|
+
* @property {string} identifier, Transaction hash used in case of retry
|
|
31
|
+
* @property {string | null} recentBlockhash, A recent blockhash
|
|
32
|
+
* @property {SolanaSignature[]} signatures, Signatures for the transaction
|
|
33
|
+
* @property {number[] | null} serializedMessage, The byte array of the transaction
|
|
34
|
+
* @property {SolanaInstruction[]} instructions, The instructions to atomically execute
|
|
35
|
+
*
|
|
36
|
+
*/
|
|
37
|
+
export interface SolanaTransaction extends GenericTransaction {
|
|
38
|
+
blockChain: string;
|
|
39
|
+
from: string;
|
|
40
|
+
identifier: string;
|
|
41
|
+
recentBlockhash: string | null;
|
|
42
|
+
signatures: SolanaSignature[];
|
|
43
|
+
serializedMessage: number[] | null;
|
|
44
|
+
instructions: SolanaInstruction[];
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=solana.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solana.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/solana.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAA;AAEzD;;GAEG;AACH,oBAAY,oBAAoB,GAAG;IACjC,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,OAAO,CAAA;IACjB,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;GAEG;AACH,oBAAY,iBAAiB,GAAG;IAC9B,IAAI,EAAE,oBAAoB,EAAE,CAAA;IAC5B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,EAAE,CAAA;CACf,CAAA;AAED;;GAEG;AACH,oBAAY,eAAe,GAAG;IAC5B,SAAS,EAAE,MAAM,EAAE,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,WAAW,iBAAkB,SAAQ,kBAAkB;IAC3D,UAAU,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,UAAU,EAAE,eAAe,EAAE,CAAA;IAC7B,iBAAiB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAClC,YAAY,EAAE,iBAAiB,EAAE,CAAA;CAClC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solana.js","sourceRoot":"","sources":["../../../../src/types/api/txs/solana.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rango-sdk",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.7",
|
|
4
4
|
"description": "Rango Exchange SDK for dApps",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"types": "lib",
|
|
@@ -15,9 +15,9 @@
|
|
|
15
15
|
"scripts": {
|
|
16
16
|
"test": "jest --config jestconfig.json",
|
|
17
17
|
"build": "tsc",
|
|
18
|
-
"format": "prettier --write ./src",
|
|
19
18
|
"lint": "eslint */**/*.{js,ts} --quiet --fix",
|
|
20
|
-
"semantic-release": "semantic-release"
|
|
19
|
+
"semantic-release": "semantic-release",
|
|
20
|
+
"format": "prettier --write './**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc"
|
|
21
21
|
},
|
|
22
22
|
"keywords": [
|
|
23
23
|
"Rango Exchange",
|