@cartridge/controller 0.3.18 → 0.3.19
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/LICENSE +16 -0
- package/lib/constants.d.ts +1 -7
- package/lib/constants.js +12 -22
- package/lib/constants.js.map +1 -1
- package/lib/device.d.ts +2 -2
- package/lib/device.js +48 -57
- package/lib/device.js.map +1 -1
- package/lib/errors.js +2 -5
- package/lib/errors.js.map +1 -1
- package/lib/index.d.ts +10 -8
- package/lib/index.js +161 -212
- package/lib/index.js.map +1 -1
- package/lib/inject.d.ts +12 -11
- package/lib/inject.js +63 -96
- package/lib/inject.js.map +1 -1
- package/lib/modal.js +3 -7
- package/lib/modal.js.map +1 -1
- package/lib/signer.d.ts +5 -2
- package/lib/signer.js +26 -21
- package/lib/signer.js.map +1 -1
- package/lib/types.d.ts +13 -14
- package/lib/types.js +2 -10
- package/lib/types.js.map +1 -1
- package/lib/utils.d.ts +12 -13
- package/lib/utils.js +51 -70
- package/lib/utils.js.map +1 -1
- package/package.json +10 -11
package/LICENSE
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
Copyright Cartridge Gaming Company 2022. All rights reserved.
|
|
2
|
+
|
|
3
|
+
You acknowledge and agree that Cartridge Gaming Company (“Cartridge”) (or Cartridge’s licensors) own all legal right, title and interest in and to the work, software, application, source code, documentation and any other documents in this repository (collectively, the “Program”), including any intellectual property rights which subsist in the Program (whether those rights happen to be registered or not, and wherever in the world those rights may exist), whether in source code or any other form.
|
|
4
|
+
|
|
5
|
+
Subject to the limited license below, you may not (and you may not permit anyone else to) distribute, publish, copy, modify, merge, combine with another program, create derivative works of, reverse engineer, decompile or otherwise attempt to extract the source code of, the Program or any part thereof, except that you may contribute to this repository.
|
|
6
|
+
|
|
7
|
+
You are granted a non-exclusive, non-transferable, non-sublicensable license to distribute, publish, copy, modify, merge, combine with another program or create derivative works of the Program (such resulting program, collectively, the “Resulting Program”) solely for Non-Commercial Use as long as you:
|
|
8
|
+
1. give prominent notice (“Notice”) with each copy of the Resulting Program that the Program is used in the Resulting Program and that the Program is the copyright of Cartridge; and
|
|
9
|
+
2. subject the Resulting Program and any distribution, publication, copy, modification, merger therewith, combination with another program or derivative works thereof to the same Notice requirement and Non-Commercial Use restriction set forth herein.
|
|
10
|
+
|
|
11
|
+
“Non-Commercial Use” means each use as described in clauses (1)-(3) below, as reasonably determined by Cartridge in its sole discretion:
|
|
12
|
+
1. personal use for research, personal study, private entertainment, hobby projects or amateur pursuits, in each case without any anticipated commercial application;
|
|
13
|
+
2. use by any charitable organization, educational institution, public research organization, public safety or health organization, environmental protection organization or government institution; or
|
|
14
|
+
3. the number of monthly active users of the Resulting Program across all versions thereof and platforms globally do not exceed 10,000 at any time.
|
|
15
|
+
|
|
16
|
+
You will not use any trade mark, service mark, trade name, logo of Cartridge or any other company or organization in a way that is likely or intended to cause confusion about the owner or authorized user of such marks, names or logos.
|
package/lib/constants.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export declare const GATEWAY_MAINNET = "https://alpha-mainnet.starknet.io/feeder_gateway";
|
|
2
|
-
export declare const GATEWAY_GOERLI = "https://alpha4.starknet.io/feeder_gateway";
|
|
3
1
|
export declare const ETH_RPC_MAINNET = "https://eth-mainnet.g.alchemy.com/v2/OGPRMquXP3K7oTkLrmVZpjCd1DswtYz3";
|
|
4
|
-
export declare const
|
|
2
|
+
export declare const ETH_RPC_SEPOLIA = "https://eth-sepolia.g.alchemy.com/v2/mURnclB5pn5elDfyzgTN4W2GR-rOYevI";
|
|
5
3
|
export declare const CONTRACT_ETH = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7";
|
|
6
4
|
export declare const CONTRACT_POINTS = "0x00c62540e9a10c47a4b7d8abaff468192c66f2d1e979f6bade6e44bf73995982";
|
|
7
5
|
export declare const CONTRACT_AVATAR = "0x002e02ab50ad223a4de99d7591cbbb565705893ad5b8522a9bde011d20e99926";
|
|
@@ -23,7 +21,3 @@ export declare const CLASS_HASHES: {
|
|
|
23
21
|
legacyController: string;
|
|
24
22
|
};
|
|
25
23
|
};
|
|
26
|
-
export declare const NamedChainId: {
|
|
27
|
-
"0x534e5f4d41494e": string;
|
|
28
|
-
"0x534e5f474f45524c49": string;
|
|
29
|
-
};
|
package/lib/constants.js
CHANGED
|
@@ -1,22 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
exports.CONTRACT_POINTS = "0x00c62540e9a10c47a4b7d8abaff468192c66f2d1e979f6bade6e44bf73995982";
|
|
11
|
-
exports.CONTRACT_AVATAR = "0x002e02ab50ad223a4de99d7591cbbb565705893ad5b8522a9bde011d20e99926";
|
|
12
|
-
exports.CONTRACT_CONTROLLER_CLASS = "0x077007d85dd2466b2b29e626bac27ee017d7586f62511f4585dd596f33337ccf";
|
|
13
|
-
exports.CONTRACT_ARGENT_CLASS = "0x025ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918";
|
|
14
|
-
exports.CONTRACT_ACHIEVEMENTS = "0x00f6883b55c1ed7814e5df15fa8fa4bdbad4d4778662a62413c1e58fce10f4f0";
|
|
15
|
-
exports.CONTRACT_UPGRADE_IMPLEMENTATION = "0x07e28fb0161d10d1cf7fe1f13e7ca57bce062731a3bd04494dfd2d0412699727";
|
|
1
|
+
export const ETH_RPC_MAINNET = "https://eth-mainnet.g.alchemy.com/v2/OGPRMquXP3K7oTkLrmVZpjCd1DswtYz3";
|
|
2
|
+
export const ETH_RPC_SEPOLIA = "https://eth-sepolia.g.alchemy.com/v2/mURnclB5pn5elDfyzgTN4W2GR-rOYevI";
|
|
3
|
+
export const CONTRACT_ETH = "0x049d36570d4e46f48e99674bd3fcc84644ddd6b96f7c741b1562b82f9e004dc7";
|
|
4
|
+
export const CONTRACT_POINTS = "0x00c62540e9a10c47a4b7d8abaff468192c66f2d1e979f6bade6e44bf73995982";
|
|
5
|
+
export const CONTRACT_AVATAR = "0x002e02ab50ad223a4de99d7591cbbb565705893ad5b8522a9bde011d20e99926";
|
|
6
|
+
export const CONTRACT_CONTROLLER_CLASS = "0x077007d85dd2466b2b29e626bac27ee017d7586f62511f4585dd596f33337ccf";
|
|
7
|
+
export const CONTRACT_ARGENT_CLASS = "0x025ec026985a3bf9d0cc1fe17326b245dfdc3ff89b8fde106542a3ea56c5a918";
|
|
8
|
+
export const CONTRACT_ACHIEVEMENTS = "0x00f6883b55c1ed7814e5df15fa8fa4bdbad4d4778662a62413c1e58fce10f4f0";
|
|
9
|
+
export const CONTRACT_UPGRADE_IMPLEMENTATION = "0x07e28fb0161d10d1cf7fe1f13e7ca57bce062731a3bd04494dfd2d0412699727";
|
|
16
10
|
// L1 Contract
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
11
|
+
export const CONTRACT_NFF_BRIDGE = "0xbd701502203B21307BEa2d4078E69dd0c9C0703C";
|
|
12
|
+
export const PROXY_CLASS = "0x04be79b3904b4e2775fd706fa037610b41d8f8708ce298aac3a470badf68176d";
|
|
13
|
+
export const CLASS_HASHES = {
|
|
20
14
|
["0.0.1"]: {
|
|
21
15
|
account: "0x079507b6068846a05500331e0b54f7b539f067c2003de1f4635fc9885a267144",
|
|
22
16
|
controller: "0x0286a2ea79ee08506efcbc330efd2ae34e2f22b79ecd2fb9b86ce26d6a1dbece",
|
|
@@ -28,8 +22,4 @@ exports.CLASS_HASHES = {
|
|
|
28
22
|
legacyController: "0x58e648a242085d5ff1e8f92a6b91057826639a82b23798998d40b61a27bca85",
|
|
29
23
|
},
|
|
30
24
|
};
|
|
31
|
-
exports.NamedChainId = {
|
|
32
|
-
[starknet_1.constants.StarknetChainId.MAINNET]: "SN_MAIN",
|
|
33
|
-
[starknet_1.constants.StarknetChainId.TESTNET]: "SN_GOERLI",
|
|
34
|
-
};
|
|
35
25
|
//# sourceMappingURL=constants.js.map
|
package/lib/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,eAAe,GAC1B,uEAAuE,CAAC;AAC1E,MAAM,CAAC,MAAM,eAAe,GAC1B,uEAAuE,CAAA;AAEzE,MAAM,CAAC,MAAM,YAAY,GACvB,oEAAoE,CAAC;AACvE,MAAM,CAAC,MAAM,eAAe,GAC1B,oEAAoE,CAAC;AACvE,MAAM,CAAC,MAAM,eAAe,GAC1B,oEAAoE,CAAC;AAEvE,MAAM,CAAC,MAAM,yBAAyB,GACpC,oEAAoE,CAAC;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAChC,oEAAoE,CAAC;AACvE,MAAM,CAAC,MAAM,qBAAqB,GAChC,oEAAoE,CAAC;AACvE,MAAM,CAAC,MAAM,+BAA+B,GAC1C,oEAAoE,CAAC;AAEvE,cAAc;AACd,MAAM,CAAC,MAAM,mBAAmB,GAAG,4CAA4C,CAAC;AAEhF,MAAM,CAAC,MAAM,WAAW,GACtB,oEAAoE,CAAC;AAEvE,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,CAAC,OAAO,CAAC,EAAE;QACT,OAAO,EACL,oEAAoE;QACtE,UAAU,EACR,oEAAoE;QACtE,gBAAgB,EACd,mEAAmE;KACtE;IACD,CAAC,QAAQ,CAAC,EAAE;QACV,OAAO,EACL,mEAAmE;QACrE,UAAU,EACR,mEAAmE;QACrE,gBAAgB,EACd,mEAAmE;KACtE;CACF,CAAC"}
|
package/lib/device.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { constants, Account, Abi, Call, EstimateFeeDetails, InvocationsDetails, Signature, typedData, InvokeFunctionResponse, EstimateFee, DeclareContractPayload,
|
|
1
|
+
import { constants, Account, Abi, Call, EstimateFeeDetails, InvocationsDetails, Signature, typedData, InvokeFunctionResponse, EstimateFee, DeclareContractPayload, RpcProvider } from "starknet";
|
|
2
2
|
import { Keychain, Modal } from "./types";
|
|
3
3
|
import { AsyncMethodReturns } from "@cartridge/penpal";
|
|
4
4
|
declare class DeviceAccount extends Account {
|
|
5
5
|
address: string;
|
|
6
6
|
private keychain;
|
|
7
7
|
private modal;
|
|
8
|
-
constructor(provider:
|
|
8
|
+
constructor(provider: RpcProvider, address: string, keychain: AsyncMethodReturns<Keychain>, modal: Modal);
|
|
9
9
|
/**
|
|
10
10
|
* Estimate Fee for a method on starknet
|
|
11
11
|
*
|
package/lib/device.js
CHANGED
|
@@ -1,20 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
const starknet_1 = require("starknet");
|
|
13
|
-
const types_1 = require("./types");
|
|
14
|
-
const signer_1 = require("./signer");
|
|
15
|
-
class DeviceAccount extends starknet_1.Account {
|
|
1
|
+
import { Account, } from "starknet";
|
|
2
|
+
import { ResponseCodes } from "./types";
|
|
3
|
+
import { Signer } from "./signer";
|
|
4
|
+
class DeviceAccount extends Account {
|
|
5
|
+
address;
|
|
6
|
+
keychain;
|
|
7
|
+
modal;
|
|
16
8
|
constructor(provider, address, keychain, modal) {
|
|
17
|
-
super(provider, address, new
|
|
9
|
+
super(provider, address, new Signer(keychain, modal));
|
|
18
10
|
this.address = address;
|
|
19
11
|
this.keychain = keychain;
|
|
20
12
|
this.modal = modal;
|
|
@@ -30,14 +22,16 @@ class DeviceAccount extends starknet_1.Account {
|
|
|
30
22
|
*
|
|
31
23
|
* @returns response from addTransaction
|
|
32
24
|
*/
|
|
33
|
-
estimateInvokeFee(calls, details) {
|
|
34
|
-
return
|
|
35
|
-
|
|
25
|
+
async estimateInvokeFee(calls, details) {
|
|
26
|
+
return this.keychain.estimateInvokeFee(calls, {
|
|
27
|
+
...details,
|
|
28
|
+
chainId: await this.getChainId(),
|
|
36
29
|
});
|
|
37
30
|
}
|
|
38
|
-
estimateDeclareFee(payload, details) {
|
|
39
|
-
return
|
|
40
|
-
|
|
31
|
+
async estimateDeclareFee(payload, details) {
|
|
32
|
+
return this.keychain.estimateDeclareFee(payload, {
|
|
33
|
+
...details,
|
|
34
|
+
chainId: await this.getChainId(),
|
|
41
35
|
});
|
|
42
36
|
}
|
|
43
37
|
/**
|
|
@@ -52,29 +46,28 @@ class DeviceAccount extends starknet_1.Account {
|
|
|
52
46
|
*
|
|
53
47
|
* @returns response from addTransaction
|
|
54
48
|
*/
|
|
55
|
-
execute(calls, abis, transactionsDetail) {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
return res;
|
|
64
|
-
}
|
|
65
|
-
this.modal.open();
|
|
66
|
-
const res2 = yield this.keychain.execute(calls, abis, transactionsDetail, true);
|
|
67
|
-
this.modal.close();
|
|
68
|
-
if (res2.code !== types_1.ResponseCodes.SUCCESS) {
|
|
69
|
-
throw new Error(res2.message);
|
|
70
|
-
}
|
|
71
|
-
return res2;
|
|
49
|
+
async execute(calls, abis, transactionsDetail) {
|
|
50
|
+
if (!transactionsDetail) {
|
|
51
|
+
transactionsDetail = {};
|
|
52
|
+
}
|
|
53
|
+
try {
|
|
54
|
+
const res = await this.keychain.execute(calls, abis, transactionsDetail);
|
|
55
|
+
if (res.code === ResponseCodes.SUCCESS) {
|
|
56
|
+
return res;
|
|
72
57
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
58
|
+
this.modal.open();
|
|
59
|
+
const res2 = await this.keychain.execute(calls, abis, transactionsDetail, true);
|
|
60
|
+
this.modal.close();
|
|
61
|
+
if (res2.code !== ResponseCodes.SUCCESS &&
|
|
62
|
+
res2.code !== ResponseCodes.CANCELED) {
|
|
63
|
+
throw new Error(res2.message);
|
|
76
64
|
}
|
|
77
|
-
|
|
65
|
+
return res2;
|
|
66
|
+
}
|
|
67
|
+
catch (e) {
|
|
68
|
+
console.error(e);
|
|
69
|
+
throw e;
|
|
70
|
+
}
|
|
78
71
|
}
|
|
79
72
|
/**
|
|
80
73
|
* Sign an JSON object for off-chain usage with the starknet private key and return the signature
|
|
@@ -84,20 +77,18 @@ class DeviceAccount extends starknet_1.Account {
|
|
|
84
77
|
* @returns the signature of the JSON object
|
|
85
78
|
* @throws {Error} if the JSON object is not a valid JSON
|
|
86
79
|
*/
|
|
87
|
-
signMessage(typedData) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
});
|
|
80
|
+
async signMessage(typedData) {
|
|
81
|
+
try {
|
|
82
|
+
this.modal.open();
|
|
83
|
+
const res = await this.keychain.signMessage(typedData, this.address);
|
|
84
|
+
this.modal.close();
|
|
85
|
+
return res;
|
|
86
|
+
}
|
|
87
|
+
catch (e) {
|
|
88
|
+
console.error(e);
|
|
89
|
+
throw e;
|
|
90
|
+
}
|
|
100
91
|
}
|
|
101
92
|
}
|
|
102
|
-
|
|
93
|
+
export default DeviceAccount;
|
|
103
94
|
//# sourceMappingURL=device.js.map
|
package/lib/device.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"device.js","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"device.js","sourceRoot":"","sources":["../src/device.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,GAWR,MAAM,UAAU,CAAC;AAElB,OAAO,EAAY,aAAa,EAAS,MAAM,SAAS,CAAC;AACzD,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAGlC,MAAM,aAAc,SAAQ,OAAO;IACjC,OAAO,CAAS;IACR,QAAQ,CAA+B;IACvC,KAAK,CAAQ;IAErB,YACE,QAAqB,EACrB,OAAe,EACf,QAAsC,EACtC,KAAY;QAEZ,KAAK,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC;QACtD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;IACrB,CAAC;IAED;;;;;;;;;;OAUG;IACH,KAAK,CAAC,iBAAiB,CACrB,KAAoB,EACpB,OAA4B;QAE5B,OAAO,IAAI,CAAC,QAAQ,CAAC,iBAAiB,CAAC,KAAK,EAAE;YAC5C,GAAG,OAAO;YACV,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,kBAAkB,CACtB,OAA+B,EAC/B,OAA4B;QAE5B,OAAO,IAAI,CAAC,QAAQ,CAAC,kBAAkB,CAAC,OAAO,EAAE;YAC/C,GAAG,OAAO;YACV,OAAO,EAAE,MAAM,IAAI,CAAC,UAAU,EAAE;SACjC,CAAC,CAAC;IACL,CAAC;IAED;;;;;;;;;;;OAWG;IACH,KAAK,CAAC,OAAO,CACX,KAAoB,EACpB,IAAY,EACZ,kBAEC;QAED,IAAI,CAAC,kBAAkB,EAAE;YACvB,kBAAkB,GAAG,EAAE,CAAC;SACzB;QAED,IAAI;YACF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,EAAE,kBAAkB,CAAC,CAAC;YACzE,IAAI,GAAG,CAAC,IAAI,KAAK,aAAa,CAAC,OAAO,EAAE;gBACtC,OAAO,GAA6B,CAAC;aACtC;YAED,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAClB,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,OAAO,CACtC,KAAK,EACL,IAAI,EACJ,kBAAkB,EAClB,IAAI,CACL,CAAC;YACF,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YAEnB,IACE,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,OAAO;gBACnC,IAAI,CAAC,IAAI,KAAK,aAAa,CAAC,QAAQ,EACpC;gBACA,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;aAC/B;YAED,OAAO,IAA8B,CAAC;SACvC;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,MAAM,CAAC,CAAC;SACT;IACH,CAAC;IAED;;;;;;;OAOG;IACH,KAAK,CAAC,WAAW,CAAC,SAA8B;QAC9C,IAAI;YACF,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;YAClB,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,WAAW,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;YACrE,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC;YACnB,OAAO,GAAgB,CAAC;SACzB;QAAC,OAAO,CAAC,EAAE;YACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YACjB,MAAM,CAAC,CAAC;SACT;IACH,CAAC;CACF;AAED,eAAe,aAAa,CAAC"}
|
package/lib/errors.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
exports.MissingPolicys = void 0;
|
|
4
|
-
class MissingPolicys extends Error {
|
|
1
|
+
export class MissingPolicys extends Error {
|
|
2
|
+
missing;
|
|
5
3
|
constructor(missing) {
|
|
6
4
|
super("missing policies");
|
|
7
5
|
this.missing = missing;
|
|
@@ -9,5 +7,4 @@ class MissingPolicys extends Error {
|
|
|
9
7
|
Object.setPrototypeOf(this, MissingPolicys.prototype);
|
|
10
8
|
}
|
|
11
9
|
}
|
|
12
|
-
exports.MissingPolicys = MissingPolicys;
|
|
13
10
|
//# sourceMappingURL=errors.js.map
|
package/lib/errors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAEA,MAAM,OAAO,cAAe,SAAQ,KAAK;IACvC,OAAO,CAAW;IAElB,YAAY,OAAiB;QAC3B,KAAK,CAAC,kBAAkB,CAAC,CAAC;QAE1B,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QAEvB,4CAA4C;QAC5C,MAAM,CAAC,cAAc,CAAC,IAAI,EAAE,cAAc,CAAC,SAAS,CAAC,CAAC;IACxD,CAAC;CACF"}
|
package/lib/index.d.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
|
-
import { AccountInterface, constants,
|
|
2
|
+
import { AccountInterface, constants, RpcProvider } from "starknet";
|
|
3
3
|
import { AsyncMethodReturns } from "@cartridge/penpal";
|
|
4
|
-
import { Session, Keychain, Policy
|
|
4
|
+
import { Session, Keychain, Policy } from "./types";
|
|
5
5
|
export declare const providers: {
|
|
6
|
-
"
|
|
7
|
-
"
|
|
6
|
+
"0x534e5f4d41494e": RpcProvider;
|
|
7
|
+
"0x534e5f5345504f4c4941": RpcProvider;
|
|
8
8
|
};
|
|
9
9
|
declare class Controller {
|
|
10
10
|
private connection?;
|
|
11
11
|
keychain?: AsyncMethodReturns<Keychain>;
|
|
12
12
|
private policies;
|
|
13
13
|
private url;
|
|
14
|
-
chainId:
|
|
14
|
+
chainId: constants.StarknetChainId;
|
|
15
15
|
accounts?: {
|
|
16
|
-
[key
|
|
16
|
+
[key: string]: AccountInterface;
|
|
17
17
|
};
|
|
18
18
|
private modal?;
|
|
19
19
|
private starterPackId?;
|
|
@@ -21,7 +21,7 @@ declare class Controller {
|
|
|
21
21
|
url?: string;
|
|
22
22
|
origin?: string;
|
|
23
23
|
starterPackId?: string;
|
|
24
|
-
chainId?:
|
|
24
|
+
chainId?: constants.StarknetChainId;
|
|
25
25
|
});
|
|
26
26
|
get account(): AccountInterface | undefined;
|
|
27
27
|
ready(): Promise<boolean | undefined>;
|
|
@@ -41,7 +41,9 @@ declare class Controller {
|
|
|
41
41
|
assertion: import("./types").Assertion;
|
|
42
42
|
} | null>;
|
|
43
43
|
provision(address: string, credentialId: string): Promise<string | null>;
|
|
44
|
-
issueStarterPack(id: string): Promise<
|
|
44
|
+
issueStarterPack(id: string): Promise<{
|
|
45
|
+
transaction_hash: string;
|
|
46
|
+
} | undefined>;
|
|
45
47
|
showQuests(gameId: string): Promise<void>;
|
|
46
48
|
connect(): Promise<AccountInterface | undefined>;
|
|
47
49
|
disconnect(): Promise<void | null>;
|