@nostra-dev/sdk 0.9.3 → 0.9.4
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/deployments.json +10 -7
- package/dist/constants.d.ts +31 -0
- package/dist/constants.js +34 -0
- package/dist/generated/abis.d.ts +2 -1
- package/dist/generated/abis.js +4 -1
- package/dist/generated/addresses.d.ts +2 -1
- package/dist/generated/addresses.js +3 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/dist/types.d.ts +1 -0
- package/dist/utils/contracts.d.ts +11 -1
- package/dist/utils/contracts.js +16 -0
- package/package.json +1 -1
package/deployments.json
CHANGED
|
@@ -6,7 +6,8 @@
|
|
|
6
6
|
"MarketFactory": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
|
|
7
7
|
"ResolutionOracle": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
|
|
8
8
|
"CTFExchange": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
|
|
9
|
-
"MockUSDC": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512"
|
|
9
|
+
"MockUSDC": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
|
|
10
|
+
"AleaToken": ""
|
|
10
11
|
}
|
|
11
12
|
},
|
|
12
13
|
"polygon": {
|
|
@@ -25,7 +26,8 @@
|
|
|
25
26
|
"MarketFactory": "",
|
|
26
27
|
"CTFExchange": "",
|
|
27
28
|
"ResolutionOracle": "",
|
|
28
|
-
"MockUSDC": ""
|
|
29
|
+
"MockUSDC": "",
|
|
30
|
+
"AleaToken": ""
|
|
29
31
|
}
|
|
30
32
|
},
|
|
31
33
|
"bsc": {
|
|
@@ -40,11 +42,12 @@
|
|
|
40
42
|
"bscTestnet": {
|
|
41
43
|
"chainId": 97,
|
|
42
44
|
"contracts": {
|
|
43
|
-
"ConditionalTokens": "
|
|
44
|
-
"MarketFactory": "
|
|
45
|
-
"ResolutionOracle": "
|
|
46
|
-
"CTFExchange": "
|
|
47
|
-
"MockUSDC": "
|
|
45
|
+
"ConditionalTokens": "0xa147Ba3077F28977Ae78E31086a6b7D748c15AA0",
|
|
46
|
+
"MarketFactory": "0xcD1Bb31A46e39b9Cd94368cDc437A8c311D50dD2",
|
|
47
|
+
"ResolutionOracle": "0x863B1DacF7beE1AcDFc768e34a8Bc9E37b74cE79",
|
|
48
|
+
"CTFExchange": "0x44e78d898024dF7E4A717a544FA7676969687427",
|
|
49
|
+
"MockUSDC": "0xa0ffCfe53F59e9ba70C269f412BaE73E35584A50",
|
|
50
|
+
"AleaToken": "0xeD09EF115E661C20ddA7747b4fbBB8E30845c376"
|
|
48
51
|
}
|
|
49
52
|
}
|
|
50
53
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Token constants for Nostra SDK
|
|
3
|
+
* Use these instead of calling decimals() on contracts for efficiency
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Alea Token (StablePoint) decimals
|
|
7
|
+
* The stable token for trading in Nostra prediction market
|
|
8
|
+
*/
|
|
9
|
+
export declare const ALEA_DECIMALS = 18;
|
|
10
|
+
/**
|
|
11
|
+
* MockUSDC decimals (for testing)
|
|
12
|
+
*/
|
|
13
|
+
export declare const MOCK_USDC_DECIMALS = 6;
|
|
14
|
+
/**
|
|
15
|
+
* Alias for ALEA_DECIMALS
|
|
16
|
+
* Generic reference for the stable trading token
|
|
17
|
+
*/
|
|
18
|
+
export declare const STABLE_POINT_DECIMALS = 18;
|
|
19
|
+
/**
|
|
20
|
+
* Token metadata
|
|
21
|
+
*/
|
|
22
|
+
export declare const ALEA_TOKEN: {
|
|
23
|
+
readonly name: "Alea";
|
|
24
|
+
readonly symbol: "ALEA";
|
|
25
|
+
readonly decimals: 18;
|
|
26
|
+
};
|
|
27
|
+
export declare const MOCK_USDC_TOKEN: {
|
|
28
|
+
readonly name: "Mock USD Coin";
|
|
29
|
+
readonly symbol: "mUSDC";
|
|
30
|
+
readonly decimals: 6;
|
|
31
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Token constants for Nostra SDK
|
|
4
|
+
* Use these instead of calling decimals() on contracts for efficiency
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.MOCK_USDC_TOKEN = exports.ALEA_TOKEN = exports.STABLE_POINT_DECIMALS = exports.MOCK_USDC_DECIMALS = exports.ALEA_DECIMALS = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Alea Token (StablePoint) decimals
|
|
10
|
+
* The stable token for trading in Nostra prediction market
|
|
11
|
+
*/
|
|
12
|
+
exports.ALEA_DECIMALS = 18;
|
|
13
|
+
/**
|
|
14
|
+
* MockUSDC decimals (for testing)
|
|
15
|
+
*/
|
|
16
|
+
exports.MOCK_USDC_DECIMALS = 6;
|
|
17
|
+
/**
|
|
18
|
+
* Alias for ALEA_DECIMALS
|
|
19
|
+
* Generic reference for the stable trading token
|
|
20
|
+
*/
|
|
21
|
+
exports.STABLE_POINT_DECIMALS = exports.ALEA_DECIMALS;
|
|
22
|
+
/**
|
|
23
|
+
* Token metadata
|
|
24
|
+
*/
|
|
25
|
+
exports.ALEA_TOKEN = {
|
|
26
|
+
name: 'Alea',
|
|
27
|
+
symbol: 'ALEA',
|
|
28
|
+
decimals: exports.ALEA_DECIMALS,
|
|
29
|
+
};
|
|
30
|
+
exports.MOCK_USDC_TOKEN = {
|
|
31
|
+
name: 'Mock USD Coin',
|
|
32
|
+
symbol: 'mUSDC',
|
|
33
|
+
decimals: exports.MOCK_USDC_DECIMALS,
|
|
34
|
+
};
|
package/dist/generated/abis.d.ts
CHANGED
|
@@ -13,7 +13,8 @@ export declare const MarketFactoryABI: any[];
|
|
|
13
13
|
export declare const CTFExchangeABI: any[];
|
|
14
14
|
export declare const ResolutionOracleABI: any[];
|
|
15
15
|
export declare const MockUSDCABI: any[];
|
|
16
|
+
export declare const AleaTokenABI: any[];
|
|
16
17
|
/**
|
|
17
18
|
* Get ABI for a contract
|
|
18
19
|
*/
|
|
19
|
-
export declare function getContractABI(contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC'): any[];
|
|
20
|
+
export declare function getContractABI(contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC' | 'AleaToken'): any[];
|
package/dist/generated/abis.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* DO NOT EDIT MANUALLY.
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
|
-
exports.MockUSDCABI = exports.ResolutionOracleABI = exports.CTFExchangeABI = exports.MarketFactoryABI = exports.ConditionalTokensABI = void 0;
|
|
9
|
+
exports.AleaTokenABI = exports.MockUSDCABI = exports.ResolutionOracleABI = exports.CTFExchangeABI = exports.MarketFactoryABI = exports.ConditionalTokensABI = void 0;
|
|
10
10
|
exports.getContractABI = getContractABI;
|
|
11
11
|
/**
|
|
12
12
|
* Placeholder for contract ABIs
|
|
@@ -17,6 +17,7 @@ exports.MarketFactoryABI = [];
|
|
|
17
17
|
exports.CTFExchangeABI = [];
|
|
18
18
|
exports.ResolutionOracleABI = [];
|
|
19
19
|
exports.MockUSDCABI = [];
|
|
20
|
+
exports.AleaTokenABI = [];
|
|
20
21
|
/**
|
|
21
22
|
* Get ABI for a contract
|
|
22
23
|
*/
|
|
@@ -32,6 +33,8 @@ function getContractABI(contractName) {
|
|
|
32
33
|
return exports.ResolutionOracleABI;
|
|
33
34
|
case 'MockUSDC':
|
|
34
35
|
return exports.MockUSDCABI;
|
|
36
|
+
case 'AleaToken':
|
|
37
|
+
return exports.AleaTokenABI;
|
|
35
38
|
default:
|
|
36
39
|
throw new Error(`Unknown contract: ${contractName}`);
|
|
37
40
|
}
|
|
@@ -16,7 +16,7 @@ export declare const deployments: Deployments;
|
|
|
16
16
|
/**
|
|
17
17
|
* Get contract address for a specific network
|
|
18
18
|
*/
|
|
19
|
-
export declare function getContractAddress(network: Network, contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC'): string | undefined;
|
|
19
|
+
export declare function getContractAddress(network: Network, contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC' | 'AleaToken'): string | undefined;
|
|
20
20
|
/**
|
|
21
21
|
* Get all contract addresses for a network
|
|
22
22
|
*/
|
|
@@ -26,6 +26,7 @@ export declare function getNetworkAddresses(network: Network): {
|
|
|
26
26
|
CTFExchange: ContractDeployment;
|
|
27
27
|
ResolutionOracle: ContractDeployment;
|
|
28
28
|
MockUSDC?: ContractDeployment;
|
|
29
|
+
AleaToken?: ContractDeployment;
|
|
29
30
|
} | undefined;
|
|
30
31
|
/**
|
|
31
32
|
* Check if a network has deployments
|
|
@@ -72,6 +72,9 @@ function buildDeployments() {
|
|
|
72
72
|
...(deployment.contracts.MockUSDC && {
|
|
73
73
|
MockUSDC: createDeployment(deployment.contracts.MockUSDC),
|
|
74
74
|
}),
|
|
75
|
+
...(deployment.contracts.AleaToken && {
|
|
76
|
+
AleaToken: createDeployment(deployment.contracts.AleaToken),
|
|
77
|
+
}),
|
|
75
78
|
},
|
|
76
79
|
};
|
|
77
80
|
}
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/types.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { Network } from '../types';
|
|
|
6
6
|
/**
|
|
7
7
|
* Get a contract instance
|
|
8
8
|
*/
|
|
9
|
-
export declare function getContract(contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC', network: Network, signerOrProvider: Signer | Provider): Contract;
|
|
9
|
+
export declare function getContract(contractName: 'ConditionalTokens' | 'MarketFactory' | 'CTFExchange' | 'ResolutionOracle' | 'MockUSDC' | 'AleaToken', network: Network, signerOrProvider: Signer | Provider): Contract;
|
|
10
10
|
/**
|
|
11
11
|
* Get ConditionalTokens contract instance
|
|
12
12
|
*/
|
|
@@ -27,3 +27,13 @@ export declare function getResolutionOracle(network: Network, signerOrProvider:
|
|
|
27
27
|
* Get MockUSDC contract instance (only available on test networks)
|
|
28
28
|
*/
|
|
29
29
|
export declare function getMockUSDC(network: Network, signerOrProvider: Signer | Provider): Contract;
|
|
30
|
+
/**
|
|
31
|
+
* Get AleaToken contract instance
|
|
32
|
+
* Alea is the stable token for trading in Nostra prediction market (18 decimals)
|
|
33
|
+
*/
|
|
34
|
+
export declare function getAleaToken(network: Network, signerOrProvider: Signer | Provider): Contract;
|
|
35
|
+
/**
|
|
36
|
+
* Get StablePoint (AleaToken) contract instance
|
|
37
|
+
* Alias for getAleaToken - provides a generic reference for the stable trading token
|
|
38
|
+
*/
|
|
39
|
+
export declare function getStablePoint(network: Network, signerOrProvider: Signer | Provider): Contract;
|
package/dist/utils/contracts.js
CHANGED
|
@@ -9,6 +9,8 @@ exports.getMarketFactory = getMarketFactory;
|
|
|
9
9
|
exports.getCTFExchange = getCTFExchange;
|
|
10
10
|
exports.getResolutionOracle = getResolutionOracle;
|
|
11
11
|
exports.getMockUSDC = getMockUSDC;
|
|
12
|
+
exports.getAleaToken = getAleaToken;
|
|
13
|
+
exports.getStablePoint = getStablePoint;
|
|
12
14
|
const ethers_1 = require("ethers");
|
|
13
15
|
const addresses_1 = require("../generated/addresses");
|
|
14
16
|
const abis_1 = require("../generated/abis");
|
|
@@ -53,3 +55,17 @@ function getResolutionOracle(network, signerOrProvider) {
|
|
|
53
55
|
function getMockUSDC(network, signerOrProvider) {
|
|
54
56
|
return getContract('MockUSDC', network, signerOrProvider);
|
|
55
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Get AleaToken contract instance
|
|
60
|
+
* Alea is the stable token for trading in Nostra prediction market (18 decimals)
|
|
61
|
+
*/
|
|
62
|
+
function getAleaToken(network, signerOrProvider) {
|
|
63
|
+
return getContract('AleaToken', network, signerOrProvider);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Get StablePoint (AleaToken) contract instance
|
|
67
|
+
* Alias for getAleaToken - provides a generic reference for the stable trading token
|
|
68
|
+
*/
|
|
69
|
+
function getStablePoint(network, signerOrProvider) {
|
|
70
|
+
return getAleaToken(network, signerOrProvider);
|
|
71
|
+
}
|