Connect Brand & Utility Provider

{
    requesterAddress: string, 
    issuerAddress: string,
    type: "sst"| "aat", 
    scope: "wallet" | "nft",
    label: "resell"|"repair"|..., 
    redirectTo: string 
    filter?: { 
	    serialNumber: string;
	  },
	  refresh?: { 
	    previousToken: string;
	  };
  } 
ParameterDescription
requesterAddressAddress of the requester. You must sign the payload with this address.
issuerAddressAddress of the brand that issued the digital passport.
typeType of return you want:

- sst
- aat
scopeโš ๏ธย For aat type only โ†’ Scope of the AAT.

- wallet
- nft
labelInformation on your actions, useful to help a brand to display a better UX:

- resell
- repair
redirectToURL the brand connect should redirect to (need to include http(s)://).
filterFilter used to display specific digital passports in the user's wallet.
refreshField used to refresh an SST. This provides the SST in previousToken.
  1. This payload needs to be converted to base64 then signed with the wallet specified in requesterAddress.
  2. You must end up with a payload that looks like this: โ€base64payloadโ€+.+โ€signedPayloadโ€
  3. A redirection to the brand website is operated (e.g https://app.arianee.com), and passes the previous payload in the brandConnectRequest query param.
  4. The brand website will display the appropriate user interface to allow the user to choose the digital passport they want to sell\repair.
  5. After that, the brand will redirect to the URL specified in redirectTo with the signed payload in transferPermit query param.

Get the SST from the query params and you can get the digital passport content like this:

const core = Core.fromWallet(wallet as any);
const serviceProvider = new ServiceProvider(core);
// if AAT :
wallet.smartAsset.getFromArianeeAccessToken(aat)

// if SST :
const nft = await serviceProvider.getSmartAssetFromSST({sst:transferPermit});
// if you want to transfer the DPP :
const tx = await serviceProvider.transferSmartAsset({sst:transferPermit, to:receiverAddress})
await tx.wait();
console.log('transfer success')