@kynesyslabs/demosdk 2.0.6 → 2.0.9
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/build/abstraction/Identities.d.ts +10 -3
- package/build/abstraction/Identities.js +23 -1
- package/build/abstraction/Identities.js.map +1 -1
- package/build/abstraction/index.d.ts +2 -2
- package/build/abstraction/index.js.map +1 -1
- package/build/types/abstraction/index.d.ts +11 -3
- package/build/types/abstraction/index.js +1 -0
- package/build/types/abstraction/index.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { XMCoreTargetIdentityPayload, GithubProof, InferFromSignaturePayload, InferFromWritePayload } from "../types/abstraction";
|
|
2
2
|
import { Demos } from "../websdk/demosclass";
|
|
3
3
|
export default class Identities {
|
|
4
4
|
/**
|
|
@@ -16,10 +16,17 @@ export default class Identities {
|
|
|
16
16
|
* @param payload The payload to remove the identity from.
|
|
17
17
|
* @returns The response from the RPC call.
|
|
18
18
|
*/
|
|
19
|
-
removeXmIdentity(demos: Demos, payload:
|
|
19
|
+
removeXmIdentity(demos: Demos, payload: XMCoreTargetIdentityPayload): Promise<any>;
|
|
20
|
+
/**
|
|
21
|
+
* Add a github identity to the GCR.
|
|
22
|
+
*
|
|
23
|
+
* @param demos A Demos instance to communicate with the RPC.
|
|
24
|
+
* @param payload The payload to add the identity to.
|
|
25
|
+
* @returns The response from the RPC call.
|
|
26
|
+
*/
|
|
27
|
+
addGithubIdentity(demos: Demos, payload: GithubProof): Promise<any>;
|
|
20
28
|
/**
|
|
21
29
|
* Get the identities associated with an address.
|
|
22
|
-
* If no address is provided, the address of the connected wallet will be used.
|
|
23
30
|
*
|
|
24
31
|
* @param demos A Demos instance to communicate with the RPC.
|
|
25
32
|
* @param address The address to get identities for.
|
|
@@ -42,9 +42,31 @@ class Identities {
|
|
|
42
42
|
};
|
|
43
43
|
return await demos.rpcCall(request, true);
|
|
44
44
|
}
|
|
45
|
+
/**
|
|
46
|
+
* Add a github identity to the GCR.
|
|
47
|
+
*
|
|
48
|
+
* @param demos A Demos instance to communicate with the RPC.
|
|
49
|
+
* @param payload The payload to add the identity to.
|
|
50
|
+
* @returns The response from the RPC call.
|
|
51
|
+
*/
|
|
52
|
+
async addGithubIdentity(demos, payload) {
|
|
53
|
+
let githubPayload = {
|
|
54
|
+
context: "github",
|
|
55
|
+
proof: payload
|
|
56
|
+
};
|
|
57
|
+
const request = {
|
|
58
|
+
method: "gcr_routine",
|
|
59
|
+
params: [
|
|
60
|
+
{
|
|
61
|
+
method: "add_github_identity",
|
|
62
|
+
params: [githubPayload], // REVIEW Is this correct?
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
};
|
|
66
|
+
return await demos.rpcCall(request, true);
|
|
67
|
+
}
|
|
45
68
|
/**
|
|
46
69
|
* Get the identities associated with an address.
|
|
47
|
-
* If no address is provided, the address of the connected wallet will be used.
|
|
48
70
|
*
|
|
49
71
|
* @param demos A Demos instance to communicate with the RPC.
|
|
50
72
|
* @param address The address to get identities for.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Identities.js","sourceRoot":"","sources":["../../../src/abstraction/Identities.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,8EAA8E;;
|
|
1
|
+
{"version":3,"file":"Identities.js","sourceRoot":"","sources":["../../../src/abstraction/Identities.ts"],"names":[],"mappings":";AAAA,4CAA4C;AAC5C,8EAA8E;;AAY9E,MAAqB,UAAU;IAC3B,gEAAgE;IAChE;;;;;;OAMG;IACH,KAAK,CAAC,aAAa,CACf,KAAY,EACZ,OAA0D;QAE1D,MAAM,WAAW,GAAG;YAChB,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE;gBACJ;oBACI,MAAM,EAAE,OAAO,CAAC,MAAM;oBACtB,MAAM,EAAE,CAAC,OAAO,CAAC;iBACpB;aACJ;SACJ,CAAA;QAED,OAAO,MAAM,KAAK,CAAC,OAAO,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inder } from "./CoinFinder";
|
|
9
9
|
import Identities from "./Identities";
|
|
10
|
-
import { InferFromWritePayload, InferFromSignaturePayload,
|
|
11
|
-
export { EvmCoinFinder, CoinFinder, Identities, InferFromWritePayload, InferFromSignaturePayload,
|
|
10
|
+
import { InferFromWritePayload, InferFromSignaturePayload, XMCoreTargetIdentityPayload, Web2CoreTargetIdentityPayload, InferFromGithubPayload, GithubProof } from "../types/abstraction";
|
|
11
|
+
export { EvmCoinFinder, CoinFinder, Identities, InferFromWritePayload, InferFromSignaturePayload, XMCoreTargetIdentityPayload, Web2CoreTargetIdentityPayload, InferFromGithubPayload, GithubProof, };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abstraction/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,mDAA+C;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/abstraction/index.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;;;;AAEH,mDAA+C;AAa3C,8FAbK,6BAAa,OAaL;AAZjB,6CAAyC;AAarC,2FAbK,uBAAU,OAaL;AAZd,8DAAqC;AAajC,qBAbG,oBAAU,CAaH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export interface
|
|
1
|
+
export interface XMCoreTargetIdentityPayload {
|
|
2
2
|
chain: string;
|
|
3
3
|
subchain: string;
|
|
4
4
|
targetAddress: string;
|
|
@@ -6,7 +6,7 @@ export interface CoreTargetIdentityPayload {
|
|
|
6
6
|
/**
|
|
7
7
|
* The identity of the target address to bind to the Demos identity
|
|
8
8
|
*/
|
|
9
|
-
export interface InferFromSignatureTargetIdentityPayload extends
|
|
9
|
+
export interface InferFromSignatureTargetIdentityPayload extends XMCoreTargetIdentityPayload {
|
|
10
10
|
chainId: number | string;
|
|
11
11
|
isEVM: boolean;
|
|
12
12
|
signature: string;
|
|
@@ -17,7 +17,7 @@ export interface InferFromSignatureTargetIdentityPayload extends CoreTargetIdent
|
|
|
17
17
|
/**
|
|
18
18
|
* The identity of the target address to bind to the Demos identity
|
|
19
19
|
*/
|
|
20
|
-
export interface InferFromWriteTargetIdentityPayload extends
|
|
20
|
+
export interface InferFromWriteTargetIdentityPayload extends XMCoreTargetIdentityPayload {
|
|
21
21
|
txHash: string;
|
|
22
22
|
isEVM: boolean;
|
|
23
23
|
chainId: number | string;
|
|
@@ -37,3 +37,11 @@ export interface InferFromSignaturePayload {
|
|
|
37
37
|
*/
|
|
38
38
|
target_identity: InferFromSignatureTargetIdentityPayload;
|
|
39
39
|
}
|
|
40
|
+
export interface Web2CoreTargetIdentityPayload {
|
|
41
|
+
context: string;
|
|
42
|
+
proof: string;
|
|
43
|
+
}
|
|
44
|
+
export type GithubProof = `https://github.com/${string}/${string}`;
|
|
45
|
+
export interface InferFromGithubPayload extends Web2CoreTargetIdentityPayload {
|
|
46
|
+
proof: GithubProof;
|
|
47
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/abstraction/index.ts"],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/abstraction/index.ts"],"names":[],"mappings":";AACA,gCAAgC"}
|