@kynesyslabs/demosdk 2.0.8 → 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.
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { XMCoreTargetIdentityPayload, InferFromSignaturePayload, InferFromWritePayload } from "../types/abstraction";
|
|
1
|
+
import { XMCoreTargetIdentityPayload, GithubProof, InferFromSignaturePayload, InferFromWritePayload } from "../types/abstraction";
|
|
2
2
|
import { Demos } from "../websdk/demosclass";
|
|
3
3
|
export default class Identities {
|
|
4
4
|
/**
|
|
@@ -17,9 +17,16 @@ export default class Identities {
|
|
|
17
17
|
* @returns The response from the RPC call.
|
|
18
18
|
*/
|
|
19
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;;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,CAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IACjD,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,gBAAgB,CAAC,KAAY,EAAE,OAAoC;QACrE,MAAM,OAAO,GAAG;YACZ,MAAM,EAAE,aAAa;YACrB,MAAM,EAAE;gBACJ;oBACI,MAAM,EAAE,iBAAiB;oBACzB,MAAM,EAAE,CAAC,OAAO,CAAC;iBACpB;aACJ;SACJ,CAAA;QAED,OAAO,MAAM,KAAK,CAAC,OAAO,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;IAC7C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